Commit Graph

4295 Commits

Author SHA1 Message Date
pschwartau%netscape.com
2f7c759f41 Adding toInt32 tests for numbers greater than 2^31 with fractional parts. See bug 120083. 2002-01-15 23:27:12 +00:00
dbradley%netscape.com
81bbc17978 Bug 111068 - SyncXPCContextLists uses of XPCContext::Mark is not thread safe. patch by jband, r=dbradley, sr=jst 2002-01-15 22:49:46 +00:00
nboyd%atg.com
14c34495ad Update for 1.5R3. 2002-01-15 17:35:09 +00:00
pschwartau%netscape.com
8d201875cc Correcting a typo in comments- 2002-01-15 01:07:28 +00:00
pschwartau%netscape.com
10fa64eeea Initial add. Regression test for bug 119909. 2002-01-15 00:51:12 +00:00
rginda%netscape.com
e4742bb5be bug 119938, nebiros bustage, r=dbaron
remove useless casts
2002-01-14 21:59:34 +00:00
jband%netscape.com
66c9536fcc fix bug 119387. Add a non-allocating IID version of the frequently used getIIDForParam method. r=dbradley sr=jst 2002-01-14 20:02:14 +00:00
bryner%netscape.com
cfc984cc6c Bug 119743 - autocomplete doesn't work in gcc 2.96 -O2 builds. r=hixie, sr=brendan. 2002-01-14 06:45:21 +00:00
nboyd%atg.com
1b30f2ebf8 Exclude Unicode-2 incompatible tests 2002-01-14 01:21:07 +00:00
beard%netscape.com
3420ef9253 Fix mac bustage: jschar* and PRUnichar* aren't compatible. 2002-01-12 01:40:15 +00:00
rginda%netscape.com
73855845b3 bug 115695, rs=brendan, venkman only
netive changes relating to pretty print support, includes...
* remove jsdIPC interface, replaced with ulong offsets from PC 0.
* add |pcmap| parameter to select between sourcetext/prettyprint linemaps (pcToLine, lineToPc, and isLineExecutable.)
* add |functionSource| property to jsdIScript.
* add |tag| to jsdIScript.
* fixed potential jsdIScript leaks.
2002-01-12 00:56:35 +00:00
pschwartau%netscape.com
d24a0fe0ca Updating JS_GetImplementationVersion() to date of latest JS release (67111). 2002-01-11 23:18:39 +00:00
pschwartau%netscape.com
db92a9fe93 Correcting a mistaken comment. 2002-01-11 01:34:07 +00:00
pschwartau%netscape.com
2d502daf70 Initial add. Regression test for bug 103602. 2002-01-11 01:23:40 +00:00
brendan%mozilla.org
28d27d47f8 Remove Call constructor (118732) and fix old bug in Function where it failed to convert args to strings (118849; both r=timeless, sr=shaver). 2002-01-10 08:51:01 +00:00
seawood%netscape.com
0d320d137e Link jsd into application in a "static" build.
Thanks to Robert Ginda <rginda@netscape.com> for the patch.
Bug #118784 r=cls
2002-01-10 08:47:01 +00:00
pschwartau%netscape.com
b1655936f8 Improving comments. 2002-01-09 19:53:02 +00:00
bryner%netscape.com
7bdffe5186 Bug 117276 - regression on gcc 2.95.x debug builds. Since we don't
understand exactly what the problem is here, and it does not seem to
happen on gcc 2.96, and 2.95 doesn't have the alias optimizations that
called for the new code in the first place, just make 2.95 use the old
code.  r=timeless, sr=brendan.
2002-01-09 19:23:37 +00:00
nboyd%atg.com
0328c83836 Fix bug 118636: Date format 2002-01-09 15:21:31 +00:00
nboyd%atg.com
d30ebd31a8 Fix bug:
We have found a problem in string.replace() when replacing a regular
expression with a dollar sign. The following code works right when the
replacement string does not contain "$":

$ java -jar js.jar
js> var re = new RegExp("%%%");
js> var price = "%%% 1.99";
js> price.replace(re, "USD");
USD 1.99
js> price.replace(re, "$");
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
         at
org.mozilla.javascript.regexp.ReplaceData.interpretDollar(RegExpImpl.java:40 0)
         at
org.mozilla.javascript.regexp.ReplaceData.findReplen(RegExpImpl.java:502)
         at
org.mozilla.javascript.regexp.RegExpImpl.replace(RegExpImpl.java:116)
         at
org.mozilla.javascript.NativeString.execMethod(NativeString.java:266)
         at org.mozilla.javascript.IdFunction.call(IdFunction.java:78)
         at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
         at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
         at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:68)
         at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:59)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:773)
         at
org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:312)
         at
org.mozilla.javascript.tools.shell.Main.processSource(Main.java:219)
         at org.mozilla.javascript.tools.shell.Main.exec(Main.java:106)
         at org.mozilla.javascript.tools.shell.Main.main(Main.java:68)
2002-01-09 15:20:48 +00:00
pschwartau%netscape.com
3190f7a74b Initial add. Regression test for bug 118849. 2002-01-09 01:09:15 +00:00
nboyd%atg.com
0e0079e943 Fix doc bug. 2002-01-08 20:11:53 +00:00
dbaron%fas.harvard.edu
85a52892dc Don't use C++ comments in C files. 2002-01-08 02:29:11 +00:00
pschwartau%netscape.com
7467a1a611 Modified test to take account of the change in SpiderMonkey date format (bug 118266) 2002-01-08 02:23:26 +00:00
alecf%netscape.com
5965318acb C++ side of fix for bug 100212 - move consumers of nsIFile.URL into nsIIOService. r=dougt, sr=darin 2002-01-08 01:31:25 +00:00
brendan%mozilla.org
8d24cf46e4 Checking in patch written by balleysson@bigfoot.com based on tenthumbs@cybernex.net's sketch, to avoid mallocs in js_strtod (115627, r=khanson, sr=me). 2002-01-07 23:42:25 +00:00
brendan%mozilla.org
56d43516cb Group date and time fields in toString's result so as to work with PR_ParseTimeString (118266, r=khanson, sr=shaver). 2002-01-07 11:09:04 +00:00
rginda%netscape.com
fa27b59d7d bug 117907, patch=joerg.schaible@gmx.de (J�rg Schaible), r=me
add release build option to jsdb.mak
2002-01-04 19:24:14 +00:00
nboyd%atg.com
302f3a0ca7 Update implemenation version date. 2002-01-04 14:04:42 +00:00
nboyd%atg.com
4476a490b1 Fix bug reported by rathje40@yahoo.com
We are converting from spidermonkey to rhino and it appears that the
name property for the constructor function returns "constructor" for
all builtin types.  Spidermonkey would return "Date" or "Array" or
whatever.  Is there a workaround?  This code needs to work with both
interpreters.

Here is an example of the rhino behavior:

js> var i=new Date;
js> i.constructor.name
constructor
js> Date.name
constructor
js> function bob(){}
js> bob.name
bob
js> var i = new Array();
js> i.constructor.name
constructor
js>
2002-01-04 14:04:01 +00:00
nboyd%atg.com
bbb7be562e Remove override that is duplicate of superclass. 2002-01-04 14:02:36 +00:00
nboyd%atg.com
15ce244c1d Print implementation version when starting up interactive mode. 2002-01-04 14:02:02 +00:00
brendan%mozilla.org
2ba4c7d57c Null pointer defense in FUN_CALLER fun_getProperty case (117307, r/sr skipped, trivial). 2002-01-01 21:12:21 +00:00
brendan%mozilla.org
8962b0ec01 Fix old bug introduced by rev 3.2, where this() crashes due to uninitialized obj register (116228, r=timeless, sr=shaver). 2001-12-27 08:47:33 +00:00
timeless%mac.com
61a97fd94a Bugzilla Bug 106386 rid source of these misspellings: persistant persistance priviledge protocal editting editted targetted targetting
r='s from many people. sr=jst
2001-12-23 23:23:41 +00:00
igor%mir2.org
30dfb0a96f Use Vector.elementAt instead of Vector.getfor jdk 1.1 complience 2001-12-20 22:05:42 +00:00
igor%mir2.org
d6078a18da Fixes to allow to use jikes to compile and produce less warnings:
1. Replace catch(Exception) by catch(RuntimeException) when only RuntimeException can be throws

2. Make sure that inner classes does not use the same name for parameters as parent scope, see  http://domino.watson.ibm.com/syssftpr/JavaTech/Jikes.nsf/Named/SunQuery8
2001-12-20 21:15:02 +00:00
dougt%netscape.com
3a73c9be8d fixing dumbass error. This could should have returned null if obsoleteManager was null, not the inverse. r=jband@netscape.com 2001-12-20 00:26:28 +00:00
nboyd%atg.com
c348be84db Added comment about bug 115717. 2001-12-19 15:31:56 +00:00
brendan%mozilla.org
de1592438e Don't double-drop a property when strict-warning about duplicate formals (115436, r=khanson, sr=jband). 2001-12-19 02:10:26 +00:00
beard%netscape.com
21b53b29a8 fix for bug #115545. r=sdagley, sr=sfraser 2001-12-19 00:23:05 +00:00
dougt%netscape.com
849d297364 nsIComponentManager API Changes (bug 98553)
a) create a new nsIComponentManager with only four functions on it:
CreateInstance CreateInstanceByContractID GetClassInfo GetClassInfoByContractID.

b) rename the old nsIComponentManager to nsIComponentManagerObsolete.

c) fixes callers which use to access the nsIComponentManager for component
registration functionality.  These callers will temporary use the
nsIComponentManagerObsolete interface.

d) Create a new API NS_GetComponentManager() which mirrors the
NS_GetServiceManager()

e) Perserves the old NS_GetGlobalComponentManager().  Note the cast usage.

r/sr = rpotts@netscape.com  alecf@netscape.com  brendan@mozilla.org
2001-12-19 00:12:41 +00:00
seawood%netscape.com
45bfbf0658 Landing the rest of the win32 gmake changes:
* Adds Makefile.ins to win32 specific dirs
* Adds WINNT ifdefs to Makefile.ins
* Causes NSPR to be compiled with --with-mozilla
* Misc general Makefile.in cleanup

