5167 Commits

Author SHA1 Message Date
brendan%mozilla.org
3d1e0a6938 Fix JS_SetTrap to cope with existing trap at same PC, overwriting its handler and closure (213841, r=self).
git-svn-id: svn://10.0.0.236/trunk@145471 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-01 23:16:04 +00:00
igor%mir2.org
0bb8f3d644 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=214608 :
The reason for the regression is that now JavaMembers.lookupClass never
attempts to reflect package-private classes. But this is wrong since even with
SecirutyManager installed JVM allows to call Class.getMethos()( and returns
list of all public methods in the class and its super classes.

The patch removes the restrictions while making JavaMembers.lookupClass much
simpler.


git-svn-id: svn://10.0.0.236/trunk@145425 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-31 17:08:58 +00:00
brendan%mozilla.org
7c3cf78ac7 Fix off-by-N in CG_COUNT_FINAL_SRCNOTES (214210).
git-svn-id: svn://10.0.0.236/trunk@145326 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-29 09:11:04 +00:00
brendan%mozilla.org
b4d3d05e3d Fix 7x bloat bug due to off-by-1-level-of-indirection in sizeof type param typo (214176, r=Mitch@0Bits.COM).
git-svn-id: svn://10.0.0.236/trunk@145281 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-28 20:58:52 +00:00
brendan%mozilla.org
89c23462fb Undo critical part of last change to try to fix crashing testerboxes.
git-svn-id: svn://10.0.0.236/trunk@145273 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-28 18:30:12 +00:00
brendan%mozilla.org
2a40dbb3c5 Minor cleanups to last checkin.
git-svn-id: svn://10.0.0.236/trunk@145263 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-28 05:46:18 +00:00
brendan%mozilla.org
2532d3d12a Big dynamic footprint win via script filename caching, plus line number fix for strict/const diags (see http://bugzilla.mozilla.org/attachment.cgi?id=127130&action=view for detailed checkin comments; 208030, r/rs=shaver, r=rginda on the jsd change, r=jst on the dom change).
git-svn-id: svn://10.0.0.236/trunk@145239 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-26 22:37:11 +00:00
igor%mir2.org
ce9a4a38b4 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=213231 :
All information about exception handlers are stored in exception table eliminating the need to have TRY bytecode.


git-svn-id: svn://10.0.0.236/trunk@145147 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-24 10:50:29 +00:00
igor%mir2.org
5d65d1a938 Work in progress on http://bugzilla.mozilla.org/show_bug.cgi?id=213231 :
Replacing try stack by static table of exception handlers


git-svn-id: svn://10.0.0.236/trunk@145146 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-24 10:46:46 +00:00
igor%mir2.org
c5866f982a Work in progress on http://bugzilla.mozilla.org/show_bug.cgi?id=213231 :
When handling exceptions, restore proper scope without using try stack


git-svn-id: svn://10.0.0.236/trunk@145145 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-24 10:45:30 +00:00
igor%mir2.org
39c85873cb Restoring NativeJavaMethod(Method, String) for backward compatibility.
git-svn-id: svn://10.0.0.236/trunk@145143 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-24 09:06:44 +00:00
caillon%returnzero.com
cd46cbbaad Bug 83536.
Merge script principal implementations into one class.
Should reduce footprint, speed up calls to caps a little bit, and fixes several memory leaks.
Also fixes bugs 211174 and 211263
r=jst@netscape.com
sr=bzbarsky@mit.edu
moa=mstoltz@netscape.com (he looked at an earlier patch and said it looked fine, and will do a retroactive review when he returns from vacation as well)


git-svn-id: svn://10.0.0.236/trunk@145137 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-24 05:15:20 +00:00
mkaply%us.ibm.com
da4cdd7619 rs=leaf
Remove XP_OS2_VACPP from the tree


git-svn-id: svn://10.0.0.236/trunk@145083 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 21:08:40 +00:00
mkaply%us.ibm.com
6b6c9782b6 rs=leaf
Remove XP_OS2_VACPP from the tree


git-svn-id: svn://10.0.0.236/trunk@145081 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 20:29:43 +00:00
mkaply%us.ibm.com
bd3b62e584 rs=leaf
Remove XP_OS2_VACPP from the tree


git-svn-id: svn://10.0.0.236/trunk@145075 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 18:38:01 +00:00
igor%mir2.org
c554efa163 Move code to adjust stack depth for finally handler from TARGET case of the main switch in generateICode to TRY switch generating all the code for try. It allows to remove special marking of JSR targets with FINALLY_PROP and make stack handling for catch and finally block uniform.
git-svn-id: svn://10.0.0.236/trunk@145054 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 13:41:35 +00:00
igor%mir2.org
9d00a6612f Removal of JTHROW byte code: instead of generation byte code pair [GOSUB exception handler], JTHROW, RETSUB from finally now supports re-throwing of exception object directly when called from exception handler.
Now the exception handler invokes finally code with the exception object on the stack top, not PC to return which allows RETSUB to distinguish between this and GOSUB invocation.


git-svn-id: svn://10.0.0.236/trunk@145053 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 13:04:07 +00:00
igor%mir2.org
d94a23acf9 Move ENDTRY, JTHROW, GOSUB and RETSUB from TokenStream to Interpreter as they specific only to Interpreter implementation.
git-svn-id: svn://10.0.0.236/trunk@145051 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 11:16:54 +00:00
igor%mir2.org
ffed4ae784 Removal of code to handle stack chages when generationg GOSUB to finally code for finally handler: the stack size adjustments is done during FINALLY code generation already.
git-svn-id: svn://10.0.0.236/trunk@145050 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 08:58:08 +00:00
igor%mir2.org
1ddaeb9422 When generating code to invoke finally block from exception handler, do not store exception object in the local slot but rather leave it on JS stack and update finally block generation to expect potentially 2 objects on stack, not single return pc address.
git-svn-id: svn://10.0.0.236/trunk@145019 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-21 16:27:48 +00:00
igor%mir2.org
2d38fcee15 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=201893 :
New class MemberBox wraps Method or Constructor instances to cache results of getParameterType() and other information and to to replace Method instance by more accessible one recovery from IllegalAccessException is possible.


git-svn-id: svn://10.0.0.236/trunk@144888 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-15 20:47:29 +00:00
igor%mir2.org
3c356fefa7 Cosmetics: layot fixes
git-svn-id: svn://10.0.0.236/trunk@144887 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-15 20:44:17 +00:00
timeless%mozdev.org
a4187e9d07 Bug 212287 xpcwrappedjsclass.cpp:891: warning: unused variable `PRUnichar * sourceNameUni'
r=dbradley sr=kin


git-svn-id: svn://10.0.0.236/trunk@144844 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-14 21:13:46 +00:00
timeless%mozdev.org
92a2cf7628 Bug 212266 xpcexception.cpp:236: warning: assignment of negative value -1' to unsigned int'
r=dbradley sr=kin


git-svn-id: svn://10.0.0.236/trunk@144841 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-14 21:12:24 +00:00
jaggernaut%netscape.com
95a2235bee Bug 73353: clean up MODULE/REQUIRES story. r=cls, sr=bryner
git-svn-id: svn://10.0.0.236/trunk@144804 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-13 22:29:00 +00:00
igor%mir2.org
eeafbe31a6 Throw IllegalArgumentException from compileString/compileReader if script line number is negative instead of catching it much later via Context.codeBug().
git-svn-id: svn://10.0.0.236/trunk@144650 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-09 19:27:46 +00:00
igor%mir2.org
1143cfe592 1. To evaluate script represented by String, use Context.evaluateString to avoid the need to create StringReader instances.
2. Catch VirtualMachineError so on out-of-memory/stack-overflow the shell will exit with System.exit(EXITCODE_RUNTIME_ERROR), not with 1. It will allow to distinguish cases when script tried to consume all available stack/memory with bugs in Rhino itself leading to NullPointerException etc.

3. Remove code to rethrow ThreadDeath from JavaScriptExcception since ThreadDeath is re-thrown by the engine itself.


git-svn-id: svn://10.0.0.236/trunk@144504 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 19:21:42 +00:00
igor%mir2.org
c3dca37870 Caching of Method/Constructor.getParameterType()
To avoid constant calling of Method/Constructor.getParameterType() which creates a new Class array on each call, NativeJavaMethod stores the parameter types for its methods in methodTypes array and similarly JavaMembers holds all constructor types in ctorTypes array. The cached Class arrays are passed explicitly to methods that previously called getParameterType().


git-svn-id: svn://10.0.0.236/trunk@144502 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 19:07:00 +00:00
igor%mir2.org
0a67419150 Cosmetics: use
import java.lang.reflect.*;
import java.io.*;

instead of explicit importing multiple classes.


git-svn-id: svn://10.0.0.236/trunk@144501 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 19:02:03 +00:00
igor%mir2.org
6a25d4e536 NativeJavaMethod.add is removed. It allows to assume that after NativeJavaMethod constructor methods array will remain the same, which I will use in the following patch to add caching of Method.getParameterTypes.
Instead of calling NativeJavaMethod.add, JavaMembers assemble the method list directly and then pass it to NativeJavaMethod when done.


git-svn-id: svn://10.0.0.236/trunk@144500 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 18:59:30 +00:00
igor%mir2.org
46eea78087 Pass staticType to wrapAsJavaObject to restore an option to use it for reflection instead of dynamicType if a security manager prevents the later
git-svn-id: svn://10.0.0.236/trunk@144499 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 18:51:54 +00:00
igor%mir2.org
4983e29d85 More JavaMembers cosmetics:
1. All its methods package private methods that are not accesible outside the class itself are made private.

2. Various package-private getters are removed in favor of direct field access.


git-svn-id: svn://10.0.0.236/trunk@144498 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 18:51:53 +00:00
igor%mir2.org
3827a12fe1 1. Changing NativeJavaMethod.findFunction to return index of found method instead of the method itself to make smaller the following optimizations of findFunction.
2. Removal of NativeJavaMethod.getMethod that simply returned package-private field NativeJavaMethod.methods since the filed itself was accessed directly by other files.


git-svn-id: svn://10.0.0.236/trunk@144482 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-05 22:13:33 +00:00
igor%mir2.org
7a57a93cb3 Added reportRuntimeError4 and getMessage4 to build 4-argument messages
git-svn-id: svn://10.0.0.236/trunk@144481 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-05 22:05:55 +00:00
igor%mir2.org
ae1be79993 For compatibility, resurrect unwrap as deprecated method.
git-svn-id: svn://10.0.0.236/trunk@144440 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-03 18:51:16 +00:00
pschwartau%netscape.com
d9f113724b Initial add. Regression test for bug 210682.
git-svn-id: svn://10.0.0.236/trunk@144410 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 23:43:09 +00:00
igor%mir2.org
f44b752b1d Added public FunctionObject.getMethodOrConstructor() to resolve
http://bugzilla.mozilla.org/show_bug.cgi?id=108719


git-svn-id: svn://10.0.0.236/trunk@144397 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 21:07:44 +00:00
igor%mir2.org
362db2c7fa Do not store dynamic scope flag in the object. Instead when checking thisObj against Java this type use scope != getParentScope() to detect such usage.
git-svn-id: svn://10.0.0.236/trunk@144391 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 19:41:48 +00:00
igor%mir2.org
e8b375fdbd Updating exception debugging to reflect changes due to http://bugzilla.mozilla.org/show_bug.cgi?id=210605 .
git-svn-id: svn://10.0.0.236/trunk@144385 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 16:37:29 +00:00
igor%mir2.org
6aa94c183c Reorganization of Java and JavaScript exception iteraction. See http://bugzilla.mozilla.org/show_bug.cgi?id=210605 for details.
git-svn-id: svn://10.0.0.236/trunk@144384 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 16:35:51 +00:00
igor%mir2.org
427a1c180b 1. Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=102093 :
In NativeCall constructor adds argument object only if there is no parameters with this name and similarly do not set arguments to undefined if the function has "var arguments".

2. Split NativeCall into NativeCall and NativeCallPrototype to allow for smaller activation objects with faster property access.


git-svn-id: svn://10.0.0.236/trunk@144383 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 16:31:54 +00:00
igor%mir2.org
2aa099367d Cosmetics: end-of-line junk space removal
git-svn-id: svn://10.0.0.236/trunk@144337 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-01 07:18:07 +00:00
igor%mir2.org
d8ecf080df Teach Committing.generateCatchBlock() to generate catch blocks for EcmaError exceptions to avoid code duplication.
git-svn-id: svn://10.0.0.236/trunk@144294 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-30 20:21:32 +00:00
igor%mir2.org
4d2a0296fd The code to deal with caught Java exceptions and transfer control to script finally/catch is transfered to CATCH bytecode which is now always added to the and of script bytecode. In this way if Context.observeInstructionCount throws an exception, a proper cleanup to restore Interpreter runtime will still be carried out. It also allowed to transfer control directly to catch/finally code when script call throw instead of throwing Java exception just to capture it immediately.
This special CATCH bytecode is a simple way to workaround lack of goto in Java which makes writing interpreters more complex then necessary...


git-svn-id: svn://10.0.0.236/trunk@144290 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-30 19:31:44 +00:00
igor%mir2.org
a322776811 Added ScriptRuntime.getCatchObject() for extracting JS object to pass as the argument to JS catch statement.
git-svn-id: svn://10.0.0.236/trunk@144288 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-30 19:21:41 +00:00
igor%mir2.org
88b2198aad Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=210682 :
A slightly modified version of Brian Gugliemetti fix for bad interaction in TokenStream.getToken()/peekTokenSameLine() when dealing with EOL.


git-svn-id: svn://10.0.0.236/trunk@144287 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-30 19:18:31 +00:00
igor%mir2.org
02f28b2721 Removal of deprecated DefiningClassLoader
git-svn-id: svn://10.0.0.236/trunk@144255 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-29 22:32:52 +00:00
igor%mir2.org
92c4314b86 Exception handling cleanup: use CATCH bytecode to extract JS object from Trowable so any exception that happens during this process will be handled properly.
git-svn-id: svn://10.0.0.236/trunk@144254 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-29 22:12:48 +00:00
igor%mir2.org
e11d03e1fc Cosmetics: removal of unused import
git-svn-id: svn://10.0.0.236/trunk@144253 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-29 21:58:01 +00:00
brendan%mozilla.org
9c5c437060 Argh, inverted logic bug.
git-svn-id: svn://10.0.0.236/trunk@144240 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-28 00:55:12 +00:00