aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:47:31 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:47:31 +0000
commit4c63cb161ab62d08ceaefb029aa3fe1ca4da92be (patch)
tree728707319212fd344ab8b2723cd7c5b3f22a88a7 /vm.c
parent380cabf8224c5623af4e686240404097da01f17d (diff)
downloadruby-4c63cb161ab62d08ceaefb029aa3fe1ca4da92be.tar.gz
* compile.c (NODE_CALL): add optimization shortcut for Array#max/min.
Now `[x, y].max` is optimized so that a temporal array object is not created in some condition. * insns.def (opt_newarray_max, opt_newarray_min): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 9057552e0d..7c91eaa579 100644
--- a/vm.c
+++ b/vm.c
@@ -1475,6 +1475,8 @@ vm_init_redefined_flag(void)
OP(Succ, SUCC), (C(Fixnum), C(String), C(Time));
OP(EqTilde, MATCH), (C(Regexp), C(String));
OP(Freeze, FREEZE), (C(String));
+ OP(Max, MAX), (C(Array));
+ OP(Min, MIN), (C(Array));
#undef C
#undef OP
}