From 15d735de1506e063b47ba1c4124a6b9cca316eda Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 29 Oct 2015 21:47:05 +0000 Subject: [PATCH] * vm_insnhelper.c (vm_env_cref): make it inline for performance. * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ vm_insnhelper.c | 9 +++++---- 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 + + * 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 * 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