Commit Graph

953 Commits

Author SHA1 Message Date
igor%mir2.org
7183ecda1e Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=184107
Always put function expression statements into initial activation object ignoring the with statement to follow SpiderMonkey
2002-12-23 15:01:53 +00:00
igor%mir2.org
453a0563cf Mostly cosmetics: use consistent naming for new API for function object initialization. 2002-12-23 14:56:58 +00:00
igor%mir2.org
508aa98e62 Eliminate double creation of Function objects representing nested functions in scripts/functions and use ScriptRutime.putFunction to bind function objects with activation scope. 2002-12-22 22:39:10 +00:00
igor%mir2.org
13ec8a642c Use Context.enter() try { } finally { Context.exit() } instead of try { Context.enter() } finally { Context.exit() } as Context.exit should only be called if Context.enter() returns successfully. 2002-12-22 19:12:50 +00:00
igor%mir2.org
0815885549 Move code to put functions as properties of activation object to ScriptRuntime.putFunction so it can reused by optimizer. 2002-12-22 19:08:52 +00:00
igor%mir2.org
dc573f11eb Do not put "anonymous" into BaseFunction.functionName for functions created via new Function. Instead NativeFunction.getFunctionName() returns "anonymous" for function name for such functions which allows to assume that BaseFunction.functionName always holds real name. 2002-12-22 19:06:26 +00:00
igor%mir2.org
f0e7977473 I replaced exception handlers for InstantiationException and friends during Class/Constructor.newInstance calls to construct NativeFunction/NativeScript instances via single catch (Exception ex) as the handlers rethrow exceptions as RuntimeException in any case. As it reduces OptRuntime.newOptFunction to few lines, its single usage in Codegen is inlined. 2002-12-22 02:51:16 +00:00
igor%mir2.org
89e660e85e I removed constants denoting _QUICK bytecodes as valid bytecode can not contain them. To catch possible bugs with passing invalid opcode I also replaced extra, opcodeCount and stackChange arrays by functions with switch statements that throws IllegalArgumentException on bad opcode. It also has an advantage of reducing class file size due to lack of support in JVM for efficient array initialization. 2002-12-22 02:42:40 +00:00
igor%mir2.org
ac9e2f79e3 I removed dependency of Parser.decompile on NativeFunction. Now Parser.decompile takes as argument a tree structure describing encoded source for script or function and their nested functions. In case of interpreter the tree is built from interpreter runtime data while the optimizer puts a static function to construct tree into the class file representing compiled script or function. This function is called via reflection.
The change removes the need to have instances of NativeFunction representing nested functions constructed before they are needed as a part of script execution.
2002-12-21 12:43:55 +00:00
igor%mir2.org
3cf3b9f6e4 I removed code to add EmptyArray field to generated field in Codegen.generateInit as it was redundant to ScriptRuntime.emptyArgs 2002-12-20 16:14:51 +00:00
igor%mir2.org
56e0e5ae51 In Codegen.visitFunction I replaced code generating call to createFunctionObject that would use reflection to instantiate function object by a direct calling of function constructor and a separated call to function initialization in OptRuntime.setupFunction. 2002-12-20 12:21:35 +00:00
igor%mir2.org
ecb7dc469e I removed debug_level and debug_srcName fields as they are never used. 2002-12-20 12:12:41 +00:00
igor%mir2.org
da6403bcf0 I moved optimizer related code to initialize a function from ScriptRuntime to optimizer/OptRuntime and replaced common code to initialize function prototype and scope in few places by ScriptRuntime.initFunction 2002-12-19 19:48:55 +00:00
igor%mir2.org
ec811806ab Cosmetics: expanding tabs 2002-12-17 20:56:08 +00:00
igor%mir2.org
b99f98d8e9 Cosmetics: removal of junk white-space at line end 2002-12-17 20:48:35 +00:00
igor%mir2.org
4dc361a246 I replaced all ScriptableObject.getClassPrototype(scope, "Function") by ScriptableObject.getFunctionPrototype(scope) 2002-12-17 16:36:23 +00:00
igor%mir2.org
2fbbcfd7f1 I moved details of debugger API changes since 1.5R3 to a separated document. 2002-12-17 09:26:48 +00:00
nboyd%atg.com
56dba39300 Add link to release candidate. 2002-12-16 16:51:33 +00:00
igor%mir2.org
3adfa94f2f Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=181834
Ignore dynamic scope flag for nested functions and functions defined inside with statements
2002-12-14 18:56:27 +00:00
igor%mir2.org
34357b4eb8 *** empty log message *** 2002-12-13 18:26:31 +00:00
igor%mir2.org
7141e33a06 *** empty log message *** 2002-12-13 18:16:12 +00:00
igor%mir2.org
9906757830 Document update 2002-12-13 14:21:38 +00:00
igor%mir2.org
8ba20cee09 Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=185165
I made ScriptRuntime.escapeString to escape \ and remove code to escape single quote ' as it is unreachable due to if (' ' <= c && c <= '~' && c != '"' && c != '\\') check as ' should not be escaped.
2002-12-13 11:56:54 +00:00
igor%mir2.org
3b3f720f15 I removed InterpretedFunction.itsClosure as it was effectively used only itsClosure != null test and the effect can be done via setting InterpretedFunction.useDynamicScope to false. 2002-12-12 10:46:52 +00:00
igor%mir2.org
d99c560f50 I moved itsUseDynamicScope from InterpreterData to InterpretedFunction as this flag affects only functions, not scripts and to initialize this flag not during script compilation but during function creation which happens at the start of script execution. It allows to alter the flag for already compiled scripts before their execution. 2002-12-11 22:28:00 +00:00
igor%mir2.org
47bee26159 Fixed link 2002-12-10 11:19:02 +00:00
igor%mir2.org
784105585e I changed InterpreterData.itsNestedFunctions from InterpretedFunction[] to InterpreterData[] because due recent changes/fixes InterpreterData.itsNestedFunctions was used effectively only to get information already available InterpreterData. 2002-12-09 17:50:20 +00:00
igor%mir2.org
2d1bf652ef Move creation of InterpretedFunction instances to createFunction (former createFunctionObject) to have function initialization at one place. 2002-12-09 13:37:13 +00:00
igor%mir2.org
8ae4899263 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=184111
Patch from Marcus Crafter:
...
After speaking with Christopher Oliver, the problem seems to be a general JDK
1.4 bug that caches selected values in JComboBox, even after removeAllItems() is
called. Since its a general defect Christopher and I thought we'd report and get
it fixed in the main CVS tree.
...
2002-12-08 21:06:45 +00:00
igor%mir2.org
50029c37e2 If debugger does not get function or script source via handleCompilationDone, try to read it from supplied URL. 2002-12-08 20:49:39 +00:00
igor%mir2.org
cea6846352 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=154693
On function/script start create and initialize instance of InterpretedFunction for each function statement.
2002-12-07 14:15:27 +00:00
igor%mir2.org
1b4064c81d Cosmetics: layout fix 2002-12-06 16:38:38 +00:00
igor%mir2.org
650a6e1763 isJavaPrimitiveWrap/setJavaPrimitiveWrap are made final as sublasses should not be override them when customizing WrapFactory 2002-12-06 16:36:25 +00:00
igor%mir2.org
30863897ad Remove generation of closure icode for function statements as they are initialized at script/function start, not at point of declaration. This redundant closure icodes were effectively no-operation but caused bigger stack to be allocated then necessary. 2002-12-05 21:04:30 +00:00
igor%mir2.org
8e6db6ff11 Remove closure constructor from InterpretedFunction and initialize InterpretedFunction.itsClosure constructor in Interpreter directly. This besides reducing code size will help to make fix for http://bugzilla.mozilla.org/show_bug.cgi?id=154693 smaller 2002-12-04 09:49:07 +00:00
igor%mir2.org
1e2bf2efec To allow straightforward detection of functions created via Function(...) constructor, I added the fromFunctionConstructor boolean flag to NativeFunction which allows to simplify code dealing with the EcmaScript requirement to return anonymous as a name for such functions. 2002-12-03 12:43:14 +00:00
igor%mir2.org
5aa3180827 1. Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=182028
Now caching of the last access slot covers GetterSlot instances as well and getter is always called for such slots

