Skip to content

Instantly share code, notes, and snippets.

@jnthn
Last active August 16, 2018 16:36
Show Gist options
  • Save jnthn/ad791530757f723b9759b6eeb9aa2058 to your computer and use it in GitHub Desktop.
Save jnthn/ad791530757f723b9759b6eeb9aa2058 to your computer and use it in GitHub Desktop.
case MVM_OP_sp_fastbox_i:
case MVM_OP_sp_fastbox_i_ic: {
MVMint32 use_cache = op == MVM_OP_sp_fastbox_i_ic;
MVMint16 offset = ins->operands[3].lit_i16;
MVMint16 val = ins->operands[use_cache ? 5 : 4].reg.orig;
if (use_cache) {
MVMObject **cache = tc->instance->int_const_cache->cache[ins->operands[4].lit_i16];
MVMint16 dst = ins->operands[0].reg.orig;
| mov TMP1, WORK[val]
| cmp TMP1, 14
| jg >1
| cmp TMP1, -1
| jl >1
| inc TMP1
| mov TMP2, qword cache
| mov TMP2, [TMP2 + TMP1 * 8]
| mov WORK[dst], TMP2
| jmp >2
|1:
}
emit_fastcreate(tc, compiler, jg, ins);
| mov TMP1, WORK[val];
| mov qword [RV+offset], TMP1;
if (use_cache) {
|2:
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment