diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-27 14:47:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-27 14:47:30 +0000 |
commit | 86a8b820d636a36ddc49f9c906f5d0744dd3ef23 (patch) | |
tree | 960d4ea17a28520c509671c80c9fb6865143f57f | |
parent | 93fba33b47524f24b018c09b79a01712a5605093 (diff) | |
download | ruby-86a8b820d636a36ddc49f9c906f5d0744dd3ef23.tar.gz |
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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; - } -} - |