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
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
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.comsr=bzbarsky@mit.edumoa=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
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
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
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
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
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
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
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
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
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
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