/home/travis/build/MoarVM/MoarVM/src/spesh/optimize.h
Line | Count | Source |
1 | | /* Maximum args a call can take for us to consider it for optimization. */ |
2 | 111k | #define MAX_ARGS_FOR_OPT 8 |
3 | | |
4 | | /* Percentage of type tuples that we expect to match at a callsite in order to |
5 | | * consider those what we should guard agaisnt (causing a deopt on mismatch). |
6 | | * So if this is 99, then we expect 1% of calls may deopt. */ |
7 | 24.4k | #define MVM_SPESH_CALLSITE_STABLE_PERCENT 99 |
8 | | |
9 | | /* Information we've gathered about the current call we're optimizing, and the |
10 | | * arguments it will take. */ |
11 | | struct MVMSpeshCallInfo { |
12 | | MVMCallsite *cs; |
13 | | MVMint8 arg_is_const[MAX_ARGS_FOR_OPT]; |
14 | | MVMSpeshFacts *arg_facts[MAX_ARGS_FOR_OPT]; |
15 | | MVMSpeshIns *prepargs_ins; |
16 | | MVMSpeshBB *prepargs_bb; |
17 | | MVMSpeshIns *arg_ins[MAX_ARGS_FOR_OPT]; |
18 | | }; |
19 | | |
20 | | void MVM_spesh_optimize(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshPlanned *p); |
21 | | MVM_PUBLIC MVMint16 MVM_spesh_add_spesh_slot(MVMThreadContext *tc, MVMSpeshGraph *g, MVMCollectable *c); |
22 | | MVMint16 MVM_spesh_add_spesh_slot_try_reuse(MVMThreadContext *tc, MVMSpeshGraph *g, MVMCollectable *c); |
23 | | MVM_PUBLIC MVMSpeshFacts * MVM_spesh_get_and_use_facts(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshOperand o); |
24 | | MVM_PUBLIC MVMSpeshFacts * MVM_spesh_get_facts(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshOperand o); |
25 | | MVM_PUBLIC void MVM_spesh_use_facts(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshFacts *f); |
26 | | MVM_PUBLIC MVMString * MVM_spesh_get_string(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshOperand o); |