From 10cc6bc4d9276023db21db1014969381de813ff8 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 3 Jul 2019 10:00:50 +0900 Subject: Just disable inlining with local varaible for now This partially reverts commit 712a66b0741605f5b2db670a292b9bb352f8a716. The previous fix made CI strange like: http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2124178 Let me just downgrade the behavior for now and deal with it later. [Bug #15971] --- mjit_compile.c | 13 +++++++++++++ test/ruby/test_jit.rb | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/mjit_compile.c b/mjit_compile.c index 4110af3855..b6ed984b20 100644 --- a/mjit_compile.c +++ b/mjit_compile.c @@ -331,6 +331,19 @@ inlinable_iseq_p(const struct rb_iseq_constant_body *body) // * Do not read any `cfp->pc` if (insn != BIN(leave) && insn_may_depend_on_sp_or_pc(insn, body->iseq_encoded + (pos + 1))) return false; + // At this moment, `cfp->ep` in an inlined method is not working. + switch (insn) { + case BIN(getlocal): + case BIN(getlocal_WC_0): + case BIN(getlocal_WC_1): + case BIN(setlocal): + case BIN(setlocal_WC_0): + case BIN(setlocal_WC_1): + case BIN(getblockparam): + case BIN(getblockparamproxy): + case BIN(setblockparam): + return false; + } pos += insn_len(insn); } return true; diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 66360731eb..08494cbbbb 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -11,6 +11,7 @@ class TestJIT < Test::Unit::TestCase IGNORABLE_PATTERNS = [ /\AJIT recompile: .+\n\z/, + /\AJIT inline: .+\n\z/, /\ASuccessful MJIT finish\n\z/, ] @@ -841,6 +842,19 @@ class TestJIT < Test::Unit::TestCase end; end + def test_block_handler_with_possible_frame_omitted_inlining + assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "70.0\n70.0\n70.0\n", success_count: 2, min_calls: 2) + begin; + def multiply(a, b) + a *= b + end + + 3.times do + p multiply(7.0, 10.0) + end + end; + end + def test_program_counter_with_regexpmatch assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "aa", success_count: 1) begin; -- cgit v1.2.3