summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:46:19 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 14:46:19 +0000
commit0a84a18ef486c13ae75d2272e2e3d4a23e4634ce (patch)
treef77b8f140459d678251f08890330b2258a42d692 /vm_insnhelper.c
parent3e26b9514563b477982444d755156e85279e84bc (diff)
merges r24511 from trunk into ruby_1_9_1.
-- * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: check definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@25478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 8a1306ab9e..2a48dba4ad 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1536,3 +1536,21 @@ opt_eq_func(VALUE recv, VALUE obj, IC ic)
return val;
}
+
+struct opt_case_dispatch_i_arg {
+ VALUE obj;
+ int label;
+};
+
+static int
+opt_case_dispatch_i(st_data_t key, st_data_t data, struct opt_case_dispatch_i_arg *arg)
+{
+ if (RTEST(rb_funcall((VALUE)key, idEqq, 1, arg->obj))) {
+ arg->label = FIX2INT((VALUE)data);
+ return ST_STOP;
+ }
+ else {
+ return ST_CONTINUE;
+ }
+}
+