Commit Graph

1731 Commits

Author SHA1 Message Date
igor%mir2.org
243ce99e7c More compatibility changes: added Main.isVisible 2004-09-24 16:38:09 +00:00
igor%mir2.org
b8bfe43a65 Move getObjectIndex/setObjectIndex that take double as index from optimizer/OptRuntime to ScriptRuntime and use it in the Interpreter to avoid code duplication. 2004-09-24 16:27:27 +00:00
igor%mir2.org
3f3a80499c Revert wrong commit of build.properties with temporary changes 2004-09-24 16:19:26 +00:00
igor%mir2.org
7523c5c791 Added few methods to redirect calls from main to DebugGui for compatibility. 2004-09-24 16:14:02 +00:00
igor%mir2.org
4a1d88a604 Use single function, Kit.xDigitToInt, to convert character representing hex digit to number. The function replaces duplicated code in TokenStream/NativeGlobal/NativeRegExp. 2004-09-24 13:14:01 +00:00
igor%mir2.org
511eb6c0fc Code reorganisation to shrink the size of JVM class files. 2004-09-24 13:11:02 +00:00
igor%mir2.org
49a53cd5e9 Resolving bug 261278: strict mode implementation 2004-09-23 21:34:22 +00:00
igor%mir2.org
81fcf9bcdf Preparations for RC2 for 1.6R1 2004-09-22 10:59:39 +00:00
igor%mir2.org
ea6f7ae6b8 Added some information about experimental support for continuations 2004-09-22 10:43:52 +00:00
igor%mir2.org
21f0e29bbd 1. Extend index and offset jump limits to 2^16 - 1 from 2^15 - 1 using unsigned indexes.
2. Use linked list of read-only REPogState to implement state stack instead of array of struct. It fixes bug 258417 while making creation of back track stack data much cheaper since there is no need to copy read-only structures.
2004-09-22 09:48:17 +00:00
igor%mir2.org
bfc17d4124 In NativeRegExp.executeREBytecode I moved code to manipulate regexp program
stack to separated pushProgStack|popProgStack methods to localize changes to
for the following patch to use linked list for state stack.
2004-09-21 18:38:46 +00:00
igor%mir2.org
86848a99b8 I merged REMatchState into REGlobalData and replaced all REMatchState usages as function return type by boolean. It simplified matching code while reducing code bloat. 2004-09-21 15:00:43 +00:00
igor%mir2.org
cc4eeda146 1. Use direct reference to backTraceStack top to save/restore backTraceStack reference when matching REOP_ASSERT/REOP_ASSERT_NOT
2. Coalesce duplicated code in NativeRegExp.executeREBytecode
2004-09-20 22:44:51 +00:00
igor%mir2.org
ed81e19108 Resolving bug 258844: implementation of continuation support for Rhino interpret
er inspired by Christopher Oliver work for custom Rhino version for cocoon.apach
e.org.
2004-09-16 19:04:34 +00:00
igor%mir2.org
c4916822f7 Resolving bug 258844: implementation of continuation support for Rhino interpreter inspired by Christopher Oliver work for custom Rhino version for cocoon.apache.org. 2004-09-16 18:27:42 +00:00
igor%mir2.org
12828edc5e Replacing back track array in RegExp matching code by linked list to address bug 258419. 2004-09-16 17:30:01 +00:00
igor%mir2.org
a30abea90c 1. Using explicit ShellContextFactory in shell to avoid interference from changes in global ContextFactory.
2. Initializing global scope before the first execution to allow to customize ShellContextFactory before calls to Context.initStandardObjects()
2004-09-15 16:00:30 +00:00
igor%mir2.org
91f7a07a68 1. Call contextData.pushFrame(this) from StackFrame.onEnter and not from StackFrame.constructor to allow multiple invocations of enter/exit per single debug frame. The continuation support will use it.
2. Expand tabs
2004-09-15 14:59:36 +00:00
igor%mir2.org
b92c21f853 1. Ignoring recursive invocation of Dim.interrupted on event thread: when Gui
processes breakpoint hit and another breakpoint is met during event processing,
then on Linux recursive invocations of EventQueue.getNextEvent()/dispatchEvent
lead to eventual GUI deadlock. It is easy to observe when the break on function
enter is enabled and a JS function is called that is attached to an action
handler of some button. With recursive bahaviour repeated clicks lead to deeper
and deeper invocation of EventQueue.getNextEvent() and GUI deadlock on Linux.

So to improve debugger stubility I modify Dim.interrupted to ignore calls from
event thread when another invocation of Dim.interrupted already waits for GUI
result.

2. To decrease class and jar bloat I merges various implementations of Runnable
and and other interfaces to single class with switch dispatch. It saved about
6K from js.jar.
2004-09-15 14:45:10 +00:00
igor%mir2.org
bef182034b 1. Using UniqueTag.DOUBLE_MARK in interpreter instaed of Object instance to mark double values on stack for better debug printouts.
2. In parse tree use Node instances, not Node.Target to denote target nodes as later just leads to code bloat without safty benefits.
2004-09-15 13:51:19 +00:00
igor%mir2.org
4f61cba96e Added UniqueTag.DOUBLE_MARK for better debug printouts in interpreter and potential support for serialization of Interpreter.CallFrame. 2004-09-15 13:42:26 +00:00
igor%mir2.org
c72dbebee7 1. Marking NativeCall.parentActivationCall transient so serialization would not see it.
2. Removal of never used NativeCall.thisObj field and code to initialize it.

3. Renaming NativeCall.funObj to NativeCall.function for better readability.
2004-09-14 14:59:21 +00:00
igor%mir2.org
5ebef36b9a 1. Allow to monitor from application top script or function calls: now they go through ContextFactory.doTopCall which can be overridden.
2. Context.observeInstructionCount now calls ContxtFactory.observeInstructionCount so it can overridden without extra Context class.
2004-09-13 13:19:17 +00:00
igor%mir2.org
4b0e5313bd My take on the patch from Attila Szegedi <szegedia@freemail.hu> to resolve 258959. 2004-09-12 16:41:04 +00:00
igor%mir2.org
9d46a01a21 Patch from Attila Szegedi <szegedia@freemail.hu> to fix bug 258958 2004-09-12 16:39:39 +00:00
igor%mir2.org
7c625d6b56 Added ContextFactory.hasExplicitGlobal to verify if ContextFactory.initGlobal was already called. 2004-09-12 16:37:59 +00:00
igor%mir2.org
66fd0127ec Few changes from continuation patch in bug 258844 that are useful on its own:
1. Fix to pass to debugger wrapped frame.resultDbl if frame.result is DBL_MARK
2. Change Interpreter.interpret to return the properly wrapped result instead of the final frame.
3. Use Object for throwable variable in Interpreter.interpret to avoid multiple casts to Throwable
2004-09-12 13:05:34 +00:00
igor%mir2.org
006a1dcfc1 Fixing recent bad typo in exception handler search that caused to ignore finally handlers and check only catch blocks with finally-only exceptions. 2004-09-12 00:36:46 +00:00
igor%mir2.org
ea82bb7ab5 Consistently use ScriptRuntime.(wrapNumber|wrapBoolean) to wrap Java double and boolean values to the corresponding JS primitive types. 2004-09-10 19:54:43 +00:00
igor%mir2.org
985134c0ed 1. Replacing IdScriptableObject.wrap_* methods by their ScriptRuntime.wrap* counterparts since the wrap methods are useful not only for subclasses of IdScriptableObject.
2. Reorganizing execIdCall in few classes inherited from IdScriptableObject to shrink code size.
2004-09-10 18:02:06 +00:00
igor%mir2.org
5eff6a3a6f Removal of unnecessary cast to (String) during getter/setter enumeration. 2004-09-10 17:56:13 +00:00
igor%mir2.org
cae5f15434 Removal of package-private setter methods in FunctionNode in favor of package-private (not private) fields: that just was just adding unnecessary code bloat. 2004-09-10 17:54:13 +00:00
igor%mir2.org
a70c59fa3a More work for bug 244492: I deprecated ClassDefinitionException modified
ScriptableObject to use EvaluatorException instead.

