ko1 7cf523c7db * vm_opts.h, iseq.c, iseq.h: add compile option to force frozen
string literals.
  [Feature #11473]
  This addition is not specification change, but to try frozen
  string literal world discussed on [Feature #11473].
  You can try frozen string literal world using this magical line:
    RubyVM::InstructionSequence.compile_option =
      {frozen_string_literal: true}
  Note that this is a global compilation option, so that you need to
  compile another script like that:
    p 'foo'.frozen? #=> false
    RubyVM::InstructionSequence.compile_option =
      {frozen_string_literal: true}
    p 'foo'.frozen? #=> false, because this line is already compiled.
    p eval("'foo'.frozen?") #=> true
  Details:
    * String literals are deduped by rb_fstring().
    * Dynamic string literals ("...#{xyz}...") is now only frozen,
      not deduped. Maybe you have other ideas.
  Now, please do not use this option on your productions :)
  Of course, current specification can be changed.
* compile.c: ditto.
* test/ruby/test_iseq.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21 20:47:53 +00:00
..
2015-07-25 02:05:34 +00:00
2015-05-27 10:56:33 +00:00
2015-06-02 02:18:44 +00:00
2015-07-13 10:07:01 +00:00
2015-04-01 00:59:14 +00:00
2015-07-13 10:07:01 +00:00
2015-08-12 03:50:59 +00:00
2015-06-02 02:18:44 +00:00
2015-06-02 02:18:44 +00:00
2015-06-02 02:18:44 +00:00
2015-08-11 02:53:31 +00:00
2015-07-13 10:07:01 +00:00
2015-06-02 02:18:44 +00:00
2015-08-13 14:43:14 +00:00
2015-07-13 10:07:01 +00:00
2015-07-13 10:07:01 +00:00
2015-06-02 02:18:44 +00:00
2015-06-02 02:18:44 +00:00
2015-05-17 00:50:11 +00:00
2015-06-02 02:18:44 +00:00
2015-06-25 05:26:31 +00:00
2015-06-25 05:26:31 +00:00
2015-06-02 02:18:44 +00:00
2015-06-02 02:18:44 +00:00
2015-07-13 10:07:01 +00:00
2015-06-25 05:26:31 +00:00