There is something very suspicious happening with makeRestartFunction where the env and control are being munged, but I haven't been able to trace where yet.
This commit is contained in:
parent
7f0fe7516b
commit
23d4c27c2b
|
@ -194,9 +194,7 @@
|
|||
|
||||
var alreadyReleased = false;
|
||||
|
||||
// Allow for re-entrancy if the id is the same as the
|
||||
// entity who is locking.
|
||||
if (this.locked === false || this.locked === id) {
|
||||
if (this.locked === false) {
|
||||
this.locked = id;
|
||||
onAcquire.call(
|
||||
that,
|
||||
|
@ -455,9 +453,8 @@
|
|||
MACHINE.exclusiveLock.acquire(
|
||||
'scheduleTrampoline',
|
||||
function(release) {
|
||||
release();
|
||||
if (before) { before(); }
|
||||
MACHINE.trampoline(f);
|
||||
MACHINE._trampoline(f, false, release);
|
||||
});
|
||||
},
|
||||
0);
|
||||
|
@ -468,8 +465,16 @@
|
|||
// Meant to be used only by the trampoline.
|
||||
var makeRestartFunction = function(MACHINE) {
|
||||
var oldArgcount = MACHINE.a;
|
||||
var oldEnv = MACHINE.e.slice();
|
||||
var oldControl = MACHINE.c.slice();
|
||||
return function(f) {
|
||||
return scheduleTrampoline(MACHINE, f, function() { MACHINE.a = oldArgcount; });
|
||||
MACHINE.exclusiveLock.acquire(undefined,
|
||||
function(release) {
|
||||
MACHINE.a = oldArgcount;
|
||||
MACHINE.e = oldEnv;
|
||||
MACHINE.c = oldControl;
|
||||
MACHINE._trampoline(f, false, release);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -505,6 +510,12 @@
|
|||
that.exclusiveLock.acquire(
|
||||
'trampoline',
|
||||
function(release) {
|
||||
that._trampoline(initialJump, noJumpingOff, release);
|
||||
});
|
||||
};
|
||||
|
||||
Machine.prototype._trampoline = function(initialJump, noJumpingOff, release) {
|
||||
var that = this;
|
||||
var thunk = initialJump;
|
||||
var startTime = (new Date()).valueOf();
|
||||
that.cbt = STACK_LIMIT_ESTIMATE;
|
||||
|
@ -580,9 +591,10 @@
|
|||
that.params.currentSuccessHandler(that);
|
||||
release();
|
||||
return;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
// recomputeGas: state number -> number
|
||||
recomputeMaxNumBouncesBeforeYield = function(MACHINE, observedDelay) {
|
||||
// We'd like to see a delay of DESIRED_DELAY_BETWEEN_BOUNCES so
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
(provide version)
|
||||
(: version String)
|
||||
|
||||
(define version "1.101")
|
||||
(define version "1.102")
|
||||
|
|
Loading…
Reference in New Issue
Block a user