cwebber pushed a commit to branch compile-to-js-merge
in repository guile.
commit b70b39e4783e15861c3a02dbb609e2558bc05506
Author: Ian Price <[email protected]>
AuthorDate: Sat Jun 6 10:26:51 2015 +0100
Remove jscall type
---
module/language/cps/compile-js.scm | 10 ++++------
module/language/js-il.scm | 4 ----
module/language/js-il/compile-javascript.scm | 3 ---
3 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/module/language/cps/compile-js.scm
b/module/language/cps/compile-js.scm
index 0e0aa4e..6d1edb8 100644
--- a/module/language/cps/compile-js.scm
+++ b/module/language/cps/compile-js.scm
@@ -58,7 +58,7 @@
(compile-term exp))
(($ $cont k _)
(make-local (list (compile-cont body))
- (make-jscall k req))))))
+ (make-continue k (map make-id req)))))))
(_
`(clause:todo: ,clause))))
@@ -78,9 +78,9 @@
;; use the name part?
(make-var k (make-function syms (compile-term body))))
(($ $cont k ($ $kreceive ($ $arity (arg) _ (? symbol? rest) _ _) k2))
- (make-var k (make-function (list arg rest) (make-jscall k2 (list arg
rest)))))
+ (make-var k (make-function (list arg rest) (make-continue k2 (list
(make-id arg) (make-id rest))))))
(($ $cont k ($ $kreceive ($ $arity (arg) _ #f _ _) k2))
- (make-var k (make-function (list arg) (make-jscall k2 (list arg)))))
+ (make-var k (make-function (list arg) (make-continue k2 (list (make-id
arg))))))
(_
`(cont:todo: ,cont))
))
@@ -94,9 +94,7 @@
(($ $call name args)
(make-call name (cons k args)))
(($ $callk label proc args)
- ;; eh?
- ;; (pk 'callk label proc args k)
- (make-jscall label (cons* proc k args)))
+ (make-continue label (map make-id (cons* proc k args))))
(($ $values values)
(make-continue k (map make-id values)))
(_
diff --git a/module/language/js-il.scm b/module/language/js-il.scm
index 7dceb60..946a1c0 100644
--- a/module/language/js-il.scm
+++ b/module/language/js-il.scm
@@ -10,7 +10,6 @@
make-const const
make-primcall primcall
make-call call
- make-jscall jscall
make-closure closure
make-branch branch
; print-js
@@ -64,7 +63,6 @@
(define-js-type const value)
(define-js-type primcall name args)
(define-js-type call name args)
-(define-js-type jscall name args) ;; TODO: shouldn't need this hack
(define-js-type closure label num-free)
(define-js-type branch test consequence alternate)
(define-js-type id name)
@@ -91,8 +89,6 @@
`(primcall ,name , args))
(($ call name args)
`(call ,name , args))
- (($ jscall name args)
- `(jscall ,name , args))
(($ closure label nfree)
`(closure ,label ,nfree))
(($ return val)
diff --git a/module/language/js-il/compile-javascript.scm
b/module/language/js-il/compile-javascript.scm
index 6fde3ba..790ac7c 100644
--- a/module/language/js-il/compile-javascript.scm
+++ b/module/language/js-il/compile-javascript.scm
@@ -64,9 +64,6 @@
(make-call (make-refine (name->id name) (make-const "fun"))
(map name->id (cons name args)))))
- (($ il:jscall name args)
- (make-return (make-call (name->id name) (map name->id args))))
-
(($ il:closure label nfree)
(make-new
(make-call (make-refine *scheme* (make-const "Closure"))