Bug #58981 r=mcafee
2001-12-18 09:14:29 +00:00
pschwartau%netscape.com
3f93033176 Updating bug number reference in test. The original bug has outgrown. 2001-12-18 01:23:15 +00:00
jaggernaut%netscape.com
ee12112b29 Remove timer from REQUIRES, the makefile.win edition 2001-12-16 18:08:20 +00:00
pavlov%netscape.com
15273ea50a bug 78611. New XP threadsafe timer implementation. r=dougt sr=brendan 2001-12-16 06:13:17 +00:00
seawood%netscape.com
51fa852613 Make OS/2 use the win32 build changes and finish LIB_PREFIX substitution.
Thanks to Javier Pedemonte (pedemont@us.ibm.com) for the patch.
Bug #58981 r=cls
2001-12-14 23:49:04 +00:00
nboyd%atg.com
8114e3ffba Fix formatting. 2001-12-13 15:27:16 +00:00
sfraser%netscape.com
7ff0b7c27c Fix bug 114915 -- app not starting up in Mac opt builds. Work around a CodeWarrior optimizer bug by bumping down the optimization level for the optimized target. r=brendan, sr=shaver, a=Roto-rooter 2001-12-13 07:11:28 +00:00
brendan%mozilla.org
74151505f6 Long ago, mccabe copied the principals setting code in Function from late to early in the function (should've moved, but no one noticed); last month, I fixed bug 90546 in the original site but not in the copy; this change eliminates the duplication, moving the fix up to the copy's site (90546, r=jst, sr=jband, a=chofmann). 2001-12-13 00:27:20 +00:00
nboyd%atg.com
cd3ab305ae Fix bug 114491: if (true) function f(){}() 2001-12-12 14:16:57 +00:00
brendan%mozilla.org
7b2b1b44ad Fix try/finally and try/guarded-catches/finally hard cases (104077, r=jband, sr=shaver). 2001-12-12 05:00:29 +00:00
brendan%mozilla.org
140631bce2 Checking in rogerl@netscape.com's patch for bug 100199 (r=rginda, sr=me). 2001-12-12 04:27:50 +00:00
nboyd%atg.com
1bd9822564 Fix bug 114493: "3"[5](); 2001-12-11 14:16:13 +00:00
nboyd%atg.com
d120758a27 Fix memory leak of class names--reset every time we get a new ClassLoader. 2001-12-11 14:13:55 +00:00
ccarlen%netscape.com
af646e6f1f Bug 98349 - Convert Mac build to CW7 and XML projects. Removing obsolete .mcp files. r=pink/sr=sfraser 2001-12-11 05:45:45 +00:00
ccarlen%netscape.com
f810f656cc Bug 98349 - Convert Mac build to CW7 and XML projects. Removing obsolete .mcp files. r=pink/sr=sfraser 2001-12-11 05:10:45 +00:00
pschwartau%netscape.com
bb9cd805fe Initial add. Regression test for bug 114493. 2001-12-11 01:59:58 +00:00
pschwartau%netscape.com
c0a324bd7e Initial add. Regression test for bug 114491. 2001-12-11 01:59:22 +00:00
ccarlen%netscape.com
884be5f4c2 Adding new files for conversion to CW7 and XML project files. Bug 98349 r=pink/sr=sfraser. 2001-12-10 21:32:41 +00:00
ccarlen%netscape.com
baca6ece31 Adding new files for conversion to CW7 and XML project files. Bug 98349 r=pink/sr=sfraser. 2001-12-10 20:42:22 +00:00
pschwartau%netscape.com
0e3eb87c82 Adding new cases to test 2001-12-10 00:43:13 +00:00
dbaron%fas.harvard.edu
f7b755c4e0 Prevent XPCReadableJSStringWrapper from having a null buffer handle. b=112496 r=shaver, jag sr=jst 2001-12-08 22:49:05 +00:00
pschwartau%netscape.com
60b99db82a Adding one more case to test 2001-12-08 03:29:52 +00:00
dbradley%netscape.com
944c82b990 Bug104843 - Added requires to makefile 2001-12-07 13:34:48 +00:00
seawood%netscape.com
16e4f2d4d9 Drop optimization level for select files on Irix when compiling with MIPSpro to workaround suspected compiler bug.
Thanks to Nick Blievers <nickb@adacel.com.au> for the patch.
Bug #79562 r=brendan sr=cls
2001-12-07 09:12:16 +00:00
pschwartau%netscape.com
45b92fe8f8 Added three more cases to test 2001-12-07 07:23:57 +00:00
nboyd%atg.com
bbc1ee2679 Updates for Rhino1.5R3. 2001-12-06 14:53:59 +00:00
nboyd%atg.com
e795599799 Update release number, date. 2001-12-06 14:33:44 +00:00
nboyd%atg.com
44b02edcc8 Change version to 1.5R3. 2001-12-06 14:27:26 +00:00
nboyd%atg.com
82fd57b5aa Hello !
I'm the maintainer of JPackage project rhino package (see
jpackage.sourceforge.net). I just found two problems for building it (version
1.52 from cvs):
- the property src.debugger is badly initialised in toolsrc/build.xml. See
patch attached for correction. Moreover, this was a real pain to make offline
building possible. I guess it's a licensing problem that prevents you
including those files in rhino sources ?
- the produced javadoc has an empty (0 sized) package-list file. Have you got
any idea why ?
-- Guillaume Rousse <rousse@ccr.jussieu.fr>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html
2001-12-06 14:26:26 +00:00
rogerl%netscape.com
5586bf8bdc Bugs #100199 & 78156. r=khanson, sr=brendan. Fixing multiline matching and
pathological character class cases in regular expression handling.
2001-12-05 23:58:51 +00:00
pschwartau%netscape.com
eb9c1aae74 not part of default build
bug 111365, JS standalone doesn't build on solaris.
point AS to /usr/ccs/bin/as
2001-12-05 19:32:16 +00:00
pschwartau%netscape.com
c59566e1a8 not part of default build
bug 111365, JS standalone doesn't build on solaris.
point AS to /usr/ccs/bin/as
2001-12-05 00:31:55 +00:00
seawood%netscape.com
c8994a7ac0 Initial landing of win32 support for autoconf builds.
Bug #58981 sr=alecf
2001-12-04 21:17:48 +00:00
pschwartau%netscape.com
922f8539d0 Adding one more case to test. 2001-12-04 00:54:00 +00:00
pschwartau%netscape.com
d06c77d845 Added more cases to test; updated the license at top. 2001-12-01 03:29:24 +00:00
dbaron%fas.harvard.edu
824e7d22ca Make nsSharable[C]String writable by overriding appropriate methods. Ensure that it doesn't store null buffer handle pointer internally, and override get() on nsXPIDL[C]String for backwards-compatibility. Collapse nsSharedBufferHandle and nsFlexBufferHandle into nsSharedBufferHandle which knows its length but can't have a storage start distinct from its data start. Convert string users who were working around broken nsSharableString::Assign back to using it. b=104663, 100751, 74726 r=jag sr=scc 2001-11-28 05:22:57 +00:00
brendan%mozilla.org
25f3ad4fb3 Update all pointers to an arena that moved when it was reallocated (111557, r=shaver, sr=jband). 2001-11-27 21:27:59 +00:00
pschwartau%netscape.com
a216201eba Skipping a new, big test that exceeds Java classfile size limitations 2001-11-27 04:21:28 +00:00
pschwartau%netscape.com
dcf76be5c0 Initial add. Regression test for bug 111557. 2001-11-27 04:13:03 +00:00
timeless%mac.com
51a4520c4a Bugzilla Bug 107823 change nsIFile
to use 'Modified' instead of 'Modification'
r=akkana sr=brendan
2001-11-26 08:05:05 +00:00
nboyd%atg.com
6a01600cc8 JavaAdapter serialization contribution from Kemal Bayram. 2001-11-23 20:40:08 +00:00
nboyd%atg.com
b52f96cd91 Hi, Norris!
In our browser we need to support scripts that use as an identifier name future reserved keywords such as interface. The scripts are rather old and perfectly legal under previous revisions of EcmaScript which does not included the list of almost every Java keyword to the future reserve.

To support this I added an option to query Context.hasFeature for FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER:

    /**
     * if hasFeature(RESERVED_KEYWORD_AS_IDENTIFIER) returns true,
     * treat future reserved keyword (see  Ecma-262, section 7.5.3) as ordinary
     * identifiers but warn about this usage
     */
    public static final int FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER = 3;

The corresponding code in TokenStream checks for it and issues just a warning when this feature is enabled.

I also think that it would be better not to return RESERVED as a token from TokenStream.getToken but report the specific syntax error immediately because it is very unclear from the error message:

js> x.interface = 1
js: "<stdin>", line 1: uncaught JavaScript exception: SyntaxError: missing name after . operator (<stdin>; line 1)
js: x.interface = 1
js: ..........^

what exactly went wrong. I can send a patch later for that.

Regards, Igor
2001-11-23 20:38:50 +00:00
nboyd%atg.com
1ce9a8feb9 Update for new failures. 2001-11-23 01:20:56 +00:00
nboyd%atg.com
4ef25a301c Hi,
I'm working on a project which uses rhino. I wanted to have finer
control over class generation and saving so I've done some patching
and clean up on the current rhino tip.

The biggest change I've made is the replacement of ClassOutput with
ClassRepository that has the single method:

    public boolean storeClass(String className, byte[] classBytes,
                           boolean isTopLevel) throws IOException;

This interface allows any arbitary storage method, such as a
Hashtable/Map. In addition it also allows you to specify whether a
class should be loaded, via returning true or false.  You can still use
ClassOutput as I've coded an internal wrapper.

With this interface it has also been possible to strip out the file
saving code from Codegen and OptClassNameHelper.  The file
saving code is now an inner class FileClassRepository in Context. As
a consequence of this  I've stripped out some methods from ClassNameHelper.
The resulting code is much more cleaner then before hand and everything
still works as per usual.

Other small additions are:
  o  Annonymous functions are now named class$1 instead of class1
  o  get/setClassName added to ClassNameHelper exposed in Context.

My final thoughts are, since all methods in ClassNameHelper except reset()
are now exposed whould n't it be much more "cleaner" to simply to some
how work around to eliminate reset() and provide getClassNameHelper()
via Context?  You could then remove the numerous ClassNameHelper shadow
methods from Context.

