Skip to content

Commit

Permalink
Remove the OSR finalize op.
Browse files Browse the repository at this point in the history
We'll need the osrpoint op to poll for a ready replacement under the
new scheme, so this op becomes redundant.
  • Loading branch information
jnthn committed Jul 17, 2017
1 parent 2226b97 commit 4629ad7
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 148 deletions.
122 changes: 59 additions & 63 deletions lib/MAST/Ops.nqp
Expand Up @@ -770,7 +770,6 @@ BEGIN {
1914,
1918,
1921,
1921,
1923,
1925,
1928,
Expand Down Expand Up @@ -1595,7 +1594,6 @@ BEGIN {
4,
4,
3,
0,
2,
2,
3,
Expand Down Expand Up @@ -4492,66 +4490,65 @@ BEGIN {
'eqaticim_s', 763,
'indexicim_s', 764,
'decodertakecharseof', 765,
'sp_osrfinalize', 766,
'sp_guardconc', 767,
'sp_guardtype', 768,
'sp_guardcontconc', 769,
'sp_guardconttype', 770,
'sp_guardrwconc', 771,
'sp_guardrwtype', 772,
'sp_getarg_o', 773,
'sp_getarg_i', 774,
'sp_getarg_n', 775,
'sp_getarg_s', 776,
'sp_fastinvoke_v', 777,
'sp_fastinvoke_i', 778,
'sp_fastinvoke_n', 779,
'sp_fastinvoke_s', 780,
'sp_fastinvoke_o', 781,
'sp_namedarg_used', 782,
'sp_getspeshslot', 783,
'sp_findmeth', 784,
'sp_fastcreate', 785,
'sp_get_o', 786,
'sp_get_i64', 787,
'sp_get_i32', 788,
'sp_get_i16', 789,
'sp_get_i8', 790,
'sp_get_n', 791,
'sp_get_s', 792,
'sp_bind_o', 793,
'sp_bind_i64', 794,
'sp_bind_i32', 795,
'sp_bind_i16', 796,
'sp_bind_i8', 797,
'sp_bind_n', 798,
'sp_bind_s', 799,
'sp_p6oget_o', 800,
'sp_p6ogetvt_o', 801,
'sp_p6ogetvc_o', 802,
'sp_p6oget_i', 803,
'sp_p6oget_n', 804,
'sp_p6oget_s', 805,
'sp_p6obind_o', 806,
'sp_p6obind_i', 807,
'sp_p6obind_n', 808,
'sp_p6obind_s', 809,
'sp_deref_get_i64', 810,
'sp_deref_get_n', 811,
'sp_deref_bind_i64', 812,
'sp_deref_bind_n', 813,
'sp_jit_enter', 814,
'sp_boolify_iter', 815,
'sp_boolify_iter_arr', 816,
'sp_boolify_iter_hash', 817,
'prof_enter', 818,
'prof_enterspesh', 819,
'prof_enterinline', 820,
'prof_enternative', 821,
'prof_exit', 822,
'prof_allocated', 823,
'ctw_check', 824,
'coverage_log', 825);
'sp_guardconc', 766,
'sp_guardtype', 767,
'sp_guardcontconc', 768,
'sp_guardconttype', 769,
'sp_guardrwconc', 770,
'sp_guardrwtype', 771,
'sp_getarg_o', 772,
'sp_getarg_i', 773,
'sp_getarg_n', 774,
'sp_getarg_s', 775,
'sp_fastinvoke_v', 776,
'sp_fastinvoke_i', 777,
'sp_fastinvoke_n', 778,
'sp_fastinvoke_s', 779,
'sp_fastinvoke_o', 780,
'sp_namedarg_used', 781,
'sp_getspeshslot', 782,
'sp_findmeth', 783,
'sp_fastcreate', 784,
'sp_get_o', 785,
'sp_get_i64', 786,
'sp_get_i32', 787,
'sp_get_i16', 788,
'sp_get_i8', 789,
'sp_get_n', 790,
'sp_get_s', 791,
'sp_bind_o', 792,
'sp_bind_i64', 793,
'sp_bind_i32', 794,
'sp_bind_i16', 795,
'sp_bind_i8', 796,
'sp_bind_n', 797,
'sp_bind_s', 798,
'sp_p6oget_o', 799,
'sp_p6ogetvt_o', 800,
'sp_p6ogetvc_o', 801,
'sp_p6oget_i', 802,
'sp_p6oget_n', 803,
'sp_p6oget_s', 804,
'sp_p6obind_o', 805,
'sp_p6obind_i', 806,
'sp_p6obind_n', 807,
'sp_p6obind_s', 808,
'sp_deref_get_i64', 809,
'sp_deref_get_n', 810,
'sp_deref_bind_i64', 811,
'sp_deref_bind_n', 812,
'sp_jit_enter', 813,
'sp_boolify_iter', 814,
'sp_boolify_iter_arr', 815,
'sp_boolify_iter_hash', 816,
'prof_enter', 817,
'prof_enterspesh', 818,
'prof_enterinline', 819,
'prof_enternative', 820,
'prof_exit', 821,
'prof_allocated', 822,
'ctw_check', 823,
'coverage_log', 824);
MAST::Ops.WHO<@names> := nqp::list_s('no_op',
'const_i8',
'const_i16',
Expand Down Expand Up @@ -5318,7 +5315,6 @@ BEGIN {
'eqaticim_s',
'indexicim_s',
'decodertakecharseof',
'sp_osrfinalize',
'sp_guardconc',
'sp_guardtype',
'sp_guardcontconc',
Expand Down
3 changes: 0 additions & 3 deletions src/core/interp.c
Expand Up @@ -5139,9 +5139,6 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
cur_op += 6;
goto NEXT;
}
OP(sp_osrfinalize):
/* TODO Remove as part of spesh worker refactor */
goto NEXT;
OP(sp_guardconc): {
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 @@ -767,7 +767,6 @@ static const void * const LABELS[] = {
&&OP_eqaticim_s,
&&OP_indexicim_s,
&&OP_decodertakecharseof,
&&OP_sp_osrfinalize,
&&OP_sp_guardconc,
&&OP_sp_guardtype,
&&OP_sp_guardcontconc,
Expand Down Expand Up @@ -1025,6 +1024,7 @@ static const void * const LABELS[] = {
NULL,
NULL,
NULL,
NULL,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
&&OP_CALL_EXTOP,
Expand Down
5 changes: 0 additions & 5 deletions src/core/oplist
Expand Up @@ -809,11 +809,6 @@ decodertakecharseof w(str) r(obj) r(int64)
# Spesh ops. Naming convention: start with sp_. Must all be marked .s, which
# is how the validator knows to exclude them.

# If we're doing OSR, the logging phase replaces the osrpoint with this op, to
# trigger the finalization of the optimization process once we do enough loops
# to gather logging information.
sp_osrfinalize .s

# Guard operations. Trigger de-optimization if the guard is violated.
# guardconc = guard on concrete type; index is spesh slot with type
# guardtype = guard on type object; index is spesh slot with type
Expand Down
12 changes: 1 addition & 11 deletions src/core/ops.c
Expand Up @@ -8419,16 +8419,6 @@ 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_int64 }
},
{
MVM_OP_sp_osrfinalize,
"sp_osrfinalize",
".s",
0,
0,
0,
0,
0,
},
{
MVM_OP_sp_guardconc,
"sp_guardconc",
Expand Down Expand Up @@ -9077,7 +9067,7 @@ static const MVMOpInfo MVM_op_infos[] = {
},
};

static const unsigned short MVM_op_counts = 826;
static const unsigned short MVM_op_counts = 825;

MVM_PUBLIC const MVMOpInfo * MVM_op_get_op(unsigned short op) {
if (op >= MVM_op_counts)
Expand Down
119 changes: 59 additions & 60 deletions src/core/ops.h
Expand Up @@ -767,66 +767,65 @@
#define MVM_OP_eqaticim_s 763
#define MVM_OP_indexicim_s 764
#define MVM_OP_decodertakecharseof 765
#define MVM_OP_sp_osrfinalize 766
#define MVM_OP_sp_guardconc 767
#define MVM_OP_sp_guardtype 768
#define MVM_OP_sp_guardcontconc 769
#define MVM_OP_sp_guardconttype 770
#define MVM_OP_sp_guardrwconc 771
#define MVM_OP_sp_guardrwtype 772
#define MVM_OP_sp_getarg_o 773
#define MVM_OP_sp_getarg_i 774
#define MVM_OP_sp_getarg_n 775
#define MVM_OP_sp_getarg_s 776
#define MVM_OP_sp_fastinvoke_v 777
#define MVM_OP_sp_fastinvoke_i 778
#define MVM_OP_sp_fastinvoke_n 779
#define MVM_OP_sp_fastinvoke_s 780
#define MVM_OP_sp_fastinvoke_o 781
#define MVM_OP_sp_namedarg_used 782
#define MVM_OP_sp_getspeshslot 783
#define MVM_OP_sp_findmeth 784
#define MVM_OP_sp_fastcreate 785
#define MVM_OP_sp_get_o 786
#define MVM_OP_sp_get_i64 787
#define MVM_OP_sp_get_i32 788
#define MVM_OP_sp_get_i16 789
#define MVM_OP_sp_get_i8 790
#define MVM_OP_sp_get_n 791
#define MVM_OP_sp_get_s 792
#define MVM_OP_sp_bind_o 793
#define MVM_OP_sp_bind_i64 794
#define MVM_OP_sp_bind_i32 795
#define MVM_OP_sp_bind_i16 796
#define MVM_OP_sp_bind_i8 797
#define MVM_OP_sp_bind_n 798
#define MVM_OP_sp_bind_s 799
#define MVM_OP_sp_p6oget_o 800
#define MVM_OP_sp_p6ogetvt_o 801
#define MVM_OP_sp_p6ogetvc_o 802
#define MVM_OP_sp_p6oget_i 803
#define MVM_OP_sp_p6oget_n 804
#define MVM_OP_sp_p6oget_s 805
#define MVM_OP_sp_p6obind_o 806
#define MVM_OP_sp_p6obind_i 807
#define MVM_OP_sp_p6obind_n 808
#define MVM_OP_sp_p6obind_s 809
#define MVM_OP_sp_deref_get_i64 810
#define MVM_OP_sp_deref_get_n 811
#define MVM_OP_sp_deref_bind_i64 812
#define MVM_OP_sp_deref_bind_n 813
#define MVM_OP_sp_jit_enter 814
#define MVM_OP_sp_boolify_iter 815
#define MVM_OP_sp_boolify_iter_arr 816
#define MVM_OP_sp_boolify_iter_hash 817
#define MVM_OP_prof_enter 818
#define MVM_OP_prof_enterspesh 819
#define MVM_OP_prof_enterinline 820
#define MVM_OP_prof_enternative 821
#define MVM_OP_prof_exit 822
#define MVM_OP_prof_allocated 823
#define MVM_OP_ctw_check 824
#define MVM_OP_coverage_log 825
#define MVM_OP_sp_guardconc 766
#define MVM_OP_sp_guardtype 767
#define MVM_OP_sp_guardcontconc 768
#define MVM_OP_sp_guardconttype 769
#define MVM_OP_sp_guardrwconc 770
#define MVM_OP_sp_guardrwtype 771
#define MVM_OP_sp_getarg_o 772
#define MVM_OP_sp_getarg_i 773
#define MVM_OP_sp_getarg_n 774
#define MVM_OP_sp_getarg_s 775
#define MVM_OP_sp_fastinvoke_v 776
#define MVM_OP_sp_fastinvoke_i 777
#define MVM_OP_sp_fastinvoke_n 778
#define MVM_OP_sp_fastinvoke_s 779
#define MVM_OP_sp_fastinvoke_o 780
#define MVM_OP_sp_namedarg_used 781
#define MVM_OP_sp_getspeshslot 782
#define MVM_OP_sp_findmeth 783
#define MVM_OP_sp_fastcreate 784
#define MVM_OP_sp_get_o 785
#define MVM_OP_sp_get_i64 786
#define MVM_OP_sp_get_i32 787
#define MVM_OP_sp_get_i16 788
#define MVM_OP_sp_get_i8 789
#define MVM_OP_sp_get_n 790
#define MVM_OP_sp_get_s 791
#define MVM_OP_sp_bind_o 792
#define MVM_OP_sp_bind_i64 793
#define MVM_OP_sp_bind_i32 794
#define MVM_OP_sp_bind_i16 795
#define MVM_OP_sp_bind_i8 796
#define MVM_OP_sp_bind_n 797
#define MVM_OP_sp_bind_s 798
#define MVM_OP_sp_p6oget_o 799
#define MVM_OP_sp_p6ogetvt_o 800
#define MVM_OP_sp_p6ogetvc_o 801
#define MVM_OP_sp_p6oget_i 802
#define MVM_OP_sp_p6oget_n 803
#define MVM_OP_sp_p6oget_s 804
#define MVM_OP_sp_p6obind_o 805
#define MVM_OP_sp_p6obind_i 806
#define MVM_OP_sp_p6obind_n 807
#define MVM_OP_sp_p6obind_s 808
#define MVM_OP_sp_deref_get_i64 809
#define MVM_OP_sp_deref_get_n 810
#define MVM_OP_sp_deref_bind_i64 811
#define MVM_OP_sp_deref_bind_n 812
#define MVM_OP_sp_jit_enter 813
#define MVM_OP_sp_boolify_iter 814
#define MVM_OP_sp_boolify_iter_arr 815
#define MVM_OP_sp_boolify_iter_hash 816
#define MVM_OP_prof_enter 817
#define MVM_OP_prof_enterspesh 818
#define MVM_OP_prof_enterinline 819
#define MVM_OP_prof_enternative 820
#define MVM_OP_prof_exit 821
#define MVM_OP_prof_allocated 822
#define MVM_OP_ctw_check 823
#define MVM_OP_coverage_log 824

#define MVM_OP_EXT_BASE 1024
#define MVM_OP_EXT_CU_LIMIT 1024
Expand Down
5 changes: 0 additions & 5 deletions src/spesh/optimize.c
Expand Up @@ -1573,11 +1573,6 @@ static void optimize_bb(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *bb)
case MVM_OP_isrwcont:
optimize_container_check(tc, g, bb, ins);
break;
case MVM_OP_sp_osrfinalize:
/* Left-over log instruction that didn't become a guard, or OSR
* finalize instruction; just delete it. */
MVM_spesh_manipulate_delete_ins(tc, g, bb, ins);
break;
case MVM_OP_prof_enter:
/* Profiling entered from spesh should indicate so. */
ins->info = MVM_op_get_op(MVM_OP_prof_enterspesh);
Expand Down

0 comments on commit 4629ad7

Please sign in to comment.