aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--vm_insnhelper.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ccb53ae0a..a34c2cb777 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Oct 30 06:43:50 2015 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_env_cref): make it inline for performance.
+
+ * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.
+
Fri Oct 30 06:20:40 2015 Koichi Sasada <ko1@atdot.net>
* insns.def: nobody set ic->ic_value.value to Qundef.
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 7fbdcd9c27..6a7bba92d4 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -448,7 +448,7 @@ check_cref(VALUE obj, int can_be_svar)
}
}
-static rb_cref_t *
+static inline rb_cref_t *
vm_env_cref(const VALUE *ep)
{
rb_cref_t *cref;
@@ -492,11 +492,12 @@ rb_vm_get_cref(const VALUE *ep)
{
rb_cref_t *cref = vm_env_cref(ep);
- if (cref == 0) {
+ if (cref != NULL) {
+ return cref;
+ }
+ else {
rb_bug("rb_vm_get_cref: unreachable");
}
-
- return cref;
}
void