summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/class.c10
-rw-r--r--src/object.c7
2 files changed, 12 insertions, 5 deletions
diff --git a/src/class.c b/src/class.c
index 1403ed48e..97a37c54a 100644
--- a/src/class.c
+++ b/src/class.c
@@ -2840,17 +2840,17 @@ static const mrb_code new_iseq[] = {
OP_LOADSELF, 4, // OP_LOADSELF R4
OP_SEND, 4, 0, 0, // OP_SEND R4 :allocate n=0
OP_MOVE, 0, 4, // OP_MOVE R0 R4
- OP_MOVE, 5, 1, // OP_MOVE R5 R1 (*)
- OP_MOVE, 6, 2, // OP_MOVE R6 R2 (**)
- OP_MOVE, 7, 3, // OP_MOVE R7 R3
- OP_SENDB, 4, 1, 255, // OP_SENDB R4 :initialize n=*|nk=*
+ OP_MOVE, 4, 3, // OP_MOVE R4 R3 (&)
+ OP_MOVE, 3, 2, // OP_MOVE R3 R2 (**)
+ OP_MOVE, 2, 1, // OP_MOVE R2 R1 (*)
+ OP_SSENDB, 1, 1, 255, // OP_SSENDB R1 :initialize n=*|nk=*
OP_RETURN, 0 // OP_RETURN R0
};
MRB_PRESYM_DEFINE_VAR_AND_INITER(new_syms, 2, MRB_SYM(allocate), MRB_SYM(initialize))
static const mrb_irep new_irep = {
- 3, 6, 0, MRB_IREP_STATIC,
+ 4, 5, 0, MRB_IREP_STATIC,
new_iseq, NULL, new_syms, NULL, NULL, NULL,
sizeof(new_iseq), 0, 2, 0, 0,
};
diff --git a/src/object.c b/src/object.c
index b3c9973bf..8eb6b6b5e 100644
--- a/src/object.c
+++ b/src/object.c
@@ -14,12 +14,18 @@
MRB_API mrb_bool
mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
{
+#if defined(MRB_NAN_BOXING)
+ return v1.u == v2.u;
+#elif defined(MRB_NAN_BOXING)
+ return v1.w == v2.w;
+#else /* MRB_NO_BOXING */
if (mrb_type(v1) != mrb_type(v2)) return FALSE;
switch (mrb_type(v1)) {
case MRB_TT_TRUE:
return TRUE;
case MRB_TT_FALSE:
+ return (mrb_fixnum(v1) == mrb_fixnum(v2));
case MRB_TT_INTEGER:
return (mrb_integer(v1) == mrb_integer(v2));
case MRB_TT_SYMBOL:
@@ -33,6 +39,7 @@ mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
default:
return (mrb_ptr(v1) == mrb_ptr(v2));
}
+#endif
}
MRB_API mrb_bool