From 27f972b04824fc2b9936a6ddd363fb3453fed2be Mon Sep 17 00:00:00 2001 From: Aurora Nockert Date: Thu, 27 Jun 2024 22:45:28 +0200 Subject: [PATCH] Reorder mrb_vtype This allows the compiler to optimise the case in obj_iv_p into a range check. There does not seem to be any other very hot uses of this index and it grants a pretty big gain on optcarrot. --- include/mruby/value.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mruby/value.h b/include/mruby/value.h index 16da2cbd4..96af28d35 100644 --- a/include/mruby/value.h +++ b/include/mruby/value.h @@ -143,16 +143,16 @@ static const unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000; f(MRB_TT_OBJECT, struct RObject, "Object") \ f(MRB_TT_CLASS, struct RClass, "Class") \ f(MRB_TT_MODULE, struct RClass, "Module") \ - f(MRB_TT_ICLASS, struct RClass, "iClass") \ f(MRB_TT_SCLASS, struct RClass, "SClass") \ + f(MRB_TT_HASH, struct RHash, "Hash") \ + f(MRB_TT_CDATA, struct RData, "C data") \ + f(MRB_TT_EXCEPTION, struct RException, "Exception") \ + f(MRB_TT_ICLASS, struct RClass, "iClass") \ f(MRB_TT_PROC, struct RProc, "Proc") \ f(MRB_TT_ARRAY, struct RArray, "Array") \ - f(MRB_TT_HASH, struct RHash, "Hash") \ f(MRB_TT_STRING, struct RString, "String") \ f(MRB_TT_RANGE, struct RRange, "Range") \ - f(MRB_TT_EXCEPTION, struct RException, "Exception") \ f(MRB_TT_ENV, struct REnv, "env") \ - f(MRB_TT_CDATA, struct RData, "C data") \ f(MRB_TT_FIBER, struct RFiber, "Fiber") \ f(MRB_TT_STRUCT, struct RArray, "Struct") \ f(MRB_TT_ISTRUCT, struct RIStruct, "istruct") \