Commit Graph

3852 Commits

Author SHA1 Message Date
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
pschwartau%netscape.com
09987595a3 Adding two new utility functions. 2001-08-28 21:13:58 +00:00
thesteve%netscape.com
aee3db86dc Bug#81373 (mac static build)
fixed up access paths: get rid of :::dist:client[_debug]
r=jfrancis
sr=sfraser
a=asa on behalf of drivers
2001-08-27 23:45:59 +00:00
pschwartau%netscape.com
7dcd878d8f Punctuation correction in comment. 2001-08-27 22:57:25 +00:00
pschwartau%netscape.com
f055101da4 Initial add. 2001-08-27 22:55:57 +00:00
pschwartau%netscape.com
c7e5cb06a4 Some RegExp bugs have now been fixed in Rhino. Removing the testcases from the skip list. 2001-08-27 19:58:56 +00:00
rogerl%netscape.com
b16d847568 Port of performance fixes from Monkey (see bug #85721).
Also, fixes for :
#91343, (non-latin1 fails for [\S])
#78156, (Unicode line terminator matching)
#87231, (/(A)?(A.*)/ didn't reset paren state for empty first match)
2001-08-27 18:03:19 +00:00
rjesup%wgate.com
6f3e4115eb Bug 94243: VoidArray usage patch. a=asa sr=brendan r=waterson r=bienvenu
r=pierre r=jband/dbradley  Also fixes some whitespace issues.
2001-08-27 06:15:54 +00:00
pschwartau%netscape.com
9e09712d1e Technical change. Now test is accurate for Rhino as well as SpiderMonkey. 2001-08-25 05:01:50 +00:00
nboyd%atg.com
115380ea02 Original problem in following mail. I implemented JDK1.1 compatibility and performance
improvements:

Subject:
        Rhino: Problem in NativeJavaMethod
   Date:
        Tue, 14 Aug 2001 10:23:35 +0200
   From:
        felix.meschberger@day.com
     To:
        Norris Boyd <nboyd@atg.com>




Hi Norris,

While working with wrapped Java classes we discovered a problem in
NativeJavaMethod : If the public method to be called is part of a
non-public class, the Sun Java VM throws an IllegalAccessException. This
bug in the Sun VM has been reported as Bug 4071593 to Sun, but has not been
resolved since....

I implemented a circumvention, for which I provide you the patch. I quickly
tested it, and it seems to work.

Regards
Felix

And here's the patch :

diff -w -r1.19 NativeJavaMethod.java
227a228,234
>        /**
>         * Due to a bug in Suns VM, public methods in private
>         * classes are not accessible by default (Sun Bug #4071593).
>         * We have to explicitly set the method accessible beforehand
>         */
>        meth.setAccessible(true);
>

-----------------------------------------------------------------
This message is a private communication. If you are not the intended
recipient, please do not read, copy, or use it, and do not disclose it
to others. Please notify the sender of the delivery error by replying to
this message, and then delete it from your system. Thank you.
The sender does not assume any liability for timely, trouble-free,
complete, virus free, secure, error free or uninterrupted arrival of
this e-mail. For verification please request a hard copy version.

mailto:felix.meschberger@day.com
http://www.day.com

Felix Meschberger
Development
Day Interactive AG
Steinenberg 21-23
4001 Basel
Switzerland

T  41 61 226 98 98
F  41 61 226 98 97
2001-08-24 20:01:49 +00:00
brendan%mozilla.org
f319c1d822 Check keyword version when scanning, not by installing different keywords on version selection (when starting to compile; bug 96562, r=rogerl, sr=shaver&jband, a=dbaron). 2001-08-24 03:32:31 +00:00
brendan%mozilla.org
f81e32a193 Avoid corrupting backpatch chains by checking for jump offset operand overflow (90445, khanson's patch with minor changes, sr=shaver&me, a=asa). 2001-08-23 02:07:07 +00:00
brendan%mozilla.org
8cc94e0ba1 Checking in khanson's patch for bug 85112, based on joemansh@interl.net's algorithm (r=beard, sr=me). 2001-08-22 05:42:16 +00:00
brendan%mozilla.org
834611cda0 Forget to include jsopcode.h. 2001-08-22 05:33:32 +00:00
brendan%mozilla.org
2b5a1171f6 Support ref()++ etc. for native ref (75688) and fix exn_toSource (96284); sr=shaver&jband. 2001-08-22 04:59:28 +00:00
brendan%mozilla.org
68f889e9bd Checking in shaver's patch for bug 78100, adding JS_GetExternalStringGCType (sr=brendan&jband). 2001-08-21 02:53:19 +00:00
dbaron%fas.harvard.edu
113ad642ae Replace uses of deprecated NS_IMPL_ISUPPORTS and NS_IMPL_QUERYINTERFACE macros with NS_IMPL_{ISUPPORTS,QUERYINTERFACE}{1,0}. r=jag rs=brendan b=45797 2001-08-21 01:48:11 +00:00
nboyd%atg.com
c9ff8d7ef1 Subject:
Rhino: Problem in NativeJavaMethod
   Date:
        Tue, 14 Aug 2001 10:23:35 +0200
   From:
        felix.meschberger@day.com
     To:
        Norris Boyd <nboyd@atg.com>




Hi Norris,

While working with wrapped Java classes we discovered a problem in
NativeJavaMethod : If the public method to be called is part of a
non-public class, the Sun Java VM throws an IllegalAccessException. This
bug in the Sun VM has been reported as Bug 4071593 to Sun, but has not been
resolved since....

I implemented a circumvention, for which I provide you the patch. I quickly
tested it, and it seems to work.

Regards
Felix
2001-08-17 14:29:48 +00:00
brendan%mozilla.org
b0e3e4ab62 Don't resolve standard classes if JSRESOLVE_ASSIGNING (NOT PART OF BUILD). 2001-08-17 10:40:15 +00:00
brendan%mozilla.org
6843e21c2b Checking in khanson's patch with whitespace cleanups for bug 89443, to avoid stack overflow on too many || operators in one expression (r=rogerl, sr=me). 2001-08-17 10:29:59 +00:00
brendan%mozilla.org
4e1703cf54 Shrinking realloc can fail (95517, basic patch from epstein@tellme.com, r=brendan, sr=jband). 2001-08-17 09:56:48 +00:00
sfraser%netscape.com
55069a4b1a Project cleanup, rs=scc. Fix one or more of access paths, linking with the correct startup library, and unnecessary linkage. 2001-08-17 01:28:47 +00:00
jband%netscape.com
2bad71c89b fix bug 94752. Let xpconnect decide when to call JS_DestroyContext. It sometimes needs to defer the call until JS code running on the context is finished. r=dbradley sr=jst 2001-08-15 04:49:09 +00:00
pschwartau%netscape.com
c2bf0b573d Removing skip for ecma_3/String/regress-83293.js. The testcase was incorrect, and is now corrected. 2001-08-14 18:28:57 +00:00
pschwartau%netscape.com
0683215880 Making extensive corrections. Testcase had not conformed to ECMA-262 Final Edition. 2001-08-14 18:02:56 +00:00
pavel%gingerall.cz
e1d4f83235 Context typemapping changed 2001-08-14 13:09:43 +00:00
cls%seawood.org
a3c1dd1b09 Use NS_PTR_TO_INT32 macros to do 64-bit safe pointer conversions.
Bug #20860 r=Roland.Mainz@informatik.med.uni-giessen.de sr=brendan@mozilla.org
2001-08-14 07:59:59 +00:00
pschwartau%netscape.com
3c0807c3df Adding new case to the test. 2001-08-13 19:38:18 +00:00
nboyd%atg.com
afe5ac0483 Fix 95101. 2001-08-13 18:33:25 +00:00
pschwartau%netscape.com
e7ab80d369 Initial add. 2001-08-13 18:05:42 +00:00
nboyd%atg.com
61f998bae8 Subject:
[Fwd: Rhino 1.5.2 bug in debug support?]
        Date:
             Sun, 12 Aug 2001 14:13:26 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

Did you or are you fixing this problem?  It seems to be simply a matter
of filtering out -1 before inserting line numbers into the
lineNumberTable.  In this particular case the Parser generates -1 as a
line number for (? : ) in IRFactory.createTernary().  However the recent
changes to InterpreterData to use UintMap instead of Hashtable will not
tolerate negative numbers.  Changing Interpreter.updateLineNumber() and
InterpreterData.getOffset() to check for negative line numbers (and
avoid generating line number code or accessing the lineNumberTable in
that case) will correct the problem.

Chris


      Subject:
             Rhino 1.5.2 bug in debug support?
        Date:
             8 Aug 2001 12:47:28 -0700
       From:
             d-russo@ti.com (dave russo)
 Organization:
             http://groups.google.com/
 Newsgroups:
             netscape.public.mozilla.jseng



I'm getting the following exception when running the Rhino debugger.

java.lang.RuntimeException
        at org.mozilla.javascript.UintMap.check(UintMap.java:349)
        at org.mozilla.javascript.UintMap.put(UintMap.java:158)
        at
org.mozilla.javascript.Interpreter.updateLineNumber(Interpreter.java:234)
        at
org.mozilla.javascript.Interpreter.generateICode(Interpreter.java:300)
        at
org.mozilla.javascript.Interpreter.generateICode(Interpreter.java:926)
        at
org.mozilla.javascript.Interpreter.generateICode(Interpreter.java:302)
        at
org.mozilla.javascript.Interpreter.generateICode(Interpreter.java:302)
        at
org.mozilla.javascript.Interpreter.generateICode(Interpreter.java:302)
        at
org.mozilla.javascript.Interpreter.generateICodeFromTree(Interpreter.java:89)
        at
org.mozilla.javascript.Interpreter.generateFunctionICode(Interpreter.java:186)
        at
org.mozilla.javascript.Interpreter.generateNestedFunctions(Interpreter.java:164)
        at
org.mozilla.javascript.Interpreter.generateScriptICode(Interpreter.java:124)
        at org.mozilla.javascript.Interpreter.compile(Interpreter.java:78)
        at org.mozilla.javascript.Context.compile(Context.java:1810)
        at org.mozilla.javascript.Context.compile(Context.java:1735)
        at org.mozilla.javascript.Context.compileReader(Context.java:852)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:770)
        at org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:300)
        at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:290)
        at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:244)
        at org.mozilla.javascript.tools.shell.Main.exec(Main.java:104)
        at org.mozilla.javascript.tools.debugger.Main.main(Main.java:3156)


