From 18dc52b1300a0d710094d8ba5ed4fd4e7ba32804 Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Tue, 10 Jun 2003 06:26:06 +0000 Subject: [PATCH] Fixed compile errors git-svn-id: svn://10.0.0.236/trunk@143498 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js2/src/js2engine.cpp | 5 +++-- mozilla/js2/src/js2engine.h | 2 +- mozilla/js2/src/js2metadata.cpp | 2 +- mozilla/js2/src/js2op_invocation.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mozilla/js2/src/js2engine.cpp b/mozilla/js2/src/js2engine.cpp index df13b534a50..f964db4c313 100644 --- a/mozilla/js2/src/js2engine.cpp +++ b/mozilla/js2/src/js2engine.cpp @@ -67,7 +67,7 @@ namespace MetaData { js2val JS2Engine::interpret(Phase execPhase, BytecodeContainer *targetbCon, Environment *env) { packageFrame = env->getPackageFrame(); - jsr(execPhase, targetbCon, sp - execStack, JS2VAL_VOID, env); + jsr(execPhase, targetbCon, sp - execStack, JS2VAL_VOID, env, NULL); ActivationFrame *f = activationStackTop; js2val result; try { @@ -1028,7 +1028,7 @@ namespace MetaData { // Save current engine state (pc, environment top) and // jump to start of new bytecodeContainer - void JS2Engine::jsr(Phase execPhase, BytecodeContainer *new_bCon, uint32 stackBase, js2val returnVal, Environment *env) + void JS2Engine::jsr(Phase execPhase, BytecodeContainer *new_bCon, uint32 stackBase, js2val returnVal, Environment *env, ParameterFrame *pFrame) { if (activationStackTop >= (activationStack + MAX_ACTIVATION_STACK)) meta->reportError(Exception::internalError, "out of activation stack", meta->engine->errorPos()); @@ -1042,6 +1042,7 @@ namespace MetaData { activationStackTop->topFrame = env->getTopFrame(); // remember how big the new env. is supposed to be so that local frames don't accumulate activationStackTop->localFrame = localFrame; activationStackTop->parameterFrame = parameterFrame; +// if (pFrame && pFrame->) activationStackTop++; if (new_bCon) { bCon = new_bCon; diff --git a/mozilla/js2/src/js2engine.h b/mozilla/js2/src/js2engine.h index af330c4771e..94897464512 100644 --- a/mozilla/js2/src/js2engine.h +++ b/mozilla/js2/src/js2engine.h @@ -313,7 +313,7 @@ public: NonWithFrame *localFrame; ParameterFrame *parameterFrame; }; - void jsr(Phase execPhase, BytecodeContainer *bCon, uint32 stackBase, js2val returnVal, Environment *env); + void jsr(Phase execPhase, BytecodeContainer *bCon, uint32 stackBase, js2val returnVal, Environment *env, ParameterFrame *pFrame); bool activationStackEmpty() { return (activationStackTop == activationStack); } void rts(); ActivationFrame *activationStack; diff --git a/mozilla/js2/src/js2metadata.cpp b/mozilla/js2/src/js2metadata.cpp index a93ac076700..83541804176 100644 --- a/mozilla/js2/src/js2metadata.cpp +++ b/mozilla/js2/src/js2metadata.cpp @@ -3593,7 +3593,7 @@ rescan: return argv[0]; // need to reset the environment to the one in operation when eval was called so // that eval code can affect the apppropriate scopes. - meta->engine->jsr(meta->engine->phase, NULL, meta->engine->sp - meta->engine->execStack, JS2VAL_VOID, meta->engine->activationStackTop[-1].env); + meta->engine->jsr(meta->engine->phase, NULL, meta->engine->sp - meta->engine->execStack, JS2VAL_VOID, meta->engine->activationStackTop[-1].env, NULL); // meta->engine->localFrame = meta->engine->activationStackTop[-1].localFrame; js2val result = meta->readEvalString(*meta->toString(argv[0]), widenCString("Eval Source")); meta->engine->rts(); diff --git a/mozilla/js2/src/js2op_invocation.cpp b/mozilla/js2/src/js2op_invocation.cpp index f1108439ccf..ad723743431 100644 --- a/mozilla/js2/src/js2op_invocation.cpp +++ b/mozilla/js2/src/js2op_invocation.cpp @@ -86,7 +86,7 @@ baseVal = OBJECT_TO_JS2VAL(new (meta) SimpleInstance(meta, protoVal, meta->objectType(protoVal))); pFrame->thisObject = baseVal; pFrame->assignArguments(meta, obj, base(argCount), argCount, length); - jsr(phase, fWrap->bCon, base(argCount + 1) - execStack, baseVal, fWrap->env); // seems out of order, but we need to catch the current top frame + jsr(phase, fWrap->bCon, base(argCount + 1) - execStack, baseVal, fWrap->env, pFrame); meta->env->addFrame(pFrame); parameterFrame = pFrame; pFrame = NULL; @@ -132,7 +132,7 @@ doCall: push(JS2VAL_UNDEFINED); argCount++; } - jsr(phase, NULL, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env); + jsr(phase, NULL, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env, NULL); if (fWrap->alien) a = fWrap->alien(meta, fInst, a, base(argCount), argc); else @@ -147,7 +147,7 @@ doCall: pFrame->thisObject = a; // XXX (use fWrap->compileFrame->signature) pFrame->assignArguments(meta, fObj, base(argCount), argCount, length); - jsr(phase, fWrap->bCon, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env); + jsr(phase, fWrap->bCon, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env, pFrame); if (fInst->isMethodClosure) meta->env->addFrame(meta->objectType(a)); meta->env->addFrame(pFrame); @@ -155,7 +155,7 @@ doCall: pFrame = NULL; } else { - jsr(phase, fWrap->bCon, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env); + jsr(phase, fWrap->bCon, base(argCount + 2) - execStack, JS2VAL_VOID, fWrap->env, pFrame); // XXX constructing a parameterFrame only for the purpose of holding the 'this' // need to find a more efficient way of stashing 'this' // used to be : "meta->env->addFrame(fWrap->compileFrame->prototype);"