Skip to content

Commit

Permalink
getstderr is used in NFA's optimize and mergesubrule
Browse files Browse the repository at this point in the history
when you have a module that add lots of operators,
this can give a noticable speed-up.

the NFA situation wants an algorithmic improvement
instead, though.
  • Loading branch information
timo committed Nov 24, 2015
1 parent 83b3ae3 commit f10000f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/jit/emit_x64.dasc
Expand Up @@ -1515,6 +1515,21 @@ void MVM_jit_emit_primitive(MVMThreadContext *tc, MVMJitGraph *jg,
/* jumping out is handled by invokish */
break;
}
case MVM_OP_getstdin:
case MVM_OP_getstdout:
case MVM_OP_getstderr: {
MVMint16 dst = ins->operands[0].reg.orig;
| mov TMP3, aword TC->instance;
if (ins->info->opcode == MVM_OP_getstdin) {
| mov TMP3, aword MVMINSTANCE:TMP3->stdin_handle;
} else if (ins->info->opcode == MVM_OP_getstdout) {
| mov TMP3, aword MVMINSTANCE:TMP3->stdout_handle;
} else if (ins->info->opcode == MVM_OP_getstderr) {
| mov TMP3, aword MVMINSTANCE:TMP3->stderr_handle;
}
| mov aword WORK[dst], TMP3;
break;
}
case MVM_OP_ordat:
case MVM_OP_ordfirst: {
MVMint16 dst = ins->operands[0].reg.orig;
Expand Down
3 changes: 3 additions & 0 deletions src/jit/graph.c
Expand Up @@ -1513,6 +1513,9 @@ static MVMint32 jgb_consume_ins(MVMThreadContext *tc, JitGraphBuilder *jgb,
case MVM_OP_paramnamesused:
case MVM_OP_assertparamcheck:
case MVM_OP_getobjsc:
case MVM_OP_getstderr:
case MVM_OP_getstdout:
case MVM_OP_getstdin:
case MVM_OP_ordat:
case MVM_OP_ordfirst:
/* Profiling */
Expand Down

0 comments on commit f10000f

Please sign in to comment.