Skip to content

Instantly share code, notes, and snippets.

@niner
Created November 3, 2020 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niner/09d149b398fc8b5b0af1c310b3938563 to your computer and use it in GitHub Desktop.
Save niner/09d149b398fc8b5b0af1c310b3938563 to your computer and use it in GitHub Desktop.
diff --git a/src/core/intcache.c b/src/core/intcache.c
index 9767d6c9b..f6909babc 100644
--- a/src/core/intcache.c
+++ b/src/core/intcache.c
@@ -39,6 +40,7 @@ MVMObject *MVM_intcache_get(MVMThreadContext *tc, MVMObject *type, MVMint64 valu
int type_index;
int right_slot = -1;
+return NULL;
if (value < -1 || value >= 15)
return NULL;
diff --git a/src/core/interp.c b/src/core/interp.c
index 5633a1f6a..817b5b7d1 100644
--- a/src/core/interp.c
+++ b/src/core/interp.c
@@ -6281,7 +6281,7 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
}
OP(sp_fastbox_i_ic): {
MVMint64 value = GET_REG(cur_op, 8).i64;
- if (value >= -1 && value < 15) {
+ if (0 && value >= -1 && value < 15) {
MVMint16 slot = GET_UI16(cur_op, 10);
GET_REG(cur_op, 0).o = tc->instance->int_const_cache->cache[slot][value + 1];
}
@@ -6295,7 +6295,7 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
}
OP(sp_fastbox_bi_ic): {
MVMint64 value = GET_REG(cur_op, 8).i64;
- if (value >= -1 && value < 15) {
+ if (0 && value >= -1 && value < 15) {
MVMint16 slot = GET_UI16(cur_op, 10);
GET_REG(cur_op, 0).o = tc->instance->int_const_cache->cache[slot][value + 1];
}
@@ -6487,7 +6487,7 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
if (ba->u.smallint.flag == MVM_BIGINT_32_FLAG && bb->u.smallint.flag == MVM_BIGINT_32_FLAG) {
MVMint64 result = (MVMint64)ba->u.smallint.value + (MVMint64)bb->u.smallint.value;
if (MVM_IS_32BIT_INT(result)) {
- if (result < -1 || result >= 15) {
+ if (1 || result < -1 || result >= 15) {
result_obj = fastcreate(tc, cur_op);
bc = (MVMP6bigintBody *)((char *)result_obj + offset);
bc->u.smallint.value = (MVMint32)result;
@@ -6518,7 +6518,7 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
if (ba->u.smallint.flag == MVM_BIGINT_32_FLAG && bb->u.smallint.flag == MVM_BIGINT_32_FLAG) {
MVMint64 result = (MVMint64)ba->u.smallint.value - (MVMint64)bb->u.smallint.value;
if (MVM_IS_32BIT_INT(result)) {
- if (result < -1 || result >= 15) {
+ if (1 || result < -1 || result >= 15) {
result_obj = fastcreate(tc, cur_op);
bc = (MVMP6bigintBody *)((char *)result_obj + offset);
bc->u.smallint.value = (MVMint32)result;
@@ -6549,7 +6549,7 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
if (ba->u.smallint.flag == MVM_BIGINT_32_FLAG && bb->u.smallint.flag == MVM_BIGINT_32_FLAG) {
MVMint64 result = (MVMint64)ba->u.smallint.value * (MVMint64)bb->u.smallint.value;
if (MVM_IS_32BIT_INT(result)) {
- if (result < -1 || result >= 15) {
+ if (1 || result < -1 || result >= 15) {
result_obj = fastcreate(tc, cur_op);
bc = (MVMP6bigintBody *)((char *)result_obj + offset);
bc->u.smallint.value = (MVMint32)result;
diff --git a/src/jit/x64/emit.dasc b/src/jit/x64/emit.dasc
index 5ae0c945a..140f5e9c9 100644
--- a/src/jit/x64/emit.dasc
+++ b/src/jit/x64/emit.dasc
@@ -2458,7 +2458,7 @@ void MVM_jit_emit_primitive(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJ
MVMint16 dst = ins->operands[0].reg.orig;
MVMint16 offset = ins->operands[3].lit_i16;
MVMint16 val = ins->operands[4].reg.orig;
- if (use_cache) {
+ if (0 && use_cache) {
MVMObject **cache = tc->instance->int_const_cache->cache[ins->operands[5].lit_i16];
MVMint16 dst = ins->operands[0].reg.orig;
| mov TMP1, WORK[val]
@@ -2541,6 +2541,7 @@ void MVM_jit_emit_primitive(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJ
| jo >1
/* No overflow. See if it's in integer cache range. */
+ | jmp >2
| cmp TMP4d, 14
| jg >2
| cmp TMP4d, -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment