Commit Graph

4296 Commits

Author SHA1 Message Date
brendan%mozilla.org
30322b2b64 Don't 'constant-fold' if(false)var foo=42 into nothing (140974, r=khanson, sr=shaver). 2002-04-30 23:28:34 +00:00
igor%mir2.org
b4d17bfe98 LabelTable cleanup:
1. Targeting of labels with 0x80000000 biscuits is moved from LabelTable to ClassFileWriter as this is classfile specific and is not necessary in Interpreter.
2. LabelTable allows for pc > Short.MAX_VALUE as this restriction is classfile specific. The only requirement is for jump offsets to stay within short range.
3. LabelTable is made private member of Interpreter and ClassFileWriter instead of being classes' superclass to avoid API leakage that forced optimizer.Codegen to declare few utility methods public as they got the same signature as LabelTable methods visible throw Interpreter inheritance.
2002-04-29 19:21:57 +00:00
igor%mir2.org
ff45d81768 I replaced java.util.Enumeration type for result and arguments of ScriptRuntime.initEnum/ScriptRuntime.nextEnum by Object to allow for greater flexibility in for (...in...) implementation. 2002-04-29 17:31:11 +00:00
nboyd%atg.com
435f28cf26 Remove skip for bug 120194 2002-04-29 00:58:40 +00:00
nboyd%atg.com
4509cada43 Patch from Igor to fix 120194 2002-04-29 00:56:30 +00:00
igor%mir2.org
b41bc47f81 Do not call acquireLabel/addLabelFixup/markLabel if label is not stored in parse tree and can be resolved immediately after node subtree generation (see new addForwardsGoto and resolveForwardGoto methods) 2002-04-28 15:17:24 +00:00
igor%mir2.org
90d91c1e22 Do not allocate Label object and instead store label's PC and fixups in itsFixupTable and itsFixupTable arrays 2002-04-27 12:27:14 +00:00
igor%mir2.org
59fedca6b1 Hiding details of omj.LabelTable implementation behind new getLabelPC, addLabelFixup, fixLabelGotos and clearLabels methods and making all its fields private. 2002-04-27 09:13:28 +00:00
darin%netscape.com
e554d83626 fixes bug 129279 "nsIFile unicode/utf8/ascii task"
r=dougt sr=alecf
2002-04-27 05:33:09 +00:00
igor%mir2.org
2c519e3fb5 Refactoring interpreter initialization to follow code more easily 2002-04-26 23:18:08 +00:00
igor%mir2.org
d8b73f2048 Tab removal 2002-04-26 23:14:50 +00:00
rginda%netscape.com
6d9b0eac20 - venkman only -
bug 139883, "ErrorHookProc can be tricked into thinking it never finished running", r=peterv
fixes bad early return in jsds_ErrorHookProc
test for correct max params (12, not 8) in CreatePPLineMap
use nsnull instead of 0 for null pointer return value
2002-04-26 20:57:35 +00:00
igor%mir2.org
e497d2b898 I changed VariableTable to store arbitrary Object as variable data to avoid allocation of LocalVariable in the interpreter mode as in this case only the variable name is used and it can be stored directly. It allows to remove omj.LocalVariable and omj.optimizer.OptVariableTable for the cost of having omc.JavaVariable which omj.optimizer.OptLocalVariable implement to pass to omc.ClassFileWriter debug information about the variable. 2002-04-26 08:01:29 +00:00
jband%netscape.com
8c580862e8 fix bug 139243. Remove reference count based rooting of JS objects of wrapped natives and replace it with GC-time marking. This is a pretty good DOM performance win. r=dbradley sr=jst. 2002-04-26 06:08:35 +00:00
brendan%mozilla.org
d4e55c2951 Purge the deflated string cache entry, if any, before finalizing external strings (140070, r=jband, sr=shaver). 2002-04-25 22:55:03 +00:00
khanson%netscape.com
dd8c0773df Reverse of Patch 66477 for bug #121744. Bug #131348, r=shaver, sr=brendan. 2002-04-25 20:33:33 +00:00
igor%mir2.org
4de1175e71 Links update 2002-04-25 06:46:47 +00:00
khanson%netscape.com
d817cc069a fixes memory leak in jsdtoa.c bug 138666, sr=brendan, r=khanson 2002-04-24 23:36:48 +00:00
igor%mir2.org
0877a53dd0 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. 2002-04-24 21:37:36 +00:00
igor%mir2.org
45b366e32d Initial version 2002-04-24 07:44:52 +00:00
igor%mir2.org
10cadaaf81 Serialization change: implement only Serializable with custom readObject/writeObject instead of Externalizable not to invent own versioning support. 2002-04-23 22:39:25 +00:00
igor%mir2.org
fe448dc961 Updating the debugger to reflect changes in Rhino debug API. 2002-04-22 20:47:51 +00:00
igor%mir2.org
1d93746ffc 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.
2002-04-22 20:46:43 +00:00
nboyd%atg.com
d3bdf13043 Implement support for new Package(<classLoader>) 2002-04-21 01:50:43 +00:00
igor%mir2.org
da6a3546f0 Removing one more time creating of bogus activation for InterpretedScript added with the previous change 2002-04-19 20:58:03 +00:00
igor%mir2.org
394848a46d 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. 2002-04-19 07:19:07 +00:00
seawood%netscape.com
97531eb92c Add make -j support to win32 gmake builds.
Bug #132848 r=bryner
2002-04-19 02:42:28 +00:00
igor%mir2.org
794d568298 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.
2002-04-16 07:28:40 +00:00
igor%mir2.org
ab6d7edc2f In setAttributes(int,...) mask out unused attributes bits in the same as setAttributes(String,...) does 2002-04-16 07:24:50 +00:00
igor%mir2.org
65e2a91173 Replace VariableTable.getVariable(name) != null by VariableTable.hasVariable(name) and use ObjToIntMap in place of Hashtable 2002-04-14 21:32:19 +00:00
igor%mir2.org
b85e4660f0 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 2002-04-14 21:29:35 +00:00
pschwartau%netscape.com
c6332db1ed Initial add. Regression test for bug 137181. 2002-04-12 21:06:15 +00:00
pschwartau%netscape.com
d10245bf7e Updating status messages to the current format. 2002-04-12 20:23:33 +00:00
igor%mir2.org
f5de7691ed 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.
2002-04-11 21:59:45 +00:00
igor%mir2.org
050ea5f4cf 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. 2002-04-11 21:36:31 +00:00
pschwartau%netscape.com
621ae10832 Adding an early return for Rhino; we only want to run this test in SpiderMonkey for now. 2002-04-11 16:11:53 +00:00
nboyd%atg.com
69e288aec4 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
2002-04-11 12:56:24 +00:00
nboyd%atg.com
887959238b Use hasProperty rather than getProperty to avoid creation of lazily evaluated properties. 2002-04-11 12:54:16 +00:00
igor%mir2.org
f689d29f4a Move code to finalize activation setup from ScriptRuntime to NativeCall not to depend in ScriptRuntime on internals of NativeCall 2002-04-11 09:15:44 +00:00
igor%mir2.org
e555ebca97 Removal of "|| caller.originalArgs == null" in the get method as caller.originalArgs is always != null 2002-04-11 09:12:45 +00:00
pschwartau%netscape.com
774ab94e93 Adding an early return for SpiderMonkey; we only want to run this test in Rhino. 2002-04-10 22:52:26 +00:00
pschwartau%netscape.com
301e5af1d6 Improving comment. 2002-04-10 22:50:42 +00:00
pschwartau%netscape.com
ce07e9f072 Improving Rhino detection by using the new inRhino() function in the utility file shell.js 2002-04-10 22:44:14 +00:00
pschwartau%netscape.com
23d222431f Adding a utility function to detect the Rhino shell. 2002-04-10 22:39:16 +00:00
pschwartau%netscape.com
a2459dc77d Initial add. Regression test for bug 131348. 2002-04-10 22:18:32 +00:00
igor%mir2.org
f296bcee63 Removal of unused maxInstanceId (I forgot to do it during 1.20 update) 2002-04-09 23:24:19 +00:00
igor%mir2.org
4c1b0e1195 Inherit from IdScriptable to save memory on hash table structures for callee, caller and length properties and speedup arguments initialization. 2002-04-09 21:00:54 +00:00
igor%mir2.org
6169deaa3c Do not alias UniqueTag.NULL_VALUE as IdScriptable.NULL_TAG and use it directly 2002-04-09 20:58:27 +00:00
igor%mir2.org
b3d3b12044 Elimination of InterpreterData.idFunction as it duplicate InterpreterData.itsFunctionType != 0 2002-04-09 18:19:01 +00:00
igor%mir2.org
548e050b50 Use int instead of byte for type of FunctionNode.itsFunctionType to have less (byte) casts. 2002-04-09 18:16:48 +00:00