trying to make globalbuckets work.
This commit is contained in:
parent
920f7cf85f
commit
cd5e6ee180
|
@ -448,7 +448,9 @@
|
||||||
(make-EnvPrefixReference (ToplevelRef-depth exp)
|
(make-EnvPrefixReference (ToplevelRef-depth exp)
|
||||||
(ToplevelRef-pos exp)
|
(ToplevelRef-pos exp)
|
||||||
#t))])]
|
#t))])]
|
||||||
[else
|
[(or (eq? prefix-element #f)
|
||||||
|
(symbol? prefix-element)
|
||||||
|
(GlobalBucket? prefix-element))
|
||||||
(append-instruction-sequences
|
(append-instruction-sequences
|
||||||
(if (ToplevelRef-check-defined? exp)
|
(if (ToplevelRef-check-defined? exp)
|
||||||
(make-Perform (make-CheckToplevelBound!
|
(make-Perform (make-CheckToplevelBound!
|
||||||
|
@ -485,7 +487,9 @@
|
||||||
(ToplevelSet-pos exp)
|
(ToplevelSet-pos exp)
|
||||||
#t)
|
#t)
|
||||||
next-linkage/expects-single)]
|
next-linkage/expects-single)]
|
||||||
[else
|
[(or (eq? prefix-element #f)
|
||||||
|
(symbol? prefix-element)
|
||||||
|
(GlobalBucket? prefix-element))
|
||||||
(compile (ToplevelSet-value exp)
|
(compile (ToplevelSet-value exp)
|
||||||
cenv
|
cenv
|
||||||
(make-EnvPrefixReference (ToplevelSet-depth exp)
|
(make-EnvPrefixReference (ToplevelSet-depth exp)
|
||||||
|
|
|
@ -41,9 +41,7 @@
|
||||||
[(eq? n #f)
|
[(eq? n #f)
|
||||||
"false"]
|
"false"]
|
||||||
[(GlobalBucket? n)
|
[(GlobalBucket? n)
|
||||||
;; FIXME: maybe we should keep a set of global variables here?
|
(format "M.globals[~s]" (symbol->string (GlobalBucket-name n)))]
|
||||||
(format "M.primitives[~s]"
|
|
||||||
(symbol->string (GlobalBucket-name n)))]
|
|
||||||
;; FIXME: this should be looking at the module path and getting
|
;; FIXME: this should be looking at the module path and getting
|
||||||
;; the value here! It shouldn't be looking into Primitives...
|
;; the value here! It shouldn't be looking into Primitives...
|
||||||
[(ModuleVariable? n)
|
[(ModuleVariable? n)
|
||||||
|
|
|
@ -460,20 +460,20 @@ M.modules[~s] =
|
||||||
(display bytes op))]
|
(display bytes op))]
|
||||||
[(cacheable? path)
|
[(cacheable? path)
|
||||||
(define string-op (open-output-bytes))
|
(define string-op (open-output-bytes))
|
||||||
(assemble/write-invoke (my-force stmts) #t string-op)
|
(assemble/write-invoke (my-force stmts) string-op 'no-trampoline)
|
||||||
(save-in-cache! path (get-output-bytes string-op))
|
(save-in-cache! path (get-output-bytes string-op))
|
||||||
(display (get-output-string string-op) op)]
|
(display (get-output-string string-op) op)]
|
||||||
[else
|
[else
|
||||||
(assemble/write-invoke (my-force stmts) #t op)])]
|
(assemble/write-invoke (my-force stmts) op 'no-trampoline)])]
|
||||||
[else
|
[else
|
||||||
(assemble/write-invoke (my-force stmts) #t op)]))
|
(assemble/write-invoke (my-force stmts) op 'no-trampoline)]))
|
||||||
(cond
|
(cond
|
||||||
[(ModuleSource? src)
|
[(ModuleSource? src)
|
||||||
(on-path (ModuleSource-path src))]
|
(on-path (ModuleSource-path src))]
|
||||||
[(MainModuleSource? src)
|
[(MainModuleSource? src)
|
||||||
(on-path (MainModuleSource-path src))]
|
(on-path (MainModuleSource-path src))]
|
||||||
[else
|
[else
|
||||||
(assemble/write-invoke (my-force stmts) #f op)]))
|
(assemble/write-invoke (my-force stmts) op 'without-preemption)]))
|
||||||
|
|
||||||
|
|
||||||
;; cached?: path -> (U false bytes)
|
;; cached?: path -> (U false bytes)
|
||||||
|
|
|
@ -310,6 +310,7 @@
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
this.globals = {};
|
||||||
this.primitives = Primitives;
|
this.primitives = Primitives;
|
||||||
this.exclusiveLock = new ExclusiveLock();
|
this.exclusiveLock = new ExclusiveLock();
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(require json
|
(require "repl-compile.rkt"
|
||||||
|
json
|
||||||
file/gzip
|
file/gzip
|
||||||
racket/runtime-path
|
racket/runtime-path
|
||||||
racket/port
|
racket/port
|
||||||
|
@ -12,7 +13,6 @@
|
||||||
web-server/servlet
|
web-server/servlet
|
||||||
"../make/make-structs.rkt"
|
"../make/make-structs.rkt"
|
||||||
"../js-assembler/package.rkt"
|
"../js-assembler/package.rkt"
|
||||||
"../repl-compile.rkt"
|
|
||||||
"../parser/parse-bytecode.rkt"
|
"../parser/parse-bytecode.rkt"
|
||||||
"../compiler/compiler.rkt"
|
"../compiler/compiler.rkt"
|
||||||
"../compiler/expression-structs.rkt"
|
"../compiler/expression-structs.rkt"
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;(write-repl-runtime-files)
|
(write-repl-runtime-files)
|
||||||
(serve/servlet start
|
(serve/servlet start
|
||||||
#:servlet-path "/compile"
|
#:servlet-path "/compile"
|
||||||
#:extra-files-paths (list htdocs)
|
#:extra-files-paths (list htdocs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user