summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-09-30 13:18:14 -0900
committerGitHub <noreply@github.com>2021-09-30 15:18:14 -0700
commit1f5f8a187adb746b01cc95c3f29a0a355f513374 (patch)
tree9d907b527d60b89f4c9d6402b1bdabb8aec7abf0 /insns.def
parenta55a5fc68426ed701dace6bc166d18de06d8dcb2 (diff)
Make Array#min/max optimization respect refined methods
Pass in ec to vm_opt_newarray_{max,min}. Avoids having to call GET_EC inside the functions, for better performance. While here, add a test for Array#min/max being redefined to test_optimization.rb. Fixes [Bug #18180]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4911 Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def4
1 files changed, 2 insertions, 2 deletions
diff --git a/insns.def b/insns.def
index cf09809ba1..43690be52e 100644
--- a/insns.def
+++ b/insns.def
@@ -834,7 +834,7 @@ opt_newarray_max
// attr bool leaf = false; /* has rb_funcall() */
// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
{
- val = vm_opt_newarray_max(num, STACK_ADDR_FROM_TOP(num));
+ val = vm_opt_newarray_max(ec, num, STACK_ADDR_FROM_TOP(num));
}
DEFINE_INSN
@@ -846,7 +846,7 @@ opt_newarray_min
// attr bool leaf = false; /* has rb_funcall() */
// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
{
- val = vm_opt_newarray_min(num, STACK_ADDR_FROM_TOP(num));
+ val = vm_opt_newarray_min(ec, num, STACK_ADDR_FROM_TOP(num));
}
/* super(args) # args.size => num */