Skip to content

Commit

Permalink
[JIT] Use '^addrf' macro for setf, getf
Browse files Browse the repository at this point in the history
For consistency
  • Loading branch information
bdw committed Jul 6, 2018
1 parent 930fd47 commit ef41080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/jit/core_templates.expr
Expand Up @@ -156,7 +156,7 @@
# we can't just toss this in here without also handling all of arg_*
# and invoke_*.
#(template: prepargs (^setf (^getf (tc) MVMThreadContext cur_frame) MVMFrame cur_args_callsite
# (^cu_callsite $0)))
# (load (^cu_callsite_addr $0) ptr_sz)))

(template: getcode
(load (idx (^getf (cu) MVMCompUnit body.coderefs) $1 ptr_sz) ptr_sz))
Expand Down
6 changes: 3 additions & 3 deletions src/jit/macro.expr
Expand Up @@ -3,11 +3,11 @@
(macro: ^addrf (,object ,type ,field)
(addr ,object (&offsetof ,type ,field)))
(macro: ^getf (,object ,type ,field)
(load (addr ,object (&offsetof ,type ,field)) (&SIZEOF_MEMBER ,type ,field)))
(load (^addrf ,object ,type ,field) (&SIZEOF_MEMBER ,type ,field)))
(macro: ^setf (,object ,type ,field ,value)
(store (addr ,object (&offsetof ,type ,field)) ,value (&SIZEOF_MEMBER ,type ,field)))
(store (^addrf ,object ,type ,field) ,value (&SIZEOF_MEMBER ,type ,field)))

(macro: ^cu_callsite (,a) (idx (^getf (cu) MVMCompUnit body.callsites) ,a ptr_sz))
(macro: ^cu_callsite_addr (,a) (idx (^getf (cu) MVMCompUnit body.callsites) ,a ptr_sz))

(macro: ^frame () (^getf (tc) MVMThreadContext cur_frame))
(macro: ^parg (,a) (idx (^getf (^frame) MVMFrame params.args) ,a reg_sz))
Expand Down

0 comments on commit ef41080

Please sign in to comment.