4193 Commits

Author SHA1 Message Date
nboyd%atg.com
d1eb87d2d8 Changes from Christopher Oliver:
Hi Norris,

Would you mind checking in the attached changes to the debugger. The
attached files include the following changes:

1) Use ScriptableObject.getAllIds to obtain an object's properties (if
the object extends ScriptableObject).  This makes non-enumerable
properties visible in the debugger for ScriptableObject's.
2) Made the coding style more consistent with the rest of Rhino.
3) Better support for displaying and stepping through eval-ed code.

As Igor suggested to me once, it might be a good idea to define a new
interface to similarly support debugging host objects that don't extend
ScriptableObject, something like the following:

public interface Debuggable extends Scriptable {
    public Object[] getAllIds();
}

The debugger could check for this interface and if a host object chose
to implement it, the debugger would be able to display its
non-enumerable properties.

Chris


git-svn-id: svn://10.0.0.236/trunk@117520 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-26 23:02:43 +00:00
cathleen%netscape.com
8aa28031b6 fix linux static build installer. bug 128507, bug 130995, bug 130998 r=seawood sr=dveditz a=asa (verbal)
git-svn-id: svn://10.0.0.236/trunk@117440 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-26 00:53:30 +00:00
pschwartau%netscape.com
aa4761f98a Removing an extraneous line.
git-svn-id: svn://10.0.0.236/trunk@117431 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-25 23:51:06 +00:00
pschwartau%netscape.com
1409934116 Initial add. Regression test for bug 130451.
git-svn-id: svn://10.0.0.236/trunk@117427 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-25 23:41:56 +00:00
pschwartau%netscape.com
f483783b5d Adding a tail recursion test by Georgi Guninski
git-svn-id: svn://10.0.0.236/trunk@117394 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-25 00:25:45 +00:00
nboyd%atg.com
c34115e075 Add missing support for multiple -implements classes
git-svn-id: svn://10.0.0.236/trunk@117390 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-24 22:37:57 +00:00
dbaron%fas.harvard.edu
772b5b8c58 Convert users of nsAReadable[C]String and nsAWritable[C]String typedefs to [const] nsA[C]String. b=131899 r=scc sr=jag a=asa
git-svn-id: svn://10.0.0.236/trunk@117354 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-24 00:16:18 +00:00
igor%mir2.org
5d07116378 In Interpreter.interpret THROW/JTHROW switch cases do not use result variable to hold temporary values to throw, use locally declared "Object exception" for that as result should only be used for value of Interpreter.interpret
git-svn-id: svn://10.0.0.236/trunk@117335 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-23 20:51:05 +00:00
brendan%mozilla.org
e6d087a0c4 Fix JSOP_DEFFUN to define functions in global code permanently, and not permanently in eval code (131964, r=khanson, sr=shaver, a=scc).
git-svn-id: svn://10.0.0.236/trunk@117325 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-23 17:34:24 +00:00
brendan%mozilla.org
f5b3ad417e Cope with OOM creating rt->atomState.table (131246, r=scole@planetweb.com, sr=jband, a=scc, thanks to scole for finding these OOM recovery bugs).
git-svn-id: svn://10.0.0.236/trunk@117298 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-23 07:38:08 +00:00
pschwartau%netscape.com
7f0c1e36c3 Fixing a typo.
git-svn-id: svn://10.0.0.236/trunk@117277 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-23 01:50:16 +00:00
khanson%netscape.com
3aa931270e patch #75132 changes for bug#132230 (str_unescape and js_str_escape in jsstr.c ignore OOM errors) Written by Steven Cole, sr=bendan, r=khanson, a=asa. Handles an out of memory conditions more gracefully.
git-svn-id: svn://10.0.0.236/trunk@117219 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-22 21:24:46 +00:00
pschwartau%netscape.com
c9655cd559 Updating JS_GetImplementationVersion() to date of latest JS release (67111).
git-svn-id: svn://10.0.0.236/trunk@117211 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-22 20:43:47 +00:00
jband%netscape.com
4f83b37d05 fix bug 132713. Use the iid for nsIException to detect exceptions rather than nsIXPCException. This allows for better error reporting of natively implemented exceptions. r=dbradley sr=jst a=scc.
git-svn-id: svn://10.0.0.236/trunk@117198 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-22 19:14:57 +00:00
igor%mir2.org
3f11019c8c Merge tryStack with sDbl, changing layout of stack arrays in Interpreter.interpret to variables|temporaries|try stack|stack and add itsMaxVars and itsMaxFrameArray to InterpreterData to simplify stack arrays setup and make possible implementation of stack reuse simple.
git-svn-id: svn://10.0.0.236/trunk@117196 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-22 18:51:33 +00:00
dougt%netscape.com
a288cd7893 130405. Makes the xpcom glue library usable. Updates XPCOM Samples. Adds requires lines to a few implict string/category consumers sr=alecf, sr=brendan@mozilla.org a=asa@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@117113 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-21 23:43:21 +00:00
jband%netscape.com
57faa09874 fix bug 125084. Add support for empty arrays in nsIVariant. This is expressed as atype id rather than as a regular array with no elements. Includes changes to xpconnect to support mapping to empty JSArrays, xpconnect tests, and SOAP. Patches are from jcorwin@us.ibm.com and rayw@netscape.com. r=jband sr=brendan a=asa
git-svn-id: svn://10.0.0.236/trunk@117098 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-21 23:21:54 +00:00
nboyd%atg.com
728dca6615 Fix eval code cases on 132217
git-svn-id: svn://10.0.0.236/trunk@117071 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-21 17:26:55 +00:00
brendan%mozilla.org
04bffdc779 Fix js_FinalizeStringRT so it doesn't depend on a dependent string's base, which may already be finalized (132088, r=scole, sr=shaver, a=asa).
git-svn-id: svn://10.0.0.236/trunk@117042 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-21 09:06:00 +00:00
nboyd%atg.com
ea60769a96 Fix bug 132217.
git-svn-id: svn://10.0.0.236/trunk@117022 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-21 01:44:54 +00:00
igor%mir2.org
15cacee8fd From my email:
I think recent Christopher suggestions about tail call elimination is worth
to consider, as it would allow to cut invocation cost of script functions
quite nicely in many cases. Plus I am thinking of not creating Object[] array
to pass arguments to callee if it is another interpreted function as it can
directly access the caller stack. But first I decided to make some
preparation work to simplify an implementation of these features later. The
attached patch includes:

1. Moving all code to setup scope from
InterpretedFunction.call/InterpretedFunction.call to Interpreter.interpret so
the call method simply calls Interpreter.interpret. It would make tail call
elimination code much simple. I also hope this simplifies changes Christopher
needs for the continuations support (but I have strong reservation about
possibility to implement it corectly).

2. Moving all declaration of temporary variables used only during processing
of the single ICODE to the case blocks.

3. Interpreter loop termination only in RETURN icodes, not when pc exceeds
icode size, so there is no need to check for this condition on each icode.
(Scripts are handled via the special END_ICODE token).


git-svn-id: svn://10.0.0.236/trunk@116986 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 20:00:32 +00:00
pschwartau%netscape.com
c58ce60f59 Fixing a blunder in Section 4, and changing from brackets to braces for ECMA attribute.
git-svn-id: svn://10.0.0.236/trunk@116982 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 19:24:08 +00:00
pschwartau%netscape.com
112ed24fd3 Deleted an extraneous line; improved readablity.
git-svn-id: svn://10.0.0.236/trunk@116981 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 19:13:36 +00:00
khanson%netscape.com
79891be530 Patch 74900 for bug #131817 (OOM in AllocSrcNote causes crash in js_NewSrcNote). The patch was contributed by Steven Cole (scole@planetweb.com), sr=brendan, r=khanson, a=scc
git-svn-id: svn://10.0.0.236/trunk@116956 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 05:45:12 +00:00
brendan%mozilla.org
ff87dae2bd Defend against early OOM when finishing JSDHashTables (131815, r=scole, sr=jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116941 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 02:22:50 +00:00
pschwartau%netscape.com
e1c6553285 Initial add. Regression test for bug 131964.
git-svn-id: svn://10.0.0.236/trunk@116922 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-20 00:23:22 +00:00
brendan%mozilla.org
686853c41c Fix ChangeScopeTable gross dimensioning bug (131904, r=scole&khanson, sr=jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116915 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-19 23:25:17 +00:00
brendan%mozilla.org
2e938ed0a9 Fix 'var arguments;' in a function by specializing to JSOP_ARGUMENTS properly (131510, r=khanson, sr=jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116910 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-19 22:51:48 +00:00
timeless%mac.com
69ae314807 Bug 106386 rid source of misspellings
r=db48x sr=blake a=asa


git-svn-id: svn://10.0.0.236/trunk@116832 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-19 04:30:17 +00:00
igor%mir2.org
6c4d9c6001 IdScriptable.maxInstanceId/IdScriptable.activateIdMap is replaced by getMaxId/setMaxId to have more flexible and simple id map initialization.
git-svn-id: svn://10.0.0.236/trunk@116769 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-18 01:26:01 +00:00
igor%mir2.org
d18abf02e1 Code to setup/restore security domain is moved to single place in Interpreter.interpret to make checking for correctness easy.
git-svn-id: svn://10.0.0.236/trunk@116753 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-17 20:10:31 +00:00
igor%mir2.org
3bb105309c cosmetics: change layout of Interpreter.interpret main switch from
switch (...)
    case LABEL:
        code
to
switch (...)
case LABEL:
    code

to has less problems with fitting to 80-character lines


git-svn-id: svn://10.0.0.236/trunk@116752 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-17 18:40:11 +00:00
brendan%mozilla.org
c6ea6491a9 Forgot to check this in yesterday: fix all engine-defined getters and setters to have no slot [to be JSPROP_SHARED] (130970, r/sr=shaver&jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116746 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-17 11:01:34 +00:00
pschwartau%netscape.com
70cccd65f4 Initial add. Regression test for bug 131510.
git-svn-id: svn://10.0.0.236/trunk@116734 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-17 05:24:01 +00:00
igor%mir2.org
1a044d7dfe Activate support for getting token names if debugging interpreter icode, not only when debugging parsing trees. Not to depend in TokenStream on Interpreter, printICode debug flag is moved to Context, as with printTrees definition.
Fixing debug printing of icode which are not defined in TokenStream


git-svn-id: svn://10.0.0.236/trunk@116731 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-17 03:34:43 +00:00
igor%mir2.org
c04519684b Fixing serialization problem reported by Todd Trimmer (babyduck@usa.com):
...

>I did some tinkering and found there are pure java.lang.Object
>instantiations deep inside all the "standard objects" added to the
>ImporterTopLevel with Context.initStandardObject(). This is what is keeping
>it from serializing.

This is due to presence of Scriptable.NOT_FOUND and IdScriptable.NULL_VALUE tags in the data to serialize.

I replaced the type for the tags from Object to UniqueTag which is serializable ad knows how to make restored tags the same objects as Scriptable.NOT_FOUND and IdScriptable.NULL_VALUE.

Similarly Undefined was made serializable and to restore to Undefined.instance upon reading.


git-svn-id: svn://10.0.0.236/trunk@116729 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 23:31:04 +00:00
brendan%mozilla.org
917f8658bb Null test to handle recovery from OOM under js_NewContext reported by scole@planetweb.com (r/sr=jband, a=me).
git-svn-id: svn://10.0.0.236/trunk@116728 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 23:19:35 +00:00
nboyd%atg.com
614e29e599 Patch from Christopher Olivier:
While looking into optimizing the modifications I've
made, I noticed that one of the bottlenecks seemed to be calls to the Java
instanceof operator, particularly if the class argument to instanceof isn't
final. Based on this observation I tweaked ScriptRuntime.java to attempt to avoid
some of the many "instanceof Scriptable" calls in it (which I've attached). In
particular I optimized the comparison operators for the case where the arguments
are Number's. This seems to provide some significant performance improvement in
many cases particularly in compiled mode.  See below (note the tests were
performed with today's rhinoLatest.zip code patched with the attached
ScriptRuntime.java and didn't include any of my other modifications).


git-svn-id: svn://10.0.0.236/trunk@116725 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 19:33:46 +00:00
brendan%mozilla.org
b9d4528238 Restore non-bogus assertion removed in last rev, and fix the case that tripped it in js_ChangeScopeProperty, by not removing [and maybe freeing sprop->slot] before re-adding sprop; also fix all engine-defined getters and setters to have no slot [to be JSPROP_SHARED] (130970, r/sr=shaver&jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116696 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 04:51:29 +00:00
rginda%netscape.com
987eb43a38 bug 129519, "JS_GetPropertyDesc gives up too easily", r=jband, sr=shaver, a=bren
dan
Reflect new JSPD_* defines, make jsd_GetValueProperty degrade gracefully instead of fail outright when we run into a problem fetching the property value.


git-svn-id: svn://10.0.0.236/trunk@116676 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 01:58:36 +00:00
rginda%netscape.com
fe7a5ec2b5 bug 129519, "JS_GetPropertyDesc gives up too easily", r=jband, sr=shaver, a=bren
dan
Make JS_GetPropertyDesc degrade gracefully instead of fail outright when we run
into a problem fetching the property value.


git-svn-id: svn://10.0.0.236/trunk@116675 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-16 01:56:19 +00:00
igor%mir2.org
6a7c0622bb 1. Implementing Externalizable interface in ObjToIntMap and UintMap to allow for efficient storage of internal hash table data. For ObjToIntMap it allows to restore correctly cached values of object's hash codes and do not store internal DELETED mark.
2. ObjToIntMap.clear and UintMap.clear now do not discard internal buffers, but clears references to external objects to match behavior of Java Vector.clear and Hashtable.clear.


git-svn-id: svn://10.0.0.236/trunk@116633 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 07:13:33 +00:00
khanson%netscape.com
4ff6898f69 bug #130991 (Out-of-Memory in jsshell causes assertion failure in jsobj.c)
patch by Brendan, sr=jband, r=khanson, a=asa


git-svn-id: svn://10.0.0.236/trunk@116632 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 06:22:00 +00:00
pschwartau%netscape.com
750daa3f98 Added two new cases where the result is all zeros.
git-svn-id: svn://10.0.0.236/trunk@116625 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 05:15:57 +00:00
jband%netscape.com
0a33474113 fix bug 130139. We are iterating an array of pointers not an array of objects. r=dbradley sr=brendan a=asa.
git-svn-id: svn://10.0.0.236/trunk@116621 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 04:10:25 +00:00
khanson%netscape.com
2a691ad4e6 bug #130711, r=khanson, sr=brendan, a=asa, memory leak in JS_dtoa
git-svn-id: svn://10.0.0.236/trunk@116601 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-15 00:11:44 +00:00
brendan%mozilla.org
97643dca16 Remove bogus assertion, tripped by js_ChangeScopePropertyAttrs calling js_AddScopeProperty (130970, r=shaver, sr=jband, a=shaver).
git-svn-id: svn://10.0.0.236/trunk@116580 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 21:59:16 +00:00
brendan%mozilla.org
45a2cddc1c Fix JS/PL_DHashTableEnumerate to compress or shrink the table after enumeration using the same logic as ADD and REMOVE use (120953, r=dbaron, sr=shaver, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116579 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 21:55:08 +00:00
timeless%mac.com
95ef008f42 Bug 61314 Makefile rules for "jsmath.o" and "jsmathtemp.o" cause stale object files, obscure bugs
patch by mang@subcarrier.org r=rogerl sr=brendan a=asa


git-svn-id: svn://10.0.0.236/trunk@116577 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 21:41:09 +00:00
igor%mir2.org
d1f9023a1d ObjToIntMap was added to map Objects to int in a memory wise way and VariableTable was modified to use ObjToIntMap for itsVariableNames
git-svn-id: svn://10.0.0.236/trunk@116571 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 20:37:15 +00:00