I'm using Rhino 1.5.2 prerelease
(ftp://ftp.mozilla.org/pub/js/rhino15R2pre.zip) and SUN's JDK 1.3.1
runtime for Windows.

I'm running the debugger as follows:
java -cp js.jar org.mozilla.javascript.tools.debugger.Main -f tconfini.tcf

Where the file tconfini.tcf is shown below:

function getBoard (defFile) {
    if (arguments.length > 0 ) {
        return (defFile != null ? defFile[1] : null);
    }
    return (null);
}

Any help would be appreciated.  Thanks!

dave
2001-08-12 22:56:33 +00:00
val4%cornell.edu
c04a3d6833 Attempt to build on Unix 2001-08-11 04:57:50 +00:00
brendan%mozilla.org
9abbf226e2 JSOP_BINDNAME needs JOF_SET flag for JSRESOLVE_ASSIGNING to be imputed (94631, r=shaver, sr=jband). 2001-08-10 23:57:07 +00:00
dbradley%netscape.com
bc3efa22e4 Bug 88130: XPConnect disturbs exception state of the call-context. This is jband's patch to reorder calls and fix whitspace. r=rginda, sr=jst 2001-08-10 19:23:39 +00:00
dbradley%netscape.com
466a26d77c Bug 93790: xpconnect does not correctly reflect nsIClassInfo interface. r=dbradley, sr=jst, patch by jband 2001-08-10 14:13:17 +00:00
brendan%mozilla.org
d109dc3d71 Check in balleysson@bigfoot.com's patch to avoid a redundant js_strlen (87271, r=shaver, sr=brendan). 2001-08-10 08:02:25 +00:00
brendan%mozilla.org
6abf5d1dd4 Fix useless expression elimination to work with native-function-called JS_EvaluateScript (87271, r=rogerl, sr=jband). 2001-08-10 07:55:17 +00:00
pschwartau%netscape.com
d0f11628fb Adding two new cases to the test. 2001-08-09 23:22:16 +00:00
pschwartau%netscape.com
a39f79907f Corrected an error in Section 3 of the test. Improved readability. 2001-08-09 22:56:07 +00:00
pschwartau%netscape.com
9cb6aa464f Initial add. 2001-08-09 19:55:49 +00:00
brendan%mozilla.org
9e5cfdfda2 Shrink principals struct back to where it was last week -- but it could go further (93043, r=shaver, sr=jst). 2001-08-09 01:15:57 +00:00
pschwartau%netscape.com
bdcd5ba11c Initial add. Tests to skip when testing the JS2 shell. 2001-08-08 21:58:12 +00:00
nboyd%atg.com
f6c346cc76 Patches from Igor:
=================================
Rhino: use of Node.get/putIntProperty to store integer values

The patch replaces usage like
        node.putProp(PROPERTY, new Integer(int_value))
        ((Integer)node.getProp(PROPERTY))
by
        node.putIntProp(PROPERTY, int_value)
        node.getIntProp(PROPERTY, defaultValue)
        node.getExistingIntProp(PROPERTY)
to avoid creation of Integer wrapper objects while storing integer
properties in Nodes.

Patch also ads Node.removeProp to explicitly remove Node properties
=================================
The patch changes the type of the first argument of Interpreter.addByte
from byte to int so there is no need to cast int arguments, adds
addShort(int value, int iCodeTop), getShort(byte[] iCode, int pc) to
pack/unpack short values from pc array, replaces calls to
getString(stringTable, byte[] iCode, int pc) by
stringTable[getShort(iCode, pc)] and similar for getNumber

It makes Interpreter.java easy to follow and slightly shrink its class file.
2001-08-08 17:02:56 +00:00
pschwartau%netscape.com
dbd534fadb Now able to run tests against the JS2 shell (code-named "DikDik"). 2001-08-08 00:12:50 +00:00
brendan%mozilla.org
68850351e9 Quick followup, my reviewers missed a copy/paste error that's harmless but formally wrong. 2001-08-07 05:32:38 +00:00
brendan%mozilla.org
bb7f3f9cb3 Use a new JSContext option to type context-private data as nsISupports* (82845, sr=jst&waterson). 2001-08-07 05:27:42 +00:00
brendan%mozilla.org
49c0102cdf Restore scriptable nsIClassInfo.classID but add fast/C++-only classIDNoAlloc; define and use nsIClassInfo::EAGER_CLASSINFO in caps (93792, sr=waterson&jst). 2001-08-07 03:59:29 +00:00
brendan%mozilla.org
9a460b4ccf Don't modify state until after realloc succeeds (92810, sr=jband&waterson). 2001-08-07 02:48:10 +00:00
pschwartau%netscape.com
489562eb32 Minor improvement in readability - 2001-08-06 23:53:54 +00:00
nboyd%atg.com
e89d7ebdc2 Try recommitting changes to see if they make it to the web site. 2001-08-03 13:57:05 +00:00
nboyd%atg.com
b42e37107b Try to tweak getting the change propagated to the web site. 2001-08-03 13:55:31 +00:00
rginda%netscape.com
78dca2e056 remove js_EmitTree call (And friends) because this stuff has already been taken care of by the Statements() call.
See bug 82188
patch=brendan, r=me, sr=jband
2001-08-03 05:20:59 +00:00
rginda%netscape.com
5f82a6723b - not built -
add javadoc comments, remove jsdIScript::isActive, add jasIService::GC()
2001-08-03 05:15:27 +00:00
rginda%netscape.com
4bec38f2e7 - not built -
remove isActive attribute from jsdScript (it's the same thing as isValid)
fix bug in jsdValue::GetDoubleValue()
add jsdService::GC()
2001-08-03 05:14:21 +00:00
brendan%mozilla.org
5627dc3547 Mike Epstein's patch to make MAX_INTERP_LEVEL predefinable (93176, r=rogerl, sr=brendan) 2001-08-02 21:31:00 +00:00
dbaron%fas.harvard.edu
6f534f6129 Fix leaks of JS runtime service. b=93089 r=shaver, dbradley sr=waterson 2001-08-02 01:58:33 +00:00
nboyd%atg.com
9e1e01f617 New version number. 2001-08-01 20:46:46 +00:00
pschwartau%netscape.com
f801e2ecf9 Improving comments. 2001-08-01 17:43:12 +00:00
pschwartau%netscape.com
473c2ac5c6 Adding attribution to jim@jibbering.com 2001-08-01 00:54:44 +00:00
pschwartau%netscape.com
19f7f431ea Minor change to comment. 2001-07-31 20:14:30 +00:00
pschwartau%netscape.com
aa725b6658 Adding a new case to the test, from jim@jibbering.com (see bug 92942). 2001-07-31 20:05:26 +00:00
pschwartau%netscape.com
275f729477 Correcting an error in the testcase - 2001-07-31 19:47:19 +00:00
brendan%mozilla.org
dbd7fed5b1 FASTLOAD_20010703_BRANCH landing, r=dbaron, sr=shaver. 2001-07-31 19:05:34 +00:00
nboyd%atg.com
3df003a114 Update for 1.5R2 release. 2001-07-30 19:30:07 +00:00
nboyd%atg.com
a44bfbaa7b Update with new bugs unfixed in either engine. 2001-07-30 14:11:18 +00:00
timeless%mac.com
e962707671 Bugzilla Bug 92134 Sun Workshop 6 Update 2 _FCS_ fails to build due "jscpucfg" error
by : Roland.Mainz@informatik.med.uni-giessen.de r=cls a=dbaron
2001-07-30 06:44:43 +00:00
pschwartau%netscape.com
2c4e65702e Updated email addresses in the document. 2001-07-27 21:24:49 +00:00
nboyd%atg.com
a0b6deb251 Updates for 1.5R2. 2001-07-27 14:12:03 +00:00
nboyd%atg.com
41a836bef0 Update to test changes. 2001-07-26 19:00:39 +00:00
jaggernaut%netscape.com
e91f8a147e Bug 86734: Remove NS_WITH_SERVICE. r=dbaron, rs=scc, a=asa 2001-07-25 07:54:28 +00:00
brendan%mozilla.org
52f4ef75ac Fix 3-way deadlock by never nesting rt->gcLock inside rt->setSlotLock (90994, sr=shaver&jband). 2001-07-25 02:43:40 +00:00
radha%netscape.com
5489eac1e8 Partial fix to bug # 40867. Exposes interfaces implemented by nsGlobalwindow to JS. r=rpotts sr=jst, vidur 2001-07-24 22:39:11 +00:00
jaggernaut%netscape.com
cb0faab070 Bug 73353: clean up the REQUIRES lines in Makefiles. 2001-07-23 22:36:12 +00:00
waldemar%netscape.com
f43f993809 Moved to mozilla/js2/semantics 2001-07-21 02:11:56 +00:00
cls%seawood.org
c95f2a4a26 Update REQUIRES for jsd 2001-07-20 05:33:34 +00:00
pschwartau%netscape.com
0733c8cb62 Changing test since bug 90551 has been marked WONTFIX. 2001-07-19 23:46:23 +00:00
brendan%mozilla.org
f90032b6ba Drop scope property after holding, even if SPROP_GET/SET failed (90597, r=hyatt, sr=waterson). 2001-07-19 23:08:10 +00:00
pschwartau%netscape.com
8a89543e3d Added another section to the test. Improved comments. 2001-07-18 22:34:37 +00:00
rogerl%netscape.com
6303b01730 Added fdlibm_ns to build, stopped warnings from formmatter.h 2001-07-18 22:34:09 +00:00
pschwartau%netscape.com
40cf988765 Adding a comment. 2001-07-18 21:49:16 +00:00
pschwartau%netscape.com
2d58cb38ba Whitespace cleanup. 2001-07-18 21:42:24 +00:00
pschwartau%netscape.com
830f617bd4 Initial add. Regression test for bug 72964. 2001-07-18 20:30:21 +00:00
pschwartau%netscape.com
22b52e59d0 Initial add. 2001-07-17 21:48:28 +00:00
jst%netscape.com
f70ebcaecd Fixing bug #87389 This refreshes prototypes when classes are initialized on the context (Page transition) to prevent changes to prototypes from persisting across document loads. r=dbradley@netscape.com, sr=jst@netscape.com, patch by jband and dbradley (dbradley checking in from jst's account) 2001-07-17 06:20:37 +00:00
av%netscape.com
3ee52d160b Backing out existing fix for 87193 -- r=mstolz, sr=shaver, attinasi 2001-07-17 02:24:16 +00:00
pschwartau%netscape.com
8105cee9ce Initial add. 2001-07-16 23:40:35 +00:00
bryner%uiuc.edu
6ea11b87bc Fixing BeOS bustage - use uint32 instead of u_int32_t. 2001-07-16 06:04:25 +00:00
bryner%uiuc.edu
006ec96e1e Bug 83388 -- dialogs (and probably other things) broken when using -O2 on gcc 2.96 due to js code that was unsafe for alias optimization. r=drepper@cygnus.com, sr=brendan. 2001-07-16 05:02:10 +00:00
dbaron%fas.harvard.edu
aa4fec2b67 Header include dependency cleanup. b=64023 r=jag rs=brendan 2001-07-16 02:40:48 +00:00
pschwartau%netscape.com
e3f7836a54 Initial add. 2001-07-15 23:01:19 +00:00
nboyd%atg.com
bf90b94ec7 Subject:
Re: Rhino 1.5R2 release candidate
        Date:
             Fri, 13 Jul 2001 22:52:43 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             Norris Boyd <nboyd@atg.com>
  References:
             1




Hi Norris,

Attached are some (final?) changes to the debugger:

- Display NativeCall objects as "[object Call]" in this/locals tree-tables
- Fixed "Go to Function" to highlight the target function in the source
window
- Synchronized ContextListener implementation
- Added slightly more useful tooltips to the tool bar

Note I modified files from today's rhinoTip.zip.  Hopefully they were
identical to those in the cvs release branch.

Chris
2001-07-14 17:17:35 +00:00
brendan%mozilla.org
a41197782b Fix a bug reported incompletely by 89474: UMR in its_item for it.item() calls (NOT PART OF BUILD). 2001-07-13 17:58:50 +00:00
nboyd%atg.com
bd4398308e Subject:
Rhino: deal with all Throwables in Interpreter.interpret
        Date:
             Thu, 12 Jul 2001 14:27:34 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The attached patch modifies the catch code in Interpreter.interpret to
catch general Throwable exceptions to allow cleanup after throwing an
Error instance from Context.observeInstructionCount.
===================
Subject:
             Rhino: change of InterpreterData.itsLineNumberTable from Hahstable to
             UintHash
        Date:
             Thu, 12 Jul 2001 15:51:38 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The patch linetable_patch changes InterpreterData.itsLineNumberTable
from Hahstable to UintHash and debug/DebuggableScript.java to return
int[] array instead of Enumeration. It was run produced via
diff -ru javascript.0 javascript

The patch debugger_patch contains update for
toolsrc/org/mozilla/javascript/tools/debugger/Main.java to reflect above
api changes.
===============================
Subject:
             Rhino: patch not to store VariableTable in InterpreterData
        Date:
             Thu, 12 Jul 2001 16:34:18 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The patch removes the "VariableTable itsVariableTable" field from
InterpreterData so it would not be stored in
InterpretedFunction/InterpretedScript and could be garbage collected
after interpreter byte code generation is finished. The usage of
theData.itsVariableTable it Interpreter.interpret is replaced by
accessing argNames/argCount fields from the passed NativeFunction.
2001-07-13 13:53:40 +00:00
brendan%mozilla.org
2822c6166e Always select JSOP_EVAL for unqualified eval calls (77578, r=rogerl, sr=shaver). 2001-07-13 06:13:56 +00:00
pschwartau%netscape.com
dbf7887f5e Initial add. Regression test for bug 77578. 2001-07-13 01:29:24 +00:00
pschwartau%netscape.com
85685006f5 Initial add. Regression test for bug 90445. 2001-07-12 21:55:17 +00:00
pschwartau%netscape.com
0da74e32ad Initial add. Regression test for bug 89443. 2001-07-12 21:54:27 +00:00
nboyd%atg.com
08f4af156e Fix bug:
Subject:
             Fatal error executing in IBM J9 VM
 Resent-Date:
             Mon, 9 Jul 2001 15:35:32 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             9 Jul 2001 15:33:38 -0700
        From:
             bdemchak@tpsoft.com (Barry Demchak)
 Organization:
             http://groups.google.com/
          To:
             mozilla-jseng@mozilla.org
  Newsgroups:
             netscape.public.mozilla.jseng




Hi --

I've encountered an error in either Rhino or the IBM J9 VM's runtime
support -- I'm not sure which -- but the end result is an unhandled
exception. I'm quite willing to believe that it's already been dealt
with. If so, will someone point me to the solution?

I'm using: IBM's J9 on Windows 2000,
           IBM's IDE v1.3 on Windows 2000,
           Rhino v1.5 from mozilla.org

The exception is java.lang.StringIndexOutOfBoundsException.

It occurs in Context.getSourcePositionFromStack just after the call to
RuntimeException.printStackTrace. The code is expecting a code
reference that looks something like "(Example.js:50)" where "50" is
the line number. (I gather that's what the Sun VM returns???)

Instead, J9 is returning a code reference that looks like:
"java.lang.RuntimeException\n\n\n\nStack trace:\n\n
java/lang/Throwable.<int>()V\n\n" etc, etc, etc.

The error occurs because the Colon variable's value is less than the
Open variable's value in Context.getSourcePositionFromStack. When the
s.substring is evaulated, there's a negative string length ... boom.

I've patched an "if" statement in the getSourcePositionFromStack code
so that instead of:

if (c == '\n' && open != -1 && close != -1 && colon != -1)

I have:

if (c == '\n' && open != -1 && close != -1 && colon != -1 && open <
colon && colon < close)

Certainly, there's a better fix, but it's sufficient to keep me going.

So, I have several questions ... being new to open source and this
forum:

1) Is this a real bug ... a real Rhino bug??
2) Has this already been found?
3) Has this already been fixed?
4) If not, what's the proper protocol for reporting it?
5) What's the proper protocol for fixing it?

