summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-12 01:55:00 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-12 01:55:00 +0000
commit33c8171c65ac0f66d1c096561e253f6f068fc85c (patch)
tree6632eedc091bc87ee8c58a8a972426a7dff48ee2 /vm_insnhelper.c
parentbddc28b2aeb6ca84c9eb2cdd59ccc9b76098e429 (diff)
make opt_case_dispatch leaf
This instruction can be written without rb_funcall. It not only boosts performance of case statements, but also makes room of future JIT improvements. Because opt_case_dispatch is about optimization this should not be a bad thing to have. ---- trunk: ruby 2.6.0dev (2018-09-05 trunk 64634) [x86_64-darwin15] ours: ruby 2.6.0dev (2018-09-12 leaf-insn 64688) [x86_64-darwin15] last_commit=make opt_case_dispatch leaf Calculating ------------------------------------- trunk ours vm2_case_lit 1.366 2.012 i/s - 1.000 times in 0.731839s 0.497008s Comparison: vm2_case_lit ours: 2.0 i/s trunk: 1.4 i/s - 1.47x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 8d4b087874..50d95610c3 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3355,7 +3355,7 @@ vm_case_dispatch(CDHASH hash, OFFSET else_offset, VALUE key)
}
}
if (st_lookup(RHASH_TBL_RAW(hash), key, &val)) {
- return FIX2INT((VALUE)val);
+ return FIX2LONG((VALUE)val);
}
else {
return else_offset;