diff --git a/NOTES b/NOTES index 100bedc..804abae 100644 --- a/NOTES +++ b/NOTES @@ -513,3 +513,19 @@ in types.js to avoid colliding with Java keywords (char, float). ---------------------------------------------------------------------- + + +I need to be careful about targetting the right target in recursive calls to compile. +The bug I was chasing down involved using (compile subexpr target cenv), where the +target was that of the parent expression. But this is an invalid thing to do. + +The other bug I nailed down yesterday was the shared-gensym bug with +lambda entry points. I have a single module now that distributes +gensyms for the lambda entry points. At some point, I'd like to make +the names descriptive so it's easier to figure out the functions by +low-level inspection. + + + +Optimizations are off at the moment until I integrate this into Moby. +Then I can start turning optimizations back on. \ No newline at end of file diff --git a/compiler.rkt b/compiler.rkt index 3371b88..acba91e 100644 --- a/compiler.rkt +++ b/compiler.rkt @@ -575,10 +575,12 @@ `(,(make-PushControlFrame/Prompt default-continuation-prompt-tag on-return))) - (compile (first seq) cenv target return-linkage/nontail) + (compile (first seq) cenv 'val return-linkage/nontail) (emit-values-context-check-on-procedure-return (linkage-context linkage) on-return/multiple - on-return))))] + on-return) + (make-instruction-sequence + `(,(make-AssignImmediateStatement target (make-Reg 'val)))))))] [else (let* ([on-return/multiple (make-label 'beforePromptPopMultiple)] [on-return (make-LinkedLabel (make-label 'beforePromptPop) @@ -588,7 +590,7 @@ `(,(make-PushControlFrame/Prompt (make-DefaultContinuationPromptTag) on-return))) - (compile (first seq) cenv target return-linkage/nontail) + (compile (first seq) cenv 'val return-linkage/nontail) on-return/multiple (make-instruction-sequence `(,(make-PopEnvironment (make-SubtractArg (make-Reg 'argcount) @@ -611,8 +613,7 @@ (let ([after-first-seq (make-label 'afterFirstSeqEvaluated)]) (append-instruction-sequences (make-instruction-sequence - `(,(make-Comment "begin0") - ,(make-Comment seq))) + `(,(make-Comment "begin0"))) ;; Evaluate the first expression in a multiple-value context, and get the values on the stack. (compile (first seq) cenv 'val next-linkage/keep-multiple-on-stack) (make-instruction-sequence diff --git a/test-parse-bytecode-5.1.1.rkt b/test-parse-bytecode-5.1.1.rkt index 938749e..797d604 100644 --- a/test-parse-bytecode-5.1.1.rkt +++ b/test-parse-bytecode-5.1.1.rkt @@ -12,7 +12,7 @@ (define (run-zo-parse stx) (parameterize ([current-namespace (make-base-namespace)] - [compile-context-preservation-enabled #t])) + [compile-context-preservation-enabled #t]) (let ([bc (compile stx)] [op (open-output-bytes)]) (write bc op)