Likewise, FileClassRepository could be made a public class very easily
and combined with the above result in a dozen or so less public methods in
Context.

Anyway, the changes can be found on http://www.cins.co.uk/rhino.zip

Hope it is of use to some

Kemal Bayram
2001-11-22 15:48:21 +00:00
brendan%mozilla.org
106186f720 Thanks to scole@planetweb.com (Steven Cole) for fixing date_format to respect PRMJ_FormatTime's return value (102159, r=beard, sr=brendan). 2001-11-21 23:53:54 +00:00
brendan%mozilla.org
3350a394b5 Don't eagerly allocate fatlock freelist chunks; don't preallocate so much, and use a smaller global lock hashtable (109218, r=shaver/sr=jband). 2001-11-21 23:28:52 +00:00
pschwartau%netscape.com
e3560ba177 Removing two tests from the skip list because they have been removed from the repository. 2001-11-21 22:16:19 +00:00
pschwartau%netscape.com
63bbacdb75 Removing test from repository. It contains very large blocks.
But because of the fix to bug 80981, these are no longer large enough
to trigger the internal error and exit code 3 that the test looked for.
2001-11-21 21:59:31 +00:00
pschwartau%netscape.com
f3c83ec62e Skipping another test with a large switch() statement 2001-11-21 21:34:25 +00:00
pschwartau%netscape.com
a929ee24ec Initial add. Regression test for bug 80981. 2001-11-21 21:17:31 +00:00
nboyd%atg.com
46b8e5185c Hi,
I'm working on a project which uses rhino. I wanted to have finer
control over class generation and saving so I've done some patching
and clean up on the current rhino tip.

The biggest change I've made is the replacement of ClassOutput with
ClassRepository that has the single method:

    public boolean storeClass(String className, byte[] classBytes,
                           boolean isTopLevel) throws IOException;

This interface allows any arbitary storage method, such as a
Hashtable/Map. In addition it also allows you to specify whether a
class should be loaded, via returning true or false.  You can still use
ClassOutput as I've coded an internal wrapper.

With this interface it has also been possible to strip out the file
saving code from Codegen and OptClassNameHelper.  The file
saving code is now an inner class FileClassRepository in Context. As
a consequence of this  I've stripped out some methods from ClassNameHelper.
The resulting code is much more cleaner then before hand and everything
still works as per usual.

Other small additions are:
  o  Annonymous functions are now named class$1 instead of class1
  o  get/setClassName added to ClassNameHelper exposed in Context.

My final thoughts are, since all methods in ClassNameHelper except reset()
are now exposed whould n't it be much more "cleaner" to simply to some
how work around to eliminate reset() and provide getClassNameHelper()
via Context?  You could then remove the numerous ClassNameHelper shadow
methods from Context.

Likewise, FileClassRepository could be made a public class very easily
and combined with the above result in a dozen or so less public methods in
Context.

Anyway, the changes can be found on http://www.cins.co.uk/rhino.zip

Hope it is of use to some

Kemal Bayram <rhino@cins.co.uk>
2001-11-21 17:12:57 +00:00
seawood%netscape.com
7733357d51 Rename 'install' build phase to 'libs'.
Bug #56601 r=pavlov
2001-11-21 09:49:41 +00:00
brendan%mozilla.org
9b46da979c Thanks to scole@planetweb.com, no more un-ECMA error for /* in a /**/ comment (110286, r=khanson, sr=brendan). 2001-11-20 23:35:45 +00:00
brendan%mozilla.org
d2eb2bf046 Better fix than 0.9.6 minimal fix for NUL-termination assumption in replace (108832, r=shaver, sr=jband). 2001-11-20 21:26:33 +00:00
brendan%mozilla.org
5eaba7585d Don't warn or 'correct' = to == in a condition unless the right operand has greater precedence than == (106244, r=shaver, sr=jband). 2001-11-20 05:20:57 +00:00
rginda%netscape.com
43f2ce47ff bug 110903, patch=brendan, sr=shaver, r=me
Call new script hook for scripts created via xdr.
2001-11-20 02:47:41 +00:00
brendan%mozilla.org
024ffbebe7 Don't ass-u-me fp->argv => fp->fun (109635, sr=shaver/jband). 2001-11-20 02:37:01 +00:00
timeless%mac.com
060425ec59 Bugzilla Bug 110080 change !NS_SUCCEEDED(status) to NS_FAILED(status)
s/!NS_SUCCEEDED/NS_FAILED/g;s/!NS_FAILED/NS_SUCCEEDED/g;
r=dougt sr=hewitt
2001-11-19 06:45:00 +00:00
pschwartau%netscape.com
216a94f367 Initial add. Regression test for bug 110286. 2001-11-17 03:20:45 +00:00
brendan%mozilla.org
051d085765 Remove __call__ and add a callback used to check f.caller access for any function object f (109113, r=jst, sr=jband). 2001-11-16 02:56:49 +00:00
alecf%netscape.com
d49a4ba867 win32 REQUIRES cleanup 2001-11-15 03:49:13 +00:00
seawood%netscape.com
c7ca889121 Build libmozjs during the install phase.
Bug #104307 sr=jband
2001-11-14 04:52:55 +00:00
bzbarsky%mit.edu
f2ee8260a0 Use NS_LITERAL_STRING instead of NS_ConvertASCIItoUCS2 where possible
(i.e. where the string is a literal).  Bug 104159, r=jag, sr=alecf
2001-11-14 01:33:42 +00:00
pschwartau%netscape.com
0a61967ca6 Adding another case to test. 2001-11-13 19:46:27 +00:00
brendan%mozilla.org
8b9fb46499 Avoid ClaimScope (lock-free to -full transition) in JS_GetClass and js_FinalizeObject called from the GC (109183, r=shaver, sr=jband). 2001-11-11 21:25:13 +00:00
jband%netscape.com
cd8dc8ee2c not part of build. Now that null DOM strings are correctly supported we can fix the test case 2001-11-10 22:35:26 +00:00
pschwartau%netscape.com
7a9c2596f2 Fixing a typo. 2001-11-10 02:47:52 +00:00
pschwartau%netscape.com
267f1d9202 Adding another case to test. 2001-11-10 02:46:24 +00:00
brendan%mozilla.org
91397f1e55 For now (0.9.6), str_replace requires an independent replacement string (108832, r=shaver, sr=jband, a=asa). 2001-11-08 23:53:33 +00:00
pschwartau%netscape.com
b0756acf45 Initial add. Regression test for bug 108440. 2001-11-07 23:20:48 +00:00
nboyd%atg.com
e60c42afed Patch from Igor:
I suggest to move the code in ScriptableObject.get/put that deals with getter/setter
into separated methods so it would be easy to follow the code and the attached patch
does just that.
2001-11-07 14:15:48 +00:00
brendan%mozilla.org
63cb2c1077 Fix Function.call(this, 'alert(42)')() so the anonymous function finds its nearest scripted caller's principals (90546, sr=shaver&jband). 2001-11-07 06:34:04 +00:00
dbaron%fas.harvard.edu
8cd8d91750 Ensure that string literals are used as |const char*| rather than |char*|. r=jag sr=brendan b=107052 2001-11-07 06:24:10 +00:00
mkaply%us.ibm.com
5991fb004d #105476
r=os2team, sr=brendan@mozilla.org
Add ASM implementation of js_CompareAndSwap for OS/2 VACPP
2001-11-07 05:20:33 +00:00
dbaron%fas.harvard.edu
bfb2f49916 Add assertions that users of nsDependentC?String meet the requirements of nsAFlatC?String. Add nsDependentSingleFragmentC?Substring for users that don't. Additional cleanup after bug 100214. b=104651 r=jag sr=scc 2001-11-07 04:12:20 +00:00
brendan%mozilla.org
c220d0c707 Avoid recursive join/toString death (108440, r=shaver, sr=jband). 2001-11-07 00:15:44 +00:00
brendan%mozilla.org
be20b21443 Move the oversized arena back-pointer to a well-aligned header extension lying just behind a->base (108013, sr=waterson&jband). 2001-11-07 00:11:22 +00:00
jband%netscape.com
0c81cb1768 better error message when zero passed where object or null expected. bug 108284. r=dbradley sr=shaver. Also, fix uninitilized counter var in debug only code rs=jband 2001-11-06 00:40:54 +00:00
rginda%netscape.com
452f1525a4 removing dead code, see mozilla/js2 2001-11-05 21:46:17 +00:00
rginda%netscape.com
0065b1bb33 removing dead code, see mozilla/js2 2001-11-05 21:38:18 +00:00
seawood%netscape.com
be10c3b1a8 Backing out fix for remote mach-o builds as it left mach-o builds fragile.
Add TK_CFLAGS back to default CFLAGS/CXXFLAGS.
Bug #107696
2001-11-03 03:29:05 +00:00
rginda%netscape.com
2085b262f0 bug 108257, "source notes broken for functions compiled via JS_CompileUCFunctionForPrincipals", sr=brendan, r=shaver
no need to emit the function body after calling FunctionBody
2001-11-03 00:10:47 +00:00
peterv%netscape.com
3470de8c5b Add build option for the JS profiler on Mac. a=dbradley. Not part of the build. 2001-11-02 10:27:52 +00:00
pschwartau%netscape.com
c97d13ddcf Improving readability. 2001-11-02 02:17:57 +00:00
pschwartau%netscape.com
491a9eb409 Initial add. Regression test for bug 107771. 2001-11-02 02:06:54 +00:00
dbradley%netscape.com
5cb0f9371f Bug 83426 - Remove DOM exception hack. r=jst, r=dbradley, sr=jband 2001-11-01 15:52:53 +00:00
jband%netscape.com
3bcdaf198c fixing warnings from recent landing and uncommenting test cases I did not mean to comment out for the checkin 2001-11-01 05:18:35 +00:00
brendan%mozilla.org
3c38914b93 Fix nul-termination assumption hidden in lastIndexOf, broken by dependent strings fix for bug 56940 (107771, r=jag, sr=waterson). 2001-11-01 03:19:54 +00:00
jband%netscape.com
a2511b96a8 fix Mac bustage. I can't believe the Mac can't do this conversion without a cast! 2001-11-01 02:36:19 +00:00
jband%netscape.com
3ff792dd5d the HP compiler says that anonymous unions can't even have structs. So the union must be named. Fixing that bustage 2001-11-01 01:45:48 +00:00
jband%netscape.com
c052cc3bf0 fix Mac bustage (I hope). I think these names conflicted with other names 2001-11-01 01:15:53 +00:00
seawood%netscape.com
8a2a775382 Since '-framework Carbon' causes binaries to require console access to run, do not link using that flag by default. Otherwise, remote builds & non-console tinderboxes will break. Mac OSX Mach-O only.
Bug #107696 r=mozbot
2001-11-01 00:54:48 +00:00
pete%alphanumerica.com
b52992027b b=107823, r=ccarlen, sr=brendan
--pete
2001-11-01 00:11:15 +00:00
jband%netscape.com
2882268cda added files: mozilla/js/src/xpconnect/src/xpcvariant.cpp 2001-10-31 23:36:34 +00:00
jband%netscape.com
84bfc894a4 add support for nsIVariant and nsIPropertyBag. bug 44675 and bug 98209. sr=vidur r=dbradley 2001-10-31 23:35:07 +00:00
rginda%netscape.com
7491994718 bug 99601, don't install xpconnect debugger keyword handler if one is already there, r=jband, sr=brendan 2001-10-31 23:13:17 +00:00
brendan%mozilla.org
2caef4a183 Don't try to correct = to == if strict, do it only if downrev (106244, r=jband, sr=shaver). 2001-10-31 03:17:00 +00:00
pschwartau%netscape.com
fb838280d6 Initial add. Regression test for bug 94257. 2001-10-31 02:32:38 +00:00
nboyd%atg.com
3067721c3c Fix bug with test case:
var testArray = new Array(6);
testArray[1+1]+=2;
2001-10-30 14:06:58 +00:00
nboyd%atg.com
787b93699a Hello Norris
The following test case case leads to a compilation error in Rhino. In this
script alert is an user defined
function in the global object and it shows the value of the specified
parameter in a popup window. Save the script as a html file and run it under
Netscape and IE. The output via their JS engines is that alert(1)
executes but the execution of line fails as blks variable is undefined. The
Fix bug:

