context expected becomes a superinstruction

This commit is contained in:
Danny Yoo 2011-09-09 16:19:33 -04:00
parent 6d3a945478
commit b2610e496e
3 changed files with 16 additions and 23 deletions

View File

@ -70,7 +70,7 @@
(assemble-boolean-chain "plt.baselib.numbers.greaterThanOrEqual" checked-operands)]
[(cons)
(format "RT.makePair(~a, ~a)"
(format "RT.makePair(~a,~a)"
(first checked-operands)
(second checked-operands))]
@ -93,13 +93,13 @@
(first checked-operands))]
[(null?)
(format "(~a === RT.NULL)" (first checked-operands))]
(format "(~a===RT.NULL)" (first checked-operands))]
[(not)
(format "(~a === false)" (first checked-operands))]
(format "(~a=== alse)" (first checked-operands))]
[(eq?)
(format "(~a === ~a)" (first checked-operands) (second checked-operands))])))
(format "(~a===~a)" (first checked-operands) (second checked-operands))])))
@ -163,7 +163,7 @@
(format "RT.isPair")]
[(box)
(format "RT.isBox")])])
(format "RT.testArgument(M, ~s, ~a, ~a, ~a, ~s)"
(format "RT.testArgument(M,~s,~a,~a,~a,~s)"
(symbol->string domain)
predicate
operand-string

View File

@ -180,15 +180,12 @@ EOF
(: assemble-basic-block (BasicBlock Blockht (Setof Symbol) (Setof Symbol) Output-Port -> 'ok))
(define (assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op)
(match (BasicBlock-stmts a-basic-block)
;; [(list (struct PopEnvironment (n (and (? (lambda (c) (equal? c (Const 0))))
;; skip)))
;; (struct GotoStatement ((and (? Label?)
;; target))))
;; (fprintf op "~a=RT.si_popgoto(~a,function(){return ~a});\n"
;; (assemble-label (make-Label (BasicBlock-name a-basic-block)))
;; (assemble-oparg n)
;; (assemble-label target))
;; 'ok]
[(list (struct PerformStatement ((struct RaiseContextExpectedValuesError! (expected))))
stmts ...)
(fprintf op "~a=RT.si_context_expected(~a);\n"
(assemble-label (make-Label (BasicBlock-name a-basic-block)))
expected)
'ok]
[else
(default-assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op)]))

View File

@ -668,15 +668,11 @@
//////////////////////////////////////////////////////////////////////
// Superinstructions to try to reduce code size.
var si_popgoto = function(n, gotoTargetThunk) {
return function(M) {
--M.cbt;
M.env.length-=n;
return gotoTargetThunk()(M);
};
var si_context_expected = function(n) {
if (n === 1) { return si_context_expected_1; }
return function(M) { raiseContextExpectedValuesError(M, n); }
};
var si_context_expected_1 = function(M) { raiseContextExpectedValuesError(M, 1); }
@ -815,7 +811,7 @@
exports['getTracedAppKey'] = getTracedAppKey;
exports['getTracedCalleeKey'] = getTracedCalleeKey;
exports['si_popgoto'] = si_popgoto;
exports['si_context_expected'] = si_context_expected;
exports['checkClosureAndArity'] = checkClosureAndArity;