renaming callsBeforeTrampoline to cbt

This commit is contained in:
Danny Yoo 2011-09-09 16:01:00 -04:00
parent 690e3a423c
commit 6d3a945478
4 changed files with 10 additions and 10 deletions

View File

@ -198,11 +198,11 @@ EOF
(define (default-assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op) (define (default-assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op)
(cond (cond
[(set-contains? function-entry-and-exit-names (BasicBlock-name a-basic-block)) [(set-contains? function-entry-and-exit-names (BasicBlock-name a-basic-block))
(fprintf op "var ~a=function(M){if(--M.callsBeforeTrampoline<0){throw ~a;}\n" (fprintf op "var ~a=function(M){if(--M.cbt<0){throw ~a;}\n"
(assemble-label (make-Label (BasicBlock-name a-basic-block))) (assemble-label (make-Label (BasicBlock-name a-basic-block)))
(assemble-label (make-Label (BasicBlock-name a-basic-block))))] (assemble-label (make-Label (BasicBlock-name a-basic-block))))]
[else [else
(fprintf op "var ~a=function(M){--M.callsBeforeTrampoline<0;\n" (fprintf op "var ~a=function(M){--M.cbt<0;\n"
(assemble-label (make-Label (BasicBlock-name a-basic-block))))]) (assemble-label (make-Label (BasicBlock-name a-basic-block))))])
(assemble-block-statements (BasicBlock-name a-basic-block) (assemble-block-statements (BasicBlock-name a-basic-block)
(BasicBlock-stmts a-basic-block) (BasicBlock-stmts a-basic-block)

View File

@ -155,7 +155,7 @@
module-requires)) module-requires))
(let ([module-body-text (let ([module-body-text
(format " (format "
if(--M.callsBeforeTrampoline<0) { throw arguments.callee; } if(--M.cbt<0) { throw arguments.callee; }
var modrec = M.modules[~s]; var modrec = M.modules[~s];
var exports = {}; var exports = {};
modrec.isInvoked = true; modrec.isInvoked = true;

View File

@ -61,7 +61,7 @@
// I'd personally love for this to be a macro and avoid the // I'd personally love for this to be a macro and avoid the
// extra function call here. // extra function call here.
var finalizeClosureCall = function (MACHINE) { var finalizeClosureCall = function (MACHINE) {
MACHINE.callsBeforeTrampoline--; MACHINE.cbt--;
var returnArgs = [].slice.call(arguments, 1); var returnArgs = [].slice.call(arguments, 1);
// clear out stack space // clear out stack space
@ -323,7 +323,7 @@
return makeClosure(name, return makeClosure(name,
arity, arity,
function(M) { function(M) {
--M.callsBeforeTrampoline; --M.cbt;
M.val = f(M); M.val = f(M);
M.env.length -= M.argcount; M.env.length -= M.argcount;
return M.control.pop().label(M); return M.control.pop().label(M);

View File

@ -186,7 +186,7 @@
var defaultCurrentPrintImplementation = function defaultCurrentPrintImplementation(MACHINE) { var defaultCurrentPrintImplementation = function defaultCurrentPrintImplementation(MACHINE) {
if(--MACHINE.callsBeforeTrampoline < 0) { if(--MACHINE.cbt < 0) {
throw defaultCurrentPrintImplementation; throw defaultCurrentPrintImplementation;
} }
var oldArgcount = MACHINE.argcount; var oldArgcount = MACHINE.argcount;
@ -211,7 +211,7 @@
// The MACHINE // The MACHINE
var Machine = function() { var Machine = function() {
this.callsBeforeTrampoline = STACK_LIMIT_ESTIMATE; this.cbt = STACK_LIMIT_ESTIMATE; // calls before trampoline
this.val = undefined; // value register this.val = undefined; // value register
this.proc = undefined; // procedure register this.proc = undefined; // procedure register
this.argcount = undefined; // argument count this.argcount = undefined; // argument count
@ -446,7 +446,7 @@
Machine.prototype.trampoline = function(initialJump) { Machine.prototype.trampoline = function(initialJump) {
var thunk = initialJump; var thunk = initialJump;
var startTime = (new Date()).valueOf(); var startTime = (new Date()).valueOf();
this.callsBeforeTrampoline = STACK_LIMIT_ESTIMATE; this.cbt = STACK_LIMIT_ESTIMATE;
this.params.numBouncesBeforeYield = this.params.numBouncesBeforeYield =
this.params.maxNumBouncesBeforeYield; this.params.maxNumBouncesBeforeYield;
this.running = true; this.running = true;
@ -478,7 +478,7 @@
// The running flag is set to false. // The running flag is set to false.
if (typeof(e) === 'function') { if (typeof(e) === 'function') {
thunk = e; thunk = e;
this.callsBeforeTrampoline = STACK_LIMIT_ESTIMATE; this.cbt = STACK_LIMIT_ESTIMATE;
if (this.params.numBouncesBeforeYield-- < 0) { if (this.params.numBouncesBeforeYield-- < 0) {
recomputeMaxNumBouncesBeforeYield( recomputeMaxNumBouncesBeforeYield(
@ -671,7 +671,7 @@
var si_popgoto = function(n, gotoTargetThunk) { var si_popgoto = function(n, gotoTargetThunk) {
return function(M) { return function(M) {
--M.callsBeforeTrampoline; --M.cbt;
M.env.length-=n; M.env.length-=n;
return gotoTargetThunk()(M); return gotoTargetThunk()(M);
}; };