Skip to content

Commit

Permalink
add an impl of prepargs, which mustn't actually be used yet
Browse files Browse the repository at this point in the history
need to implement the rest of function invocation first, i.e.
arg_* and invoke_*.
  • Loading branch information
timo committed Apr 10, 2017
1 parent 2dd7a11 commit 7f84ede
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jit/core.expr
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
(macro: ^cu_string (,a) (idx (^getf (cu) MVMCompUnit body.strings) ,a ptr_sz))
(template: const_s (load (^cu_string $1) ptr_sz))

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

(template: set (copy $1))
(template: getlex (copy $1))
(template: bindlex (store $0 $1 reg_sz))
Expand Down Expand Up @@ -103,6 +105,12 @@
$replace
(addr ,a (&offsetof MVMP6opaque body)))))

# since compilation of invocation is special-cased in the regular jit
# 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))))

(template: sp_p6oget_i (load (add (^p6obody $1) $2) int_sz))
(template: sp_p6oget_n (load (add (^p6obody $1) $2) (&sizeof MVMnum64)))
(template: sp_p6oget_s (load (add (^p6obody $1) $2) ptr_sz))
Expand Down
4 changes: 4 additions & 0 deletions src/jit/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ static MVMint32 MVM_jit_expr_add_const(MVMThreadContext *tc, MVMJitExprTree *tre
template[1] = MVM_jit_label_before_bb(tc, tree->graph, opr.ins_bb);
template[2] = sizeof(MVMint32);
break;
case MVM_operand_callsite:
template[1] = opr.callsite_idx;
template[2] = sizeof(MVMuint16);
break;
case MVM_operand_spesh_slot:
template[1] = opr.lit_i16;
template[2] = sizeof(MVMuint16);
Expand Down

0 comments on commit 7f84ede

Please sign in to comment.