ruby-changes:51662
From: k0kubun <ko1@a...>
Date: Sat, 7 Jul 2018 23:28:42 +0900 (JST)
Subject: [ruby-changes:51662] k0kubun:r63874 (trunk): _mjit_compile_insn_body: rollback pc correctly
k0kubun 2018-07-07 23:28:34 +0900 (Sat, 07 Jul 2018) New Revision: 63874 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63874 Log: _mjit_compile_insn_body: rollback pc correctly for catch_except_p case Partially solving Bug#14892 Modified files: trunk/test/ruby/test_jit.rb trunk/tool/ruby_vm/views/_mjit_compile_insn_body.erb Index: tool/ruby_vm/views/_mjit_compile_insn_body.erb =================================================================== --- tool/ruby_vm/views/_mjit_compile_insn_body.erb (revision 63873) +++ tool/ruby_vm/views/_mjit_compile_insn_body.erb (revision 63874) @@ -69,9 +69,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_insn_body.erb#L69 % end % when /\A\s+DISPATCH_ORIGINAL_INSN\([^)]+\);\s+\z/ % # For `opt_xxx`'s fallbacks. - if (!body->catch_except_p) { - fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); - } + fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos); fprintf(f, " goto cancel;\n"); % else fprintf(f, <%= to_cstr.call(line) %>); Index: test/ruby/test_jit.rb =================================================================== --- test/ruby/test_jit.rb (revision 63873) +++ test/ruby/test_jit.rb (revision 63874) @@ -686,10 +686,12 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L686 end def test_stack_pointer_with_regexpmatch - skip - assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "nil\nnil\n", success_count: 1) + assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "aa", success_count: 1) begin; - 1000.times { break if /a/ =~ "ab" && !$~[0] } + 2.times do + break if /a/ =~ "ab" && !$~[0] + print $~[0] + end end; end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/