Commit Graph

4246 Commits

Author SHA1 Message Date
igor%mir2.org
5bb1c2ac17 In Interpreter.interpret move initialization of debug frame after the setup of nested functions so they are visible to debugger on debug frame creation 2002-04-08 21:52:10 +00:00
nboyd%atg.com
a81c4b5ada Hi Norris,
I think there's a small problem with Igor's changes.  The modifed Interpreter.java
seems to create unnecessary activation objects for InterpretedScripts.  You can
see this in the debugger (local variables are present even for top level scripts).
I believe the attached change will fix the problem.

Regards,

Chris
2002-04-08 15:54:57 +00:00
igor%mir2.org
ed22f7158e Proprty access cleanup: use ScriptableObject.get/set/hasProperty to get/set/query properties on the prototype chain in ScriptRuntime to avoid code duplication 2002-04-08 08:19:21 +00:00
igor%mir2.org
6bbac51c73 In NativeObject.toSource and NativeArray.toStringHelper methods set cx.iterating to null when done to prevent Hashtable with potentially ever growing internal buffers to lay around. Use ObjToIntMap instead of Hashtable for cx.iterating, it servers the same purpose as using JDK 1.2 HashSet, but without breaking 1.1 compatibility. 2002-04-08 08:15:23 +00:00
igor%mir2.org
760e4b4196 Clear jiles warning:
VariableModel.java:220:30:220:40: Caution: This try block cannot throw a "checked exception" (JLS section 14.7) that can be caught here. You may have intended to catch a RuntimeException instead of an Exception.
2002-04-06 17:33:33 +00:00
igor%mir2.org
3b5657f132 This was for the very old implementation. Nothing there is relevant now 2002-04-06 14:34:56 +00:00
igor%mir2.org
8975e9eb32 Uodate with info on Break on Function Enter/Exit options 2002-04-06 14:18:32 +00:00
igor%mir2.org
c31e40fc89 From the email about debug API changes:
Changes to omj.tools.debugger are mostly due to renames and refactoring, the new code is limited to ContextData class which contains simplified version of the code for DebugFrame stack from the current DebuggableEngineImplementation and FrameHelper class implementing DebugFrame.
2002-04-06 13:57:24 +00:00
igor%mir2.org
b3d321243c From the email about debug API changes:
...
The idea is to make Debugger responsible for creation of DebugFrame in
Interpreter.interpret which gives simple way for a Debugger implementation to
observe function enter/exit while completely removing the need to have code
for debug frame stack in the Rhino core as the Debugger implementation can
easily support this on its own when necessary. So I suggest to have:

public interface Debugger { ... }

and

public interface DebugFrame { ... }

which eliminates omj.InterpreterFrame and as DebuggableEngine shrinks down to
3 methods set/getDebugger and getDebuggerContextData, I simply moved them to
Context. The 3rd method is useful to refer to per Context debug data from a
Debugger implementation, but it can be removed as well as the same effect can
be achieved via Context.set/getThreadLocal.
2002-04-06 13:54:48 +00:00
igor%mir2.org
a070528256 When re-throwing exception in Interpreter.interpret, always use original caught exception object, not exception it wraps as in the case of WrappedException instances 2002-04-06 05:58:23 +00:00
nboyd%atg.com
ecd8a089b7 Makefiles no longer supported: use Ant. 2002-04-06 01:56:50 +00:00
bnesse%netscape.com
56adb62c30 Fix for smoketest blocker 135697. Bump up version on the compiler test to force JS to be compiled with opt level 2. a=leaf. 2002-04-05 19:06:29 +00:00
brendan%mozilla.org
3f8594ea0e Forgot to #ifdef JS_THREADSAFE last change (no effect on Mozilla build; fixes broken standalone/single-threaded JS builds, sanity-sr=shaver). 2002-04-04 18:02:59 +00:00
brendan%mozilla.org
e424e842c6 Followup fix to synchronize with a nt-last-destroy-context racing GC when unpinning pinned atoms (133773, r=shaver, sr=jband, a=rjesup). 2002-04-03 20:38:39 +00:00
nboyd%atg.com
dab3f9ac65 Added support for a DebuggableObject interface that can be implemented for
non-ScriptableObject implementations of Scriptable.

I checked in fixes for the problems of serializing objects with FunctionObjects or
GetterSlots. With Foo.class in the current directory, I can now do:

