Conflicts:
	native.js
This commit is contained in:
Marco Castelluccio 2014-10-14 15:45:32 -07:00
Родитель 824c3fa01c eecf45cc06
Коммит 118a04612d
2 изменённых файлов: 25 добавлений и 27 удалений

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

@ -141,38 +141,36 @@ Context.prototype.execute = function() {
Context.prototype.start = function() {
var ctx = this;
window.setZeroTimeout(function() {
Instrument.callResumeHooks(ctx.current());
try {
VM.execute(ctx);
} catch (e) {
switch (e) {
case VM.Yield:
break;
case VM.Pause:
Instrument.callPauseHooks(ctx.current());
return;
default:
console.info(e);
throw e;
}
}
Instrument.callPauseHooks(ctx.current());
// 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();
Instrument.callResumeHooks(ctx.current());
try {
VM.execute(ctx);
} catch (e) {
switch (e) {
case VM.Yield:
break;
case VM.Pause:
Instrument.callPauseHooks(ctx.current());
return;
default:
console.info(e);
throw e;
}
}
Instrument.callPauseHooks(ctx.current());
ctx.start();
});
// 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;
}
ctx.resume();
}
Context.prototype.resume = function() {
this.start();
window.setZeroTimeout(this.start.bind(this));
}
Context.prototype.block = function(obj, queue, lockLevel) {

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

@ -486,7 +486,7 @@ Native.create("java/lang/Thread.start0.()V", function(ctx) {
});
ctx.frames.push(new Frame(syntheticMethod, [ this ], 0));
ctx.start();
ctx.resume();
});
Native.create("java/lang/Thread.internalExit.()V", function(ctx) {