This shows up *very* quickly when trying to run a script under J9.
When it occurs, Rhino is trying to issue a warning about some shady
JavaScript code.

If this is a real bug and hasn't been fixed, I would infer that there
aren't a lot of people trying to run this under J9. Would that be a
fair statement? If so, can anyone comment as to why that would be??

Thanks!
2001-07-12 00:07:27 +00:00
nboyd%atg.com
0ee98640dd Subject:
Rhino: Fixes for catch in Interpreter.interpret
        Date:
             Wed, 11 Jul 2001 19:06:46 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

When doing that instruction counting implementation, I managed to mess
up code in the catch statement in Interpreter.interpret.

First for some reason I assumed that for a general RuntimeException the
previous code do not run finally statements but only script catch code.
Of cause this was wrong: that code skipped catch for arbitrary exception
while calling finally.

This is a reasonable behavior especially given the fact that arbitrary
RuntimeException may only arise from, say, bugs, other exceptions should
be wrapped to JavaScriptException.

Second I removed calls to debug.handleExceptionThrown...

The attached patch restores the original catch/finally logic and re-adds
calls to debug.handleExceptionThrown.

I will later update it that catch to handle Error as well to allow
cleanup after throwing an Error instance from
Context.observeInstructionCount , but restoration should go first.

Regards, Igor
2001-07-12 00:06:27 +00:00
pschwartau%netscape.com
b401fcb3a4 Initial add. Regression test for bug 49286. 2001-07-11 04:58:04 +00:00
mstoltz%netscape.com
755eb0ae93 Checking in bug 87913 for jesse@netscape.com - Allow untrusted scripts
to call Components.manager.autoRefresh, but only with default params.
r=mstoltz, sr=jst.
2001-07-11 04:48:55 +00:00
nboyd%atg.com
f7a0fa338c Fix bug 49286 "try/catch within JavaScript not working as expected"
Also, accept patches from Igor:

Subject:
             Rhino: UintMap optimization
        Date:
             Fri, 06 Jul 2001 13:14:49 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

Currently omj.Node uses Hashtable to map int property types to
objects/integer. In my opinion this is very inefficient: to store single
int property it creates 5 objects: one for property Hahstable, 2 Integer
wrappers for property/value, array to sore Hahstable slots and Hashtable
slot itself. To fix this I added omj.UintMap class that can map
non-negative integers to objects or integers and modified omj.Node to
use it. The class is a hashtable implementation that uses one int[] and
one Object[] arrays to store keys/values and Object[] array is not
created if the map contains only integers.

To take full advantage of omj.UintMap code has to be modified to use
Node.getIntProp/Node.putIntProp to store int properties, but even in
this form it is a win.

I can provide patches to use Node.getIntProp/Node.putIntProp and UintMap
for InterpreterData.itsLineNumberTable if this is OK.

Regards, Igor
2001-07-10 17:30:16 +00:00
pschwartau%netscape.com
bce61b5cdb Correcting a misattribution, and improving readability. 2001-07-09 01:09:27 +00:00
pschwartau%netscape.com
844089d849 Initial add. Regression test for bug 89474. 2001-07-08 21:07:23 +00:00
rginda%netscape.com
8208d4a257 remove bogus SAVE_SP before calling debugger hook
sr=brendan,r=shaver,bug=76983
2001-07-06 22:14:24 +00:00
rginda%netscape.com
817140e9a0 save context's exception state before calling a method on a wrapped js.
r=dbradley,sr=shaver,bug=88130
2001-07-06 03:28:07 +00:00
cls%seawood.org
cfce8f4dcc Updating .cvsignore files.
Bug #84824 r=jag
2001-07-06 02:36:37 +00:00
pschwartau%netscape.com
1a7bc2cd74 Improving readability. 2001-07-05 21:00:37 +00:00
rginda%netscape.com
67588ab2bd - not built -
remove spaces from non debug definitions of DEBUG_*, bug 89240
2001-07-05 09:06:24 +00:00
nboyd%atg.com
5e9bc346cb Date:
Mon, 02 Jul 2001 12:58:44 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

