Created
August 23, 2017 11:06
-
-
Save bdw/b03c3de02750f9ffd088081aab95bba9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void adhoc_jit_graph (MVMThreadContext *tc) { | |
MVMJitGraph graph; | |
MVMJitNode label_node, call_node; | |
void *labels[2]; | |
labels[0] = &label_node; | |
labels[1] = &graph; | |
MVMJitCode *code; | |
graph.labels = labels; | |
graph.first_node = &label_node; | |
label_node.type = MVM_JIT_NODE_LABEL; | |
label_node.u.label.name = 0; | |
label_node.next = &call_node; | |
graph.last_node = &call_node; | |
call_node.type = MVM_JIT_NODE_CALL_C; | |
call_node.next = NULL; | |
call_node.u.call.func_ptr = &my_func_ptr; | |
code = MVM_jit_compile_graph(tc, &graph); | |
code->func_ptr(tc, cu, code->labels[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment