Skip to content

Commit

Permalink
existskey is another common op.
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Jul 28, 2014
1 parent caa93e4 commit ca03ffd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/jit/graph.c
Expand Up @@ -141,6 +141,7 @@ static void * op_to_func(MVMThreadContext *tc, MVMint16 opcode) {
case MVM_OP_shift_o: return &MVM_repr_shift_o;
case MVM_OP_pop_i: return &MVM_repr_pop_i;
case MVM_OP_shift_i: return &MVM_repr_shift_i;
case MVM_OP_existskey: return &MVM_repr_exists_key;
case MVM_OP_atpos_o: return &MVM_repr_at_pos_o;
case MVM_OP_atpos_i: return &MVM_repr_at_pos_i;
case MVM_OP_atkey_o: return &MVM_repr_at_key_o;
Expand Down Expand Up @@ -581,6 +582,16 @@ static MVMint32 jgb_consume_ins(MVMThreadContext *tc, JitGraphBuilder *jgb,
jgb_append_call_c(tc, jgb, op_to_func(tc, op), 2, args, MVM_JIT_RV_INT, dst);
break;
}
case MVM_OP_existskey: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint32 invocant = ins->operands[1].reg.orig;
MVMint32 key = ins->operands[2].reg.orig;
MVMJitCallArg args[] = { { MVM_JIT_INTERP_VAR, MVM_JIT_INTERP_TC },
{ MVM_JIT_REG_VAL, invocant },
{ MVM_JIT_REG_VAL, key } };
jgb_append_call_c(tc, jgb, op_to_func(tc, op), 3, args, MVM_JIT_RV_INT, dst);
break;
}
case MVM_OP_atpos_o: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint32 invocant = ins->operands[1].reg.orig;
Expand Down

0 comments on commit ca03ffd

Please sign in to comment.