From 3ad2a9b9ce5e752b30033ffc1734f8df4642290d Mon Sep 17 00:00:00 2001 From: iveresov Date: Wed, 16 Nov 2011 19:42:58 -0800 Subject: [PATCH] 7112085: assert(fr.interpreter_frame_expression_stack_size()==0) failed: only handle empty stacks Summary: Move the inlinee invoke notification callback into inlinee preamble Reviewed-by: kvn, never --- src/share/vm/c1/c1_GraphBuilder.cpp | 7 ++-- src/share/vm/c1/c1_Instruction.hpp | 1 + src/share/vm/c1/c1_LIRGenerator.cpp | 2 +- .../vm/runtime/simpleThresholdPolicy.cpp | 41 +++++++++++-------- .../vm/runtime/simpleThresholdPolicy.hpp | 2 +- test/compiler/6792161/Test6792161.java | 2 +- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/share/vm/c1/c1_GraphBuilder.cpp b/src/share/vm/c1/c1_GraphBuilder.cpp index 0c3f32bcd..fbda48f2f 100644 --- a/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/src/share/vm/c1/c1_GraphBuilder.cpp @@ -3495,9 +3495,6 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, BlockBeg if (profile_calls()) { profile_call(recv, holder_known ? callee->holder() : NULL); } - if (profile_inlined_calls()) { - profile_invocation(callee, copy_state_before()); - } } // Introduce a new callee continuation point - if the callee has @@ -3571,6 +3568,10 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, BlockBeg append(new RuntimeCall(voidType, "dtrace_method_entry", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), args)); } + if (profile_inlined_calls()) { + profile_invocation(callee, copy_state_before_with_bci(SynchronizationEntryBCI)); + } + BlockBegin* callee_start_block = block_at(0); if (callee_start_block != NULL) { assert(callee_start_block->is_set(BlockBegin::parser_loop_header_flag), "must be loop header"); diff --git a/src/share/vm/c1/c1_Instruction.hpp b/src/share/vm/c1/c1_Instruction.hpp index 44022c261..9f9de6a14 100644 --- a/src/share/vm/c1/c1_Instruction.hpp +++ b/src/share/vm/c1/c1_Instruction.hpp @@ -501,6 +501,7 @@ class Instruction: public CompilationResourceObj { virtual RoundFP* as_RoundFP() { return NULL; } virtual ExceptionObject* as_ExceptionObject() { return NULL; } virtual UnsafeOp* as_UnsafeOp() { return NULL; } + virtual ProfileInvoke* as_ProfileInvoke() { return NULL; } virtual void visit(InstructionVisitor* v) = 0; diff --git a/src/share/vm/c1/c1_LIRGenerator.cpp b/src/share/vm/c1/c1_LIRGenerator.cpp index f9099e940..0491d7156 100644 --- a/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/src/share/vm/c1/c1_LIRGenerator.cpp @@ -429,7 +429,7 @@ CodeEmitInfo* LIRGenerator::state_for(Instruction* x, ValueStack* state, bool ig // all locals are dead on exit from the synthetic unlocker liveness.clear(); } else { - assert(x->as_MonitorEnter(), "only other case is MonitorEnter"); + assert(x->as_MonitorEnter() || x->as_ProfileInvoke(), "only other cases are MonitorEnter and ProfileInvoke"); } } if (!liveness.is_valid()) { diff --git a/src/share/vm/runtime/simpleThresholdPolicy.cpp b/src/share/vm/runtime/simpleThresholdPolicy.cpp index d132c0e96..232da70b0 100644 --- a/src/share/vm/runtime/simpleThresholdPolicy.cpp +++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp @@ -30,6 +30,27 @@ #include "runtime/simpleThresholdPolicy.inline.hpp" #include "code/scopeDesc.hpp" + +void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) { + int invocation_count = mh->invocation_count(); + int backedge_count = mh->backedge_count(); + methodDataHandle mdh = mh->method_data(); + int mdo_invocations = 0, mdo_backedges = 0; + int mdo_invocations_start = 0, mdo_backedges_start = 0; + if (mdh() != NULL) { + mdo_invocations = mdh->invocation_count(); + mdo_backedges = mdh->backedge_count(); + mdo_invocations_start = mdh->invocation_count_start(); + mdo_backedges_start = mdh->backedge_count_start(); + } + tty->print(" %stotal: %d,%d %smdo: %d(%d),%d(%d)", prefix, + invocation_count, backedge_count, prefix, + mdo_invocations, mdo_invocations_start, + mdo_backedges, mdo_backedges_start); + tty->print(" %smax levels: %d,%d", prefix, + mh->highest_comp_level(), mh->highest_osr_comp_level()); +} + // Print an event. void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh, int bci, CompLevel level) { @@ -38,8 +59,6 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH ttyLocker tty_lock; tty->print("%lf: [", os::elapsedTime()); - int invocation_count = mh->invocation_count(); - int backedge_count = mh->backedge_count(); switch(type) { case CALL: tty->print("call"); @@ -82,23 +101,9 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH print_specific(type, mh, imh, bci, level); if (type != COMPILE) { - methodDataHandle mdh = mh->method_data(); - int mdo_invocations = 0, mdo_backedges = 0; - int mdo_invocations_start = 0, mdo_backedges_start = 0; - if (mdh() != NULL) { - mdo_invocations = mdh->invocation_count(); - mdo_backedges = mdh->backedge_count(); - mdo_invocations_start = mdh->invocation_count_start(); - mdo_backedges_start = mdh->backedge_count_start(); - } - tty->print(" total: %d,%d mdo: %d(%d),%d(%d)", - invocation_count, backedge_count, - mdo_invocations, mdo_invocations_start, - mdo_backedges, mdo_backedges_start); - tty->print(" max levels: %d,%d", - mh->highest_comp_level(), mh->highest_osr_comp_level()); + print_counters("", mh); if (inlinee_event) { - tty->print(" inlinee max levels: %d,%d", imh->highest_comp_level(), imh->highest_osr_comp_level()); + print_counters("inlinee ", imh); } tty->print(" compilable: "); bool need_comma = false; diff --git a/src/share/vm/runtime/simpleThresholdPolicy.hpp b/src/share/vm/runtime/simpleThresholdPolicy.hpp index 5aad121c3..1cff0c6cd 100644 --- a/src/share/vm/runtime/simpleThresholdPolicy.hpp +++ b/src/share/vm/runtime/simpleThresholdPolicy.hpp @@ -55,7 +55,7 @@ class SimpleThresholdPolicy : public CompilationPolicy { // loop_event checks if a method should be OSR compiled at a different // level. CompLevel loop_event(methodOop method, CompLevel cur_level); - + void print_counters(const char* prefix, methodHandle mh); protected: int c1_count() const { return _c1_count; } int c2_count() const { return _c2_count; } diff --git a/test/compiler/6792161/Test6792161.java b/test/compiler/6792161/Test6792161.java index 0f99d8589..ac3843c1b 100644 --- a/test/compiler/6792161/Test6792161.java +++ b/test/compiler/6792161/Test6792161.java @@ -27,7 +27,7 @@ * @bug 6792161 * @summary assert("No dead instructions after post-alloc") * - * @run main/othervm -Xcomp -XX:MaxInlineSize=120 Test6792161 + * @run main/othervm/timeout=300 -Xcomp -XX:MaxInlineSize=120 Test6792161 */ import java.lang.reflect.Constructor; -- GitLab