зеркало из https://github.com/mozilla/pjs.git
Remove closure constructor from InterpretedFunction and initialize InterpretedFunction.itsClosure constructor in Interpreter directly. This besides reducing code size will help to make fix for http://bugzilla.mozilla.org/show_bug.cgi?id=154693 smaller
This commit is contained in:
Родитель
b04e4cb40c
Коммит
87b0cf6408
|
@ -53,13 +53,6 @@ final class InterpretedFunction extends NativeFunction
|
|||
argCount = (short)itsData.argCount;
|
||||
}
|
||||
|
||||
InterpretedFunction(InterpretedFunction theOther,
|
||||
Scriptable theScope, Context cx)
|
||||
{
|
||||
this(cx, theOther.itsData);
|
||||
itsClosure = theScope;
|
||||
}
|
||||
|
||||
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
||||
Object[] args)
|
||||
throws JavaScriptException
|
||||
|
|
|
@ -2436,8 +2436,9 @@ public class Interpreter {
|
|||
break;
|
||||
case TokenStream.CLOSURE : {
|
||||
int i = getIndex(iCode, pc + 1);
|
||||
InterpretedFunction f = idata.itsNestedFunctions[i];
|
||||
InterpretedFunction closure = new InterpretedFunction(f, scope, cx);
|
||||
InterpreterData closureData = idata.itsNestedFunctions[i].itsData;
|
||||
InterpretedFunction closure = new InterpretedFunction(cx, closureData);
|
||||
closure.itsClosure = scope;
|
||||
createFunctionObject(closure, scope, idata.itsFromEvalCode);
|
||||
stack[++stackTop] = closure;
|
||||
pc += 2;
|
||||
|
|
Загрузка…
Ссылка в новой задаче