Coverage Report

Created: 2018-06-05 05:44

/home/travis/build/MoarVM/MoarVM/src/jit/compile.h
Line
Count
Source (jump to first uncovered line)
1
2
struct MVMJitCode {
3
    void     (*func_ptr)(MVMThreadContext *tc, MVMCompUnit *cu, void * label);
4
    size_t     size;
5
    MVMuint8  *bytecode;
6
7
    MVMStaticFrame *sf;
8
9
    MVMuint16 *local_types;
10
    MVMint32   num_locals;
11
12
    /* The basic idea here is that /all/ label names are indexes into the single
13
     * labels array. This isn't particularly efficient at runtime (because we
14
     * need a second dereference to figure the labels out), but very simple for
15
     * me now, and super-easy to optimise at a later date */
16
    MVMint32   num_labels;
17
    void     **labels;
18
19
    MVMint32       num_deopts;
20
    MVMint32       num_inlines;
21
    MVMint32       num_handlers;
22
    MVMJitDeopt    *deopts;
23
    MVMJitInline  *inlines;
24
    MVMJitHandler *handlers;
25
26
    MVMint32       spill_size;
27
    MVMint32       seq_nr;
28
};
29
30
MVMJitCode* MVM_jit_compile_graph(MVMThreadContext *tc, MVMJitGraph *graph);
31
32
void MVM_jit_destroy_code(MVMThreadContext *tc, MVMJitCode *code);
33
void MVM_jit_enter_code(MVMThreadContext *tc, MVMCompUnit *cu,
34
                        MVMJitCode * code);
35
36
/* Peseudotile compile functions */
37
void MVM_jit_compile_label(MVMThreadContext *tc, MVMJitCompiler *compiler,
38
                           MVMJitTile *tile, MVMJitExprTree *tree);
39
void MVM_jit_compile_branch(MVMThreadContext *tc, MVMJitCompiler *compiler,
40
                            MVMJitTile *tile, MVMJitExprTree *tree);
41
void MVM_jit_compile_conditional_branch(MVMThreadContext *tc, MVMJitCompiler *compiler,
42
                                        MVMJitTile *tile, MVMJitExprTree *tree);
43
void MVM_jit_compile_store(MVMThreadContext *tc, MVMJitCompiler *compiler,
44
                           MVMJitTile *tile, MVMJitExprTree *tree);
45
void MVM_jit_compile_load(MVMThreadContext *tc, MVMJitCompiler *compiler,
46
                          MVMJitTile *tile, MVMJitExprTree *tree);
47
void MVM_jit_compile_move(MVMThreadContext *tc, MVMJitCompiler *compiler,
48
                          MVMJitTile *tile, MVMJitExprTree *tree);
49
void MVM_jit_compile_memory_copy(MVMThreadContext *tc, MVMJitCompiler *compiler,
50
                                 MVMJitTile *tile, MVMJitExprTree *tree);
51
void MVM_jit_compile_guard(MVMThreadContext *tc, MVMJitCompiler *compiler,
52
                           MVMJitTile *tile, MVMJitExprTree *tree);
53
54
/* Function for getting effective (JIT/specialized/original) bytecode. */
55
0
MVM_STATIC_INLINE MVMuint8 * MVM_frame_effective_bytecode(MVMFrame *f) {
56
0
    MVMSpeshCandidate *spesh_cand = f->spesh_cand;
57
0
    if (spesh_cand)
58
0
        return spesh_cand->jitcode ? spesh_cand->jitcode->bytecode : spesh_cand->bytecode;
59
0
    return f->static_info->body.bytecode;
60
0
}
61