4253 Commits

Author SHA1 Message Date
khanson%netscape.com
fe8d0add83 Reverse of Patch 66477 for bug #121744. Bug #131348, r=shaver, sr=brendan.
git-svn-id: svn://10.0.0.236/trunk@119848 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-25 20:33:33 +00:00
igor%mir2.org
974c0a6fd0 Links update
git-svn-id: svn://10.0.0.236/trunk@119818 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-25 06:46:47 +00:00
khanson%netscape.com
4289421167 fixes memory leak in jsdtoa.c bug 138666, sr=brendan, r=khanson
git-svn-id: svn://10.0.0.236/trunk@119780 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-24 23:36:48 +00:00
igor%mir2.org
cd67667f6d I replaced Vector by ObjArray when it was used from the single thread and similarly replaced Hashatble by ObjToIntMap when it was used from the single thread to mark keys presence ignoring values. It avoids unnecessary synchronization and save memory. To simplify the replacement I added to ObjArray and ObjToIntMap few utility methods.
git-svn-id: svn://10.0.0.236/trunk@119752 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-24 21:37:36 +00:00
igor%mir2.org
4322887b08 Initial version
git-svn-id: svn://10.0.0.236/trunk@119699 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-24 07:44:52 +00:00
igor%mir2.org
ccaa4ae84c Serialization change: implement only Serializable with custom readObject/writeObject instead of Externalizable not to invent own versioning support.
git-svn-id: svn://10.0.0.236/trunk@119638 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-23 22:39:25 +00:00
igor%mir2.org
d46b041bb0 Updating the debugger to reflect changes in Rhino debug API.
git-svn-id: svn://10.0.0.236/trunk@119562 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-22 20:47:51 +00:00
igor%mir2.org
c2e4714c61 Debugger interface changes:
1. Replacing omj.debug.Debugger.enterFrame() by omj.debug.Debugger.getFrame() and omj.debug.DebugFrame.onEnter() to allow to return null from omj.debug.Debugger.getFrame to enable full optimization with debugger set if it is not interested in monitoring a particular frame

2. Changing type for the source argument in omj.debug.Debugger.handleCompilationDone from StringBuffer to String as Debugger instances should not be able to modify source even by chance.


git-svn-id: svn://10.0.0.236/trunk@119561 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-22 20:46:43 +00:00
nboyd%atg.com
5d2b6cb32b Implement support for new Package(<classLoader>)
git-svn-id: svn://10.0.0.236/trunk@119507 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-21 01:50:43 +00:00
igor%mir2.org
526727ee42 Removing one more time creating of bogus activation for InterpretedScript added with the previous change
git-svn-id: svn://10.0.0.236/trunk@119416 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-19 20:58:03 +00:00
igor%mir2.org
b1e186737a Making interpreter bytecode independent from Context.isGeneratingDebug so debugger can handle scripts compiled without Context.isGeneratingDebug: if itsNeedsActivation is false with debugger present, Interpreter.interpret creates activation scope and check in variable queries/assignments if they should be made against activation object and not stack[VAR_SHIFT+...] array.
git-svn-id: svn://10.0.0.236/trunk@119378 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-19 07:19:07 +00:00
seawood%netscape.com
26389cf685 Add make -j support to win32 gmake builds.
Bug #132848 r=bryner


git-svn-id: svn://10.0.0.236/trunk@119345 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-19 02:42:28 +00:00
igor%mir2.org
76a458a7fe Fixing bug 137181 so after delete arguments[i], arguments[i] and corresponding function parameter in activation are not shared:
The patch uses the special NOT_FOUND value to flag deleted indexes. It also
make sure that original array object passed to Function.call is not modified,
as all changes goes to cloned copy. It is not necessary for the fix, but it is
the only place in the current Rhino that can alter Object[] array passed to
Function.call and I think it is better to remove this exceptional case.


git-svn-id: svn://10.0.0.236/trunk@119090 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-16 07:28:40 +00:00
igor%mir2.org
8bbd639ae9 In setAttributes(int,...) mask out unused attributes bits in the same as setAttributes(String,...) does
git-svn-id: svn://10.0.0.236/trunk@119089 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-16 07:24:50 +00:00
igor%mir2.org
ac3b5c6c15 Replace VariableTable.getVariable(name) != null by VariableTable.hasVariable(name) and use ObjToIntMap in place of Hashtable
git-svn-id: svn://10.0.0.236/trunk@118960 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-14 21:32:19 +00:00
igor%mir2.org
eeebf685e0 Make all fields in VariableTable private and use access API to get them in optimizer/OptVariableTable to allow to change VariableTable implementation without changing its usage
git-svn-id: svn://10.0.0.236/trunk@118959 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-14 21:29:35 +00:00
pschwartau%netscape.com
649f1c5b5c Initial add. Regression test for bug 137181.
git-svn-id: svn://10.0.0.236/trunk@118875 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-12 21:06:15 +00:00
pschwartau%netscape.com
48521f8b50 Updating status messages to the current format.
git-svn-id: svn://10.0.0.236/trunk@118871 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-12 20:23:33 +00:00
igor%mir2.org
abea7cfb18 As Christopher Oliver <coliver@mminternet.com> pointed out, in many execution paths calls to Scriptable.put follows corresponding Scriptable.has with the same name/id, and although the put method implementations in ScriptableObject and IdScriptable use cache for a previously accessed name to avoid expensive name lookups, the corresponding has implementation do use the cache.
These changes add the cache optimization to the has methods and remove cache update from the put methods under the assumption that newly assigned properties would not be used immediately.


git-svn-id: svn://10.0.0.236/trunk@118797 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:59:45 +00:00
igor%mir2.org
ab92539dc3 As the scope parameter for the bind and getBase methods should never be null, make sure they trigger NullPointerException on "scope == null" to detect bad API usage earlier.
git-svn-id: svn://10.0.0.236/trunk@118790 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 21:36:31 +00:00
pschwartau%netscape.com
d573f597e1 Adding an early return for Rhino; we only want to run this test in SpiderMonkey for now.
git-svn-id: svn://10.0.0.236/trunk@118768 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 16:11:53 +00:00
nboyd%atg.com
1a079cafd3 Fix for following problem:
hi Norris,

in our product, which makes heavy use of Rhino, we have many Java Objects
we wrap with ECMAScript wrappers, which extend the ScriptableObject class
and implement the Wrapper interface. Those wrappers automagically wrap the
native Java object with the help of a WrapHandler implementation.

we now ran into a problem :

we have a java class with two overloaded static methods like this :
     public class Test {
         public static String create(File f) {}
         public static String create(Custom c) {}
     }

The Custom class exists as a native Java implementation like
     public class Custom {}

and a accompanying ECMAScript wrapper like
     public class CustomWrapper
        extends ScriptableObject
        implements Wrapper {}

in our ECMAScripts we make the wrapper class known as a host object along
the lines of
     defineClass("CustomWrapper");
and can then use the object as a normal ECMAScript host object. no big deal
and working great.

but : the code
     var s = Test.creat( new Custom( "xyz") );
fails with the information, that the methods are ambiguous, which of course
they are not.

Looking at the code of NativeJavaMethod.findFunction() and the helpers in
NativeJavaObject it seems, that the fact of the Custom host object being a
Wrapper is not taken into account. in an easy fix of
NativeJavaMethod.findFunction(), i simply replace all arguments, which are
Wrapper imlpementation by the wrapped object. this solves my problem, but
of course i'm not sure on side effects.

i attach the testcase as well as the fixed NativeJavaMethod class in the
jar file. to run the test with and without the fix, extract the jar and do
     ant test

please let me know, what you think of this.

regards and thanks, f.

Felix Meschberger


git-svn-id: svn://10.0.0.236/trunk@118744 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 12:56:24 +00:00
nboyd%atg.com
f3170be2ce Use hasProperty rather than getProperty to avoid creation of lazily evaluated properties.
git-svn-id: svn://10.0.0.236/trunk@118743 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 12:54:16 +00:00
igor%mir2.org
2837f1aad7 Move code to finalize activation setup from ScriptRuntime to NativeCall not to depend in ScriptRuntime on internals of NativeCall
git-svn-id: svn://10.0.0.236/trunk@118741 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 09:15:44 +00:00
igor%mir2.org
b42ddce943 Removal of "|| caller.originalArgs == null" in the get method as caller.originalArgs is always != null
git-svn-id: svn://10.0.0.236/trunk@118740 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-11 09:12:45 +00:00
pschwartau%netscape.com
0aeda3e829 Adding an early return for SpiderMonkey; we only want to run this test in Rhino.
git-svn-id: svn://10.0.0.236/trunk@118666 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-10 22:52:26 +00:00
pschwartau%netscape.com
c0b0a2682b Improving comment.
git-svn-id: svn://10.0.0.236/trunk@118665 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-10 22:50:42 +00:00
pschwartau%netscape.com
ed6654fc50 Improving Rhino detection by using the new inRhino() function in the utility file shell.js
git-svn-id: svn://10.0.0.236/trunk@118663 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-10 22:44:14 +00:00
pschwartau%netscape.com
8569e5d014 Adding a utility function to detect the Rhino shell.
git-svn-id: svn://10.0.0.236/trunk@118662 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-10 22:39:16 +00:00
pschwartau%netscape.com
1c4fc339c1 Initial add. Regression test for bug 131348.
git-svn-id: svn://10.0.0.236/trunk@118659 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-10 22:18:32 +00:00
igor%mir2.org
1a558693c3 Removal of unused maxInstanceId (I forgot to do it during 1.20 update)
git-svn-id: svn://10.0.0.236/trunk@118575 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-09 23:24:19 +00:00
igor%mir2.org
ee2cf584a7 Inherit from IdScriptable to save memory on hash table structures for callee, caller and length properties and speedup arguments initialization.
git-svn-id: svn://10.0.0.236/trunk@118564 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-09 21:00:54 +00:00
igor%mir2.org
cd133cdc1e Do not alias UniqueTag.NULL_VALUE as IdScriptable.NULL_TAG and use it directly
git-svn-id: svn://10.0.0.236/trunk@118562 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-09 20:58:27 +00:00
igor%mir2.org
91a578dd8c Elimination of InterpreterData.idFunction as it duplicate InterpreterData.itsFunctionType != 0
git-svn-id: svn://10.0.0.236/trunk@118555 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-09 18:19:01 +00:00
igor%mir2.org
02741cc679 Use int instead of byte for type of FunctionNode.itsFunctionType to have less (byte) casts.
git-svn-id: svn://10.0.0.236/trunk@118554 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-09 18:16:48 +00:00
igor%mir2.org
74d361a0fd In Interpreter.interpret move initialization of debug frame after the setup of nested functions so they are visible to debugger on debug frame creation
git-svn-id: svn://10.0.0.236/trunk@118488 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-08 21:52:10 +00:00
nboyd%atg.com
ce9dc7c2ab 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


git-svn-id: svn://10.0.0.236/trunk@118475 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-08 15:54:57 +00:00
igor%mir2.org
72e53b155c Proprty access cleanup: use ScriptableObject.get/set/hasProperty to get/set/query properties on the prototype chain in ScriptRuntime to avoid code duplication
git-svn-id: svn://10.0.0.236/trunk@118467 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-08 08:19:21 +00:00
igor%mir2.org
49fe1b383b 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.
git-svn-id: svn://10.0.0.236/trunk@118466 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-08 08:15:23 +00:00
igor%mir2.org
edcc2442e5 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.


git-svn-id: svn://10.0.0.236/trunk@118373 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 17:33:33 +00:00
igor%mir2.org
f33000f612 This was for the very old implementation. Nothing there is relevant now
git-svn-id: svn://10.0.0.236/trunk@118369 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 14:34:56 +00:00
igor%mir2.org
6ac0021793 Uodate with info on Break on Function Enter/Exit options
git-svn-id: svn://10.0.0.236/trunk@118368 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 14:18:32 +00:00
igor%mir2.org
55deb7b928 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.


git-svn-id: svn://10.0.0.236/trunk@118367 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 13:57:24 +00:00
igor%mir2.org
f6e30861d8 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.


git-svn-id: svn://10.0.0.236/trunk@118366 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 13:54:48 +00:00
igor%mir2.org
6dec2aa906 When re-throwing exception in Interpreter.interpret, always use original caught exception object, not exception it wraps as in the case of WrappedException instances
git-svn-id: svn://10.0.0.236/trunk@118347 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 05:58:23 +00:00
nboyd%atg.com
df3e942e85 Makefiles no longer supported: use Ant.
git-svn-id: svn://10.0.0.236/trunk@118334 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-06 01:56:50 +00:00
bnesse%netscape.com
229113a7fc Fix for smoketest blocker 135697. Bump up version on the compiler test to force JS to be compiled with opt level 2. a=leaf.
git-svn-id: svn://10.0.0.236/trunk@118265 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-05 19:06:29 +00:00
brendan%mozilla.org
e1859a4360 Forgot to #ifdef JS_THREADSAFE last change (no effect on Mozilla build; fixes broken standalone/single-threaded JS builds, sanity-sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@118128 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-04 18:02:59 +00:00
brendan%mozilla.org
35a8120be9 Followup fix to synchronize with a nt-last-destroy-context racing GC when unpinning pinned atoms (133773, r=shaver, sr=jband, a=rjesup).
git-svn-id: svn://10.0.0.236/trunk@118031 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-03 20:38:39 +00:00
nboyd%atg.com
72d0461e26 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


git-svn-id: svn://10.0.0.236/trunk@117974 18797224-902f-48f8-a5cc-f745e15eee43
2002-04-03 01:55:50 +00:00