Skip to content

Commit

Permalink
Make JIT of sp_get_o match the interp
Browse files Browse the repository at this point in the history
That is, add the NULL -> VMNull mapping logic in there.
  • Loading branch information
jnthn committed Feb 13, 2019
1 parent 78e8a60 commit c5e4326
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/jit/x64/emit.dasc
Expand Up @@ -789,13 +789,25 @@ void MVM_jit_emit_primitive(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJ
}
case MVM_OP_sp_get_i64:
case MVM_OP_sp_get_n:
case MVM_OP_sp_get_s:
case MVM_OP_sp_get_s: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 obj = ins->operands[1].reg.orig;
MVMint16 offset = ins->operands[2].lit_i16;
| mov TMP1, WORK[obj]; // object
| mov TMP2, qword [TMP1+offset]; // get value from body
| mov WORK[dst], TMP2;
break;
}
case MVM_OP_sp_get_o: {
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 obj = ins->operands[1].reg.orig;
MVMint16 offset = ins->operands[2].lit_i16;
| mov TMP1, WORK[obj]; // object
| mov TMP1, WORK[obj]; // object
| mov TMP2, qword [TMP1+offset]; // get value from body
| test TMP2, TMP2;
| jnz >1;
| get_vmnull TMP2;
|1:
| mov WORK[dst], TMP2;
break;
}
Expand Down

0 comments on commit c5e4326

Please sign in to comment.