[ruby-cvs:65315] normal:r58144 (trunk): fix redefinition optimization for -"literal string" (UMinus)

normal at ruby-lang.org normal at ruby-lang.org
Mon Mar 27 15:12:37 JST 2017


normal	2017-03-27 15:12:37 +0900 (Mon, 27 Mar 2017)

  New Revision: 58144

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58144

  Log:
    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

  Modified files:
    trunk/compile.c
    trunk/insns.def
    trunk/test/ruby/test_optimization.rb
    trunk/vm.c
    trunk/vm_core.h


More information about the ruby-cvs mailing list