2. Fixing a potential race condition in setBySetter when a setter slot becomes an ordinary slot in response to a setter returning a value.

During execution of setBySetter a different thread can see initial null value in slot.value instead of the result of setter call as it is possible that JVM will first update slot.flags and only then slot.value for that thread. The fix replaces the old getter slot  by an ordinary one under synchronized block for that I added new getSlotPosition method and updated the rest of code accordingly.
2002-12-03 12:38:55 +00:00
igor%mir2.org
fa14609cd7 I moved decompilation code from NativeFunction to Parser so changes in compressed source structure will affect only one file. 2002-11-26 08:00:44 +00:00
igor%mir2.org
3626a138ec Add args and argCount to InterpreterData to emphasize that InterpretedScript/InterpretedFunction are just runtime wrappers around InterpreterData 2002-11-25 21:33:56 +00:00
igor%mir2.org
1e02010066 Wrap restoring of the original optimization level into finally block 2002-11-25 16:46:16 +00:00
igor%mir2.org
8f8ec48385 Fixing 181654: Error.prototype.toString is a generic function now
printing this.name + ": " + this.message for any this.
2002-11-25 16:44:30 +00:00
igor%mir2.org
9be5d10e5c Replace getScriptable() by getFunctionName() in omj/debug/DebuggableScript.java as the debugger used DebuggableScript.getScriptable() only to query function names.
It allows to implement the DebuggableScript interface only  by omj/InterpreterData instead of 2 identical implementations by InterpretedFunction and InterpretedScript.
2002-11-14 21:12:36 +00:00
igor%mir2.org
cd8a03eb8a Fixing in Interpreter.dumpICode reading of index from a wrong offset 2002-11-13 10:22:46 +00:00
igor%mir2.org
b09ef875a4 Fixing misspellings comments 2002-11-13 10:13:40 +00:00
igor%mir2.org
efd9f298ab Call NativeArray.getLength() instead of deprecated NativeArray.jsGet_length() 2002-11-12 09:41:09 +00:00
igor%mir2.org
6e859f553a Cosmetics: use consistent naming and layout for internal methods providing JS library implementation. 2002-11-12 09:37:43 +00:00
igor%mir2.org
8cd90d6557 1. Deprecation jsGet_length in favour of getLength
2. Cosmetics: use consistent naming and layout for internal methods providing JS library implementation.
2002-11-12 09:36:40 +00:00
igor%mir2.org
594696279f 1. In js_concat determine the the size of the resulting string to avoid reallocations in StringBuffer .
2. Cosmetics: use consistent naming and layout for internal methods providing JS library implementation.
2002-11-12 09:33:48 +00:00
igor%mir2.org
82ea401577 Cosmetics: use consistent naming and layout for internal methods providing JS library implementation 2002-11-12 09:29:57 +00:00
igor%mir2.org
99c0da59df Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=179068
Allow to use char sequences exceeding 64K when storing source for decompilation

The current 64K limit for string literals comes from omj/Parser.java where it constructs the internal script presentation for future decompilation. The patch extends this form to allow string sequences with more then 64K characters and modifes decompilation code in omj/NativeFunction.java accordingly.
2002-11-12 09:24:54 +00:00