-
-
Save MasterDuke17/158822a788da37ec18af67f77607578f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/6model/reprconv.c b/src/6model/reprconv.c | |
index d47003271..3612b1fe0 100644 | |
--- a/src/6model/reprconv.c | |
+++ b/src/6model/reprconv.c | |
@@ -485,6 +485,19 @@ MVMint64 MVM_repr_at_key_i(MVMThreadContext *tc, MVMObject *obj, MVMString *key) | |
return value.i64; | |
} | |
+MVMuint64 MVM_repr_at_key_u(MVMThreadContext *tc, MVMObject *obj, MVMString *key) { | |
+ MVMRegister value; | |
+ if (REPR(obj)->ID == MVM_REPR_ID_MVMHash) { | |
+ MVMHash_at_key(tc, STABLE(obj), obj, OBJECT_BODY(obj), | |
+ (MVMObject *)key, &value, MVM_reg_uint64); | |
+ } | |
+ else { | |
+ REPR(obj)->ass_funcs.at_key(tc, STABLE(obj), obj, OBJECT_BODY(obj), | |
+ (MVMObject *)key, &value, MVM_reg_uint64); | |
+ } | |
+ return value.u64; | |
+} | |
+ | |
MVMnum64 MVM_repr_at_key_n(MVMThreadContext *tc, MVMObject *obj, MVMString *key) { | |
MVMRegister value; | |
if (REPR(obj)->ID == MVM_REPR_ID_MVMHash) { | |
diff --git a/src/6model/reprconv.h b/src/6model/reprconv.h | |
index 1f869b153..2974cfdba 100644 | |
--- a/src/6model/reprconv.h | |
+++ b/src/6model/reprconv.h | |
@@ -76,6 +76,7 @@ MVM_PUBLIC MVMString * MVM_repr_shift_s(MVMThreadContext *tc, MVMObject *obj); | |
MVM_PUBLIC MVMObject * MVM_repr_shift_o(MVMThreadContext *tc, MVMObject *obj); | |
MVM_PUBLIC MVMint64 MVM_repr_at_key_i(MVMThreadContext *tc, MVMObject *obj, MVMString *key); | |
+MVM_PUBLIC MVMuint64 MVM_repr_at_key_u(MVMThreadContext *tc, MVMObject *obj, MVMString *key); | |
MVM_PUBLIC MVMnum64 MVM_repr_at_key_n(MVMThreadContext *tc, MVMObject *obj, MVMString *key); | |
MVM_PUBLIC MVMString * MVM_repr_at_key_s(MVMThreadContext *tc, MVMObject *obj, MVMString *key); | |
MVM_PUBLIC MVMObject * MVM_repr_at_key_o(MVMThreadContext *tc, MVMObject *obj, MVMString *key); | |
diff --git a/src/jit/graph.c b/src/jit/graph.c | |
index 274b6967a..6b38a8e65 100644 | |
--- a/src/jit/graph.c | |
+++ b/src/jit/graph.c | |
@@ -200,6 +200,7 @@ static void * op_to_func(MVMThreadContext *tc, MVMint16 opcode) { | |
case MVM_OP_atkey_n: return MVM_repr_at_key_n; | |
case MVM_OP_atkey_s: return MVM_repr_at_key_s; | |
case MVM_OP_atkey_o: return MVM_repr_at_key_o; | |
+ case MVM_OP_atkey_u: return MVM_repr_at_key_u; | |
case MVM_OP_bindpos_i: return MVM_repr_bind_pos_i; | |
case MVM_OP_bindpos_n: return MVM_repr_bind_pos_n; | |
@@ -800,6 +801,7 @@ static MVMint32 consume_reprop(MVMThreadContext *tc, MVMJitGraph *jg, | |
case MVM_OP_atkey_n: | |
case MVM_OP_atkey_s: | |
case MVM_OP_atkey_o: | |
+ case MVM_OP_atkey_u: | |
case MVM_OP_elems: | |
case MVM_OP_shift_i: | |
case MVM_OP_shift_n: | |
@@ -847,6 +849,7 @@ static MVMint32 consume_reprop(MVMThreadContext *tc, MVMJitGraph *jg, | |
case MVM_OP_atkey_n: | |
case MVM_OP_atkey_s: | |
case MVM_OP_atkey_o: | |
+ case MVM_OP_atkey_u: | |
alternative = 1; | |
case MVM_OP_atpos_i: | |
case MVM_OP_atpos_n: | |
@@ -878,6 +881,7 @@ static MVMint32 consume_reprop(MVMThreadContext *tc, MVMJitGraph *jg, | |
{ MVM_JIT_REG_ADDR, dst }, | |
{ MVM_JIT_LITERAL, | |
op == MVM_OP_atpos_i || op == MVM_OP_atkey_i ? MVM_reg_int64 : | |
+ op == MVM_OP_atkey_u ? MVM_reg_uint64 : | |
op == MVM_OP_atpos_n || op == MVM_OP_atkey_n ? MVM_reg_num64 : | |
op == MVM_OP_atpos_s || op == MVM_OP_atkey_s ? MVM_reg_str : | |
MVM_reg_obj } }; | |
@@ -1454,6 +1458,7 @@ skipdevirt: | |
} | |
case MVM_OP_existspos: | |
case MVM_OP_atkey_i: | |
+ case MVM_OP_atkey_u: | |
case MVM_OP_atpos_i: { | |
MVMint16 dst = ins->operands[0].reg.orig; | |
MVMint32 invocant = ins->operands[1].reg.orig; | |
@@ -2487,6 +2492,7 @@ static MVMint32 consume_ins(MVMThreadContext *tc, MVMJitGraph *jg, | |
case MVM_OP_atkey_n: | |
case MVM_OP_atkey_s: | |
case MVM_OP_atkey_o: | |
+ case MVM_OP_atkey_u: | |
case MVM_OP_bindpos_i: | |
case MVM_OP_bindpos_n: | |
case MVM_OP_bindpos_s: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment