Skip to content

Instantly share code, notes, and snippets.

@bdw

bdw/from.c Secret

Last active August 29, 2015 14:25
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/8ed7638d265ff77d716e to your computer and use it in GitHub Desktop.
Save bdw/8ed7638d265ff77d716e to your computer and use it in GitHub Desktop.
example of conversion
case MVM_OP_unshift_i: return &MVM_repr_unshift_i;
case MVM_OP_unshift_n: return &MVM_repr_unshift_n;
case MVM_OP_unshift_n:
case MVM_OP_push_n: {
MVMint32 invocant = ins->operands[0].reg.orig;
MVMint32 value = ins->operands[1].reg.orig;
MVMJitCallArg args[] = { { MVM_JIT_INTERP_VAR, MVM_JIT_INTERP_TC },
{ MVM_JIT_REG_VAL, invocant },
{ MVM_JIT_REG_VAL_F, value } };
jg_append_call_c(tc, jgb->graph, op_to_func(tc, op), 3, args, MVM_JIT_RV_VOID, -1);
break;
}
(template: unshift_n
(call (^func &MVM_repr_unshift_n)
(arglist 3
(carg (tc) ptr)
(carg $0 ptr)
(carg $1 num))
void))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment