Resolving bug 256339: interpreter does not recurse across calls to interpreted functions and scripts and instead uses explicit State object to store JS frame information. It removes the limit on maximum recursion depth in scripts.
git-svn-id: svn://10.0.0.236/trunk@161083 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2163,15 +2163,6 @@ public class Context
|
||||
{
|
||||
}
|
||||
|
||||
final void addInstructionCount(int n)
|
||||
{
|
||||
instructionCount += n;
|
||||
if (instructionCount > instructionThreshold) {
|
||||
observeInstructionCount(instructionCount);
|
||||
instructionCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public GeneratedClassLoader createClassLoader(ClassLoader parent)
|
||||
{
|
||||
return new DefiningClassLoader(parent);
|
||||
@@ -2428,7 +2419,7 @@ public class Context
|
||||
Context cx = getCurrentContext();
|
||||
if (cx == null)
|
||||
return null;
|
||||
if (cx.interpreterData != null) {
|
||||
if (cx.interpreterLineCounting != null) {
|
||||
return Interpreter.getSourcePositionFromStack(cx, linep);
|
||||
}
|
||||
/**
|
||||
@@ -2636,8 +2627,7 @@ public class Context
|
||||
Hashtable activationNames;
|
||||
|
||||
// For the interpreter to indicate line/source for error reports.
|
||||
int interpreterLineIndex;
|
||||
InterpreterData interpreterData;
|
||||
Object interpreterLineCounting;
|
||||
|
||||
// For instruction counting (interpreter only)
|
||||
int instructionCount;
|
||||
|
||||
@@ -137,11 +137,7 @@ final class InterpretedFunction extends NativeFunction implements Script
|
||||
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
||||
Object[] args)
|
||||
{
|
||||
if (!ScriptRuntime.hasTopCall(cx)) {
|
||||
return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args);
|
||||
}
|
||||
return Interpreter.interpret(cx, scope, thisObj, args, null,
|
||||
0, args.length, this);
|
||||
return Interpreter.interpret(this, cx, scope, thisObj, args);
|
||||
}
|
||||
|
||||
public Object exec(Context cx, Scriptable scope)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user