Coverage Report

Created: 2018-07-03 15:31

/home/travis/build/MoarVM/MoarVM/src/jit/tile.h
Line
Count
Source
1
struct MVMJitTileTemplate {
2
    void (*emit)(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJitTile *tile, MVMJitExprTree *tree);
3
    const char    *path;
4
    const char    *expr;
5
    MVMint32  left_sym;
6
    MVMint32  right_sym;
7
8
    MVMint32  num_refs;
9
    MVMint32  value_bitmap;
10
    MVMuint32 register_spec;
11
};
12
13
struct MVMJitTile {
14
    void (*emit)(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJitTile *tile, MVMJitExprTree *tree);
15
    MVMint32 node;
16
    MVMint32 op;
17
18
    MVMint32      num_refs;
19
    MVMint32       refs[4];
20
    MVMJitExprNode args[4];
21
    MVMint8      values[4];
22
23
    MVMuint32 register_spec;
24
    MVMint8   size;
25
26
    const char *debug_name;
27
};
28
29
struct MVMJitTileBB {
30
    /* first and last tile index of code  */
31
    MVMint32 start, end;
32
    /* up to two successors */
33
    MVMint32 num_succ, succ[2];
34
};
35
36
/* A tile I'm planning to insert into the list */
37
struct MVMJitTileInsert {
38
    MVMint32 position;
39
    MVMint32 order;
40
    MVMJitTile *tile;
41
};
42
43
/* A list of tiles representing a (part of a) routine */
44
struct MVMJitTileList {
45
    MVMJitExprTree *tree;
46
    MVM_VECTOR_DECL(MVMJitTile*, items);
47
    MVM_VECTOR_DECL(struct MVMJitTileInsert, inserts);
48
    MVM_VECTOR_DECL(struct MVMJitTileBB, blocks);
49
50
    /* TODO implement structures to mark basic blocks */
51
    MVMint32 num_arglist_refs;
52
};
53
54
55
56
57
MVMJitTile     * MVM_jit_tile_make(MVMThreadContext *tc, MVMJitCompiler *compiler, void *emit,
58
                                   MVMint32 num_args, MVMint32 num_values, ...);
59
MVMJitTile     * MVM_jit_tile_make_from_template(MVMThreadContext *tc, MVMJitCompiler *compiler,
60
                                                 const MVMJitTileTemplate *template,
61
                                                 MVMJitExprTree *tree, MVMint32 node);
62
MVMJitTileList * MVM_jit_tile_expr_tree(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJitExprTree *tree);
63
64
65
void MVM_jit_tile_list_insert(MVMThreadContext *tc, MVMJitTileList *list, MVMJitTile *tile, MVMint32 position, MVMint32 order);
66
void MVM_jit_tile_list_edit(MVMThreadContext *tc, MVMJitTileList *list);
67
void MVM_jit_tile_list_destroy(MVMThreadContext *tc, MVMJitTileList *list);
68
69
16.2M
#define MVM_JIT_TILE_YIELDS_VALUE(t) ((t)->register_spec & 1)
70
#define MVM_JIT_TILE_DECL(name) \
71
    void MVM_jit_tile_ ## name (MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJitTile *tile, MVMJitExprTree *tree)