[rhino] java -classpath 'build/rhino1_5R4pre/js.jar;.' org.mozilla.javascript.tools.shell.Main
Rhino 1.5 release 4 0000 00 00 (in progress)
js> defineClass("Foo")
js> f = new Foo
[object Foo]
js> print(f.counter)
0
js> print(f.counter)
1
js> serialize(f, "f.ser")
js> quit()
[rhino] java -classpath 'build/rhino1_5R4pre/js.jar;.' org.mozilla.javascript.tools.shell.Main
Rhino 1.5 release 4 0000 00 00 (in progress)
js> f = deserialize("f.ser")
[object Foo]
js> f.counter
2
js> f.counter
3
2002-04-03 01:55:50 +00:00
nboyd%atg.com
8fc68d6900 Fixed problem with -opt 9:
Hi Norris,

I encountered the following exception with the below script in compiled
mode with RhinoLatest.zip:

java.lang.NullPointerException
 at
org.mozilla.javascript.optimizer.Codegen.visitCall(Codegen.java:1790)
 at
org.mozilla.javascript.optimizer.Codegen.generateCodeFromNode(Codegen.java:567)

 at
org.mozilla.javascript.optimizer.Codegen.visitReturn(Codegen.java:2283)
 at
org.mozilla.javascript.optimizer.Codegen.generateCodeFromNode(Codegen.java:592)

 at
org.mozilla.javascript.optimizer.Codegen.generateCodeFromNode(Codegen.java:546)

 at
org.mozilla.javascript.optimizer.Codegen.generateCodeFromNode(Codegen.java:546)

 at
org.mozilla.javascript.optimizer.Codegen.generateCodeFromNode(Codegen.java:546)

 at
org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:497)
 at
org.mozilla.javascript.optimizer.Codegen.generateFunctionInits(Codegen.java:1292)

 at
org.mozilla.javascript.optimizer.Codegen.generateInit(Codegen.java:1186)

 at
org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:481)
 at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:88)
 at org.mozilla.javascript.Context.compile(Context.java:1965)
 at org.mozilla.javascript.Context.compile(Context.java:1874)
 at org.mozilla.javascript.Context.compileReader(Context.java:895)
 at org.mozilla.javascript.Context.evaluateReader(Context.java:813)
 at
org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:318)
 at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:309)
 at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:248)

 at org.mozilla.javascript.tools.shell.Main.exec(Main.java:95)
 at org.mozilla.javascript.tools.shell.Main.main(Main.java:68)
Exception in thread "main"

function tak(x, y, z, k) {
    if (!(y < x)) {
        return k(z);
    } else {
        return tak(x - 1,
                   y,
                   z,
                   function(v1) {
            return tak(y - 1,
                       z,
                       x,
                       function(v2) {
                return tak(z - 1,
                           x,
                           y,
                           function(v3) {
                    return tak(v1, v2, v3, k);
                });
            });
        });
    }
}

function cpstak(x, y, z) {
    return tak(x, y, z, function(a) {return a;});
}

//;;; call: (cpstak 18 12 6)

//(run-benchmark "CPSTAK" (lambda () (cpstak 18 12 6)))

var start = new Date();
var res = cpstak(18, 12, 6);
var end = new Date();
print(res +": elapsed: " + (end - start));
2002-04-03 01:20:27 +00:00
beard%netscape.com
8f9516a234 Fixes an installer crash on pre-PCI PowerMacs, bug # 125411. sr=sfraser, r=sdagley, a=asa 2002-04-02 23:27:55 +00:00
colin%theblakes.com
9b779d9dd5 Do not define MODULE_NAME for components which are shareable even in
static builds.
b=134650 r=cls sr=dveditz a=asa
2002-04-02 13:36:56 +00:00
seawood%netscape.com
090c63d423 More cruft removal. Remove platform.h xp_debug.h xpassert.h & xp_trace.h from the build.
Replace currently unused references to XP_ASSERT with one of NS_ASSERTION & friends.
Bug #38061 r=bryner sr=alecf a=tor/drivers a=putterman/adt
2002-04-02 07:57:02 +00:00
brendan%mozilla.org
0555817eef Fix next-to-last vs. last context GC race, plus ClaimScope vs. js_DestroyContext race; removed js_ForceGC from the FRIEND JS API (133773, sr=jband&shaver, a=asa). 2002-04-02 04:23:21 +00:00
nboyd%atg.com
750bfdb52c Patch from Chris Oliver:
Hi Norris,

Can you check in the attached Main.java which works around a problem with using
JTreeTable in JDK 1.4.

Thanks,

Chris
2002-04-01 22:12:11 +00:00
seawood%netscape.com
2d941f53cc Do not set EXPORT_LIBRARY for libs that we do _not_ want in the static link list.
Bug #134012 r=rjesup sr=dveditz a=leaf
2002-03-30 01:46:52 +00:00
pschwartau%netscape.com
70dfff7f09 Correcting mistake in location of JS2 debug shell on Windows. 2002-03-30 00:35:16 +00:00
pschwartau%netscape.com
66b70399fe Added another big function to compile, from duplicate bug 133897. 2002-03-29 15:46:09 +00:00
sfraser%netscape.com
85b2719aac Bug 133412: Changes to allow for upgrading to CodeWarrior Pro 7.2 tools -- depending on the tools version, remove the clamp on the optimization level, since the optimizer bug is fixed. r=sdagley, sr=scc, a=asa 2002-03-27 04:10:46 +00:00
nboyd%atg.com
b9766e8169 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
2002-03-26 23:02:43 +00:00
cathleen%netscape.com
99fa3efa4e fix linux static build installer. bug 128507, bug 130995, bug 130998 r=seawood sr=dveditz a=asa (verbal) 2002-03-26 00:53:30 +00:00
pschwartau%netscape.com
3460c97c56 Removing an extraneous line. 2002-03-25 23:51:06 +00:00
pschwartau%netscape.com
10ade298db Initial add. Regression test for bug 130451. 2002-03-25 23:41:56 +00:00
pschwartau%netscape.com
b150cad06d Adding a tail recursion test by Georgi Guninski 2002-03-25 00:25:45 +00:00
nboyd%atg.com
4b432d7521 Add missing support for multiple -implements classes 2002-03-24 22:37:57 +00:00
dbaron%fas.harvard.edu
6cdcd7ef3a Convert users of nsAReadable[C]String and nsAWritable[C]String typedefs to [const] nsA[C]String. b=131899 r=scc sr=jag a=asa 2002-03-24 00:16:18 +00:00
igor%mir2.org
5024940d53 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 2002-03-23 20:51:05 +00:00
brendan%mozilla.org
ac2c08044b Fix JSOP_DEFFUN to define functions in global code permanently, and not permanently in eval code (131964, r=khanson, sr=shaver, a=scc). 2002-03-23 17:34:24 +00:00
brendan%mozilla.org
74c88d8460 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). 2002-03-23 07:38:08 +00:00
pschwartau%netscape.com
8260547943 Fixing a typo. 2002-03-23 01:50:16 +00:00
khanson%netscape.com
51645833cc 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. 2002-03-22 21:24:46 +00:00
pschwartau%netscape.com
4cf8850876 Updating JS_GetImplementationVersion() to date of latest JS release (67111). 2002-03-22 20:43:47 +00:00
jband%netscape.com
6ce09c1621 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. 2002-03-22 19:14:57 +00:00
igor%mir2.org
b47432fc67 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. 2002-03-22 18:51:33 +00:00
dougt%netscape.com
40642fc34c 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 2002-03-21 23:43:21 +00:00
jband%netscape.com
16d78379aa 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 2002-03-21 23:21:54 +00:00
nboyd%atg.com
6b14bb8383 Fix eval code cases on 132217 2002-03-21 17:26:55 +00:00
brendan%mozilla.org
c2ee1d2afb 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). 2002-03-21 09:06:00 +00:00
nboyd%atg.com
7f70eb708f Fix bug 132217. 2002-03-21 01:44:54 +00:00
igor%mir2.org
052726b68e 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).
2002-03-20 20:00:32 +00:00
pschwartau%netscape.com
ca2670e317 Fixing a blunder in Section 4, and changing from brackets to braces for ECMA attribute. 2002-03-20 19:24:08 +00:00
pschwartau%netscape.com
096af14c9a Deleted an extraneous line; improved readablity. 2002-03-20 19:13:36 +00:00
khanson%netscape.com
5bf172e81d 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 2002-03-20 05:45:12 +00:00
brendan%mozilla.org
94a74d7db5 Defend against early OOM when finishing JSDHashTables (131815, r=scole, sr=jband, a=asa). 2002-03-20 02:22:50 +00:00