Skip to content

Commit

Permalink
Merge pull request #809 from ugexe/getppid
Browse files Browse the repository at this point in the history
Add getppid op
  • Loading branch information
niner committed Feb 22, 2018
2 parents 4226137 + 9936bcc commit 642a2af
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 203 deletions.
269 changes: 137 additions & 132 deletions lib/MAST/Ops.nqp
Expand Up @@ -796,74 +796,75 @@ BEGIN {
1986,
1990,
1995,
1998,
2001,
2004,
2007,
2010,
2014,
2016,
2018,
2020,
2022,
2024,
2026,
2028,
2030,
2032,
2034,
2037,
2040,
2043,
2046,
1996,
1999,
2002,
2005,
2008,
2011,
2015,
2017,
2019,
2021,
2023,
2025,
2027,
2029,
2031,
2033,
2035,
2038,
2041,
2044,
2047,
2049,
2053,
2056,
2059,
2062,
2065,
2068,
2071,
2074,
2077,
2080,
2083,
2086,
2089,
2092,
2095,
2098,
2101,
2105,
2109,
2112,
2115,
2118,
2121,
2124,
2127,
2130,
2133,
2136,
2139,
2142,
2146,
2150,
2048,
2050,
2054,
2057,
2060,
2063,
2066,
2069,
2072,
2075,
2078,
2081,
2084,
2087,
2090,
2093,
2096,
2099,
2102,
2106,
2110,
2113,
2116,
2119,
2122,
2125,
2128,
2131,
2134,
2137,
2140,
2143,
2147,
2151,
2153,
2155,
2157,
2161,
2163,
2165,
2165,
2165,
2152,
2154,
2156,
2158,
2162,
2164,
2166,
2166,
2166,
2167,
2167,
2168,
2170);
2168,
2169,
2171);
MAST::Ops.WHO<@counts> := nqp::list_i(0,
2,
2,
Expand Down Expand Up @@ -1656,6 +1657,7 @@ BEGIN {
5,
4,
5,
1,
3,
3,
3,
Expand Down Expand Up @@ -3720,6 +3722,7 @@ BEGIN {
57,
57,
33,
34,
65,
128,
152,
Expand Down Expand Up @@ -4691,75 +4694,76 @@ BEGIN {
'encodeconf', 789,
'decodeconf', 790,
'decoderepconf', 791,
'sp_guard', 792,
'sp_guardconc', 793,
'sp_guardtype', 794,
'sp_guardsf', 795,
'sp_guardsfouter', 796,
'sp_rebless', 797,
'sp_resolvecode', 798,
'sp_decont', 799,
'sp_getlex_o', 800,
'sp_getlex_ins', 801,
'sp_getlex_no', 802,
'sp_getarg_o', 803,
'sp_getarg_i', 804,
'sp_getarg_n', 805,
'sp_getarg_s', 806,
'sp_fastinvoke_v', 807,
'sp_fastinvoke_i', 808,
'sp_fastinvoke_n', 809,
'sp_fastinvoke_s', 810,
'sp_fastinvoke_o', 811,
'sp_paramnamesused', 812,
'sp_getspeshslot', 813,
'sp_findmeth', 814,
'sp_fastcreate', 815,
'sp_get_o', 816,
'sp_get_i64', 817,
'sp_get_i32', 818,
'sp_get_i16', 819,
'sp_get_i8', 820,
'sp_get_n', 821,
'sp_get_s', 822,
'sp_bind_o', 823,
'sp_bind_i64', 824,
'sp_bind_i32', 825,
'sp_bind_i16', 826,
'sp_bind_i8', 827,
'sp_bind_n', 828,
'sp_bind_s', 829,
'sp_p6oget_o', 830,
'sp_p6ogetvt_o', 831,
'sp_p6ogetvc_o', 832,
'sp_p6oget_i', 833,
'sp_p6oget_n', 834,
'sp_p6oget_s', 835,
'sp_p6obind_o', 836,
'sp_p6obind_i', 837,
'sp_p6obind_n', 838,
'sp_p6obind_s', 839,
'sp_deref_get_i64', 840,
'sp_deref_get_n', 841,
'sp_deref_bind_i64', 842,
'sp_deref_bind_n', 843,
'sp_getlexvia_o', 844,
'sp_getlexvia_ins', 845,
'sp_jit_enter', 846,
'sp_boolify_iter', 847,
'sp_boolify_iter_arr', 848,
'sp_boolify_iter_hash', 849,
'sp_cas_o', 850,
'sp_atomicload_o', 851,
'sp_atomicstore_o', 852,
'prof_enter', 853,
'prof_enterspesh', 854,
'prof_enterinline', 855,
'prof_enternative', 856,
'prof_exit', 857,
'prof_allocated', 858,
'ctw_check', 859,
'coverage_log', 860);
'getppid', 792,
'sp_guard', 793,
'sp_guardconc', 794,
'sp_guardtype', 795,
'sp_guardsf', 796,
'sp_guardsfouter', 797,
'sp_rebless', 798,
'sp_resolvecode', 799,
'sp_decont', 800,
'sp_getlex_o', 801,
'sp_getlex_ins', 802,
'sp_getlex_no', 803,
'sp_getarg_o', 804,
'sp_getarg_i', 805,
'sp_getarg_n', 806,
'sp_getarg_s', 807,
'sp_fastinvoke_v', 808,
'sp_fastinvoke_i', 809,
'sp_fastinvoke_n', 810,
'sp_fastinvoke_s', 811,
'sp_fastinvoke_o', 812,
'sp_paramnamesused', 813,
'sp_getspeshslot', 814,
'sp_findmeth', 815,
'sp_fastcreate', 816,
'sp_get_o', 817,
'sp_get_i64', 818,
'sp_get_i32', 819,
'sp_get_i16', 820,
'sp_get_i8', 821,
'sp_get_n', 822,
'sp_get_s', 823,
'sp_bind_o', 824,
'sp_bind_i64', 825,
'sp_bind_i32', 826,
'sp_bind_i16', 827,
'sp_bind_i8', 828,
'sp_bind_n', 829,
'sp_bind_s', 830,
'sp_p6oget_o', 831,
'sp_p6ogetvt_o', 832,
'sp_p6ogetvc_o', 833,
'sp_p6oget_i', 834,
'sp_p6oget_n', 835,
'sp_p6oget_s', 836,
'sp_p6obind_o', 837,
'sp_p6obind_i', 838,
'sp_p6obind_n', 839,
'sp_p6obind_s', 840,
'sp_deref_get_i64', 841,
'sp_deref_get_n', 842,
'sp_deref_bind_i64', 843,
'sp_deref_bind_n', 844,
'sp_getlexvia_o', 845,
'sp_getlexvia_ins', 846,
'sp_jit_enter', 847,
'sp_boolify_iter', 848,
'sp_boolify_iter_arr', 849,
'sp_boolify_iter_hash', 850,
'sp_cas_o', 851,
'sp_atomicload_o', 852,
'sp_atomicstore_o', 853,
'prof_enter', 854,
'prof_enterspesh', 855,
'prof_enterinline', 856,
'prof_enternative', 857,
'prof_exit', 858,
'prof_allocated', 859,
'ctw_check', 860,
'coverage_log', 861);
MAST::Ops.WHO<@names> := nqp::list_s('no_op',
'const_i8',
'const_i16',
Expand Down Expand Up @@ -5552,6 +5556,7 @@ BEGIN {
'encodeconf',
'decodeconf',
'decoderepconf',
'getppid',
'sp_guard',
'sp_guardconc',
'sp_guardtype',
Expand Down
4 changes: 4 additions & 0 deletions src/core/interp.c
Expand Up @@ -5308,6 +5308,10 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
GET_REG(cur_op, 2).o, GET_REG(cur_op, 4).s, GET_REG(cur_op, 6).s, GET_REG(cur_op, 8).i64);
cur_op += 10;
goto NEXT;
OP(getppid):
GET_REG(cur_op, 0).i64 = MVM_proc_getppid(tc);
cur_op += 2;
goto NEXT;
OP(sp_guard): {
MVMObject *check = GET_REG(cur_op, 0).o;
MVMSTable *want = (MVMSTable *)tc->cur_frame
Expand Down
2 changes: 1 addition & 1 deletion src/core/oplabels.h
Expand Up @@ -793,6 +793,7 @@ static const void * const LABELS[] = {
&&OP_encodeconf,
&&OP_decodeconf,
&&OP_decoderepconf,
&&OP_getppid,
&&OP_sp_guard,
&&OP_sp_guardconc,
&&OP_sp_guardtype,
Expand Down Expand Up @@ -1024,7 +1025,6 @@ static const void * const LABELS[] = {
NULL,
NULL,
NULL,
NULL,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
Expand Down
1 change: 1 addition & 0 deletions src/core/oplist
Expand Up @@ -845,6 +845,7 @@ encoderepconf w(obj) r(str) r(str) r(str) r(obj) r(int64)
encodeconf w(obj) r(str) r(str) r(obj) r(int64)
decodeconf w(str) r(obj) r(str) r(int64)
decoderepconf w(str) r(obj) r(str) r(str) r(int64)
getppid w(int64)

# Spesh ops. Naming convention: start with sp_. Must all be marked .s, which
# is how the validator knows to exclude them.
Expand Down
15 changes: 14 additions & 1 deletion src/core/ops.c
Expand Up @@ -10288,6 +10288,19 @@ static const MVMOpInfo MVM_op_infos[] = {
0,
{ MVM_operand_write_reg | MVM_operand_str, MVM_operand_read_reg | MVM_operand_obj, MVM_operand_read_reg | MVM_operand_str, MVM_operand_read_reg | MVM_operand_str, MVM_operand_read_reg | MVM_operand_int64 }
},
{
MVM_OP_getppid,
"getppid",
" ",
1,
0,
0,
0,
0,
0,
0,
{ MVM_operand_write_reg | MVM_operand_int64 }
},
{
MVM_OP_sp_guard,
"sp_guard",
Expand Down Expand Up @@ -11184,7 +11197,7 @@ static const MVMOpInfo MVM_op_infos[] = {
},
};

static const unsigned short MVM_op_counts = 861;
static const unsigned short MVM_op_counts = 862;

MVM_PUBLIC const MVMOpInfo * MVM_op_get_op(unsigned short op) {
if (op >= MVM_op_counts)
Expand Down

0 comments on commit 642a2af

Please sign in to comment.