/home/travis/build/MoarVM/MoarVM/src/core/ext.h
Line | Count | Source (jump to first uncovered line) |
1 | | typedef void MVMExtOpFunc(MVMThreadContext *tc, MVMuint8 *cur_op); |
2 | | typedef void MVMExtOpSpesh(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshBB *bb, MVMSpeshIns *ins); |
3 | | typedef void MVMExtOpFactDiscover(MVMThreadContext *tc, MVMSpeshGraph *g, MVMSpeshIns *ins); |
4 | | |
5 | | /* Flags we might put on an extension op to indicate its properties. */ |
6 | 0 | #define MVM_EXTOP_PURE 1 |
7 | 0 | #define MVM_EXTOP_NOINLINE 2 |
8 | 0 | #define MVM_EXTOP_INVOKISH 4 |
9 | 0 | #define MVM_EXTOP_NO_JIT 8 |
10 | 0 | #define MVM_EXTOP_ALLOCATING 16 |
11 | | |
12 | | struct MVMExtRegistry { |
13 | | MVMDLLSym *sym; |
14 | | MVMString *name; |
15 | | UT_hash_handle hash_handle; |
16 | | }; |
17 | | |
18 | | struct MVMExtOpRegistry { |
19 | | MVMString *name; |
20 | | MVMExtOpFunc *func; |
21 | | MVMOpInfo info; |
22 | | MVMExtOpSpesh *spesh; |
23 | | MVMExtOpFactDiscover *discover; |
24 | | MVMuint32 no_jit; |
25 | | MVMuint32 allocating; |
26 | | UT_hash_handle hash_handle; |
27 | | }; |
28 | | |
29 | | int MVM_ext_load(MVMThreadContext *tc, MVMString *lib, MVMString *ext); |
30 | | MVM_PUBLIC int MVM_ext_register_extop(MVMThreadContext *tc, const char *cname, |
31 | | MVMExtOpFunc func, MVMuint8 num_operands, MVMuint8 operands[], |
32 | | MVMExtOpSpesh *spesh, MVMExtOpFactDiscover *discover, MVMuint32 flags); |
33 | | const MVMOpInfo * MVM_ext_resolve_extop_record(MVMThreadContext *tc, |
34 | | MVMExtOpRecord *record); |