It turned out that in our browser implementation we need to be able to
abort too-long-running scripts. I implemented that for interpreter mode
via instruction counter callback. This callback is called at branch
points after instruction counter reach certain threshold as you
suggested once in mozilla-jseng mail list. The attached patch adds to
Context.java:
        public int getInstructionObserverThreshold() {
                return instructionThreshold;
        }

        public void setInstructionObserverThreshold(int threshold) {
                instructionThreshold = threshold;
        }

        protected void observeInstructionCount(int instructionCount) {}
...
        int instructionCount;
        int instructionThreshold;


where observeInstructionCount is a callback that should be overwritten
in a custom Context to observe execution.

Then as long as instructionThreshold is not 0 modifications to
Interpreter.java increase instructionCount at branches/function
calls/catch blocks and call cx.observeInstructionCount when it reaches
instructionThreshold. I also replaces 3 catch statements in
Interpreter.interpret for EcmaError, JavaScriptException and
RuntimeException by single one to reduce code duplication.

The patch lacks documentation in Context.java but I would add that later
if the patch is ok.

Regards, Igor

==========================


Subject:
        Re: Working for Rhino
   Date:
        Tue, 3 Jul 2001 10:41:42 +0200
   From:
        felix.meschberger@day.com
     To:
        Norris Boyd <nboyd@atg.com>