Rhino engine fails at compilation time itself and cannot excute the script.
It doesn't like the syntax of line.


Steven


/// ****************  test case **************    ///
<script>
alert(1);
  blks[ 10 << 2 ] |= true;
  alert(2);
</script>


/// **********************  Error Message ************************** ////
evaluating script: null
java.lang.NullPointerException
  at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
  at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
  at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
  at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
  at org.mozilla.javascript.Interpreter.generateICode(Compiled Code)
  at org.mozilla.javascript.Interpreter.generateICodeFromTree(Compiled Code)
  at
org.mozilla.javascript.Interpreter.generateScriptICode(Interpreter.java)
  at org.mozilla.javascript.Interpreter.compile(Interpreter.java)
  at org.mozilla.javascript.Context.compile(Context.java)
  at org.mozilla.javascript.Context.compile(Context.java)
2001-10-30 13:55:26 +00:00
rginda%netscape.com
db43fadc93 bug 99601, add filter support to js/jsd, r=jband sr=brendan
large addition to the jsd_xpc component allows arbitrary filtering of debug hooks by url pattern, line range, and global object.  also adds ability to begin instrumenting jsscripts at app startup.
2001-10-30 13:41:32 +00:00
nboyd%atg.com
0babafcaa0 Patch from Igor:
I must admit this is very subtitle, but still...

Here are the lines from
    public void defineProperty(String propertyName, Object delegateTo,
                               Method getter, Method setter, int attributes)


        GetterSlot slot = (GetterSlot)getSlotToSet(propertyName,
                                                   propertyName.hashCode(),
                                                   true);
        slot.delegateTo = delegateTo;
        slot.getter = getter;
        slot.setter = setter;
        slot.setterReturnsValue = setter != null && setter.getReturnType() != Void.TYPE;
        slot.value = null;
        slot.attributes = (short) attributes;
        slot.flags = (byte)flags;

Now suppose that after the new slot is added, another thread is accessing it. Then it would see not yet ready slot with all nasty consequences! For example,  SMP computer can re-arrange writes so the new value of slot.flags would be visible before slot.getter then another thread would generate null pointer exception.

race2_fix.diff fixes that by using the explicit Slot argument to addSlot instead of boolean flag so the new slot can be fully initialized and then inserted under synchronization to the table. I also call addSlot directly because it is supposed to be used with not-yet existed properties and split addSlot to addSlot and addSlotImpl so in case of table growth there is no need to re-enter already synchronized monitor.

This changes also allows to explicitly throw RuntimeException if defineProperty is called for the property that is already exists instead of either throwing cast exception in "GetterSlot slot = (GetterSlot)getSlotToSet(propertyName," or worth yet re-initializing already existed slot.

Regards, Igor
2001-10-30 13:07:00 +00:00
nboyd%atg.com
08247fcd49 Print either line or file name if either is present. 2001-10-30 12:59:30 +00:00
pschwartau%netscape.com
489809edc1 Adding reference to another Bugzilla bug this testcase covers. 2001-10-30 03:28:15 +00:00
brendan%mozilla.org
7000513580 Ensure atom strings are immutable -- duh! (107138, r=jag, sr=jband). 2001-10-30 02:33:41 +00:00
pschwartau%netscape.com
cd0a6755c1 Initial add. Regression test for bug 107138. 2001-10-30 00:20:03 +00:00
brendan%mozilla.org
671178cbdb Consolidate property cache flush under JS_ClearScope (107265, r=shaver, sr=jband). 2001-10-29 19:30:03 +00:00
brendan%mozilla.org
d27c4cb86f Followup to bug 56940's big patch, tighten GC-mark case analysis, assume atom strings are immutable. 2001-10-28 22:37:25 +00:00
brendan%mozilla.org
114a9d244c Ensure proper pointer alignment in oversized arena footers (105726, r/sr=jband,shaver). 2001-10-28 20:41:53 +00:00
brendan%mozilla.org
467cafd25f Avoid stack overflow in js_EmitTree on long left-associative operator chains (98901, r=jband, sr=shaver). 2001-10-27 18:38:16 +00:00
seawood%netscape.com
9b5ae05e33 Landing the rest of the mach-o OSX changes.
Bug #75653 r=cls sr=waterson
2001-10-27 07:38:18 +00:00
pschwartau%netscape.com
6a49244c08 Fixing a typo 2001-10-27 00:48:14 +00:00
rginda%netscape.com
a38f6a4b18 check in jband's fix for command paths on win2k, whitespace nits. 2001-10-26 21:37:51 +00:00
mike+mozilla%meer.net
41da6c554a Initial checkin of build file for Darwin1.4.mk. It just includes Darwin1.3.mk. Because I happened to be fooling around with an OS X system. 2001-10-26 09:38:43 +00:00
alecf%netscape.com
a6790acff4 other part of bug 106130, remove unicharutil dependency and linking (just requires updates) 2001-10-26 03:06:04 +00:00
brendan%mozilla.org
63754279fd epstein@tellme.com's patch implementing JS_ClearNewbornRoots (106790, r=brendan, sr=jband). 2001-10-26 02:38:10 +00:00
brendan%mozilla.org
862a59da87 khanson@netscape.com's fix for silent ValueIsLength failure (101488, r=rogerl, sr=me). 2001-10-26 02:35:01 +00:00
jst%netscape.com
05bb290330 Fixing bug 106823. Pass the length to nsAString::Assign() to make sure we don't loose embedded null characters in strings, and also to speed things up a bit. Also trunkate strings before 'voiding' them to make sure old string data is deleted from the string before it's reused. r=bzbarsky@mit.edu, rs=jband@netscape.com 2001-10-26 02:18:16 +00:00
dbradley%netscape.com
900bb81362 Bug 106130 - Remove dependancy of xpconnect on intl. r=alecf, sr=shaver, patch=jband 2001-10-25 12:07:23 +00:00
brendan%mozilla.org
894b19f8c3 Add mutable (growable or dependent, two subtypes) strings to solve O(n^2) and O(n^3) growth rates (56940, r=rogerl, sr=jband&shaver). 2001-10-25 00:26:38 +00:00
jaggernaut%netscape.com
1541469c6a Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc 2001-10-24 09:43:59 +00:00
jst%netscape.com
ec6e6aa5da Fixing bug 69468. Finally adding support for string nullness to XPConnect. r=jaggernaut@netscape.com, shaver@mozilla.org, sr=jband@netscape.com 2001-10-24 07:15:06 +00:00
pschwartau%netscape.com
9565961ff0 Adding two more cases to the test. 2001-10-24 02:01:59 +00:00
pschwartau%netscape.com
53e1fc0bb1 Improving comments. 2001-10-23 23:02:25 +00:00
pschwartau%netscape.com
80bbc8630d Initial add. Test for regexps with global flag set. 2001-10-23 22:29:01 +00:00
pschwartau%netscape.com
a61d44caad More accurate comment. 2001-10-23 19:28:40 +00:00
pschwartau%netscape.com
fa37601fdb Correcting an error in comments. 2001-10-23 19:12:42 +00:00
pschwartau%netscape.com
37ce28ddd4 Minor changes in style. 2001-10-23 17:39:31 +00:00
cls%seawood.org
b41bf3571c Since the purpose of --enable-ultrasparc is to just flip on the ultrasparc-specific js compare & swap code, move the asflags/defines to turn it on back into js/src/Makefile.in rather than causing the entire project to be built with those flags. 2001-10-23 08:17:16 +00:00
pschwartau%netscape.com
4965e9aa2c Adding comments. 2001-10-22 23:59:20 +00:00
dougt%netscape.com
0a62d4e8d5 99163 - removing nsObserverService.h includes. Also fixing 106090, extra methods on nsObserverService. r=shaver@mozilla.org, sr=jband@netscape.com 2001-10-22 22:01:27 +00:00
alecf%netscape.com
c8469b7ac5 bug 100214 - add libunicharutil_s to all unix projects that require it, r=cls 2001-10-22 20:44:02 +00:00
pschwartau%netscape.com
e8e300d648 Improving readability. 2001-10-22 20:09:12 +00:00
pschwartau%netscape.com
53c5b4683a Initial add. Regression test for Bugzilla bug 105972. 2001-10-22 20:06:52 +00:00
jaggernaut%netscape.com
3e278e4913 Bug 105973: s/Observe/observe/ 2001-10-22 04:16:33 +00:00
dougt%netscape.com
d18d7e2b17 nsIObserver and nsIObserverService API freeze. r=rpotts@netscape.com, alecf@netscape.com. bug 99163 2001-10-19 20:52:59 +00:00
brendan%mozilla.org
ef987373e8 Avoid converting lock-free to lock-full scope from GC mark call-outs (105571, r=jst, sr=jband). 2001-10-19 03:02:41 +00:00
nboyd%atg.com
b2eea2f3d4 Patch from Igor:
Unsynchronized ScriptableObject.getSlotToSet contains references/modifications
to the slots array which is no go under multithreading. The attached patch
replaces references to slots by references to its local copy and moves code
to allocate the initial array to synchronized addSlot.

