Skip to content

Commit

Permalink
Merge pull request #1567 from MasterDuke17/add_more_jit_templates_see…
Browse files Browse the repository at this point in the history
…n_in_megamorphic_multi_dispatch_spesh_log
  • Loading branch information
MasterDuke17 committed Oct 17, 2021
2 parents 4e7fa77 + 7b0cc28 commit 098e9b1
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,8 +1341,8 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
}
OP(captureposprimspec): {
MVMObject *obj = GET_REG(cur_op, 2).o;
MVMint64 i = GET_REG(cur_op, 4).i64;
GET_REG(cur_op, 0).i64 = MVM_capture_arg_pos_primspec(tc, obj, i);
MVMuint32 idx = (MVMuint32)GET_REG(cur_op, 4).i64;
GET_REG(cur_op, 0).i64 = MVM_capture_arg_pos_primspec(tc, obj, idx);
cur_op += 6;
goto NEXT;
}
Expand Down
80 changes: 80 additions & 0 deletions src/jit/core_templates.expr
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

(template: set (copy $1))

(template: trunc_u8 (ucast $1 int_sz 1))
(template: trunc_u16 (ucast $1 int_sz 2))
(template: trunc_u32 (ucast $1 int_sz 4))

(template: trunc_i8 (ucast $1 int_sz 1))
(template: trunc_i16 (ucast $1 int_sz 2))
(template: trunc_i32 (ucast $1 int_sz 4))
Expand Down Expand Up @@ -402,6 +406,60 @@
(carg (tc) ptr)
(carg (^frame) ptr)) ptr_sz))

(template: captureposelems
(call (^func &MVM_capture_num_pos_args)
(arglist
(carg (tc) ptr)
(carg $1 ptr)) int_sz))

(template: captureposarg
(call (^func &MVM_capture_arg_pos_o)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg (ucast $2 int_sz 4) int)) ptr_sz))

(template: captureposarg_i
(call (^func &MVM_capture_arg_pos_i)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg (ucast $2 int_sz 4) int)) int_sz))

(template: captureposarg_n
(calln (^func &MVM_capture_arg_pos_n)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg (ucast $2 int_sz 4) int))))

(template: captureposarg_s
(call (^func &MVM_capture_arg_pos_s)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg (ucast $2 int_sz 4) int)) ptr_sz))

(template: captureposprimspec
(call (^func &MVM_capture_arg_pos_primspec)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg (ucast $2 int_sz 4) int)) int_sz))

(template: captureexistsnamed
(call (^func &MVM_capture_has_named_arg)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg $2 ptr)) int_sz))

(template: capturehasnameds
(call (^func &MVM_capture_has_nameds)
(arglist
(carg (tc) ptr)
(carg $1 ptr)) int_sz))

(template: null_s (^nullptr))

(template: isnull_s (flagval (zr $1)))
Expand Down Expand Up @@ -995,6 +1053,14 @@
(carg $3 ptr)
(carg (const -1 int_sz) int)) ptr_sz))

(template: attrinited
(call (^func &MVM_repr_attribute_inited)
(arglist
(carg (tc) ptr)
(carg $1 ptr)
(carg $2 ptr)
(carg $3 ptr)) ptr_sz))

(template: box_i
(call (^func &MVM_repr_box_int)
(arglist
Expand Down Expand Up @@ -1606,6 +1672,14 @@
(carg (tc) ptr)
(carg $1 ptr)) ptr_sz))

(template: getcodename
(do
(when (any
(^is_type_obj $1)
(^not_repr_id $1 MVM_REPR_ID_MVMCode))
(^throw_adhoc "getcodename requires a concrete code object"))
(^getf $1 MVMCode body.name)))

(template: iscoderef
(call (^func &MVM_code_iscode)
(arglist
Expand Down Expand Up @@ -1920,6 +1994,12 @@
(carg $2 ptr)
(carg $1 ptr)) ptr_sz))

(template: coerce_In
(calln (^func &MVM_bigint_to_num)
(arglist
(carg (tc) ptr)
(carg $1 ptr))))

(template: coerce_Is
(call (^func &MVM_bigint_to_str)
(arglist
Expand Down

0 comments on commit 098e9b1

Please sign in to comment.