Commit Graph

3762 Commits

Author SHA1 Message Date
nboyd%atg.com
4ed02f7b8a Fix bug:
var passed = true;
try {
    eval("/* mello /* yello */");
    } catch (e) {
        print(e);
        passed = false;
    }
print(passed);

should print "true", not "false".
2001-10-01 14:25:30 +00:00
jaggernaut%netscape.com
3b8177ee43 Checking in updated mac project file for Venkman (the JS Debugger) 2001-09-30 12:39:29 +00:00
rginda%netscape.com
9b83e1a5a9 - not built -
remove java references, add jsd_xpc.cpp note, explain jsdb.
2001-09-30 08:52:04 +00:00
rginda%netscape.com
2af8768593 move REQUIRES line above include config.mak, to fix bustage 2001-09-30 07:10:21 +00:00
rginda%netscape.com
d81887f935 fixing REQUIRES bustage 2001-09-30 06:28:38 +00:00
brendan%mozilla.org
8cf1697439 Check in patch for bug 94580, thanks to Bernard Alleysson <balleysson@bigfoot.com> for researching and writing it (r=me, sr=shaver). 2001-09-29 21:30:26 +00:00
nboyd%atg.com
b22c4d0d63 Patch from Igor:
As profiler data show, the execution time of the nextNode and replaceCurrent
methods in PreorderNodeIterator contribute quite significantly to the total
time to run Context.compileReader.

replaceCurrent is slow because it calls Node.replaceChild which have to
iterate through all previous siblings to find the nearest to the current.
But it is easy to avoid this search by caching the previous sibling of the
current while iterating over the node tree in nextNode.

nextNode slowness is attributed to the usage of java.lang.Stack which is
expensive due to its synchronized methods. In the attched patch I replaced
it by the explicit array management.

It allows to cut Context.compileReader time by 5%-30% when processing
20K-3MB sources assembled form JS files in the test suite.
2001-09-29 20:55:36 +00:00
nboyd%atg.com
a4c318ad54 More javadoc 2001-09-29 20:55:03 +00:00
nboyd%atg.com
bcf8c2b632 Move serialization classes to separate package. 2001-09-29 20:54:08 +00:00
nboyd%atg.com
4a2fc2e226 Move serialization classes to new package. 2001-09-29 20:50:59 +00:00
nboyd%atg.com
c7d3c57514 Move serialization files to separate package. 2001-09-29 20:50:18 +00:00
jaggernaut%netscape.com
ca6197295f Bug 100476: Convert uses of member functions ToNewUnicode, ToNewCString and ToNewUTF8String to their global versions and remove support from nsCString and nsString. r=dbaron, rs=scc 2001-09-29 08:28:41 +00:00
bryner%netscape.com
28d15740ef Fixing xpctools build on win32. r=cls. 2001-09-29 06:24:41 +00:00
dbradley%netscape.com
2dca78dc34 Items moved to bugzilla or have already been addressed 2001-09-29 00:13:34 +00:00
dbradley%netscape.com
3305314761 Bug 97967 - leak of nsLocalFile on failure. Patch by dbaron, r=dbradley, sr=jband 2001-09-28 21:49:00 +00:00
gerv%gerv.net
4e12e44b2f Relicensing Round 1, Take 2. Most C-like NPL files -> NPL/GPL/LGPL. Bug 98089. 2001-09-28 20:14:13 +00:00
pschwartau%netscape.com
5c97ceca72 Initial add. Regression test for bug 101964. 2001-09-28 04:50:52 +00:00
nboyd%atg.com
3a63e824ea Remove obsolete comment about serialization. 2001-09-27 15:14:24 +00:00
nboyd%atg.com
1682c2fc43 Add new serialization API classes. 2001-09-27 14:59:59 +00:00
shaver%mozilla.org
77d6e73e42 Bug 94506: parameter named "arguments" is not accessible in JavaScript method.
Now we check for the magic "arguments" name after var-and-arg slot
optimizations. r=rogerl, sr=brendan
2001-09-27 14:52:14 +00:00
nboyd%atg.com
fdc6f6b166 Add docs for serialization. 2001-09-27 14:51:20 +00:00
nboyd%atg.com
fea124fdd5 Remove obsolete files (perhaps re-added by mistake?) 2001-09-27 12:59:30 +00:00
nboyd%atg.com
3d2e81a014 Patches from Igor:
Note form omj/Parser.java:

