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