diff --git a/lib/MAST/Ops.nqp b/lib/MAST/Ops.nqp index a65e077dae..b61469364b 100644 --- a/lib/MAST/Ops.nqp +++ b/lib/MAST/Ops.nqp @@ -818,34 +818,33 @@ BEGIN { 2045, 2049, 2053, - 2056, - 2059, - 2063, - 2067, - 2070, - 2073, - 2077, + 2057, + 2061, + 2065, + 2068, + 2071, + 2075, 2079, - 2081, - 2083, + 2082, 2085, - 2087, 2089, 2091, 2093, 2095, 2097, - 2100, + 2099, + 2101, 2103, - 2106, + 2105, + 2107, 2109, - 2113, - 2114, - 2116, - 2120, - 2123, + 2112, + 2115, + 2118, + 2121, + 2125, 2126, - 2129, + 2128, 2132, 2135, 2138, @@ -859,11 +858,11 @@ BEGIN { 2162, 2165, 2168, - 2172, - 2176, - 2179, - 2182, - 2185, + 2171, + 2174, + 2177, + 2180, + 2184, 2188, 2191, 2194, @@ -872,25 +871,29 @@ BEGIN { 2203, 2206, 2209, - 2213, - 2217, - 2220, - 2223, - 2224, - 2226, - 2228, - 2230, - 2234, + 2212, + 2215, + 2218, + 2221, + 2225, + 2229, + 2232, + 2235, 2236, 2238, - 2238, - 2238, - 2239, - 2240, 2240, - 2241, - 2243, - 2247); + 2242, + 2246, + 2248, + 2250, + 2250, + 2250, + 2251, + 2252, + 2252, + 2253, + 2255, + 2259); MAST::Ops.WHO<@counts> := nqp::list_i(0, 2, 2, @@ -1705,6 +1708,9 @@ BEGIN { 4, 4, 4, + 4, + 4, + 4, 3, 3, 4, @@ -3820,6 +3826,18 @@ BEGIN { 33, 66, 65, + 65, + 161, + 33, + 161, + 65, + 161, + 161, + 161, + 65, + 161, + 49, + 161, 66, 65, 128, @@ -4839,83 +4857,86 @@ BEGIN { 'hllboolfor', 808, 'decodelocaltime', 809, 'buffertocu', 810, - 'sp_guard', 811, - 'sp_guardconc', 812, - 'sp_guardtype', 813, - 'sp_guardsf', 814, - 'sp_guardsfouter', 815, - 'sp_guardobj', 816, - 'sp_guardnotobj', 817, - 'sp_guardjustconc', 818, - 'sp_guardjusttype', 819, - 'sp_rebless', 820, - 'sp_resolvecode', 821, - 'sp_decont', 822, - 'sp_getlex_o', 823, - 'sp_getlex_ins', 824, - 'sp_getlex_no', 825, - 'sp_getarg_o', 826, - 'sp_getarg_i', 827, - 'sp_getarg_n', 828, - 'sp_getarg_s', 829, - 'sp_fastinvoke_v', 830, - 'sp_fastinvoke_i', 831, - 'sp_fastinvoke_n', 832, - 'sp_fastinvoke_s', 833, - 'sp_fastinvoke_o', 834, - 'sp_speshresolve', 835, - 'sp_paramnamesused', 836, - 'sp_getspeshslot', 837, - 'sp_findmeth', 838, - 'sp_fastcreate', 839, - 'sp_get_o', 840, - 'sp_get_i64', 841, - 'sp_get_i32', 842, - 'sp_get_i16', 843, - 'sp_get_i8', 844, - 'sp_get_n', 845, - 'sp_get_s', 846, - 'sp_bind_o', 847, - 'sp_bind_i64', 848, - 'sp_bind_i32', 849, - 'sp_bind_i16', 850, - 'sp_bind_i8', 851, - 'sp_bind_n', 852, - 'sp_bind_s', 853, - 'sp_p6oget_o', 854, - 'sp_p6ogetvt_o', 855, - 'sp_p6ogetvc_o', 856, - 'sp_p6oget_i', 857, - 'sp_p6oget_n', 858, - 'sp_p6oget_s', 859, - 'sp_p6obind_o', 860, - 'sp_p6obind_i', 861, - 'sp_p6obind_n', 862, - 'sp_p6obind_s', 863, - 'sp_deref_get_i64', 864, - 'sp_deref_get_n', 865, - 'sp_deref_bind_i64', 866, - 'sp_deref_bind_n', 867, - 'sp_getlexvia_o', 868, - 'sp_getlexvia_ins', 869, - 'sp_getstringfrom', 870, - 'sp_getwvalfrom', 871, - 'sp_jit_enter', 872, - 'sp_boolify_iter', 873, - 'sp_boolify_iter_arr', 874, - 'sp_boolify_iter_hash', 875, - 'sp_cas_o', 876, - 'sp_atomicload_o', 877, - 'sp_atomicstore_o', 878, - 'prof_enter', 879, - 'prof_enterspesh', 880, - 'prof_enterinline', 881, - 'prof_enternative', 882, - 'prof_exit', 883, - 'prof_allocated', 884, - 'ctw_check', 885, - 'coverage_log', 886, - 'breakpoint', 887); + 'writeint', 811, + 'writeuint', 812, + 'writenum', 813, + 'sp_guard', 814, + 'sp_guardconc', 815, + 'sp_guardtype', 816, + 'sp_guardsf', 817, + 'sp_guardsfouter', 818, + 'sp_guardobj', 819, + 'sp_guardnotobj', 820, + 'sp_guardjustconc', 821, + 'sp_guardjusttype', 822, + 'sp_rebless', 823, + 'sp_resolvecode', 824, + 'sp_decont', 825, + 'sp_getlex_o', 826, + 'sp_getlex_ins', 827, + 'sp_getlex_no', 828, + 'sp_getarg_o', 829, + 'sp_getarg_i', 830, + 'sp_getarg_n', 831, + 'sp_getarg_s', 832, + 'sp_fastinvoke_v', 833, + 'sp_fastinvoke_i', 834, + 'sp_fastinvoke_n', 835, + 'sp_fastinvoke_s', 836, + 'sp_fastinvoke_o', 837, + 'sp_speshresolve', 838, + 'sp_paramnamesused', 839, + 'sp_getspeshslot', 840, + 'sp_findmeth', 841, + 'sp_fastcreate', 842, + 'sp_get_o', 843, + 'sp_get_i64', 844, + 'sp_get_i32', 845, + 'sp_get_i16', 846, + 'sp_get_i8', 847, + 'sp_get_n', 848, + 'sp_get_s', 849, + 'sp_bind_o', 850, + 'sp_bind_i64', 851, + 'sp_bind_i32', 852, + 'sp_bind_i16', 853, + 'sp_bind_i8', 854, + 'sp_bind_n', 855, + 'sp_bind_s', 856, + 'sp_p6oget_o', 857, + 'sp_p6ogetvt_o', 858, + 'sp_p6ogetvc_o', 859, + 'sp_p6oget_i', 860, + 'sp_p6oget_n', 861, + 'sp_p6oget_s', 862, + 'sp_p6obind_o', 863, + 'sp_p6obind_i', 864, + 'sp_p6obind_n', 865, + 'sp_p6obind_s', 866, + 'sp_deref_get_i64', 867, + 'sp_deref_get_n', 868, + 'sp_deref_bind_i64', 869, + 'sp_deref_bind_n', 870, + 'sp_getlexvia_o', 871, + 'sp_getlexvia_ins', 872, + 'sp_getstringfrom', 873, + 'sp_getwvalfrom', 874, + 'sp_jit_enter', 875, + 'sp_boolify_iter', 876, + 'sp_boolify_iter_arr', 877, + 'sp_boolify_iter_hash', 878, + 'sp_cas_o', 879, + 'sp_atomicload_o', 880, + 'sp_atomicstore_o', 881, + 'prof_enter', 882, + 'prof_enterspesh', 883, + 'prof_enterinline', 884, + 'prof_enternative', 885, + 'prof_exit', 886, + 'prof_allocated', 887, + 'ctw_check', 888, + 'coverage_log', 889, + 'breakpoint', 890); MAST::Ops.WHO<@names> := nqp::list_s('no_op', 'const_i8', 'const_i16', @@ -5727,6 +5748,9 @@ BEGIN { 'hllboolfor', 'decodelocaltime', 'buffertocu', + 'writeint', + 'writeuint', + 'writenum', 'sp_guard', 'sp_guardconc', 'sp_guardtype', diff --git a/src/core/interp.c b/src/core/interp.c index ba93f3d123..7d6369170a 100644 --- a/src/core/interp.c +++ b/src/core/interp.c @@ -5377,6 +5377,24 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex cur_op += 6; goto NEXT; } + OP(writeint): + OP(writeuint): + OP(writenum): { + MVMObject *buf = GET_REG(cur_op, 0).o; + MVMuint64 off = (MVMuint64)GET_REG(cur_op, 2).i64; + MVMuint64 num = *(MVMuint64*)&GET_REG(cur_op, 4).n64; + MVMuint64 flags = (MVMuint64)GET_REG(cur_op, 6).i64; + MVMRegister byte; + char i; + for(i = 0; i < 8; i++) { + byte.i64 = (unsigned char)((num & (0xFFull << (i * 8))) >> (i * 8)); + REPR(buf)->pos_funcs.bind_pos(tc, STABLE(buf), buf, + OBJECT_BODY(buf), off + i, byte, MVM_reg_int64); + } + MVM_SC_WB_OBJ(tc, buf); + cur_op += 8; + goto NEXT; + } OP(sp_guard): { MVMObject *check = GET_REG(cur_op, 2).o; MVMSTable *want = (MVMSTable *)tc->cur_frame diff --git a/src/core/oplabels.h b/src/core/oplabels.h index 7f260f59ce..c94d5a39e2 100644 --- a/src/core/oplabels.h +++ b/src/core/oplabels.h @@ -812,6 +812,9 @@ static const void * const LABELS[] = { &&OP_hllboolfor, &&OP_decodelocaltime, &&OP_buffertocu, + &&OP_writeint, + &&OP_writeuint, + &&OP_writenum, &&OP_sp_guard, &&OP_sp_guardconc, &&OP_sp_guardtype, @@ -1022,9 +1025,6 @@ static const void * const LABELS[] = { NULL, NULL, NULL, - NULL, - NULL, - NULL, &&OP_CALL_EXTOP, &&OP_CALL_EXTOP, &&OP_CALL_EXTOP, diff --git a/src/core/oplist b/src/core/oplist index b3e7ff921b..bf8aeb1d8d 100644 --- a/src/core/oplist +++ b/src/core/oplist @@ -871,6 +871,9 @@ hllbool w(obj) r(int64) :pure :useshll hllboolfor w(obj) r(int64) r(str) :pure :useshll decodelocaltime w(obj) r(int64) buffertocu w(obj) r(obj) :invokish :maycausedeopt +writeint r(obj) r(uint64) r(int64) r(uint64) +writeuint r(obj) r(uint64) r(uint64) r(uint64) +writenum r(obj) r(uint64) r(num64) r(uint64) # Spesh ops. Naming convention: start with sp_. Must all be marked .s, which # is how the validator knows to exclude them. diff --git a/src/core/ops.c b/src/core/ops.c index 7d56c8b355..fd1f4fd38d 100644 --- a/src/core/ops.c +++ b/src/core/ops.c @@ -12157,6 +12157,51 @@ static const MVMOpInfo MVM_op_infos[] = { 0, { MVM_operand_write_reg | MVM_operand_obj, MVM_operand_read_reg | MVM_operand_obj } }, + { + MVM_OP_writeint, + "writeint", + " ", + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + { MVM_operand_read_reg | MVM_operand_obj, MVM_operand_read_reg | MVM_operand_uint64, MVM_operand_read_reg | MVM_operand_int64, MVM_operand_read_reg | MVM_operand_uint64 } + }, + { + MVM_OP_writeuint, + "writeuint", + " ", + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + { MVM_operand_read_reg | MVM_operand_obj, MVM_operand_read_reg | MVM_operand_uint64, MVM_operand_read_reg | MVM_operand_uint64, MVM_operand_read_reg | MVM_operand_uint64 } + }, + { + MVM_OP_writenum, + "writenum", + " ", + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + { MVM_operand_read_reg | MVM_operand_obj, MVM_operand_read_reg | MVM_operand_uint64, MVM_operand_read_reg | MVM_operand_num64, MVM_operand_read_reg | MVM_operand_uint64 } + }, { MVM_OP_sp_guard, "sp_guard", @@ -13311,7 +13356,7 @@ static const MVMOpInfo MVM_op_infos[] = { }, }; -static const unsigned short MVM_op_counts = 888; +static const unsigned short MVM_op_counts = 891; MVM_PUBLIC const MVMOpInfo * MVM_op_get_op(unsigned short op) { if (op >= MVM_op_counts) diff --git a/src/core/ops.h b/src/core/ops.h index 3f68d9713a..97472bb22d 100644 --- a/src/core/ops.h +++ b/src/core/ops.h @@ -812,83 +812,86 @@ #define MVM_OP_hllboolfor 808 #define MVM_OP_decodelocaltime 809 #define MVM_OP_buffertocu 810 -#define MVM_OP_sp_guard 811 -#define MVM_OP_sp_guardconc 812 -#define MVM_OP_sp_guardtype 813 -#define MVM_OP_sp_guardsf 814 -#define MVM_OP_sp_guardsfouter 815 -#define MVM_OP_sp_guardobj 816 -#define MVM_OP_sp_guardnotobj 817 -#define MVM_OP_sp_guardjustconc 818 -#define MVM_OP_sp_guardjusttype 819 -#define MVM_OP_sp_rebless 820 -#define MVM_OP_sp_resolvecode 821 -#define MVM_OP_sp_decont 822 -#define MVM_OP_sp_getlex_o 823 -#define MVM_OP_sp_getlex_ins 824 -#define MVM_OP_sp_getlex_no 825 -#define MVM_OP_sp_getarg_o 826 -#define MVM_OP_sp_getarg_i 827 -#define MVM_OP_sp_getarg_n 828 -#define MVM_OP_sp_getarg_s 829 -#define MVM_OP_sp_fastinvoke_v 830 -#define MVM_OP_sp_fastinvoke_i 831 -#define MVM_OP_sp_fastinvoke_n 832 -#define MVM_OP_sp_fastinvoke_s 833 -#define MVM_OP_sp_fastinvoke_o 834 -#define MVM_OP_sp_speshresolve 835 -#define MVM_OP_sp_paramnamesused 836 -#define MVM_OP_sp_getspeshslot 837 -#define MVM_OP_sp_findmeth 838 -#define MVM_OP_sp_fastcreate 839 -#define MVM_OP_sp_get_o 840 -#define MVM_OP_sp_get_i64 841 -#define MVM_OP_sp_get_i32 842 -#define MVM_OP_sp_get_i16 843 -#define MVM_OP_sp_get_i8 844 -#define MVM_OP_sp_get_n 845 -#define MVM_OP_sp_get_s 846 -#define MVM_OP_sp_bind_o 847 -#define MVM_OP_sp_bind_i64 848 -#define MVM_OP_sp_bind_i32 849 -#define MVM_OP_sp_bind_i16 850 -#define MVM_OP_sp_bind_i8 851 -#define MVM_OP_sp_bind_n 852 -#define MVM_OP_sp_bind_s 853 -#define MVM_OP_sp_p6oget_o 854 -#define MVM_OP_sp_p6ogetvt_o 855 -#define MVM_OP_sp_p6ogetvc_o 856 -#define MVM_OP_sp_p6oget_i 857 -#define MVM_OP_sp_p6oget_n 858 -#define MVM_OP_sp_p6oget_s 859 -#define MVM_OP_sp_p6obind_o 860 -#define MVM_OP_sp_p6obind_i 861 -#define MVM_OP_sp_p6obind_n 862 -#define MVM_OP_sp_p6obind_s 863 -#define MVM_OP_sp_deref_get_i64 864 -#define MVM_OP_sp_deref_get_n 865 -#define MVM_OP_sp_deref_bind_i64 866 -#define MVM_OP_sp_deref_bind_n 867 -#define MVM_OP_sp_getlexvia_o 868 -#define MVM_OP_sp_getlexvia_ins 869 -#define MVM_OP_sp_getstringfrom 870 -#define MVM_OP_sp_getwvalfrom 871 -#define MVM_OP_sp_jit_enter 872 -#define MVM_OP_sp_boolify_iter 873 -#define MVM_OP_sp_boolify_iter_arr 874 -#define MVM_OP_sp_boolify_iter_hash 875 -#define MVM_OP_sp_cas_o 876 -#define MVM_OP_sp_atomicload_o 877 -#define MVM_OP_sp_atomicstore_o 878 -#define MVM_OP_prof_enter 879 -#define MVM_OP_prof_enterspesh 880 -#define MVM_OP_prof_enterinline 881 -#define MVM_OP_prof_enternative 882 -#define MVM_OP_prof_exit 883 -#define MVM_OP_prof_allocated 884 -#define MVM_OP_ctw_check 885 -#define MVM_OP_coverage_log 886 -#define MVM_OP_breakpoint 887 +#define MVM_OP_writeint 811 +#define MVM_OP_writeuint 812 +#define MVM_OP_writenum 813 +#define MVM_OP_sp_guard 814 +#define MVM_OP_sp_guardconc 815 +#define MVM_OP_sp_guardtype 816 +#define MVM_OP_sp_guardsf 817 +#define MVM_OP_sp_guardsfouter 818 +#define MVM_OP_sp_guardobj 819 +#define MVM_OP_sp_guardnotobj 820 +#define MVM_OP_sp_guardjustconc 821 +#define MVM_OP_sp_guardjusttype 822 +#define MVM_OP_sp_rebless 823 +#define MVM_OP_sp_resolvecode 824 +#define MVM_OP_sp_decont 825 +#define MVM_OP_sp_getlex_o 826 +#define MVM_OP_sp_getlex_ins 827 +#define MVM_OP_sp_getlex_no 828 +#define MVM_OP_sp_getarg_o 829 +#define MVM_OP_sp_getarg_i 830 +#define MVM_OP_sp_getarg_n 831 +#define MVM_OP_sp_getarg_s 832 +#define MVM_OP_sp_fastinvoke_v 833 +#define MVM_OP_sp_fastinvoke_i 834 +#define MVM_OP_sp_fastinvoke_n 835 +#define MVM_OP_sp_fastinvoke_s 836 +#define MVM_OP_sp_fastinvoke_o 837 +#define MVM_OP_sp_speshresolve 838 +#define MVM_OP_sp_paramnamesused 839 +#define MVM_OP_sp_getspeshslot 840 +#define MVM_OP_sp_findmeth 841 +#define MVM_OP_sp_fastcreate 842 +#define MVM_OP_sp_get_o 843 +#define MVM_OP_sp_get_i64 844 +#define MVM_OP_sp_get_i32 845 +#define MVM_OP_sp_get_i16 846 +#define MVM_OP_sp_get_i8 847 +#define MVM_OP_sp_get_n 848 +#define MVM_OP_sp_get_s 849 +#define MVM_OP_sp_bind_o 850 +#define MVM_OP_sp_bind_i64 851 +#define MVM_OP_sp_bind_i32 852 +#define MVM_OP_sp_bind_i16 853 +#define MVM_OP_sp_bind_i8 854 +#define MVM_OP_sp_bind_n 855 +#define MVM_OP_sp_bind_s 856 +#define MVM_OP_sp_p6oget_o 857 +#define MVM_OP_sp_p6ogetvt_o 858 +#define MVM_OP_sp_p6ogetvc_o 859 +#define MVM_OP_sp_p6oget_i 860 +#define MVM_OP_sp_p6oget_n 861 +#define MVM_OP_sp_p6oget_s 862 +#define MVM_OP_sp_p6obind_o 863 +#define MVM_OP_sp_p6obind_i 864 +#define MVM_OP_sp_p6obind_n 865 +#define MVM_OP_sp_p6obind_s 866 +#define MVM_OP_sp_deref_get_i64 867 +#define MVM_OP_sp_deref_get_n 868 +#define MVM_OP_sp_deref_bind_i64 869 +#define MVM_OP_sp_deref_bind_n 870 +#define MVM_OP_sp_getlexvia_o 871 +#define MVM_OP_sp_getlexvia_ins 872 +#define MVM_OP_sp_getstringfrom 873 +#define MVM_OP_sp_getwvalfrom 874 +#define MVM_OP_sp_jit_enter 875 +#define MVM_OP_sp_boolify_iter 876 +#define MVM_OP_sp_boolify_iter_arr 877 +#define MVM_OP_sp_boolify_iter_hash 878 +#define MVM_OP_sp_cas_o 879 +#define MVM_OP_sp_atomicload_o 880 +#define MVM_OP_sp_atomicstore_o 881 +#define MVM_OP_prof_enter 882 +#define MVM_OP_prof_enterspesh 883 +#define MVM_OP_prof_enterinline 884 +#define MVM_OP_prof_enternative 885 +#define MVM_OP_prof_exit 886 +#define MVM_OP_prof_allocated 887 +#define MVM_OP_ctw_check 888 +#define MVM_OP_coverage_log 889 +#define MVM_OP_breakpoint 890 #define MVM_OP_EXT_BASE 1024 #define MVM_OP_EXT_CU_LIMIT 1024