Hi Norris,

Well, I couldn't wait ;-) Here are my diffs :

   LazilyLoadedCtor: Make class and constructor public for use on my host
   objects
   NodeTransformer : Replace checks for "arguments" by call to
   checkActivationNeeded() in Context
   Context: Add the name list proposed as a hashtable with
   adder/checker/remover methods

Hope this helps. Regards
Felix
2001-07-05 02:08:14 +00:00
jst%netscape.com
030da7b1b9 Fixing bug 86147. Adding code that does security checks on access to getter and setter functions for properties of DOM objects in JS. Also fixing a JS engine bug that caused problems with the real fix for this bug, the JS engine bug was that a jsid was passed as a jsval to the checkAccess() class hook. r=mstolts@netscape.com, sr=brendan@mozilla.org 2001-07-04 09:44:57 +00:00
pschwartau%netscape.com
586ff89371 Initial add. 2001-07-04 00:17:36 +00:00
rginda%netscape.com
5ab2adfee9 - not built -
add jsdIEphemeral interface, inherit from it in interfaces that need to.
2001-07-03 22:22:58 +00:00
rginda%netscape.com
a29db3ffa9 - not built -
move debug object counters and various constructors to jsd_xpc.cpp
add LiveEphemeral struct to reperesent a link in a PRCList of ephemeral objects.
declare jsdIEphemeral interface in objects that need it, add invalidaAll static method to jsdIProperty and jsdIValue.  jsdIObject still needs work.
2001-07-03 22:21:56 +00:00
rginda%netscape.com
b96fa36548 - not built -
Large changes to improve the way we deal with our wrappers around js engine structures.  jsdIScript, jsdIStackFrame, jsdIValue, and jsdIProperty interfaces now inherit from a new interface "jsdIEphemeral".  This interface is used to invalidate the wrapper.  Once the wrapper is invalidated, *most* methods throw NS_ERROR_NOT_AVAILABLE, some interfaces, such as jsdIScript, cache important information so that the wrapper isn't utterly useless once it has been invalidated.  The boolean isValid attribute can be used to see if the wrapper is still valid.

