igor%mir2.org
c21ab0c7a0
FunctionObject.convertArg is split into FunctionObject.getTypeTag() and FunctionObject.convertArg version taking that tag for better error reporting and performance since the tag can be cached and an expensive sequence of if and instanceof to check for the type would be replaced by a simple switch.
2003-10-13 16:02:35 +00:00
igor%mir2.org
064afe0a07
Run ContextListener.contextCreated from Context.enter(), not Context constructor. In this way listeners will not be invoked for Context that are never associated with a thread and contextCreated will be more symmetric with Context.contextReleased.
2003-10-13 15:57:18 +00:00
igor%mir2.org
89318be0fd
Inlining code into exceMethod to shrink code size.
2003-10-13 07:30:33 +00:00
igor%mir2.org
d50209987d
In getLength check for version of compiled function, not version from the current context for consistency.
2003-10-13 07:29:43 +00:00
igor%mir2.org
27cae5bd87
In classOrNull and newInstanceOrNull catch and ignore LinkageError since it can be thrown if class links to unknown class.
2003-10-13 07:28:37 +00:00
igor%mir2.org
c23530f968
Added to build.xml the smalljar target to generate smalljs.jar. Its usage is documented in doc/footprint.html.
2003-10-12 13:45:41 +00:00
igor%mir2.org
6419c245b7
More optimizations to shrink code size.
2003-10-12 08:52:24 +00:00
igor%mir2.org
778fff4c99
Inlining of private functions and reorganization to shrink code size to offset resent Rhino size growth
2003-10-11 20:29:32 +00:00
igor%mir2.org
3cc6308b48
Using ScriptRuntime.splitSC to extract packages from semicolon-separated string instead of explicit code.
2003-10-11 20:27:08 +00:00
igor%mir2.org
0a5b59efe7
Added ScriptRuntime.splitSC
2003-10-11 20:24:27 +00:00
igor%mir2.org
bb5d66ddc1
Change JavaScriptException to include source and line information in Throwable.getMessage()
2003-10-11 19:36:25 +00:00
igor%mir2.org
6935fd4558
Optimization: for line counting use offset of line icode of interpreter instead of the line itself. In this way interpreter does not need to read encoded line data on each line marker which can occur quite frequently.
2003-10-11 19:34:29 +00:00
igor%mir2.org
fe83dbd84d
BinaryDigitReader logic is inlined in ScriptRuntime.stringToNumber removing the need in the class.
2003-10-09 17:38:34 +00:00
igor%mir2.org
4f020527c8
Use newly introduced Context.initStandardObjects(), not initStandardObjects(null) in the examples
2003-10-09 07:00:40 +00:00
igor%mir2.org
13d75fc940
Use non-static functions in Shell
2003-10-09 07:00:01 +00:00
igor%mir2.org
2aa3f1b663
Cosmetics: removal of end-of-line junk space
2003-10-09 06:57:12 +00:00
igor%mir2.org
99ad0b5fed
Use newly introduced Context.initStandardObjects(), not initStandardObjects(null) in the documentation
2003-10-09 06:55:49 +00:00
igor%mir2.org
a738d7b424
dist depends on deepclean to prevent erroneous distribution builds when ant fails to detect source code dependencies and misses recompilation.
2003-10-09 06:44:38 +00:00
igor%mir2.org
a95f9c4651
GlobalScope is a part of API now.
2003-10-09 06:42:30 +00:00
igor%mir2.org
0c39c2bd7b
Cosmetics: change argument order for package-private EcmaError constructor to it matchers other cases when a method takes line and column number.
2003-10-09 06:41:28 +00:00
igor%mir2.org
75e6970c55
Added version of Context.initStandardObjects that does not take scope as its argument.
2003-10-09 06:37:25 +00:00
igor%mir2.org
2593ae88cb
Adding getParent() to omg.debug.DebuggableScript to allow to browse whole script function tree from any function.
2003-10-01 15:03:06 +00:00
igor%mir2.org
2ab3731f6d
Cosmetics: expanding tabs
2003-10-01 15:02:09 +00:00
igor%mir2.org
002127495a
Changing ScriptRuntime.initScript to return vois since it does not and should not change scope
2003-10-01 11:55:56 +00:00
igor%mir2.org
c3fc6c32a5
Extending omj.debug.DebuggableScript interface with functions to access nested functions and check if it is top-level script.
2003-10-01 11:55:55 +00:00
igor%mir2.org
f8232c4663
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=220584 :
...
Script() result has no prototype and scope chains
Fix: initialize scope and prototype for Script instances in
NativeScript.jsConstructor
If Script is called as a constructor, it will get the proper parent and
prototype from the generic code to initialize newly constructed objects but if
it is called as a function, then it is the responsibility of the call
implementation to do the job.
2003-09-28 22:52:57 +00:00
igor%mir2.org
b74c0ad822
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=220362 :
...
Local functions lose scope when called from outside (compiled with dynamic scopes, optlevel >= 0)
Fix: ignore dynamic scope for nested functions and functions declared within
the with statement.
The patch makes optimizer to behave in the same way as the interpreter does
with regard to dynamic scope: it ignores it for nested functions and functions
declared under with statements. Now parser checks for such functions and set
new flag itsIgnoreDynamicScope in FunctionNode. The flag then checked both by
interpreter and optimizer during byte code generation.
The patch also changes slightly interaction between changing dynamic scope flag
and interpreted Script instances. Currently the dynamic flag is read during
script execution but patch changes interpreter to behave exactly as the
optimizer does: the dynamic flag only affect script compilation, changes in its
value does not affect already compiled scripts.
2003-09-28 20:01:27 +00:00
igor%mir2.org
1ef13c34c6
Self-documenting example
2003-09-28 19:49:07 +00:00
igor%mir2.org
caa446bcc0
Added msg.adapter.zero.args
2003-09-28 18:14:16 +00:00
igor%mir2.org
b976cc3dce
JavaAdapter.createAdapterCode now takes the function name to function arity instead of Scriptable object. It allows to remove a hack from optimizer/Codegen where it created a temporary Scriptable just to populate it with FunctionNode as a source of arity values thus violating requirement on types of JS values.
...
The rest of JavaAdapter code is updated to use the ned form of the method as well.
2003-09-28 18:13:51 +00:00
igor%mir2.org
0335328a4b
In ScriptRuntime.toInt32 check for Integer, not Byte when doing short-circuit optimization since Integer is always used to wrap int values.
2003-09-28 16:03:10 +00:00
igor%mir2.org
fc51c3df0e
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=220367 :
...
Fix: if in RegExpImpl.getParenSubString parens.get(i) is null, return
emptySubstring
If a branch of | with capturing () does not match , then RegExpImpl.parens will
contain null for corresponding $<group-number> according to code in
NativeRegExp.executeRegExp(). The current code does not check for a possible
null in RegExpImpl.parens when calling toString and the patch fixes that by
making sure that getParenSubString return SubString.emptySubString in such
cases.
2003-09-26 17:25:33 +00:00
igor%mir2.org
9aed8fe664
Use ScriptableObject.getPropertyIds(jsObj) to get all object ids instead of explicit working throw prototype chain.
2003-09-24 13:35:52 +00:00
igor%mir2.org
0924111af4
Optimization in getPropertyIds: since Scriptable.getIds returns unique ids, check against id duplication only if prototype chain contains more then one object with enumerable ids. It this way there is no need to allocate hash map in the common case of objects without enumerable properties on the prototype chain.
2003-09-24 13:32:42 +00:00
igor%mir2.org
f04a8dec42
Optimization in IdEnumeration: since Scriptable.getIds returns unique ids, check against id duplication only if prototype chain contains more then one object with enumerable ids. It this way there is no need to allocate hash map in the common case of objects without enumerable properties on the prototype chain.
2003-09-24 13:29:17 +00:00
igor%mir2.org
7546dbbac4
Use special subclasses of Node to represent various jumps and control structures to avoid allocating of property objects for frequently occurring parse tree nodes.
2003-09-18 16:20:32 +00:00
igor%mir2.org
7848633a4a
Mark parse subtree for finally statement with Token.FINALLY instead of using special property to mark USETEMP node.
2003-09-17 13:43:12 +00:00
igor%mir2.org
8df24a01d8
Addressing http://bugzilla.mozilla.org/show_bug.cgi?id=219055 :
...
Delay creation of NativeError wrapper for EcmaError until the exception is caught in the script.
2003-09-16 16:08:55 +00:00
igor%mir2.org
c7382925ac
Changing Main.eval implementation to use compileString/exec instead of evalString to avoid dependancy on NativeGlobal when passing explicit thisObj to Script instances when they implement Function interface which holds currently in Rhino.
2003-09-12 17:12:20 +00:00
igor%mir2.org
9aa6317814
Cosmetics: identation fixes
2003-09-12 15:04:21 +00:00
igor%mir2.org
ca657b86ae
Siplified code to extract error message from Throwable to reflect recent changes in exception-related API semantics.
2003-09-11 15:41:06 +00:00
igor%mir2.org
cf45db3956
Changing Context.newObject to use ScriptRuntime.getExistingCtor to get constructor Function instance. In this way Context.newObject will throw the same set of exceptions that other parts of Rhino will throw on bad access to constructor.
...
With this change NotAFunctionException is no longer used so it is deprecated and changed to extend from Error not Exception for source compatibility: otherwise compiler will complain about unreachable catch handler.
2003-09-10 12:44:23 +00:00
igor%mir2.org
f0adcfbccd
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=218440 :
...
Making Script implementations by Interpreter and Optimizer scope independent while keeping while still supporting compiling of regexp literals only once per Script instance.
2003-09-10 11:06:25 +00:00
igor%mir2.org
207ceb33fe
Restoring NativeJavaPackage(String) constructor as deprecated for compatibility with Batik.
2003-09-09 13:27:11 +00:00
igor%mir2.org
0296631e46
ScriptRuntime.getCatchObject is modified to allow to accept instances of EvaluatorException, not only its WrappedException subclass.
2003-09-09 13:25:15 +00:00
igor%mir2.org
68676e179e
Restoring JavaScriptException(String) as deprecated constructor for compatibility with BSF.
2003-09-09 13:22:50 +00:00
igor%mir2.org
88c394e664
Explicit separation between regexp compilation and execution: all data structures that represent compiled regexp are moved to a separated RECompiled class.
2003-09-06 15:49:05 +00:00
igor%mir2.org
31b2256d97
To construct regexp objects the generated code now calls omj.RegExpProxy instead of explicit calls to NativeRegExp constructor. It removes dependence of compiled Script instances on details of RegExp implementation.
2003-09-06 15:44:41 +00:00
igor%mir2.org
f8c669f1dd
Added ScriptRuntime.checkRegExpProxy which is used in Interpreter and NativeString to check for regexp package presence instead of own duplicating code.
...
RegExpProxy.find_split is changed to include Context argument to follow the rest of RegExpProxy functions.
2003-09-06 15:41:03 +00:00
igor%mir2.org
de7b10603e
I made most internal functions of NativeRegExp static since they do not reference NativeRegExp.
2003-09-06 12:49:07 +00:00