diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | insns.def | 16 | ||||
-rw-r--r-- | vm_insnhelper.c | 19 |
3 files changed, 9 insertions, 33 deletions
@@ -1,3 +1,10 @@ +Mon Sep 27 23:30:34 2010 Koichi Sasada <ko1@atdot.net> + + * insns.def (opt_case_dispatch), vm_insnhelper.c: + execute the procedures of "when" clauses by bytecode + instead of st_foreach() when the object does not hit + prepared hash. [ruby-dev:42304] + Mon Sep 27 15:54:03 2010 URABE Shyouhei <shyouhei@ruby-lang.org> * test/net/http/test_https.rb: As always, localhost is not @@ -1281,20 +1281,8 @@ opt_case_dispatch } break; } - default: { /* fall through (else) */ - struct opt_case_dispatch_i_arg arg; - - arg.obj = key; - arg.label = -1; - st_foreach(RHASH_TBL(hash), opt_case_dispatch_i, (st_data_t)&arg); - - if (arg.label != -1) { - JUMP(arg.label); - } - else { - JUMP(else_offset); - } - } + default: + break; } } diff --git a/vm_insnhelper.c b/vm_insnhelper.c index c26f50eeb4..46326d1de4 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1699,22 +1699,3 @@ opt_eq_func(VALUE recv, VALUE obj, IC ic) return Qundef; } -struct opt_case_dispatch_i_arg { - VALUE obj; - int label; -}; - -static int -opt_case_dispatch_i(st_data_t key, st_data_t data, st_data_t p) -{ - struct opt_case_dispatch_i_arg *arg = (void *)p; - - if (RTEST(rb_funcall((VALUE)key, idEqq, 1, arg->obj))) { - arg->label = FIX2INT((VALUE)data); - return ST_STOP; - } - else { - return ST_CONTINUE; - } -} - |