factor debug object counters into some simple macros
add new velid assertion macros for the new ephemeral objects
add utility functions for dealing with PR_CLISTs full of ephemeral objects.
invalidate the jsdIFrame after the execution hook completes
move some c/dtors from jsd_xpc.h over here to avoid exposing debug object counters, and repeating some macros
fix incorrectly set out parameter in getValue::GetDoubleValue
2001-07-03 22:19:04 +00:00
nboyd%atg.com
61f8164eba Fix following bug:
Subject:
             Re: Rhino: [[DefaultValue]] missing for Call object
 Resent-Date:
             Mon, 2 Jul 2001 08:52:07 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Mon, 02 Jul 2001 11:49:59 -0400
        From:
             Norris Boyd <nboyd@atg.com>
 Organization:
             Art Technology Group
          To:
             Christopher Oliver <coliver@mminternet.com>
         CC:
             mozilla-jseng@mozilla.org
  References:
             1




I believe the correct result of the script should be

[object global]
[object Object]
[object global]

The activation object (which goes by the name of "Call" for historical
reasons) should never be the 'this' value in a function call. See "10.1.6
Activation Object" in the ECMA spec.

I'll look at fixing the problem for Rhino. If there's agreement on my
analysis, someone should fix this for Spidermonkey too.

--N

Christopher Oliver wrote:

> Hi,
>
> function a() {
>     function b() {
>          print(this);
>     }
>     this.f = function() {
>          print(this);
>          b();
>     }
>     b();
> }
>
> var a = new a();
> a.f();
>
> Running the above script with SpiderMonkey produces:
>
> [object global]
> [object Object]
> [object Call]
>
> Running with Rhino produces the following exception:
>
> uncaught JavaScript exception: undefined: Cannot find default value for
> object. (line 3)
>
> This is due to a bug in org.mozilla.javascript.NativeCall which doesn't
> implement toString or valueOf or override getDefaultValue.
> However, even after I hacked in an implementation of getDefaultValue in
> NativeCall, Rhino still produces a different result then spidermonkey:
>
> [object Call]
> [object Object]
> [object Call]
2001-07-03 02:19:51 +00:00
pschwartau%netscape.com
65130fd171 Improving readability. 2001-07-03 01:13:23 +00:00
pschwartau%netscape.com
a9e33f26e5 Fixing bug that prevented -p option from working on the Mac. 2001-07-03 00:40:46 +00:00
pschwartau%netscape.com
a889741b9e Initial add. 2001-07-02 20:43:49 +00:00
nboyd%atg.com
079d7bea96 Subject:
Re: Bug in RhinoTip
 Resent-Date:
             Sat, 30 Jun 2001 11:45:38 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Sat, 30 Jun 2001 20:54:21 +0200
        From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
          To:
             nboyd@atg.com
         CC:
             Christopher Oliver <coliver@mminternet.com>, mozilla-jseng@mozilla.org
  References:
             1




Christopher Oliver wrote:

> Hi,
>
> I noticed the following in today's rhinoTip:
>
> js> throw 100
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw 200
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw i = 100
> js: uncaught JavaScript exception: 100



The attached patch to omj/Interpreter.java fixes that: I forgot to check
for stack[stackTop] == DBL_MARK during throw when implemented
interpreter optimization to minimize number of created Double instances.

I think that example should go to the test suite in a form like:
try { throw 100; } catch (ex) { return ex == 100; }

Regards, Igor
2001-07-02 14:00:00 +00:00
nboyd%atg.com
9a8d2c2e41 In case of exceptions creating optimizer, just use interpreter. 2001-07-02 13:59:09 +00:00
nboyd%atg.com
99d9b052fd More liberal rules for default value conversions for java objects. 2001-07-02 13:58:17 +00:00
nboyd%atg.com
b7d911651e Subject:
Bugfix to Rhino Debugger
        Date:
             Sat, 30 Jun 2001 06:09:44 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

Attached is a fix to a problem I encountered with the Rhino debugger.
Apparently some recent changes to the engine broke the debugger because
the debugger wasn't  acquiring a Context before making certain engine
calls like ScriptableObject.getIds().  You can see this by stepping
through the "enum.js" example and expanding the variable "elements".
The below exception trace will be printed on the debugger console.  The
attached file should fix this problem.

Chris

Subject:
             Another fix to VariableModel.java
        Date:
             Sat, 30 Jun 2001 07:33:51 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

I modified this file to always call Context.toString() to display a
variable's value in the the tree table.  Previously it only called it
for Scriptables and the toString() method of the object otherwise.  This
caused for example JavaScript "2" to be displayed as "2.0".

Chris
2001-07-02 13:55:20 +00:00
nboyd%atg.com
ddaaaa90cc Updates from Christopher Oliver. 2001-07-02 13:50:23 +00:00
cls%seawood.org
b0724d0103 Link mozjs before nspr for static irix build.
Thanks to John Mark Vandenberg <johnv@adacel.com.au> for the patch.
Bug #88288 r=cls
2001-07-01 15:02:27 +00:00
cls%seawood.org
66d937045b Landing static build changes for OS2
Thanks to Javier Pedemonte <pedemont@us.ibm.com> for the patch.
Bug #85283 r=mkaply r=waterson
2001-07-01 12:11:13 +00:00
jaggernaut%netscape.com
5a6317b8a5 Bug 88413: Remove |GetUnicode()| from nsString (and replace it with |get()|). r=dbaron, rs=scc.
This removes all call-sites I can currently fix. Tomorrow I'll try to get someone to checkin my changes to security/ and I'll get some help with the Netscape side of things.

nsString::GetUnicode()'s final death-blow will be dealt soon. Please keep this in mind as you add new code :-)
2001-06-30 11:02:25 +00:00
pavel%gingerall.cz
9df1ab2d5c JS.pm works correctly 2001-06-29 10:59:32 +00:00
rginda%netscape.com
0e1ad7ad4e use file:// url as the filename, instead of the native path, when compiling js components.
for bug 85968.  r=dbradley, sr=shaver
2001-06-29 02:20:48 +00:00
nboyd%atg.com
a3ebe88fb9 Subject:
Rhino: speed optimization in omj/Interpreter.java
        Date:
             Tue, 26 Jun 2001 21:06:56 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

The attached Interpreter_patch contains a speed optimization patch that
tries to avoid creation of Double objects by keeping a parallel stack
for double values: instead of putting Double to the stack, DBL_MRK is
put and the real value is put to double stack (sDbl). Then when reading
stack with DBL_MRK, the double value from the double stack is used
wrapped to Double object when necessary. In addition local and vars
arrays are merged to stack array.

The attached before.txt and after.txt contain results of typical runs of
mozilla/js/benchmarks/all_bench.js before and after optimization on my
PC: Athlon 650/Red Hat 7.0/JDK 1.3.0 from Sun .

In number of cases the optimization actually slow down the executionby
5-10% (I guess due to the checks for DBL_MRK), but mostly it is a nice
sped up often by factor of 2 ot more with overall optimization win: 267
versus 218 seconds.

I guess it is possible to apply the same optimization to the optimizer
package, but in our browser we use strictly interpreter mode. Also by
changing signature of call/construct methods in Scriptable it is
possible to avoid creation of almost all objects currently allocated
during method calls, but that is for far future.

Regards, Igor
2001-06-28 14:28:19 +00:00
rginda%netscape.com
6a25bb3258 - not built -
Add isValid to jsdIScript
Add jsdIService::isOn
2001-06-28 07:47:22 +00:00
rginda%netscape.com
19f9333338 - not built -
declare and initialize new provate members in jsdScript, copy important script properties at jsdScript creation time, so they're around after Invalidate().
2001-06-28 07:47:04 +00:00
rginda%netscape.com
f40fe785c4 - not built -
large changes to fix the following bugs:
82684, crash manually clearing breakpoint
*actually* clearing mValid in jsdScript::Invalidate fixed this one.

85636, assertions on quiting venkman
jsdService::Off now disconnects the hooks into JSD, to avoid calling back into js after that.  It also processes any pending script delete events that occurred during the last GC. The code to process the gPendingScripts list has been factored out of the gc callback.  Processing the dead script list allows us to properly finalize all of the jsdIScript object, which seems to clear up the "gc roots exist at shutdown" assertions.  In effect, these changes get rid of *all* of the jsd related assertions on exit.

Added isOn attribute to jsdIService.
Added isValid attribute to jsdIScript.  We now prefetch appropriate properties from the underlying JSDScript, so that it's available after the script is Invalidate()d

moved jsdService constructor to jsd_xpc.h

Save the runtime passed to OnForRuntime so we can use it to clear the GC Gallback in Off().
2001-06-28 07:46:36 +00:00
pschwartau%netscape.com
9c7a5c99bf Fixing bug that prevented -p option from working (user-specified path to test directory) 2001-06-25 21:04:02 +00:00
pschwartau%netscape.com
b157dbb66e Added more cases to test. Also improved readability. 2001-06-23 19:22:07 +00:00
pschwartau%netscape.com
a0bd092d95 Show "$0" for the global match. Also minor changes to improve readability. 2001-06-23 19:21:05 +00:00
pschwartau%netscape.com
872b7a18e4 Minor formatting change - 2001-06-23 00:48:31 +00:00
pschwartau%netscape.com
a75120a825 Initial add. Regression test for bug 87231. 2001-06-23 00:42:39 +00:00
pschwartau%netscape.com
5298a496bc Replacing a return with a continue. Further readability improvements. 2001-06-23 00:41:58 +00:00
pschwartau%netscape.com
d44f753a83 Added array-length check. Also improved readability; cleaned up whitespace. 2001-06-22 20:12:01 +00:00
waterson%netscape.com
b74d6e1c8b Land STATIC_BUILD_20010612_BRANCH, which supports building mozilla with components statically linked into the executable, as well as 'meta modules' that combine components into uber-DLLs. 2001-06-20 20:21:49 +00:00
rginda%netscape.com
12ea62d4af bug 85355, XPCWrappedNative::ToString should sometimes yield '[object Foo]'. patch=dbradley, r=beard+me, sr=jst, a=dbaron.
Make .toString print [object <class>] instead of [object wrapped <classname>] for xpc wrapped objects with scriptable info.
2001-06-20 00:04:36 +00:00
rginda%netscape.com
6dda9ad7d9 bug 83864 "Access to Components.interfaces denied sometimes", patch=jband, r=dbradley+mstoltz, sr=jst, a=blizzard
Allow xpc wrappers to be created by default, relying on security checks to happen at call-time instead.
2001-06-19 23:39:30 +00:00
rginda%netscape.com
5a37561605 bug 85572, "Javascript Error for each message sent"; patch=jband, r=me, sr=vidur, a=asa
xpconnect had been printing it's large "js component threw exception" whenever chatzilla's socket code threw NS_BASE_STREAM_WOULD_BLOCK from it's streamprovider (a non-error nsresult, bah.)  This patch adds the exception to the "suppression list", to quiet the debug message.
2001-06-19 22:53:36 +00:00