Coverage Report

Created: 2017-04-15 07:07

/home/travis/build/MoarVM/MoarVM/src/spesh/inline.h
Line
Count
Source
1
/* Maximum size of bytecode we'll inline. */
2
7.05k
#define MVM_SPESH_MAX_INLINE_SIZE 256
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 inlined code ref. */
12
    MVMCode *code;
13
14
    /* Start position of the locals and lexicals, so we can extract them
15
     * to the new frame. */
16
    MVMuint16 locals_start;
17
    MVMuint16 lexicals_start;
18
19
    /* Result register and result type. */
20
    MVMuint16     res_reg;
21
    MVMReturnType res_type;
22
23
    /* Deopt index used to find return address. */
24
    MVMuint32 return_deopt_idx;
25
26
    /* Inlinee's spesh graph, so we can free it up after code-gen. */
27
    MVMSpeshGraph *g;
28
};
29
30
MVMSpeshGraph * MVM_spesh_inline_try_get_graph(MVMThreadContext *tc,
31
    MVMSpeshGraph *inliner, MVMCode *target, MVMSpeshCandidate *cand);
32
void MVM_spesh_inline(MVMThreadContext *tc, MVMSpeshGraph *inliner,
33
    MVMSpeshCallInfo *call_info, MVMSpeshBB *invoke_bb,
34
    MVMSpeshIns *invoke, MVMSpeshGraph *inlinee, MVMCode *inlinee_code);