Skip to content

Instantly share code, notes, and snippets.

@bdw
Created August 23, 2017 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdw/b03c3de02750f9ffd088081aab95bba9 to your computer and use it in GitHub Desktop.
Save bdw/b03c3de02750f9ffd088081aab95bba9 to your computer and use it in GitHub Desktop.
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