5969 Commits

Author SHA1 Message Date
igor%mir2.org
3fc1e8f2c8 The scope argument is removed from Context.decompileScript() since
decompilation does not depends on scope.
For compatibility the old signature is preserved as a deprecated method.


git-svn-id: svn://10.0.0.236/trunk@160756 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-14 10:28:15 +00:00
igor%mir2.org
86b75f0608 More JavaDoc comments including Context customization example
git-svn-id: svn://10.0.0.236/trunk@160755 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-14 09:01:26 +00:00
igor%mir2.org
d0e695929a Fixing broken HTML markup in JavaDoc comments.
git-svn-id: svn://10.0.0.236/trunk@160754 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-14 06:44:39 +00:00
igor%mir2.org
6d26f1266f Renaming Kit.initCauseOrNull into simple Kit.initCause and making it to
return the passed exception to allow usage like:

throw Kit.initCause(new RuntimeException("WRAPPED"), origException);


git-svn-id: svn://10.0.0.236/trunk@160751 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-13 23:45:52 +00:00
igor%mir2.org
12a4b6614e Fixing bug 255549: proper resolution of overloaded methods.
git-svn-id: svn://10.0.0.236/trunk@160730 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-13 19:31:32 +00:00
nboyd%atg.com
ae87d31326 Prepare release candidate for 1.6R1.
git-svn-id: svn://10.0.0.236/trunk@160697 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-12 02:00:09 +00:00
brendan%mozilla.org
b0ea43af3b Decompile return from try or catch with finally correctly (255245, r=shaver, a=asa).
git-svn-id: svn://10.0.0.236/trunk@160688 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-11 23:07:15 +00:00
brendan%mozilla.org
8e4956796a Fix simple-match optimization for positive and negative lookahead assertions (254296, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@160646 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-11 02:27:29 +00:00
igor%mir2.org
bea731bb62 Using explicit JavaImporter constructor to make namespace for swing and using it later with the "with" statement to get access to Java classes.
In this way the example can be used in an application that does not use ImporterTopLevel.


git-svn-id: svn://10.0.0.236/trunk@160610 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-10 16:11:13 +00:00
igor%mir2.org
345d904c02 1. Separating compilation into bytecode and wrapping it into Script and Function instances both for the interpreter and class compiler. It is possible now to serialize the compiled interpreter bytecode and then wrap it in proper security context.
The change required to move security domain information form InterpreterData to its Scriptable wrappers. To simplify it and to make the interpreted functions to behave exactly as class compiled I merged InterpretedScript into InterpretedFunction which allowed to remove many casts and discrepancies when handling script and function instances.

2. Explicitly passing Interpreter instances to Context.compile... functions to avoid changing optimization level even temporarily.

3. Uniform initialization of class compiled and interpreted functions and scripts to avoid code duplication.


git-svn-id: svn://10.0.0.236/trunk@160608 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-10 16:06:56 +00:00
igor%mir2.org
f8ee0283ff In JavaAdapter.currentFactory() do not assume that there is always active Context available and fallback to ContextFactory.getGlobal() in that case.
git-svn-id: svn://10.0.0.236/trunk@160606 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-10 15:52:19 +00:00
brendan%mozilla.org
98aac40feb Use JSPROP_SHARED for JSOP_DEFLOCALFUN-induced nested function local variable property to avoid claiming a slot later subject to reservation for a JSOP_REGEXP-induced regexp clone (254974, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@160591 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-10 05:13:17 +00:00
igor%mir2.org
3aa222957e Simpler SyntxError handling:
Since changes to fix bug 254778 made the parser the sole source of syntax error reports, it removed the need to check for errors after tree transformation.

The patch removes those checks and moves all reporting about syntax errors into omj/Parser.java.


git-svn-id: svn://10.0.0.236/trunk@160530 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-09 18:04:18 +00:00
igor%mir2.org
131a63f841 Fixing bug 254915: proper name lookup etc.
git-svn-id: svn://10.0.0.236/trunk@160525 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-09 16:57:06 +00:00
igor%mir2.org
8d126b3ff0 Top call scope tracking changes:
Since E4X implementation needs to know the activation scope for tracking of default namespaces, previously an elaborated schema was added to set/restore the activation scope which relied on the fact that scrip and function with activation record should always call special entry/exit functions.

But that does not work for functions without activation records since they never call any special entry/exit pairs. So if application call such function directly, the function would not store its top scope anywhere and the E4X subsystem would not be able to get E4X library object.

The patch fixes with introduction of 2 functions, hasTopCall and doTopCall to ScriptRuntime and adding the following code prefix to each implementation of Callable.call that can start execution of script code:

    public Object call(Context cx, Scriptable scope,
                       Scriptable thisObj, Object[] args)
        throws JavaScriptException
    {
// Prefix start
        if (!ScriptRuntime.hasTopCall(cx)) {
            return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args);
        }
// Prefix end
        ...

In this way there is always registered top scope during script execution and the previous elaborated schema became unnecessary so I reverted that part to almost pre-E4x state.


git-svn-id: svn://10.0.0.236/trunk@160512 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-09 11:00:47 +00:00
timeless%mozdev.org
6369baa290 Bug 240521 Crash [@ jsd_NewThreadState] when script is null
r=rginda sr=dmose


git-svn-id: svn://10.0.0.236/trunk@160499 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-08 19:56:49 +00:00
igor%mir2.org
037c9f8c0f Fixing bug 254778: proper treatment of labels
git-svn-id: svn://10.0.0.236/trunk@160489 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-08 13:45:09 +00:00
igor%mir2.org
089f6b0704 More switch parsing/code generation cleanups: now IRFactory constructs the proper parsed tree for the switch statement which removed the need for tree mutations in NodeTransformer and during code generation.
git-svn-id: svn://10.0.0.236/trunk@160480 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-07 20:08:38 +00:00
igor%mir2.org
c7f00880b7 Cleanup for code generation in interpreter: store itsICodeTop as instance variable to avoid clattering code with explicit passing of iCodeTop,
git-svn-id: svn://10.0.0.236/trunk@160476 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-07 15:42:13 +00:00
igor%mir2.org
da093a9768 Switch parsing cleanup including reporting syntax error on duplicated default label
git-svn-id: svn://10.0.0.236/trunk@160475 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-07 15:39:55 +00:00
igor%mir2.org
308595834c Preparations for 1.6R1
git-svn-id: svn://10.0.0.236/trunk@160449 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-06 16:05:40 +00:00
igor%mir2.org
f5c79bb6e0 Class-Path entry for Rhino: xmlbean.jar
git-svn-id: svn://10.0.0.236/trunk@160446 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-06 15:49:25 +00:00
igor%mir2.org
123432076e Cleanup of call code generation: now it is split into separated functions for optimized/standard function calls.
git-svn-id: svn://10.0.0.236/trunk@160445 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-06 15:08:38 +00:00
igor%mir2.org
590bb5f382 Removal of no longer used debug name index in Token.CALL/Token.REF_CALL: ScriptRuntime.get(Elem|Prop|Name|Value)FunctionAndThis takes care about debugging themselves.
git-svn-id: svn://10.0.0.236/trunk@160444 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-06 15:02:48 +00:00
brendan%mozilla.org
a1895165ae Fix bug 254375 by quoting negative integer property ids in js_obj_toSource.
git-svn-id: svn://10.0.0.236/trunk@160391 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-05 08:06:26 +00:00
brendan%mozilla.org
90b882af41 Remove deadwood left by last checkin (254382, r=cst).
git-svn-id: svn://10.0.0.236/trunk@160390 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-05 07:52:45 +00:00
igor%mir2.org
517d03f07c GeneratedClassLoader is API class and should be listed in apiClasses.properties
git-svn-id: svn://10.0.0.236/trunk@160388 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-05 06:06:30 +00:00
brendan%mozilla.org
65f01a3d29 Comment fixes to track bug 254067.
git-svn-id: svn://10.0.0.236/trunk@160363 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 18:40:55 +00:00
brendan%mozilla.org
8a13e960a1 JSOP_SETGVAR tweak: don't store rval needlessly in the optimized case, there's no chance it has changed.
git-svn-id: svn://10.0.0.236/trunk@160360 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 18:08:17 +00:00
brendan%mozilla.org
01497fded6 Remove bogus instanceof equivalence of distinct constructor function objects
that have the same native or script internally.  We no longer need this hack,
given regexp cloning done for precompiled scripts and functions (i.e., those
not eval'd or compile-and-go executed via a JS_Evaluate* API).

Fix a script_compile bug found during the scan of JSFRAME_EVAL occasioned by
the instanceof fix.

Bug 254067, r=shaver@mozilla.org.


git-svn-id: svn://10.0.0.236/trunk@160359 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 17:56:31 +00:00
igor%mir2.org
fbc49b9ae9 Restoring ScriptRuntime.call: BSF uses it!
git-svn-id: svn://10.0.0.236/trunk@160356 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 17:42:56 +00:00
igor%mir2.org
7bd8b80ced Allow to pass JS-wrapped instances of org.apache.xmlbeans.XmlCursor and org.apache.xmlbeans.XmlObject to XML constructor to make proper XML objects from them.
git-svn-id: svn://10.0.0.236/trunk@160354 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 17:32:48 +00:00
igor%mir2.org
4fb4ecc8b0 Preparations for Rhino 1.6R1 RC1
git-svn-id: svn://10.0.0.236/trunk@160353 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 17:28:11 +00:00
igor%mir2.org
820523d394 1. Recently introduced ScriptableObject.default(Prototype|ParentScope)() methods had problems with serialization and are removed now. XML code explicitly sets parent/prototype. To simplify that ScriptableObject now contains a special constructor taking scope and prototype arguments.
2. xml/XMLObject do not define lib() method and instead defines few abstract methods to create "with" proxies and perform addition.

3. XMLLib implementation is stored in the scope using ScriptableObject.associateValue() and does not depend on presence of proper XML object.


git-svn-id: svn://10.0.0.236/trunk@160339 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 12:54:03 +00:00
brendan%mozilla.org
f17fbb8285 Whitespace cleanup.
git-svn-id: svn://10.0.0.236/trunk@160327 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 02:28:58 +00:00
igor%mir2.org
0add72333a Preparations for 1.6R1 RC1
git-svn-id: svn://10.0.0.236/trunk@160298 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-03 17:13:40 +00:00
igor%mir2.org
e8d7e6ea9a Cosmetics: untabify
git-svn-id: svn://10.0.0.236/trunk@160235 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-02 17:49:04 +00:00
brendan%mozilla.org
3928ffaab2 Fix trunk version of patch for bug 252892 to handle JSOP_{GET,SET}GVAR (253952).
git-svn-id: svn://10.0.0.236/trunk@160233 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-02 17:17:55 +00:00
igor%mir2.org
4528aa2c7c Added runtime support to allow custom wrapping of XML objects
git-svn-id: svn://10.0.0.236/trunk@160224 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-02 14:46:33 +00:00
igor%mir2.org
32402eadcd Use ScriptRuntime.notAFunction to report bad ScriptableObject.callMethod arguments
git-svn-id: svn://10.0.0.236/trunk@160223 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-02 14:44:03 +00:00
igor%mir2.org
038e9eeb33 Explicit ScriptRuntime methods to get function and function this for all cases of method calls:
ScriptRuntime.get(Name|Prop|Elem|Value)FunctionAndThis provides uniform way to get function object and its this during function calls. It allowed to simplify handling of method calls both in interpreter and optimizer and opened a way to implement independent processing of function and property namespaces.


git-svn-id: svn://10.0.0.236/trunk@160197 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-01 23:21:17 +00:00
igor%mir2.org
627b494c93 More compatibility renames: to simplify life for applications that use old IdScriptable/IdFunction/IdFunctionMaster I farther renamed:
IdFunction -> IdFunctionObject
IdFunctionMaster -> IdFunctionCall


git-svn-id: svn://10.0.0.236/trunk@160135 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-30 13:18:30 +00:00
igor%mir2.org
4e37b2254b Compatibility rename: due to changes in IdScrittable any code that sublasses
it has to be updated. This is done for Rhino classes and since IdScriptable
is not a part of public API, it should not matter. But in reality someone can
subclass IdScriptable in application code.

To help with upgrade in such cases I renamed IdScriptable into
IdScriptableObject. In this way the application using IdScriptable code can add
old IdScriptable class to its CLASSPATH  and be able to run again without the
need to recompile/change anything in the source.


git-svn-id: svn://10.0.0.236/trunk@160128 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-30 10:31:00 +00:00
igor%mir2.org
35201173e6 The previous patch introduced regression: it is posible for slots array to be filled with slot objects and REMOVED tags. Thus getSlotPosition can loop through the whole table. This patch restores the old and proper state of affairs.
git-svn-id: svn://10.0.0.236/trunk@160127 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-30 07:52:30 +00:00
brendan%mozilla.org
340570a787 - Decorate PN_LIST nodes with pn_extra flags whose constant names describe
their meaning better, adding a flag for 'for (var x ... in o)'.
- Set these flags from the parser, in a future-proof way (|=, not =, given the
  zero initialized pn_extra flags member of pn_list).
- Test list flags in the code generator, including PNX_FORINVAR in conjunction
  with whether the for..in loop is of the oddball form 'for (var x = i in o)'.
- Thereby fix failure to emit a JSOP_DEFVAR in the case that a function wraps
  a for..in loop in a with statement (252892, r=shaver).
- The same fix cured another bug, not reported, where 'for (var x = i in o)'
  in a function without any 'with' statement would emit the wrong opcode
  (JSOP_FORNAME, not JSOP_FORVAR).


git-svn-id: svn://10.0.0.236/trunk@160101 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-30 00:00:09 +00:00
igor%mir2.org
b5c4423136 Using single ScriptRuntime.toStringIdOrIndex to convert object id to string of index key instead of multiple calls to getStringId/getIntId.
git-svn-id: svn://10.0.0.236/trunk@160089 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 22:47:05 +00:00
igor%mir2.org
49dcb980fb Calling proper ScriptRuntime.call taking scope argument instead of eprectaed old form.
git-svn-id: svn://10.0.0.236/trunk@160088 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 22:44:45 +00:00
igor%mir2.org
6a6aa0487b New "scratch" field for int indexes to allow to return more then one result from index parsing functions.
git-svn-id: svn://10.0.0.236/trunk@160086 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 22:42:50 +00:00
igor%mir2.org
31a989f895 Explicitly throw IllegalStateException to indicate code bug when hashtable scan end up in infinite loop.
git-svn-id: svn://10.0.0.236/trunk@160085 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 22:40:47 +00:00
brendan%mozilla.org
0144b0c6a4 Improve JSRESOLVE_DETECTING to handle typeof, ==, !=, etc.; don't give undefined property strict warning for detecting cases (253150, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@160075 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 20:44:20 +00:00