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:
igor%mir2.org 2002-12-04 09:49:07 +00:00
Родитель b04e4cb40c
Коммит 87b0cf6408
2 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -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;