The patch also replace throwing of RuntimeException in case of broken code by
if (Context.check && badCondition) Context.codeBug();

Regards, Igor
2001-10-18 18:16:28 +00:00
nboyd%atg.com
eef3184d67 Apparently the "classic" compiler is not only deprecated in JDK 1.4, but it
also has a significant regression introduced in it.   The default compiler
not only works, but also is noticably faster.  Ant takes care of the
selection of the compiler automatically based on the JDK level, so the
following patch should make things better all around.
2001-10-17 12:59:48 +00:00
nboyd%atg.com
78ab3bb949 Remove deprecated class. 2001-10-17 12:59:18 +00:00
nboyd%atg.com
250051383e Remove deprecated FlattenedObject.
Patch from Igor:
The 2 attached patches allow to avoid wrapping of array indexes to Double object
when Interpreter knows that the index is an integer number. It speed up array
benchmark by 5-10%

array_access.diff adds to ScriptRuntime getStrIdElem and setStrIdElem to get/set
properties which known to be strings plus it modifies NativeArray to use these methods.

interpreter.diff contains the Interpreter modifications to call get/setElem for
integer or string properties when the property type is known for sure.
2001-10-17 12:59:02 +00:00
nboyd%atg.com
1bc0630719 Backslashes don't work. 2001-10-17 12:53:39 +00:00
dbradley%netscape.com
19f0e89f2b bug 103649 - Crash when rendering a page with hundreds of iframes - This reduces the number of calls to JS_ContextIterator from XPCJSRuntime::SyncXPCContextList. It is only the first step in addressing this bug. r=jband, sr=jst 2001-10-17 11:52:55 +00:00
brendan%mozilla.org
38b3c5bb4b Checking in scole@planetweb.com's patch to prefix str_escape with js_ (96084, r=rogerl, sr=brendan). 2001-10-17 08:16:53 +00:00
brendan%mozilla.org
43a911aeb6 Fixes for bug 80981 (``Need extended jump bytecode to avoid "script too large"
errors, etc.''):

We now ReportStatementTooLarge only if
- a jump offset overflows 32 bits, signed;
- there are 2**32 or more span dependencies in a script;
- a backpatch chain link is more than (2**30 - 1) bytecodes long;
- a source note's distance from the last note, or from script main entry
  point, is > 0x7fffff bytes.

Narrative of the patch, by file:

- js.c
  The js_SrcNoteName array of const char * is now a js_SrcNoteSpec array of
  "specifiers", structs that include a const char *name member.  Also, due to
  span-dependent jumps at the ends of basic blocks where the decompiler knows
  the basic block length, but not the jump format, we need an offset operand
  for SRC_COND, SRC_IF_ELSE, and SRC_WHILE (to tell the distance from the
  branch bytecode after the condition expression to the span-dependent jump).

- jsarena.[ch]
  JS arenas are used mainly for last-in-first-out allocation with _en masse_
  release to the malloc pool (or, optionally, to a private freelist).  But
  the code generator needs to allocate and grow (by doubling, to avoid O(n^2)
  growth) allocations that hold bytecode, source notes, and span-dependency
  records.  This exception to LIFO allocation works by claiming an entire
  arena from the pool and realloc'ing it, as soon as the allocation size
  reaches the pool's default arena size.  Call such an allocation a "large
  single allocation".

  This patch adds a new arena API, JS_ArenaFreeAllocation, which can be used
  to free a large single allocation.  If called with an allocation that's not
  a large single allocation, it will nevertheless attempt to retract the arena
  containing that allocation, if the allocation is last within its arena.
  Thus JS_ArenaFreeAllocation adds a non-LIFO "free" special case to match the
  non-LIFO "grow" special case already implemented under JS_ARENA_GROW for
  large single allocations.

  The code generator still benefits via this extension to arenas, over purely
  manual malloc/realloc/free, by virtue of _en masse_ free (JS_ARENA_RELEASE
  after code generation has completed, successfully or not).

  To avoid searching for the previous arena, in order to update its next
  member upon reallocation of the arena containing a large single allocation,
  the oversized arena has a back-pointer to that next member stored (but not
  as allocable space within the arena) in a (JSArena **) footer at its end.

- jscntxt.c
  I've observed for many scripts that the bytes of source notes and bytecode
  are of comparable lengths, but only now am I fixing the default arena size
  for cx->notePool to match the size for cx->codePool (1024 instead of 256).