* OPT source info collection is a potential performance bottleneck;
* Source wraps a java.lang.StringBuffer, which is synchronized.  It
* might be faster to implement Source with its own char buffer and
* toString method.

It is indeed a bottleneck under JDK 1.1. When I replaced StringBuffer
by a char array (see the attached patch), execution time of
Context.compileReader decreased by 15%: to test I combined a few test
cases to get a 3MB JS source and then measured time to process it by
Context.compileReader in the interpreter mode.

Under JDK 1.3 the difference is less then 1%, but still using the explicit
string buffer saves memory. When converting StringBuffer to String Sun JDK
shares the internal char array in StringBuffer with new String, but in the
Parser case typically the capacity of this buffer is bigger then the actual
string length, so this unused space in source strings is wasted in the
interpreter mode that keeps these strings in InterpreterData.

Regards, Igor

========
I implemented that member expression as function name syntactic sugar to
support scripts using this MS extension. This is only available when
Context.hasFeature(Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME)
returns true to allow the deviation from the standard only when required.

The patch effectively transforms 'function <memberExpr>(...)...' to
'<memberExpr> = function(...)...' when <memberExpr> is not simple
identifier. I am not sure that MS implementation does exactly this
but hopefully it is sufficiently general to cover MS cases.

(The patch assumes that source_change.patch is already applied)

Regards, Igor
2001-09-27 12:51:42 +00:00
nboyd%atg.com
367774a772 Patch from Igor:
I implemented that member expression as function name syntactic sugar to support
scripts using this MS extension. This is only available when
Context.hasFeature(Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME)
returns true to allow the deviation from the standard only when required.

The patch effectively transforms 'function <memberExpr>(...)...' to
'<memberExpr> = function(...)...' when <memberExpr> is not simple identifier.
I am not sure that MS implementation does exactly this but hopefully it is
sufficiently general to cover MS cases.

(The patch assumes that source_change.patch is already applied)

Regards, Igor
2001-09-27 12:50:14 +00:00
brendan%mozilla.org
06c740491e Don't report uncaught exceptions unless returning to native code (97646, r=jband, sr=shaver). 2001-09-27 05:04:45 +00:00
nboyd%atg.com
212d1b132a Add support for serialization and deserialization. 2001-09-27 02:33:51 +00:00
dbradley%netscape.com
0b484536e8 Bug 94859 silence compiler warning about unused variable r=rginda, sr=jband 2001-09-26 04:11:54 +00:00
pschwartau%netscape.com
9c2e261f72 Adding comments from contributor. 2001-09-26 01:15:14 +00:00
pschwartau%netscape.com
9fb2c068a7 Correcting some typos. 2001-09-26 00:58:35 +00:00
pschwartau%netscape.com
576808aca7 Initial add. Regression test for bug 101488. 2001-09-26 00:32:11 +00:00
nboyd%atg.com
7c030bfefb Patch from Igor:
Currently omj/TokenStream and omj/optimizer/Optimizer.java both contain
code to convert number value to a wrapper object of smallest size. The
attached patch moves this wrapping to Node constructor to avoid code
duplication and eliminate special treatment of exact integers in
Optimizer.java.


The constant folding code in omj/optimizer/Optimizer.java currently always
replaces x * 1, x - 0 by simply x which does not force the toNumber convertion,
which is visible, for example, via typeof. For example, when running at
optimization level 2, the following

function f() {
    return "0" * 1;
}

print(typeof(f()));

prints "string" instead of expected "number".

The const_fold.patch fixes this via replacing x*1 by (+x) to force number convertion.