For greater compatibility I also changed ClassDefinitionException to extend
from RuntimeException, not Exception so compilers would not complain about
"catch (ClassDefinitionException ex)" when no ClassDefinitionException is present in the called code.
2004-09-10 17:50:05 +00:00
igor%mir2.org
0aa318e581 XMLLib.escapeXMLAttribute is required to add " arround the text to simplify code generation. 2004-09-10 17:40:59 +00:00
igor%mir2.org
ef2adbe0e4 1. Fixing a race in implementation of date.prototype.setYear where NativeDate.date was updated several times with temporary values.
2. Reorganizing NativeDate.execIdCall to shrink code size
2004-09-10 17:36:49 +00:00
igor%mir2.org
7ddb76cbaf RegExpProxy.(search|find|match) was replaced by the single action taking additional actionType argument: this is how the methods were implemented in RegExpImpl in any case and talking to implementation directly saved code. 2004-09-10 07:51:16 +00:00
igor%mir2.org
ef60132dfa Inlining back code that were moved recently to do_call/do_new: if continuation support materializes, it would be much easier to transfer control to appropriate part of interpretation loop from the inlined code then to pass the necessary information from do_call. 2004-09-10 07:48:00 +00:00
igor%mir2.org
3047c478e0 1. Interpreter.interpret no longer tracks "with" statement nesting and instead use local register to save/restore scope during exception handling. It allowed to simplify exception handling and move it back to Interpreter.interpret to avoid issues with hypothetical stack overflow exceptions during exception catching.
2. local registers are cleared with null after use to allow to GC no longer used objects.
2004-09-09 17:40:48 +00:00
igor%mir2.org
db8822eccc Removal of "throws JavaSriptException" declaration:
JavaSriptException now inherits from RhinoException which inherits from RuntimeException and as such it does not necessary to declare it.

Moreover, it is wrong to use it for the documentation purpose since a  script can also throw EcmaError and WrappedException and a proper documentation would require to document those exceptions as well. But since almost all Rhino functions can potentially execute script code it means that wast majority of functions would bear the declarations, not only code overriding or calling explicitly Function.call/construct. And then the throw declarations would bring no information if it always would be "throws RhinoException". Thus it is better not to litter sources with the declarations at all.
2004-09-08 12:29:59 +00:00
igor%mir2.org
30e63c4179 Fixing bug 258144: my take on patch patch from Andrew Madigan <andymadigan@yahoo.com> to add class compiler option controlling which class will be used for main method implementation. 2004-09-07 19:11:39 +00:00
igor%mir2.org
d29f6cb477 Inline small functions used for code generation to produce intepreter or JVM bytecode for particular parser tree node: they just add to jar file size without readability benefits. 2004-09-07 09:08:31 +00:00
igor%mir2.org
b1162d3958 Refactoring of catch code generation to address bug 258183 and bug 258207. 2004-09-06 20:05:55 +00:00
igor%mir2.org
faab99c5dd Print exception trace inside Kit.codeBug() to have it even if the execption is shadowed by another one 2004-09-06 19:08:11 +00:00
igor%mir2.org
8f793c397e Resolving bug 255891: new approach to dynamic scoping 2004-09-01 14:17:00 +00:00
igor%mir2.org
df590d4933 Fixing bug 257425: Context.toObject now works even without Context.iniStandardLibrary 2004-08-30 14:57:25 +00:00
igor%mir2.org
614804384d Fixing bug 257423: the code generation was not updated to use ScriptRuntime.getObjedctProp instead of OptRuntime.thisGet. 2004-08-30 14:48:23 +00:00
igor%mir2.org
ef89c5d451 Renaming Interpreter.State to Interpreter.CallFrame to better reflect class semantics 2004-08-28 19:19:30 +00:00
igor%mir2.org
1e75534222 Changes to make Interpreter to recover from exceptions during execution of ScriptRuntime.getCatchObject() and during initState and do not leave runtime in inconsitent o even corrupt state. 2004-08-28 17:29:50 +00:00
igor%mir2.org
8eb18ba2ca Implementing 257128: tail call optimization 2004-08-28 00:42:38 +00:00
igor%mir2.org
1c4a403de2 Removal of ScriptRuntime.getThis() : it was used by nested functions or
functions declared inside with statements to ensure that their thisObj
is not with or call scope as required by ECMA-262.

But due the changes to support E4X extensions such situation can only happen
when function is accessed as expression like in

var f = function() { }
...

f()

and typically it is exactly nested the functions that are accessed in this way.
So the patch adds optimized code that always check for proper thisObj to
ScriptRuntime.getValueFunctionAndThis and removes getThis and corresponding parsing/code generation code.

In this way when nested functions are accessed  as name or property no checks are done for them and Rhino code slightly shrinks.
2004-08-27 11:37:17 +00:00