From cc1c156df79bab09ca37164e75ae0afe0ac1b0d0 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Tue, 12 Apr 2011 16:22:16 -0400 Subject: [PATCH] assembler seems to be doing the right thing now --- assemble.rkt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/assemble.rkt b/assemble.rkt index eaac349..48bf450 100644 --- a/assemble.rkt +++ b/assemble.rkt @@ -329,21 +329,33 @@ EOF (assemble-jump (GotoStatement-target stmt))] [(PushControlFrame? stmt) - (format "MACHINE.control.push(new RUNTIME.CallFrame(~a, MACHINE.proc));" (PushControlFrame-label stmt))] + (format "MACHINE.control.push(new RUNTIME.CallFrame(~a, MACHINE.proc));" + (let ([label (PushControlFrame-label stmt)]) + (cond + [(symbol? label) label] + [(LinkedLabel? label) (LinkedLabel-label label)])))] + [(PushControlFrame/Prompt? stmt) ;; fixme: use a different frame structure (format "MACHINE.control.push(new RUNTIME.PromptFrame(~a, ~a));" - (PushControlFrame/Prompt-label stmt) + (let ([label (PushControlFrame/Prompt-label stmt)]) + (cond + [(symbol? label) label] + [(LinkedLabel? label) (LinkedLabel-label label)])) + (let ([tag (PushControlFrame/Prompt-tag stmt)]) (cond [(DefaultContinuationPromptTag? tag) (assemble-default-continuation-prompt-tag)] [(OpArg? tag) (assemble-oparg tag)])))] + [(PopControlFrame? stmt) "MACHINE.control.pop();"] + [(PopControlFrame/Prompt? stmt) "MACHINE.control.pop();"] + [(PushEnvironment? stmt) (if (= (PushEnvironment-n stmt) 0) ""