more fixes

This commit is contained in:
Danny Yoo 2011-05-18 16:40:30 -04:00
parent 501b11a931
commit 76d37f1df1
3 changed files with 23 additions and 6 deletions

16
NOTES
View File

@ -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.

View File

@ -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

View File

@ -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)