From bb1ff92465f860dc534c413e847167fa20fbd150 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 14 Feb 2012 10:00:33 -0700 Subject: [PATCH] svm: Add clear-map! before invocation:special-primitive. Also, fix order of float arguments in rule for flonum constants. And simplify the POP-RETURN rule. --- src/compiler/machines/svm/rules.scm | 30 +++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/compiler/machines/svm/rules.scm b/src/compiler/machines/svm/rules.scm index e22bc1115..1c19e8eff 100644 --- a/src/compiler/machines/svm/rules.scm +++ b/src/compiler/machines/svm/rules.scm @@ -542,8 +542,8 @@ USA. ,@((or (1d-table/get flonum-2-args-methods operation #f) (error "Unknown flonum operation:" operation)) (float-target target) - source2 temp + source2 overflow?)))) (define flonum-2-args-methods @@ -570,21 +570,12 @@ USA. (POP-RETURN) ;; The continuation is on the stack. ;; The type code needs to be cleared first. - (current-bblock-continue! - (let ((pop-return - (lambda () - (let ((temp (word-temporary))) - (LAP ,@(inst:load 'WORD temp (ea:stack-pop)) - ,@(inst:object-address temp temp) - ,@(inst:jump (ea:indirect temp))))))) - (let ((checks (get-exit-interrupt-checks))) - (if (null? checks) - (make-new-sblock - (pop-return)) - (make-new-sblock - (LAP ,@(inst:interrupt-test-continuation) - ,@(pop-return))))))) - (LAP)) + (let ((checks (get-exit-interrupt-checks))) + (LAP ,@(clear-map!) + ,@(if (null? checks) '() (inst:interrupt-test-continuation)) + ,@(inst:load 'WORD rref:word-0 (ea:stack-pop)) + ,@(inst:object-address rref:word-0 rref:word-0) + ,@(inst:jump (ea:indirect rref:word-0))))) (define-rule statement (INVOCATION:APPLY (? frame-size) (? continuation)) @@ -709,7 +700,12 @@ USA. ,(make-primitive-procedure name #t)) frame-size continuation (expect-no-exit-interrupt-checks) - (,(close-syntax (symbol-append 'TRAP: name) environment))))))) + (%primitive-invocation + ,(close-syntax (symbol-append 'TRAP: name) environment))))))) + +(define (%primitive-invocation make-trap) + (LAP ,@(clear-map!) + ,@(make-trap))) (define-primitive-invocation &+) (define-primitive-invocation &-) -- 2.25.1