Project

General

Profile

Feature #13295 ยป 0001-compile.c-apply-opt_str_freeze-to-String-uminus.patch

normalperson (Eric Wong), 03/08/2017 09:26 PM

View differences:

bootstraptest/test_insns.rb
178 178
  },
179 179

  
180 180
  [ 'opt_str_freeze', %q{ 'true'.freeze }, ],
181
  [ 'opt_str_freeze', %q{ -'true' }, ],
181 182
  [ 'opt_str_freeze', <<~'},', ], # {
182 183
    class String
183 184
      def freeze
compile.c
5188 5188
	 *   "literal".freeze -> opt_str_freeze("literal")
5189 5189
	 */
5190 5190
	if (node->nd_recv && nd_type(node->nd_recv) == NODE_STR &&
5191
	    node->nd_mid == idFreeze && node->nd_args == NULL &&
5191
	    (node->nd_mid == idFreeze || node->nd_mid == idUMinus) &&
5192
	    node->nd_args == NULL &&
5192 5193
	    ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
5193 5194
	    ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
5194 5195
	    VALUE str = rb_fstring(node->nd_recv->nd_lit);
5195
-