Permalink
Browse files

JIT decodertakeline.

  • Loading branch information...
jnthn committed Jun 13, 2017
1 parent 8fe17d3 commit 78ac0ad54c27f06c542273e5d1db57ba399b6924
Showing with 19 additions and 0 deletions.
  1. +19 −0 src/jit/graph.c
View
@@ -300,6 +300,8 @@ static void * op_to_func(MVMThreadContext *tc, MVMint16 opcode) {
case MVM_OP_eof_fh: return MVM_io_eof;
case MVM_OP_decodertakeline: return MVM_decoder_take_line;
case MVM_OP_elems: return MVM_repr_elems;
case MVM_OP_concat_s: return MVM_string_concatenate;
case MVM_OP_repeat_s: return MVM_string_repeat;
@@ -2344,6 +2346,23 @@ static MVMint32 jgb_consume_ins(MVMThreadContext *tc, JitGraphBuilder *jgb,
{ MVM_JIT_REG_VAL, { type } } };
jgb_append_call_c(tc, jgb, op_to_func(tc, op), 3, args, MVM_JIT_RV_PTR, dst);
break;
}
/* streaming decode ops */
case MVM_OP_decodertakeline: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 decoder = ins->operands[1].reg.orig;
MVMint16 chomp = ins->operands[2].reg.orig;
MVMint16 inc = ins->operands[3].reg.orig;
MVMJitCallArg argc[] = { { MVM_JIT_INTERP_VAR, { MVM_JIT_INTERP_TC } },
{ MVM_JIT_REG_VAL, { decoder } },
{ MVM_JIT_LITERAL_PTR, { (MVMint64)"decodertakeline" } } };
MVMJitCallArg args[] = { { MVM_JIT_INTERP_VAR, { MVM_JIT_INTERP_TC } },
{ MVM_JIT_REG_VAL, { decoder } },
{ MVM_JIT_REG_VAL, { chomp } },
{ MVM_JIT_REG_VAL, { inc } } };
jgb_append_call_c(tc, jgb, &MVM_decoder_ensure_decoder, 3, argc, MVM_JIT_RV_VOID, -1);
jgb_append_call_c(tc, jgb, op_to_func(tc, op), 4, args, MVM_JIT_RV_PTR, dst);
break;
}
/* bigint ops */
case MVM_OP_isbig_I: {

0 comments on commit 78ac0ad

Please sign in to comment.