[ruby-cvs:66533] normal:r59355 (trunk): newhash insn reuses existing keys

normal at ruby-lang.org normal at ruby-lang.org
Tue Jul 18 13:30:08 JST 2017


normal	2017-07-18 13:30:08 +0900 (Tue, 18 Jul 2017)

  New Revision: 59355

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

  Log:
    newhash insn reuses existing keys
    
    This gives the newhash VM instruction the same string reuse
    capabilities as rb_hash_aset.
    
    * st.c (str_key): new wrapper function to call rb_fstring_existing
      (rb_hash_bulk_insert): use str_key
    * test/ruby/test_optimization.rb (test_hash_reuse_fstring):
      ensure key reuse for newhash instructions

  Modified files:
    trunk/st.c
    trunk/test/ruby/test_optimization.rb


More information about the ruby-cvs mailing list