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
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Wed Nov 16 19:42:58 2011 -0800
@@ -3495,9 +3495,6 @@
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 @@
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");
--- a/hotspot/src/share/vm/c1/c1_Instruction.hpp Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp Wed Nov 16 19:42:58 2011 -0800
@@ -501,6 +501,7 @@
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;
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Nov 16 19:42:58 2011 -0800
@@ -429,7 +429,7 @@
// 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()) {
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp Wed Nov 16 19:42:58 2011 -0800
@@ -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 @@
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 @@
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;
--- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.hpp Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.hpp Wed Nov 16 19:42:58 2011 -0800
@@ -55,7 +55,7 @@
// 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; }
--- a/hotspot/test/compiler/6792161/Test6792161.java Wed Nov 16 09:13:57 2011 -0800
+++ b/hotspot/test/compiler/6792161/Test6792161.java Wed Nov 16 19:42:58 2011 -0800
@@ -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;