[ruby-cvs:51696] tmm1:r44551 (trunk): insns.def: add opt path for Hash#[] and Hash#[]= used with str literal keys

tmm1 at ruby-lang.org tmm1 at ruby-lang.org
Fri Jan 10 13:54:10 JST 2014


tmm1	2014-01-10 13:54:08 +0900 (Fri, 10 Jan 2014)

  New Revision: 44551

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44551

  Log:
    insns.def: add opt path for Hash#[] and Hash#[]= used with str literal keys
    
    * insns.def (opt_aref_with): new instruction to optimize Hash#[],
      removing any allocation overhead when used with a string literal
      key. Patch by normalperson (Eric Wong). [ruby-core:59640] [Bug #9382]
    * insns.def (opt_aset_with): new instruction to optimize Hash#[]=
    * compile.c (iseq_compile_each): compiler shortcuts for new
      instructions
    * hash.c (static VALUE rb_hash_compare_by_id_p): fix documentation for
      Hash#compare_by_identity to reflect frozen string sharing
    * test/ruby/test_hash.rb (class TestHash): test for new behavior

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/hash.c
    trunk/insns.def
    trunk/test/ruby/test_hash.rb


More information about the ruby-cvs mailing list