- jsemit.c
  Span-dependent instructions in JS bytecode consist of the jump (JOF_JUMP)
  and switch (JOF_LOOKUPSWITCH, JOF_TABLESWITCH) format opcodes, subdivided
  into unconditional (gotos and gosubs), and conditional jumps or branches
  (which pop a value, test it, and jump depending on its value).  Most jumps
  have just one immediate operand, a signed offset from the jump opcode's pc
  to the target bytecode.  The lookup and table switch opcodes may contain
  many jump offsets.

  This patch adds "X" counterparts to the opcodes/formats (X is suffixed, btw,
  to prefer JSOP_ORX and thereby to avoid colliding on the JSOP_XOR name for
  the extended form of the JSOP_OR branch opcode).  The unextended or short
  formats have 16-bit signed immediate offset operands, the extended or long
  formats have 32-bit signed immediates.  The span-dependency problem consists
  of selecting as few long instructions as possible, or about as few -- since
  jumps can span other jumps, extending one jump may cause another to need to
  be extended.

  Most JS scripts are short, so need no extended jumps.  We optimize for this
  case by generating short jumps until we know a long jump is needed.  After
  that point, we keep generating short jumps, but each jump's 16-bit immediate
  offset operand is actually an unsigned index into cg->spanDeps, an array of
  JSSpanDep structs.  Each struct tells the top offset in the script of the
  opcode, the "before" offset of the jump (which will be the same as top for
  simplex jumps, but which will index further into the bytecode array for a
  non-initial jump offset in a lookup or table switch), the after "offset"
  adjusted during span-dependent instruction selection (initially the same
  value as the "before" offset), and the jump target (more below).

  Since we generate cg->spanDeps lazily, from within js_SetJumpOffset, we must
  ensure that all bytecode generated so far can be inspected to discover where
  the jump offset immediate operands lie within CG_CODE(cg).  But the bonus is
  that we generate span-dependency records sorted by their offsets, so we can
  binary-search when trying to find a JSSpanDep for a given bytecode offset,
  or the nearest JSSpanDep at or above a given pc.

  To avoid limiting scripts to 64K jumps, if the cg->spanDeps index overflows
  65534, we store SPANDEP_INDEX_HUGE in the jump's immediate operand.  This
  tells us that we need to binary-search for the cg->spanDeps entry by the
  jump opcode's bytecode offset (sd->before).

  Jump targets need to be maintained in a data structure that lets us look
  up an already-known target by its address (jumps may have a common target),
  and that also lets us update the addresses (script-relative, a.k.a. absolute
  offsets) of targets that come after a jump target (for when a jump below
  that target needs to be extended).  We use an AVL tree, implemented using
  recursion, but with some tricky optimizations to its height-balancing code
  (see http://www.enteract.com/~bradapp/ftp/src/libs/C++/AvlTrees.html).

  A final wrinkle: backpatch chains are linked by jump-to-jump offsets with
  positive sign, even though they link "backward" (i.e., toward lower bytecode
  address).  We don't want to waste space and search time in the AVL tree for
  such temporary backpatch deltas, so we use a single-bit wildcard scheme to
  tag true JSJumpTarget pointers and encode untagged, signed (positive) deltas
  in JSSpanDep.target pointers, depending on whether the JSSpanDep has a known
  target, or is still awaiting backpatching.

  Note that backpatch chains would present a problem for BuildSpanDepTable,
  which inspects bytecode to build cg->spanDeps on demand, when the first
  short jump offset overflows.  To solve this temporary problem, we emit a
  proxy bytecode (JSOP_BACKPATCH; JSOP_BACKPATCH_PUSH for jumps that push a
  result on the interpreter's stack, namely JSOP_GOSUB; or JSOP_BACKPATCH_POP
  for branch ops) whose nuses/ndefs counts help keep the stack balanced, but
  whose opcode format distinguishes its backpatch delta immediate operand from
  a normal jump offset.

  The cg->spanDeps array and JSJumpTarget structs are allocated from the
  cx->tempPool arena-pool.  This created a LIFO vs. non-LIFO conflict: there
  were two places under the TOK_SWITCH case in js_EmitTree that used tempPool
  to allocate and release a chunk of memory, during whose lifetime JSSpanDep
  and/or JSJumpTarget structs might also be allocated from tempPool -- the
  ensuing release would prove disastrous.  These bitmap and table temporaries
  are now allocated from the malloc heap.

- jsinterp.c
  Straightforward cloning and JUMP => JUMPX mutating of the jump and switch
  format bytecode cases.

- jsobj.c
  Silence warnings about %p used without (void *) casts.

- jsopcode.c
  Massive and scary decompiler whackage to cope with extended jumps, using
  source note offsets to help find jumps whose format (short or long) can't
  be discovered from properties of prior instructions in the script.

  One cute hack here: long || and && expressions are broken up to wrap before
  the 80th column, with the operator at the end of each non-terminal line.

- jsopcode.h, jsopcode.tbl
  The new extended jump opcodes, formats, and fundamental parameterization
  macros.  Also, more comments.

- jsparse.c
  Random and probably only aesthetic fix to avoid decorating a foo[i]++ or
  --foo[i] parse tree node with JSOP_SETCALL, wrongly (only foo(i)++ or
  --foo(i), or the other post- or prefix form operator, should have such an
  opcode decoration on its parse tree).

- jsscript.h
  Random macro naming sanity: use trailing _ rather than leading _ for macro
  local variables in order to avoid invading the standard C global namespace.
2001-10-17 03:16:48 +00:00
jaggernaut%netscape.com
ce6e434d2a More REQUIRES clean-up. 2001-10-16 22:08:55 +00:00
pschwartau%netscape.com
f28aa32398 Comment fix. 2001-10-16 19:22:47 +00:00
nboyd%atg.com
af90c96f02 Test not valid in JDK 1.4. 2001-10-16 18:33:38 +00:00
pschwartau%netscape.com
0c21f002ec Skip new test that uses the gc() function of SpiderMonkey. 2001-10-16 18:14:19 +00:00
pschwartau%netscape.com
d952a19514 Intial add. Regression test for Bugzilla bug 104584. 2001-10-16 17:46:26 +00:00
jband%netscape.com
e6e171574e trivial warning fix. rs=jband 2001-10-16 05:48:25 +00:00
brendan%mozilla.org
eb9671e246 Add SetAlphaBounds, TABLE_SIZE, and MIN_ALPHA APIs (103990, r=dbaron, sr=waterson). 2001-10-16 05:40:27 +00:00
dougt%netscape.com
4f3a44d63b API Freeze for nsIServiceManager r=shaver@mozilla.org, sr=rpotts@netscape.com bug 99147 2001-10-16 03:35:52 +00:00
brendan%mozilla.org
12d650dc85 Fix js_GC to mark max(#actuals, #formals) slots at fp->argv (104584, r=shaver, sr=jband). 2001-10-16 02:21:02 +00:00
bryner%netscape.com
7e89125660 Bug 102725 -- problems converting numbers to strings when using gcc -O2. r=bbaetz, sr=brendan. 2001-10-15 22:31:39 +00:00
nboyd%atg.com
9ccbb97cbb Fix 104493:
We have a tool that looks for a scary noop case of assigning an instance field
to itself. this usually comes from a constructor that assigns a argument to a
instance field with the same name and then later the argument changes name. we
ran our tool on all of our classes we have in our classpath here and found this
problem in your code.

rhino1_5R2/src/org/mozilla/javascript/regexp/NativeRegExp.java line 159 it has:
        this.flags = flags;

This seems to be a bad cut and paste from the CompilerState constructor on line
2155. or has some initialization that used to work been lost?
2001-10-13 12:06:16 +00:00
pschwartau%netscape.com
a6a85c77d4 Initial add. Regression test for bug 104375. 2001-10-12 21:28:43 +00:00
jband%netscape.com
e21b56807d not yet part of build. support tracking the iid in array of interfaces 2001-10-12 20:29:19 +00:00
pschwartau%netscape.com
9c84b7f6f0 Initial add. Regression test for bug 104077. 2001-10-10 20:50:27 +00:00
pschwartau%netscape.com
b650df504b Minor change to make test exactly the same as the one reported in bug 102725. 2001-10-10 20:36:17 +00:00
brendan%mozilla.org
064c4cae19 Avoid O(n**2) growth rate of token buffer arena-based reallocation (103042, r=jband, sr=shaver). 2001-10-10 20:19:12 +00:00
rginda%netscape.com
6c53ec4ba6 bug 103804, "Venkman doesn't like stopping in timeouts", r=jband, sr=shaver
add callback to the enterNestedEventLoop method
2001-10-10 06:35:46 +00:00
pschwartau%netscape.com
ee091c31af Initial add. Regression test for bug 102725. 2001-10-10 01:32:28 +00:00
jband%netscape.com
900a5bfba9 NOT PART OF BUILD. bug 44675. bug 98209. New files 2001-10-09 23:42:22 +00:00
pschwartau%netscape.com
2059c2f02a Skip this test for now. Currently uses the non-EMCA 'it' object of SpiderMonkey. 2001-10-09 23:28:21 +00:00
pschwartau%netscape.com
d6986f9388 Initial add. Regression test for bug 99663. 2001-10-09 23:12:16 +00:00
rginda%netscape.com
28b0c9fa5b bug 103831, r=cls, sr=jband
remove java stubs
2001-10-09 21:43:15 +00:00
dbradley%netscape.com
6907d52b27 bug 102750 - Can't call JSIID.equals from web content. r=mstoltz, sr=jband 2001-10-09 18:54:37 +00:00
nboyd%atg.com
2eb21c32b3 Fix name of function in error message 2001-10-09 00:54:49 +00:00
jband%netscape.com
5992cc2572 fix bug 103259. Avoid crasher by correctly marking sharedscriptable object so that JSClasses don't get collected prematurely even when wrapper is 'stillborn' and not reflected into JS. r=dbradley sr=vidur. 2001-10-08 19:56:25 +00:00
rginda%netscape.com
4d363f3ca0 bug 102785, r=dp, sr=shaver, a=asa
remove venkman startup listener so we don't have to load the dll at startup.
checking into 0.9.5 branch also.
2001-10-08 19:44:35 +00:00
nboyd%atg.com
f70b7e4c78 Fix for problem:
There is a bug in JavaScriptException which prevents it from being used with
out a Rhino Context.  When the getMessage() method is invoked on it, the
exception goes to the ScriptRuntime to toString the value.  If you have
already exited your context, the runtime will throw an error.  The solution
is to simply remove the overridden getMessage method from
JavaScriptException.  JavaScriptException's constructor calls the Exception
constructor with the toString'ed value.  The default implementation of
getMessage will return the exception message.

Jeff
2001-10-07 18:44:39 +00:00
nboyd%atg.com
6642d0e4f2 Fix for the following problem:
I'm having problems getting inner class objects with Rhino.

I create a Hashmap, which is an implementation of Map. Map.Entry is an
inner interface of Map with key-value pairs. If I have a Map object,
"property", I should be able to get the key element with the expression
"property.key".

When I look at the "property" class name that Rhino returns I get:
"java.util.HashMap$Entry". I don't believe Rhino has a notion of the
inner Map.Entry object. The expression "property" succeeds. The
expression "property.key", which should retrieve the Map.Entry
keyValue(), fails with a "unexpected IllegalAccessException accessing
Java field".

I'm including a simple example that illustrates the problem. I hope you
can shed some light on this. Thanks!

Justyna
< Justyna.Horwat@Sun.com >

----
import java.io.*;
import java.util.*;
import org.mozilla.javascript.*;


public class MapTest {

    public static void main(String argv[]) {
        Test test = new Test();
        test.testMap();
    }
}

class Test {
    Map map;
    Set set;
    Iterator it;
    Map.Entry entry;

    public void testMap() {
System.out.println("testMap");
        map = new HashMap();

        populate();

        set = map.entrySet();
        it = set.iterator();

        // let's see if Map is populated correctly
        while (it.hasNext()) {
            entry = (Map.Entry) it.next();
            System.out.println("entry: " + entry.getClass().getName());
            System.out.println("key: " + entry.getKey());
            System.out.println("value: " + entry.getValue());
        }

        evaluate();
    }

    void populate() {
        map.put("firstKey", "firstValue");
        map.put("secondKey", "secondValue");
        map.put("thirdKey", "thirdValue");
        map.put("fourthKey", "fourthValue");
    }

    public void evaluate() {

        Context cx = Context.enter();
        Scriptable scope = cx.initStandardObjects(null);

        set = map.entrySet();
        it = set.iterator();

        while (it.hasNext()) {
            entry = (Map.Entry) it.next();
            scope.put("property", scope, cx.toObject(entry,scope));
        }

        Object eval = null;

        try {
            // attempt to get Map.Entry key value using Rhino
            eval = cx.evaluateString(scope, "property.key", "", 0,
null);
            // Unwrap scoped object
            if (eval instanceof Wrapper)
                eval = ((Wrapper) eval).unwrap();

        } catch (JavaScriptException jse) {
            System.out.println("EXCEPTION: " + jse.getMessage());
        }

        // DELETE
        System.out.println("RHINO result: " + eval + ":");
        System.out.println("RHINO class: " + eval.getClass().getName());
    }
}
2001-10-07 18:42:09 +00:00
jaggernaut%netscape.com
0c2b3bc449 Bug 81444: eliminate |null_nsCOMPtr|. Eliminating all callers, r=syd, rs=mozbot. 2001-10-07 10:58:39 +00:00
jaggernaut%netscape.com
c39b98b2a4 Clean up REQUIRES lines. 2001-10-07 10:35:41 +00:00
brendan%mozilla.org
95df849df8 Fix bogus return JS_FALSE without error report for empty flat string regexp match/replace (83293, r=rogerl, sr=shaver). 2001-10-06 08:07:43 +00:00
pschwartau%netscape.com
6ca4e471c4 Improving comments and readability. 2001-10-05 20:32:12 +00:00
pschwartau%netscape.com
c26dfebaed Improving comments. 2001-10-05 18:36:06 +00:00
pschwartau%netscape.com
b44e470e4b Initial add. Tests sparse arrays. 2001-10-05 18:27:40 +00:00
pschwartau%netscape.com
9a3fc24abe Skip test of (non-ECMA) fileName, lineNumber properties of Error objects 2001-10-05 16:25:55 +00:00
pschwartau%netscape.com
69ab92c82f Initial add. Regression test for bug 50447. 2001-10-05 16:19:37 +00:00
pschwartau%netscape.com
00d691ea88 Slight changes - 2001-10-05 02:07:47 +00:00
pschwartau%netscape.com
657d299244 Improving readability - 2001-10-05 00:25:11 +00:00
pschwartau%netscape.com
c188eb0d39 Including more RegExps. Not checking expected vs. actual matches now; just that we don't crash. 2001-10-04 23:58:24 +00:00
pschwartau%netscape.com
8ad7d34603 Initial add. Regression test for bug 103087. 2001-10-04 19:54:04 +00:00
pschwartau%netscape.com
8e321ed4c9 Fixing bug that prevented -p option from working on the Mac (again!) 2001-10-04 02:08:16 +00:00
brendan%mozilla.org
9324b81dee Fix for bug 99663 (for loop resolves properties of the object being enumerated
with JSRESOLVE_ASSIGNING, wrongly), plus a few miscellaneous bugfixes.

- Combine the JSStackFrame members constructing, special, overrides, and
  reserved into a uint32 flags member.

- Separate JOF_ASSIGNING from the JOF_SET bytecode format flag, and impute
  JSRESOLVE_ASSIGNING from the presence of JOF_ASSIGNING among the current
  opcode's format flags.  To handle the for-in loop opcodes, which do more
  than simply assign -- in particular, they do property lookups whose resolve
  hook outcalls should not be flagged with JSRESOLVE_ASSIGNING -- a new frame
  flag, JSFRAME_ASSIGNING, has been added.

- Fix interpreter version selection to respect JS_SetVersion, whose effect on
  cx->version is "sticky".

- Fix js_DecompileValueGenerator to deal with JSOP_ENUMELEM -- it never had,
  as this testcase shows (it crashes without this patch):

    version(120);
    eval("function fe(s) { for (it[s] in this); }");
    try { fe('rdonly'); } catch (e) { print(e); }
2001-10-03 06:39:30 +00:00
dbradley%netscape.com
aa050fb3a4 bug 100665 - Maybe xpconnect should not init the XPCOutArg JSClass. r=jband, sr=shaver 2001-10-03 02:57:42 +00:00
dbradley%netscape.com
9bb2766908 Bug 102294 - printf has an extra parameter. r=jband 2001-10-03 02:48:40 +00:00
nboyd%atg.com
81d6990263 Patch from Igor:
My optimization for PreorderNodeIterator has a bug that would cause an attempt
to access stack[-1] in
    currentParent = (current == null) ? null : stack[stackTop - 1];
when current refers to a start node sibling. This is not visible in Rhino because
currently PreorderNodeIterator is always started from nodes with node.next == null.

iter.diff fixes that plus it removes currentParent field because it is always
available as stack[stackTop - 1] and code to access its value are executed less
frequently than the lines to update it in nextNode

Regarsd, Igor
2001-10-02 12:49:46 +00:00
dbaron%fas.harvard.edu
9a4acbab7a Bug 45797: replace remaining uses of deprecated macros NS_IMPL_QUERY_INTERFACE and friends with NS_IMPL_QUERY_INTERFACE1 and friends and remove the deprecated macros. r=jag sr=alecf 2001-10-02 03:18:08 +00:00
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
rogerl%netscape.com
30680afe44 Fix bug #98306, ParseAtom crash for "/[/]/" r=jst, r/sr=be. 2001-09-18 22:36:14 +00:00
jaggernaut%netscape.com
d1a7bfa843 One module per line for REQUIRES. r=/sr=alecf 2001-09-18 22:01:13 +00:00
jaggernaut%netscape.com
dc40187223 Bug 73353: splitting the modules on the REQUIRES lines in Makefile.in across multiple lines to more clearly show the changes made. sr=alecf 2001-09-18 13:41:47 +00:00
nboyd%atg.com
8496f933ce Patch from Igor:
Currently in the interpreter mode all number literals are stored in
InterpreterData.itsICode as an index to InterpreterData.itsNumberTable
which holds the actual value.

For integers that fit 2 or 4 bytes this is an overkill and the attached
patch stores integers in InterpreterData.itsICode inline after special
TokenStream.INTNUMBER or TokenStream.SHORTNUMBERS tokens.

The changes made benchmarks to run 1.5% faster. It also saves memory
because InterpreterData.itsNumberTable is allocated only for non-integers
that present only in a small number of scripts.

In principle, it may be possible to store all numbers inline as well, but
unfortunately re-assembling of 8 bytes from InterpreterData.itsICode array
into double is rather slow operation and is not worth the hassles.

Regards, Igor
2001-09-18 12:27:23 +00:00
nboyd%atg.com
eb3cf99fce Patch from Igor:
Hi, Norris!

Currently ScriptableObject.put does not check lastAccess cache during its search for
slots. When I added this check (see the attached patch) it speeded up the benchmark
suite by about 1.5% and in particular for setProp_bench.js the win was about 8%.

I think that even on multiprocessor machines it would not introduces any additional
issues  like accessing the old value in the processor cache because the put method
accesses existing properties via unsynchronized getSlot, and the check for lastAccess
is on pair with that.

Trgards, Igor
2001-09-18 12:26:10 +00:00
nboyd%atg.com
c352f1aa9b Fix for problem from Felix Meschberger:
When handling an Exception the Context tries to get the current script
and line number from the Java Stacktrace. To get the indication of which
entry in the trace might be an ECMA script, the file extension ".js" is
assumed.

For our integration we use the standard extension ".ecma" which collides
with the above assumption. But we don't force this extension, we just
have a convention. We name these files ".ecma" as they are not plain
ECMA but JSP-like ECMA. That is instead of using Java as the programming
language we use ECMA. In this respect they would be ".esp".
2001-09-18 12:24:56 +00:00
brendan%mozilla.org
c18c814935 Use the maximum of fp->argc and fp->fun->nargs to bound fp->argv (97921, sr=jband&shaver). 2001-09-18 01:47:41 +00:00
pschwartau%netscape.com
ca95abb70c Forgot to remove these comment-marks. 2001-09-17 23:55:06 +00:00
pschwartau%netscape.com
12c45dcfdc Skip regression test for bug 100199 until the bug is fixed. 2001-09-17 23:53:12 +00:00
pschwartau%netscape.com
67ac10ea31 Initial add. Regression test for bug 100199. 2001-09-17 23:49:25 +00:00
alecf%netscape.com
62424ee7b2 Final REQUIRES changes for bug 98371, adding support for MOZ_TRACK_MODULE_DEPS to win32. r=cls (and tested by cls!) 2001-09-17 19:06:35 +00:00
pschwartau%netscape.com
625129bd11 Improve visual presentation in the case where test string contains '\n'. 2001-09-14 20:10:49 +00:00
nboyd%atg.com
b5141d614d Patch from Igor:
Patch fixes issue of not ignoring UNICODE format characters in match
and peek methods, adds explicit assertions checks for code assumptions
and makes handling of ASCII '\r', '\n' and UNICODE U+2028, U+2029 line
ends uniform.

It was rather tricky to fix format character issue and I spend some
time figuring out what TokenStream assumes about LineBuffer that
breaks my initial thoughts on the patch in cases like very long
sequences of format characters that do not fit in the buffer. I
fixed that but it made the code rather unclear so I put explicit
checks for assumptions/preconditions to help with debugging.

I added Context.check flag to turn on/off these checks and
Context.codeBug to throw an exception in case of check violations,
and also modified UintMap to use them instead of the private
flags there.

It would be nice to add some tests about format characters to the test
suite with checks similar to "eval('1 =\u200C= 1') == true" and
"eval('.\u200C1') == 0.1".
2001-09-14 17:26:12 +00:00
nboyd%atg.com
7c041252b1 Patch from Igor:
Hi, Norris!

I have found few problems with NativeArraj.java.

1. jsSet_length requires that the new length value should be an instance of Number. But according to Ecma 15.4.5.1, item 12-13, an error should be thrown only if ToUint32(length_value) != ToNumber(length_value). Here is a simple test that demonstrates it:

Array(5).length = new Number(1)

It currenly throws an exception.

2. jsSet_length when executing the code marked with "// assume that the representation is sparse" effectively removes all properties with values less then the current length when String is used to represent its value. Note that simply changing lines "if (d == d && d < length) delete(id);" to "if (d == d && d >= longVal) delete(id);" is not good because it would remove properties like "4.5" or "007", the full array index check has to be used instead.

Here is a test case that catches the problem:

var BIG_INDEX = 4294967290;
var a = Array(BIG_INDEX);
a[BIG_INDEX - 1] = 'a';
a[BIG_INDEX - 10000] = 'b';
a[BIG_INDEX - 0.5] = 'c';

a.length = BIG_INDEX - 5000;
var s = '';
for (var i in a) s += a[i];

print('s="'+s+'"');

this should print s='cb' (or 'bc': EcmaScript does not fix the order), but currently it gives s=''.

3. There are race conditions in jsSet_length and getIds.
The first contains:
                    if (hasElem(this, i))
                        ScriptRuntime.delete(this, new Long(i));
which would lead to call to delete in the Array prototype if 2 threads would invoke this code. Simply calling ScriptableObject.delete without any checks for existence is enough here.

getIds assumes that the count of present elements in the dense array does not change, which is not true when another thread deletes elements from dense.

The attached patch fixes these issues.

Regards, Igor
2001-09-14 13:50:09 +00:00
brendan%mozilla.org
cf80f7240c Fix unsafe JS_DHashTableRawRemove usage; unoverload cx->resolving into a counter and a JSDHashTable pointer (94422, r/sr=jband,waterson with dbaron sanity checks). 2001-09-14 03:37:15 +00:00
pschwartau%netscape.com
6333005ace Making testcase compatible with updated testRegExp() function in utility file shell.js 2001-09-14 00:29:21 +00:00
pschwartau%netscape.com
a6700335b7 Improving the error-reporting functions for RegExp tests. Now more complete and more consistent. 2001-09-14 00:15:59 +00:00
nboyd%atg.com
db1d39756e Fix broken link 2001-09-13 13:49:23 +00:00
brendan%mozilla.org
3efd0e519f 1. Fix jsdhash/pldhash.[ch] so that add/remove cycles for a given k do not
create a long chain of removed sentinels.  Also, when adding k to a table
    where k is not mapped, but where k hashes to a chain that includes removed
    sentinels, recycle the first removed sentinel in the chain for k's entry.
2.  Cache cx->resolving till js_DestroyContext, to avoid high JSDHashTable
    new/destroy overhead in js_LookupProperty.
3.  Add NS_TraceStack to nsTraceMalloc.[ch] and clean the .c file up a bit.
2001-09-12 06:39:31 +00:00
cls%seawood.org
1db0a058f3 Make generated header use common install rules.
Bug #59454 r=bryner sr=alecf
2001-09-12 06:35:50 +00:00
blizzard%redhat.com
3b2127bd59 Checking in for Ulrich Drepper. Bug #99246. r=beard, sr=brendan 2001-09-12 03:19:08 +00:00
pschwartau%netscape.com
cb7ef4c5f2 Trivial whitespace cleanup. 2001-09-10 23:16:43 +00:00
pschwartau%netscape.com
9394dbd3ec Initial add. Regression test for bug 97921. 2001-09-10 23:05:12 +00:00
alecf%netscape.com
8bf5905937 add REQUIRES support to jpeg, sun-java, db, etc.. b=98371 r=cls 2001-09-10 20:48:38 +00:00
pschwartau%netscape.com
9b63ff8183 Trivial change to comment and whitespace. 2001-09-08 18:58:40 +00:00
rginda%netscape.com
911df23fb2 bug 95534, r=brendan, sr=jband
fix semantics of JSTRAP_CONTINUE to prevent a debugger client from telling the engine to continue when we all know it'll proobably just crash.
2001-09-06 21:46:18 +00:00
jband%netscape.com
02986411d1 fix bug 96511. Meant #ifdef not #if. sr=brendan r=jband 2001-09-06 19:01:17 +00:00
nboyd%atg.com
a14d6d33c5 patch (with my modifications) from jj@mail.ahc.umn.edu:
It would be nice if the rhino shell would accept a URL as the source
for javascript.

I've added this feature to my local copy so that I can launch rhino
with js scripts using  JavaWebStart.

Below is a context diff of the changes I made to
toolsrc/org/mozilla/javascript/tools/shell/Main.java
2001-09-06 16:53:29 +00:00
jband%netscape.com
0a93bb62fa fix bug 98450. We need to be calling OBJ_DROP_PROPERTY after OBJ_LOOKUP_PROPERTY. Also, this was refactored on dbradley's suggestion. sr=brendan r=dbradley 2001-09-06 06:29:19 +00:00
rginda%netscape.com
49273bb507 - venkman only -
init xpconnect on the debugger's default context so that xpconnect can use it when it has to.  r=jband
2001-09-06 01:34:44 +00:00
pschwartau%netscape.com
082245971f Trivial whitespace fix. 2001-09-05 23:35:07 +00:00
pschwartau%netscape.com
ed10eb7850 Completely rethinking this testcase. Reduced test as much as possible, added try...catch blocks and for-loop to stress-test the code. 2001-09-05 23:21:33 +00:00
rginda%netscape.com
ea08067f65 - venkman only -
turn off verbose debugging for me
push a thread event queue for necko before we enter a nested event loop
2001-09-05 21:29:59 +00:00
jband%netscape.com
23d7dc717d fix bug 97444. It is not good to patch a different fun into the frame. Let's safely shunt aside the callee frame instead. r=rogerl sr=brendan 2001-09-05 21:25:09 +00:00
pschwartau%netscape.com
8873ed636b Improved accuracy of test, and added more cases. 2001-09-05 21:15:43 +00:00
pschwartau%netscape.com
4380531bc9 Adding comment regarding regress-97646-001-n.js, regress-97646-002-n.js 2001-09-05 17:47:11 +00:00
pschwartau%netscape.com
a42722d0e6 Correcting comments at top of file, plus bug and summary values. 2001-09-05 17:13:14 +00:00
pschwartau%netscape.com
4757b4fc39 Correcting date at top of file. 2001-09-05 17:03:32 +00:00
pschwartau%netscape.com
87765e762a Correcting comments at top of file, plus bug and summary values. 2001-09-05 17:01:03 +00:00
nboyd%atg.com
4e39e826e2 Patch from Igor. 2001-09-05 16:54:37 +00:00
nboyd%atg.com
8eb4d39793 Patch from jeffh@aiinet.com:
There is a bug in the JavaMembers class called to wrap a Java object.

In JavaMembers.lookup(), code was added to override the static type.  The
code works in the case of an Enumeration returning an Object which would
have to be casted to the appropriate type.

The code does not work when the static type is an interface.  In this case,
the interface class is the one which should be reflected, not a parent class
of the dynamic type.  A simple staticType.isInterface() check around the
parent traversal code fixes the problem.

Jeff
2001-09-05 16:52:39 +00:00
nboyd%atg.com
a19d5beda6 Patch from jeffh@aiinet.com:
I have found a couple problems with running Rhino 1.5R2 in a heavily
multi-threaded environment.  The attached patches fix the problems.

- org.mozilla.javascript.optimizer.InvokerImpl - This class was accessing
the shared classNumber outside of the synchronized block.

- org.mozilla.javascript.optimizer.OptClassNameHelper - The reset method was
not synchronized.  It needs to be because the class using the classNames map
is synchronized and does not handle nulling of the variable while it's
looping on the map.

Jeff
2001-09-05 16:50:26 +00:00
nboyd%atg.com
4507a1cf73 Update for new tests. 2001-09-05 16:48:31 +00:00
pschwartau%netscape.com
cb11cb7e47 Initial add. Regression test for bug 98306. 2001-09-05 06:27:25 +00:00
pschwartau%netscape.com
0b02e3b978 Skipping two new tests that use non-EMCA functionality: toSource() and uneval(). 2001-09-05 01:07:17 +00:00
pschwartau%netscape.com
ded8f34015 Improved readabilty. Improved accuracy of stripBraces() function. 2001-09-05 00:49:31 +00:00
pschwartau%netscape.com
018096156d This is more accurate. Also using sorting now, for definiteness in comparisons. 2001-09-05 00:46:24 +00:00
pschwartau%netscape.com
3e130a22c8 Initial add. Regression test for bug 96284. 2001-09-04 01:54:36 +00:00
brendan%mozilla.org
622522e134 Ignore property found in non-native prototype (12367, sr=jband&shaver, a=asa). 2001-09-03 22:29:12 +00:00
brendan%mozilla.org
0cf73f1847 Fix toSource on exception objects so it uses toSource to generate properly-quoted, embedded string literals for message and filename (bug 96284, r=jband, sr=shaver, a=asa). 2001-09-03 19:36:24 +00:00
rginda%netscape.com
f14e08526e bug 88130, patch=jband, r=me,dbradley, sr=jst, a=brendan
clear exception state before and after calling out via xpconnect.
remove redundant exception clear from CallQueryInterfaceOnJSObject.
2001-09-01 22:47:47 +00:00
rginda%netscape.com
c5226cb4b5 -- not built --
exposing call hook functionality
2001-09-01 18:03:53 +00:00
rginda%netscape.com
95a185d386 -- not built --
whitespace cleanup
2001-09-01 18:01:28 +00:00
jband%netscape.com
56d03ab63d fix bug 97555. Need to get the correct value of staep into the iterator object when we fail during enumeration init. r=jst sr=brendan a=asa 2001-08-31 21:48:18 +00:00
brendan%mozilla.org
43c254feee Fix 97540, r=rginda, sr=jband, a=asa:
- The most significant fix, to keep JSStackFrame.spbase, the operand stack base pointer for an active frame, null except when there is an operand stack allocated and in use by js_Interpret.  Previously, spbase would point after args and local vars (if any), then advance upon allocation of the (possibly discontiguous) operand stack space.  This made for a fatal ambiguity: js_AllocStack, called by XPConnect, could not tell when there was allocated operand stack space above the frame's sp, which needs to be set to a known (JSVAL_VOID) state for exact GC to work.  Now, the GC doesn't have to mark any operand stack space for a frame whose spbase is null, and js_AllocStack doesn't need to void any unused space for such a frame.

- Fixes to reload the JSRuntime's callHook or executeHook after calling or executing, in case the debugger removes the hook.  In which case, it must clean up any dynamic memory held by hookData, but in any event, in which case the engine must not call the post-call or post-execute hook.

- While debugging with rginda, I was horrified to see his trivial testcase function, expressed as a lambda, fail to be invoked using the "inline_call" machinery in js_Interpret (which avoids js_Interpret recursion through js_Invoke for most JS functions).  The problem was a test of fun->flags == 0 conditioning the /* inline_call: */ code.  Since that test was written, at least one JSFUN_* flag (JSFUN_LAMBDA, used only for pretty-printing or accurate decompilation) has been added.  But all along, that test was an over-optimization (testing against 0 without &'ing certain flags), making for an accident waiting to happen -- which did happen.  The relevant flags are JSFUN_HEAVYWEIGHT (set by the compiler when a function calls eval, uses with, or otherwise needs an activation object for its scope; if lightweight, the compiler can see the function's scope and eliminate it via specialized bytecodes) and JSFUN_BOUND_METHOD (for Java method calls, where |this| binds statically to the instance, not dynamically to the calling expression reference's base object, as in JS).
2001-08-31 21:25:26 +00:00
pschwartau%netscape.com
f37dffb52a Corrected testcase so it will work in Rhino as well as SpiderMonkey. 2001-08-31 06:10:13 +00:00
pschwartau%netscape.com
d3d0f5e05a Initial add. 2001-08-30 19:55:05 +00:00
pschwartau%netscape.com
e456fc4d42 Trivial whitespace change. 2001-08-29 23:34:32 +00:00
pschwartau%netscape.com
42fca7b54a Initial add. 2001-08-29 23:20:16 +00:00
pschwartau%netscape.com
36ee37b5de Removed a few hundred || conditions. See comment 2001-08-29 12:00 in bug 89443. 2001-08-29 20:37:58 +00:00
pschwartau%netscape.com
1842238b89 Adding skips for two tests employing the non-ECMA toSource() and uneval() functions. 2001-08-29 06:14:38 +00:00
pschwartau%netscape.com
cf7115e693 Initial add. 2001-08-29 05:59:52 +00:00
rginda%netscape.com
6835cdd75e - not built -
spruce up some comments
added, then comented out, jsdIDebuggerService::filterGlobalObject
2001-08-28 22:03:44 +00:00
rginda%netscape.com
7d148030f7 - not built -
whitespace tweakage
2001-08-28 22:02:28 +00:00
rginda%netscape.com
4f4bb7a28f - not built -
don't allow gc's during script hooks if CAUTIOUS_SCRIPTHOOK is defined (which it is, by default.)  Should help with stability until we can fix the real problems.
Use JSVAL_ macros instead of JSD_* calls in jsdValue::GetJSType method, avoiding two c++ frames per call.
2001-08-28 22:02:07 +00:00
rginda%netscape.com
7cb5a48149 - not built -
modeline fix
2001-08-28 21:59:53 +00:00
jband%netscape.com
f95e84e0e7 fix bug 96725. Avoid infinite recursion in call to QI'd xbl binding by avoiding the mutation of the interface set when the object implementing the interface is a wrappedJS around our wrappedNative's own JSObject. r=dbradley sr=hyatt a=brendan,hyatt,jband 2001-08-28 21:52:10 +00:00