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

View File

@ -180,15 +180,12 @@ EOF
(: assemble-basic-block (BasicBlock Blockht (Setof Symbol) (Setof Symbol) Output-Port -> 'ok)) (: 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) (define (assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op)
(match (BasicBlock-stmts a-basic-block) (match (BasicBlock-stmts a-basic-block)
;; [(list (struct PopEnvironment (n (and (? (lambda (c) (equal? c (Const 0)))) [(list (struct PerformStatement ((struct RaiseContextExpectedValuesError! (expected))))
;; skip))) stmts ...)
;; (struct GotoStatement ((and (? Label?) (fprintf op "~a=RT.si_context_expected(~a);\n"
;; target)))) (assemble-label (make-Label (BasicBlock-name a-basic-block)))
;; (fprintf op "~a=RT.si_popgoto(~a,function(){return ~a});\n" expected)
;; (assemble-label (make-Label (BasicBlock-name a-basic-block))) 'ok]
;; (assemble-oparg n)
;; (assemble-label target))
;; 'ok]
[else [else
(default-assemble-basic-block a-basic-block blockht entry-points function-entry-and-exit-names op)])) (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. // Superinstructions to try to reduce code size.
var si_context_expected = function(n) {
var si_popgoto = function(n, gotoTargetThunk) { if (n === 1) { return si_context_expected_1; }
return function(M) { return function(M) { raiseContextExpectedValuesError(M, n); }
--M.cbt;
M.env.length-=n;
return gotoTargetThunk()(M);
};
}; };
var si_context_expected_1 = function(M) { raiseContextExpectedValuesError(M, 1); }
@ -815,7 +811,7 @@
exports['getTracedAppKey'] = getTracedAppKey; exports['getTracedAppKey'] = getTracedAppKey;
exports['getTracedCalleeKey'] = getTracedCalleeKey; exports['getTracedCalleeKey'] = getTracedCalleeKey;
exports['si_popgoto'] = si_popgoto; exports['si_context_expected'] = si_context_expected;
exports['checkClosureAndArity'] = checkClosureAndArity; exports['checkClosureAndArity'] = checkClosureAndArity;