[ruby-cvs:50770] charliesome:r43627 (trunk): * compile.c (iseq_compile_each): emit opt_str_freeze if the #freeze

charliesome at ruby-lang.org charliesome at ruby-lang.org
Sun Nov 10 06:17:07 JST 2013


charliesome	2013-11-10 06:17:06 +0900 (Sun, 10 Nov 2013)

  New Revision: 43627

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

  Log:
    * compile.c (iseq_compile_each): emit opt_str_freeze if the #freeze
      method is called on a static string literal with no arguments.
    
    * defs/id.def (firstline): add freeze so idFreeze is available
    
    * insns.def (opt_str_freeze): add opt_str_freeze instruction which
      pushes a frozen string literal without allocating a new object if
      String#freeze is not overriden
    
    * string.c (Init_String): define String#freeze
    
    * vm.c (vm_init_redefined_flag): define BOP_FREEZE on String class as
      a basic operation
    
    * vm_insnhelper.h: ditto

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/defs/id.def
    trunk/insns.def
    trunk/string.c
    trunk/vm.c
    trunk/vm_insnhelper.h


More information about the ruby-cvs mailing list