[前][次][番号順一覧][スレッド一覧]

ruby-changes:54128

From: nobu <ko1@a...>
Date: Wed, 12 Dec 2018 14:46:17 +0900 (JST)
Subject: [ruby-changes:54128] nobu:r66349 (trunk): Disable tailcall optimization [Bug #15303]

nobu	2018-12-12 14:46:13 +0900 (Wed, 12 Dec 2018)

  New Revision: 66349

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

  Log:
    Disable tailcall optimization [Bug #15303]

  Modified files:
    trunk/ext/rubyvm/lib/forwardable/impl.rb
    trunk/lib/forwardable/impl.rb
    trunk/lib/forwardable.rb
    trunk/template/prelude.c.tmpl
Index: lib/forwardable.rb
===================================================================
--- lib/forwardable.rb	(revision 66348)
+++ lib/forwardable.rb	(revision 66349)
@@ -222,7 +222,7 @@ module Forwardable https://github.com/ruby/ruby/blob/trunk/lib/forwardable.rb#L222
           #{pre}
           begin
             #{accessor}
-          end#{method_call}#{FILTER_EXCEPTION}
+          end#{method_call}
         end
       end
     end;
Index: lib/forwardable/impl.rb
===================================================================
--- lib/forwardable/impl.rb	(revision 66348)
+++ lib/forwardable/impl.rb	(revision 66349)
@@ -1,13 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/lib/forwardable/impl.rb#L1
 # :stopdoc:
 module Forwardable
-  FILE_REGEXP = %r"#{Regexp.quote(File.dirname(__FILE__))}"
-  FILTER_EXCEPTION = <<-'END'
-
-        rescue ::Exception
-          $@.delete_if {|s| ::Forwardable::FILE_REGEXP =~ s} unless ::Forwardable::debug
-          ::Kernel::raise
-  END
-
   def self._valid_method?(method)
     catch {|tag|
       eval("BEGIN{throw tag}; ().#{method}", binding, __FILE__, __LINE__)
Index: ext/rubyvm/lib/forwardable/impl.rb
===================================================================
--- ext/rubyvm/lib/forwardable/impl.rb	(revision 66348)
+++ ext/rubyvm/lib/forwardable/impl.rb	(revision 66349)
@@ -1,7 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/rubyvm/lib/forwardable/impl.rb#L1
 # :stopdoc:
 module Forwardable
-  FILTER_EXCEPTION = ""
-
   def self._valid_method?(method)
     iseq = RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)
   rescue SyntaxError
@@ -12,8 +10,7 @@ module Forwardable https://github.com/ruby/ruby/blob/trunk/ext/rubyvm/lib/forwardable/impl.rb#L10
 
   def self._compile_method(src, file, line)
     RubyVM::InstructionSequence.compile(src, file, file, line,
-               trace_instruction: false,
-               tailcall_optimization: true)
+               trace_instruction: false)
       .eval
   end
 end
Index: template/prelude.c.tmpl
===================================================================
--- template/prelude.c.tmpl	(revision 66348)
+++ template/prelude.c.tmpl	(revision 66349)
@@ -148,7 +148,7 @@ prelude_eval(VALUE code, VALUE name, int https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L148
     static const rb_compile_option_t optimization = {
 	TRUE, /* int inline_const_cache; */
 	TRUE, /* int peephole_optimization; */
-	TRUE, /* int tailcall_optimization; */
+	FALSE,/* int tailcall_optimization; */
 	TRUE, /* int specialized_instruction; */
 	TRUE, /* int operands_unification; */
 	TRUE, /* int instructions_unification; */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]