Commit c20f5a4b authored by Guy Watson's avatar Guy Watson
Browse files

Change format of global.set to not use the unifies property

The global.set node now produces a 'get' after the 'set'. This leads to a more concise and traceable effect on the stack
parent fc3d25cb
......@@ -158,9 +158,8 @@
#:prop reference-info (read name)
#:prop choice-weight 4]
[GlobalSet Expr ([val : Expr]
[expr : Expr])
#:prop reference-info (write name #:unifies val)
#:prop reference-info (write name)
#:prop choice-weight 4]
;; Type conversions
......@@ -213,8 +212,7 @@
[ForLoop (hash 'loopvar (make-fresh-node
(hash 'val (make-fresh-node 'LiteralIntThirtyTwo) ;;dummy
'name (binding-name (send this xsmith_get-reference-for-child! i32 #t))
'expr (make-fresh-node 'LiteralIntThirtyTwo))))] ;;dummy
'name (binding-name (send this xsmith_get-reference-for-child! i32 #t)))))]
......@@ -336,8 +334,7 @@
'expr i32))]]
[LocalTee [i32 (λ (n t) (hash 'val i32))]]
[GlobalGet [(number) (no-child-types)]]
[GlobalSet [(number) (λ (n t) (hash 'val t
'expr t))]]
[GlobalSet [(number) (λ (n t) (hash 'val t))]]
;;Type conversions
[TruncateFloat [(int)
(λ (n t)
......@@ -583,7 +580,7 @@
($xsmith_render-node (ast-child 'val n))
`(global.set ,(string->symbol (format "$~a" (ast-child 'name n))))
($xsmith_render-node (ast-child 'expr n))))]
`(global.get ,(string->symbol (format "$~a" (ast-child 'name n))))))]
[TruncateFloat (λ (n)
($xsmith_render-node (ast-child 'expr n))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment