renaming control to c
This commit is contained in:
parent
cb592460f0
commit
e0f2502b18
|
@ -103,7 +103,7 @@
|
|||
|
||||
(: assemble-control-frame-temporary (ControlFrameTemporary -> String))
|
||||
(define (assemble-control-frame-temporary t)
|
||||
(format "M.control[M.control.length-1].~a"
|
||||
(format "M.c[M.c.length-1].~a"
|
||||
(ControlFrameTemporary-name t)))
|
||||
|
||||
;; fixme: use js->string
|
||||
|
@ -313,12 +313,12 @@
|
|||
|
||||
(: assemble-control-stack-label (ControlStackLabel -> String))
|
||||
(define (assemble-control-stack-label a-csl)
|
||||
"M.control[M.control.length-1].label")
|
||||
"M.c[M.c.length-1].label")
|
||||
|
||||
|
||||
(: assemble-control-stack-label/multiple-value-return (ControlStackLabel/MultipleValueReturn -> String))
|
||||
(define (assemble-control-stack-label/multiple-value-return a-csl)
|
||||
"M.control[M.control.length-1].label.mvr")
|
||||
"M.c[M.c.length-1].label.mvr")
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
","))]
|
||||
|
||||
[(SetFrameCallee!? op)
|
||||
(format "M.control[M.control.length-1].proc=~a;"
|
||||
(format "M.c[M.c.length-1].proc=~a;"
|
||||
(assemble-oparg (SetFrameCallee!-proc op)))]
|
||||
|
||||
[(SpliceListIntoStack!? op)
|
||||
|
@ -112,7 +112,7 @@
|
|||
|
||||
[(InstallContinuationMarkEntry!? op)
|
||||
(string-append "M.installContinuationMarkEntry("
|
||||
"M.control[M.control.length-1].pendingContinuationMarkKey,"
|
||||
"M.c[M.c.length-1].pendingContinuationMarkKey,"
|
||||
"M.val);")]
|
||||
|
||||
[(RaiseContextExpectedValuesError!? op)
|
||||
|
|
|
@ -483,10 +483,10 @@ EOF
|
|||
(assemble-jump (GotoStatement-target stmt))]
|
||||
|
||||
[(PushControlFrame/Generic? stmt)
|
||||
"M.control.push(new RT.Frame());"]
|
||||
"M.c.push(new RT.Frame());"]
|
||||
|
||||
[(PushControlFrame/Call? stmt)
|
||||
(format "M.control.push(new RT.CallFrame(~a,M.proc));"
|
||||
(format "M.c.push(new RT.CallFrame(~a,M.proc));"
|
||||
(let: ([label : (U Symbol LinkedLabel) (PushControlFrame/Call-label stmt)])
|
||||
(cond
|
||||
[(symbol? label)
|
||||
|
@ -496,7 +496,7 @@ EOF
|
|||
|
||||
[(PushControlFrame/Prompt? stmt)
|
||||
;; fixme: use a different frame structure
|
||||
(format "M.control.push(new RT.PromptFrame(~a,~a));"
|
||||
(format "M.c.push(new RT.PromptFrame(~a,~a));"
|
||||
(let: ([label : (U Symbol LinkedLabel) (PushControlFrame/Prompt-label stmt)])
|
||||
(cond
|
||||
[(symbol? label)
|
||||
|
@ -513,7 +513,7 @@ EOF
|
|||
(assemble-oparg tag)])))]
|
||||
|
||||
[(PopControlFrame? stmt)
|
||||
"M.control.pop();"]
|
||||
"M.c.pop();"]
|
||||
|
||||
[(PushEnvironment? stmt)
|
||||
(cond [(= (PushEnvironment-n stmt) 0)
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
(function(MACHINE, EXPORTS){~a})(M, exports);
|
||||
~a
|
||||
modrec.privateExports = exports;
|
||||
return M.control.pop().label(M);"
|
||||
return M.c.pop().label(M);"
|
||||
(symbol->string name)
|
||||
text
|
||||
(get-provided-name-code bytecode))])
|
||||
|
|
|
@ -69,15 +69,15 @@
|
|||
|
||||
if (returnArgs.length === 1) {
|
||||
MACHINE.val = returnArgs[0];
|
||||
return MACHINE.control.pop().label(MACHINE);
|
||||
return MACHINE.c.pop().label(MACHINE);
|
||||
} else if (returnArgs.length === 0) {
|
||||
MACHINE.a = 0;
|
||||
return MACHINE.control.pop().label.mvr(MACHINE);
|
||||
return MACHINE.c.pop().label.mvr(MACHINE);
|
||||
} else {
|
||||
MACHINE.a = returnArgs.length;
|
||||
MACHINE.val = returnArgs.shift();
|
||||
MACHINE.e.push.apply(MACHINE.e, returnArgs.reverse());
|
||||
return MACHINE.control.pop().label.mvr(MACHINE);
|
||||
return MACHINE.c.pop().label.mvr(MACHINE);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -179,7 +179,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
MACHINE.control.push(
|
||||
MACHINE.c.push(
|
||||
new baselib.frames.CallFrame(afterGoodInvoke, v));
|
||||
MACHINE.a = arguments.length - 2;
|
||||
var i;
|
||||
|
@ -276,7 +276,7 @@
|
|||
});
|
||||
};
|
||||
|
||||
MACHINE.control.push(
|
||||
MACHINE.c.push(
|
||||
new baselib.frames.CallFrame(afterGoodInvoke, proc));
|
||||
MACHINE.a = arguments.length - 4;
|
||||
for (i = 0; i < arguments.length - 4; i++) {
|
||||
|
@ -326,7 +326,7 @@
|
|||
--M.cbt;
|
||||
M.val = f(M);
|
||||
M.e.length -= M.a;
|
||||
return M.control.pop().label(M);
|
||||
return M.c.pop().label(M);
|
||||
},
|
||||
[]);
|
||||
};
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
MACHINE.params['currentErrorHandler'] = oldErrorHandler;
|
||||
fail(MACHINE, anError);
|
||||
};
|
||||
MACHINE.control.push(new plt.baselib.frames.CallFrame(afterGoodInvoke, null));
|
||||
MACHINE.c.push(new plt.baselib.frames.CallFrame(afterGoodInvoke, null));
|
||||
if (isInternal) {
|
||||
throw that.label;
|
||||
} else {
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
this.proc = undefined; // procedure register
|
||||
this.a = undefined; // argument count
|
||||
this.e = []; // environment
|
||||
this.control = []; // control: Arrayof (U Frame CallFrame PromptFrame)
|
||||
this.c = []; // control: Arrayof (U Frame CallFrame PromptFrame)
|
||||
this.running = false;
|
||||
this.modules = {}; // String -> ModuleRecord
|
||||
this.mainModules = []; // Arrayof String
|
||||
|
@ -293,10 +293,10 @@
|
|||
Machine.prototype.captureControl = function(skip, tag) {
|
||||
var MACHINE = this;
|
||||
var i;
|
||||
for (i = MACHINE.control.length - 1 - skip; i >= 0; i--) {
|
||||
if (MACHINE.control[i].tag === tag) {
|
||||
return MACHINE.control.slice(i + 1,
|
||||
MACHINE.control.length - skip);
|
||||
for (i = MACHINE.c.length - 1 - skip; i >= 0; i--) {
|
||||
if (MACHINE.c[i].tag === tag) {
|
||||
return MACHINE.c.slice(i + 1,
|
||||
MACHINE.c.length - skip);
|
||||
}
|
||||
}
|
||||
raise(MACHINE, new Error("captureControl: unable to find tag " + tag));
|
||||
|
@ -311,10 +311,10 @@
|
|||
Machine.prototype.restoreControl = function(tag) {
|
||||
var MACHINE = this;
|
||||
var i;
|
||||
for (i = MACHINE.control.length - 1; i >= 0; i--) {
|
||||
if (MACHINE.control[i].tag === tag) {
|
||||
MACHINE.control =
|
||||
MACHINE.control.slice(0, i+1).concat(
|
||||
for (i = MACHINE.c.length - 1; i >= 0; i--) {
|
||||
if (MACHINE.c[i].tag === tag) {
|
||||
MACHINE.c =
|
||||
MACHINE.c.slice(0, i+1).concat(
|
||||
MACHINE.e[MACHINE.e.length - 1]);
|
||||
return;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@
|
|||
|
||||
// Save the continuation mark on the top control frame.
|
||||
Machine.prototype.installContinuationMarkEntry = function(key, value) {
|
||||
var frame = this.control[this.control.length - 1];
|
||||
var frame = this.c[this.c.length - 1];
|
||||
var marks = frame.marks;
|
||||
var i;
|
||||
for (i = 0; i < marks.length; i++) {
|
||||
|
@ -375,7 +375,7 @@
|
|||
Machine.prototype.captureContinuationMarks = function() {
|
||||
var kvLists = [];
|
||||
var i;
|
||||
var control = this.control;
|
||||
var control = this.c;
|
||||
var tracedCalleeKey = getTracedCalleeKey(this);
|
||||
for (i = control.length-1; i >= 0; i--) {
|
||||
if (control[i].marks.length !== 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user