зеркало из https://github.com/mozilla/pluotsorbet.git
Terminate execution when there's only one frame left
This commit is contained in:
Родитель
e1390b706c
Коммит
0162737534
|
@ -134,7 +134,9 @@ Context.prototype.execute = function(stopFrame) {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
} while (this.current() !== stopFrame);
|
||||
} while (this.frames.length !== 1);
|
||||
|
||||
this.frames.pop();
|
||||
}
|
||||
|
||||
Context.prototype.start = function(stopFrame) {
|
||||
|
@ -159,7 +161,10 @@ Context.prototype.start = function(stopFrame) {
|
|||
}
|
||||
Instrument.callPauseHooks(ctx.current());
|
||||
|
||||
if (ctx.current() === stopFrame) {
|
||||
// If there's one frame left, we're back to
|
||||
// the method that created the thread and
|
||||
// we're done.
|
||||
if (ctx.frames.length === 1) {
|
||||
ctx.kill();
|
||||
return;
|
||||
}
|
||||
|
|
12
vm.js
12
vm.js
|
@ -1077,9 +1077,9 @@ VM.execute = function(ctx) {
|
|||
if (VM.DEBUG) {
|
||||
VM.trace("return", ctx.thread.pid, frame.methodInfo);
|
||||
}
|
||||
popFrame(0);
|
||||
if (!frame.methodInfo)
|
||||
if (ctx.frames.length == 1)
|
||||
return;
|
||||
popFrame(0);
|
||||
break;
|
||||
case 0xac: // ireturn
|
||||
case 0xae: // freturn
|
||||
|
@ -1087,18 +1087,18 @@ VM.execute = function(ctx) {
|
|||
if (VM.DEBUG) {
|
||||
VM.trace("return", ctx.thread.pid, frame.methodInfo, stack[stack.length-1]);
|
||||
}
|
||||
popFrame(1);
|
||||
if (!frame.methodInfo)
|
||||
if (ctx.frames.length == 1)
|
||||
return;
|
||||
popFrame(1);
|
||||
break;
|
||||
case 0xad: // lreturn
|
||||
case 0xaf: // dreturn
|
||||
if (VM.DEBUG) {
|
||||
VM.trace("return", ctx.thread.pid, frame.methodInfo, stack[stack.length-1]);
|
||||
}
|
||||
popFrame(2);
|
||||
if (!frame.methodInfo)
|
||||
if (ctx.frames.length == 1)
|
||||
return;
|
||||
popFrame(2);
|
||||
break;
|
||||
default:
|
||||
var opName = OPCODES[op];
|
||||
|
|
Загрузка…
Ссылка в новой задаче