diff --git a/whalesong/js-assembler/assemble-perform-statement.rkt b/whalesong/js-assembler/assemble-perform-statement.rkt index c558aaf..767c2dc 100644 --- a/whalesong/js-assembler/assemble-perform-statement.rkt +++ b/whalesong/js-assembler/assemble-perform-statement.rkt @@ -156,13 +156,14 @@ function(restart){ RT.currentModuleLoader(M,~s, function(){ - restart(function(M){ ~a(M); }); + restart(function(M){ console.log('resume after loading ~a'); ~a(M); }); }, function(){ RT.raiseModuleLoadingError(M,~s); }); });" (symbol->string (ModuleLocator-name (LinkModule!-path op))) + (symbol->string (ModuleLocator-name (LinkModule!-path op))) (assemble-label (make-Label (LinkModule!-label op))) (symbol->string (ModuleLocator-name (LinkModule!-path op))))] diff --git a/whalesong/js-assembler/assemble.rkt b/whalesong/js-assembler/assemble.rkt index 8dfadc3..ade1147 100644 --- a/whalesong/js-assembler/assemble.rkt +++ b/whalesong/js-assembler/assemble.rkt @@ -31,11 +31,11 @@ -(: assemble/write-invoke ((Listof Statement) #;Boolean Output-Port -> Void)) +(: assemble/write-invoke ((Listof Statement) Boolean Output-Port -> Void)) ;; Writes out the JavaScript code that represents the anonymous invocation expression. ;; What's emitted is a function expression that, when invoked, runs the ;; statements. -(define (assemble/write-invoke stmts #;without-trampoline? op) +(define (assemble/write-invoke stmts without-trampoline? op) (parameterize ([current-interned-symbol-table ((inst make-hash Symbol Symbol))] [current-interned-constant-closure-table ((inst make-hash Symbol MakeCompiledProcedure))]) (display "(function(M, success, fail, params) {\n" op) @@ -73,9 +73,7 @@ for (param in params) { } EOF op) - (fprintf op "~a(M); })" - (assemble-label (make-Label (BasicBlock-name (first basic-blocks))))) - #;(cond [without-trampoline? + (cond [without-trampoline? ;; If it's a module statement, we just want to call it directly, to get things loaded. (fprintf op "~a(M); })" (assemble-label (make-Label (BasicBlock-name (first basic-blocks)))))] diff --git a/whalesong/js-assembler/package.rkt b/whalesong/js-assembler/package.rkt index fdf6c95..1df57da 100644 --- a/whalesong/js-assembler/package.rkt +++ b/whalesong/js-assembler/package.rkt @@ -454,20 +454,20 @@ M.modules[~s] = (display bytes op))] [(cacheable? path) (define string-op (open-output-bytes)) - (assemble/write-invoke (my-force stmts) string-op) + (assemble/write-invoke (my-force stmts) #t string-op) (save-in-cache! path (get-output-bytes string-op)) (display (get-output-string string-op) op)] [else - (assemble/write-invoke (my-force stmts) op)])] + (assemble/write-invoke (my-force stmts) #t op)])] [else - (assemble/write-invoke (my-force stmts) op)])) + (assemble/write-invoke (my-force stmts) #t op)])) (cond [(ModuleSource? src) (on-path (ModuleSource-path src))] [(MainModuleSource? src) (on-path (MainModuleSource-path src))] [else - (assemble/write-invoke (my-force stmts) op)])) + (assemble/write-invoke (my-force stmts) #f op)])) ;; cached?: path -> (U false bytes)