It assumes that the patch with number wrapping changes is in place.
2001-09-25 14:09:22 +00:00
nboyd%atg.com
7ccac99fc4 Currently omj/TokenStream and omj/optimizer/Optimizer.java both contain code to
convert number value to a wrapper object of smallest size. The attached patch
moves this wrapping to Node constructor to avoid code duplication and eliminate
special treatment of exact integers in Optimizer.java.
2001-09-25 14:08:08 +00:00
brendan%mozilla.org
3558787cfd Report uncaught exceptions from all JS_Compile* APIs (97646, sr=jband&shaver). 2001-09-25 06:43:33 +00:00
dbradley%netscape.com
a47dae7c99 patch from bug 99838 - Changes to remove xpconnects dependency on DOM r=jband, sr=jst 2001-09-24 22:57:47 +00:00
dbradley%netscape.com
03a4f2723c added files: mozilla/js/src/xpconnect/idl/nsIXPCScriptNotify.idl 2001-09-24 22:53:00 +00:00
dbradley%netscape.com
1f85e703a9 patch from bug 99838 - Changes to remove xpconnects dependency on DOM r=jband, sr=jst 2001-09-24 22:48:35 +00:00
nboyd%atg.com
6a75823f31 Remove obsolete class. 2001-09-23 20:01:43 +00:00
nboyd%atg.com
113dae7eb7 Fix bug:
Hello Norris

The script should return 0, Rhino returns NaN

Steven

<script>
var trial = parseInt("0)");
alert(trial);
</script>
2001-09-23 20:01:31 +00:00
nboyd%atg.com
8bb4a031bf Patch from Igor:
Currently omj/optimizer/Codegen.java uses special classes ConstantList
and ConstantDude to store the list of static constants in the generated
class. It seems that using a simple double[] array with a constant
counter and checking via "(int)number == number" for constant types not
only eliminates these 2 classes but makes the whole code simple, see
the attached patch.

The patch also modifies nodeIsConvertToObjectOfNumber to return not a
Number, but the number node itself that is used to extract double
value directly via Node.getDouble() call. I changed it to allow  to
store values of number literals in nodes without using wrapper object.
2001-09-23 20:00:26 +00:00
nboyd%atg.com
5ad714f337 Patch from Igor:
Replacing usage of ShallowNodeIterator to loop throw node children by
explicit calls to Node.getFirstChild()/ Node.getNextSibling()) with
comments when the node children list is modified while iterating
through it.

It avoids creation of ShallowNodeIterator objects and eliminates the
need to have ShallowNodeIterator class.
2001-09-23 19:58:38 +00:00
cls%seawood.org
69b6808ca6 Use default EXPORTS rules instead of installing headers by hand.
Bug #98371 sr=alecf
2001-09-23 03:34:32 +00:00
jband%netscape.com
801cc884a1 I'm tired of this warning: '*/' found outside of comment. This was much discussed. But no one ever bothered to actually check in the trivial fix. r=rginda rs=jband. 2001-09-22 17:42:36 +00:00
rginda%netscape.com
c07e99883d - venkman only -
bug 100943, changes needed to build jsd on os/2
patch by Dainis Jonitis, r=mkaply,rginda
2001-09-22 01:39:24 +00:00
pschwartau%netscape.com
b38eac9fd6 Make formatArray() work in Rhino. Improve getState() by checking for more whitespace characters. 2001-09-21 22:44:46 +00:00
timeless%mac.com
d2a5676d57 Bug 100873 JS Hard Codes JS_HAVE_LONG_LONG to the detriment of FreeBSD
r=cls sr=shaver
2001-09-21 14:09:54 +00:00
jband%netscape.com
afa3e0b204 fix bug 100222. Fix crash by only releasing other objects in xpcwrappedjs dtor if xpconnect has not yet shutdown. r=dbradley sr=jst. 2001-09-20 00:51:38 +00:00
gerv%gerv.net
1856815ff1 Oops. 2001-09-20 00:02:59 +00:00
scc%mozilla.org
bc444f528a bug #98089: ripped new license 2001-09-19 22:39:41 +00:00
nboyd%atg.com
dfdc492a06 Patch from Igor:
Currently Rhino source has quite a few places with code like (String)node.getDatum()
 or ((Number)node.getDatum()).doubleValue(). The patch changes this usage to call
node.getString() or node.getDouble().

It also adds new constructors to Node to accept int or double values in addition to
Object datum to replace new Node(token, new Integer(x)) by Node(token, x) etc. It
may allow in future not to create a wrapper object for int or double datum to speed
up parsing.
2001-09-19 17:01:46 +00:00
jband%netscape.com
229409f54e fix bug 100260. xpconnect should not hold a weak reference to a classinfo object after the xpcwrappednativeproto that was holding a strong ref is destroyed. sr=jst, r=dbradley,markh. 2001-09-19 06:22:17 +00:00