Patch from Attila Szegedi <szegedia@freemail.hu> to adress bug 264637 :

Reducing InterpretedFunction footprint
This commit is contained in:
igor%mir2.org 2004-10-17 14:18:19 +00:00
Родитель cc626c7883
Коммит bf7c485bb4
4 изменённых файлов: 5 добавлений и 4 удалений

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

@ -44,7 +44,6 @@ final class InterpretedFunction extends NativeFunction implements Script
SecurityController securityController; SecurityController securityController;
Object securityDomain; Object securityDomain;
Scriptable[] functionRegExps; Scriptable[] functionRegExps;
boolean evalScriptFlag; // true if script corresponds to eval() code
private InterpretedFunction(InterpreterData idata, private InterpretedFunction(InterpreterData idata,
Object staticSecurityDomain) Object staticSecurityDomain)

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

@ -2134,7 +2134,7 @@ public class Interpreter
InterpretedFunction fn; InterpretedFunction fn;
fn = InterpretedFunction.createFunction(cx, scope, parent, index); fn = InterpretedFunction.createFunction(cx, scope, parent, index);
ScriptRuntime.initFunction(cx, scope, fn, fn.idata.itsFunctionType, ScriptRuntime.initFunction(cx, scope, fn, fn.idata.itsFunctionType,
parent.evalScriptFlag); parent.idata.evalScriptFlag);
} }
static Object interpret(InterpretedFunction ifun, static Object interpret(InterpretedFunction ifun,
@ -3663,7 +3663,7 @@ switch (op) {
} else { } else {
scope = callerScope; scope = callerScope;
ScriptRuntime.initScript(fnOrScript, thisObj, cx, scope, ScriptRuntime.initScript(fnOrScript, thisObj, cx, scope,
fnOrScript.evalScriptFlag); fnOrScript.idata.evalScriptFlag);
} }
if (idata.itsNestedFunctions != null) { if (idata.itsNestedFunctions != null) {

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

@ -118,6 +118,8 @@ final class InterpreterData implements Serializable, DebuggableScript
InterpreterData parentData; InterpreterData parentData;
boolean evalScriptFlag; // true if script corresponds to eval() code
public boolean isTopLevel() public boolean isTopLevel()
{ {
return topLevel; return topLevel;

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

@ -2201,7 +2201,7 @@ public class ScriptRuntime {
// mode. // mode.
Script script = cx.compileString((String)x, new Interpreter(), Script script = cx.compileString((String)x, new Interpreter(),
reporter, sourceName, 1, null); reporter, sourceName, 1, null);
((InterpretedFunction)script).evalScriptFlag = true; ((InterpretedFunction)script).idata.evalScriptFlag = true;
// if the compile fails, an error has been reported by the // if the compile fails, an error has been reported by the
// compiler, but we need to stop execution to avoid // compiler, but we need to stop execution to avoid