mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
fix redefinition optimization for -"literal string" (UMinus)
Unfortunately this enlarges insns.def by yet another instruction. However, it is much prettier than opt_str_freeze in use, and maybe we can avoid having so many instructions in the future. [ruby-core:80368] * insns.def (DEFINE_INSN): new instruction: opt_str_uminus (maybe temporary) * compile.c (iseq_compile_each0): split instructions * test/ruby/test_optimization.rb (test_string_uminus): new test * vm.c (vm_init_redefined_flag): set redefinintion flag for uminus * vm_core.h (enum ruby_basic_operators): add BOP_UMINUS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
833e42d120
commit
669a55dfed
5 changed files with 27 additions and 1 deletions
|
@ -454,6 +454,7 @@ enum ruby_basic_operators {
|
|||
BOP_NEQ,
|
||||
BOP_MATCH,
|
||||
BOP_FREEZE,
|
||||
BOP_UMINUS,
|
||||
BOP_MAX,
|
||||
BOP_MIN,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue