Skip to content

Commit

Permalink
Add istty_fh legojit (#1084)
Browse files Browse the repository at this point in the history
  • Loading branch information
ugexe authored and MasterDuke17 committed Mar 26, 2019
1 parent 9e5196d commit 3c2e98d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/jit/graph.c
Expand Up @@ -244,6 +244,7 @@ static void * op_to_func(MVMThreadContext *tc, MVMint16 opcode) {
case MVM_OP_open_fh: return MVM_file_open_fh;
case MVM_OP_close_fh: return MVM_io_close;
case MVM_OP_eof_fh: return MVM_io_eof;
case MVM_OP_istty_fh: return MVM_io_is_tty;
case MVM_OP_fileno_fh: return MVM_io_fileno;
case MVM_OP_write_fhb: return MVM_io_write_bytes;
case MVM_OP_read_fhb: return MVM_io_read_bytes;
Expand Down Expand Up @@ -2837,6 +2838,14 @@ static MVMint32 consume_ins(MVMThreadContext *tc, MVMJitGraph *jg,
jg_append_call_c(tc, jg, op_to_func(tc, op), 2, args, MVM_JIT_RV_INT, dst);
break;
}
case MVM_OP_istty_fh: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 fho = ins->operands[1].reg.orig;
MVMJitCallArg args[] = { { MVM_JIT_INTERP_VAR, { MVM_JIT_INTERP_TC } },
{ MVM_JIT_REG_VAL, { fho } } };
jg_append_call_c(tc, jg, op_to_func(tc, op), 2, args, MVM_JIT_RV_INT, dst);
break;
}
case MVM_OP_fileno_fh: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 fho = ins->operands[1].reg.orig;
Expand Down

0 comments on commit 3c2e98d

Please sign in to comment.