/home/travis/build/MoarVM/MoarVM/src/spesh/inline.h
Line | Count | Source |
1 | | /* Maximum size of bytecode we'll inline. */ |
2 | 22.6k | #define MVM_SPESH_MAX_INLINE_SIZE 384 |
3 | | |
4 | | /* Inline table entry. The data is primarily used in deopt. */ |
5 | | struct MVMSpeshInline { |
6 | | /* Start and end position in the bytecode where we're inside of this |
7 | | * inline. */ |
8 | | MVMuint32 start; |
9 | | MVMuint32 end; |
10 | | |
11 | | /* The static frame that was inlined. */ |
12 | | MVMStaticFrame *sf; |
13 | | |
14 | | /* The register holding the inlined code ref. */ |
15 | | MVMuint16 code_ref_reg; |
16 | | |
17 | | /* Start position of the locals and lexicals, so we can extract them |
18 | | * to the new frame. */ |
19 | | MVMuint16 locals_start; |
20 | | MVMuint16 lexicals_start; |
21 | | |
22 | | /* The number of locals in the inline. */ |
23 | | MVMuint16 num_locals; |
24 | | |
25 | | /* Result register and result type. */ |
26 | | MVMuint16 res_reg; |
27 | | MVMReturnType res_type; |
28 | | |
29 | | /* Deopt index used to find return address. */ |
30 | | MVMuint32 return_deopt_idx; |
31 | | |
32 | | /* If the inline became unreachable after being made, we'll mark it as |
33 | | * such, so we won't try and fix it up later. */ |
34 | | MVMuint8 unreachable; |
35 | | |
36 | | /* Bit field of named args used to put in place during deopt, since we |
37 | | * typically don't update the array in specialized code. */ |
38 | | MVMuint64 deopt_named_used_bit_field; |
39 | | |
40 | | /* Inlinee's spesh graph, so we can free it up after code-gen. */ |
41 | | MVMSpeshGraph *g; |
42 | | }; |
43 | | |
44 | | MVMSpeshGraph * MVM_spesh_inline_try_get_graph(MVMThreadContext *tc, |
45 | | MVMSpeshGraph *inliner, MVMStaticFrame *target_sf, MVMSpeshCandidate *cand, |
46 | | MVMSpeshIns *invoke_ins, char **no_inline_reason); |
47 | | void MVM_spesh_inline(MVMThreadContext *tc, MVMSpeshGraph *inliner, |
48 | | MVMSpeshCallInfo *call_info, MVMSpeshBB *invoke_bb, |
49 | | MVMSpeshIns *invoke, MVMSpeshGraph *inlinee, MVMStaticFrame *inlinee_sf, |
50 | | MVMSpeshOperand code_ref_reg); |