提交 3a939df8 编写于 作者: V vlivanov

8006613: adding reason to made_not_compilable

Reviewed-by: kvn, vlivanov
Contributed-by: NIgor Ignatyev <igor.ignatyev@oracle.com>
上级 5b3ed02e
...@@ -977,7 +977,7 @@ bool ciMethod::can_be_compiled() { ...@@ -977,7 +977,7 @@ bool ciMethod::can_be_compiled() {
// ciMethod::set_not_compilable // ciMethod::set_not_compilable
// //
// Tell the VM that this method cannot be compiled at all. // Tell the VM that this method cannot be compiled at all.
void ciMethod::set_not_compilable() { void ciMethod::set_not_compilable(const char* reason) {
check_is_loaded(); check_is_loaded();
VM_ENTRY_MARK; VM_ENTRY_MARK;
ciEnv* env = CURRENT_ENV; ciEnv* env = CURRENT_ENV;
...@@ -986,7 +986,7 @@ void ciMethod::set_not_compilable() { ...@@ -986,7 +986,7 @@ void ciMethod::set_not_compilable() {
} else { } else {
_is_c2_compilable = false; _is_c2_compilable = false;
} }
get_Method()->set_not_compilable(env->comp_level()); get_Method()->set_not_compilable(env->comp_level(), true, reason);
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
......
...@@ -252,7 +252,7 @@ class ciMethod : public ciMetadata { ...@@ -252,7 +252,7 @@ class ciMethod : public ciMetadata {
bool has_option(const char *option); bool has_option(const char *option);
bool can_be_compiled(); bool can_be_compiled();
bool can_be_osr_compiled(int entry_bci); bool can_be_osr_compiled(int entry_bci);
void set_not_compilable(); void set_not_compilable(const char* reason = NULL);
bool has_compiled_code(); bool has_compiled_code();
void log_nmethod_identity(xmlStream* log); void log_nmethod_identity(xmlStream* log);
bool is_not_reached(int bci); bool is_not_reached(int bci);
......
...@@ -1398,7 +1398,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, ...@@ -1398,7 +1398,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
method->print_short_name(tty); method->print_short_name(tty);
tty->cr(); tty->cr();
} }
method->set_not_compilable_quietly(); method->set_not_compilable(CompLevel_all, !quietly, "excluded by CompilerOracle");
} }
return false; return false;
......
...@@ -699,7 +699,7 @@ void Method::set_signature_handler(address handler) { ...@@ -699,7 +699,7 @@ void Method::set_signature_handler(address handler) {
} }
void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report) { void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason) {
if (PrintCompilation && report) { if (PrintCompilation && report) {
ttyLocker ttyl; ttyLocker ttyl;
tty->print("made not %scompilable on ", is_osr ? "OSR " : ""); tty->print("made not %scompilable on ", is_osr ? "OSR " : "");
...@@ -713,14 +713,21 @@ void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report) ...@@ -713,14 +713,21 @@ void Method::print_made_not_compilable(int comp_level, bool is_osr, bool report)
} }
this->print_short_name(tty); this->print_short_name(tty);
int size = this->code_size(); int size = this->code_size();
if (size > 0) if (size > 0) {
tty->print(" (%d bytes)", size); tty->print(" (%d bytes)", size);
}
if (reason != NULL) {
tty->print(" %s", reason);
}
tty->cr(); tty->cr();
} }
if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) { if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) {
ttyLocker ttyl; ttyLocker ttyl;
xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'", xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'",
is_osr ? "osr_" : "", os::current_thread_id()); is_osr ? "osr_" : "", os::current_thread_id());
if (reason != NULL) {
xtty->print(" reason=\'%s\'", reason);
}
xtty->method(this); xtty->method(this);
xtty->stamp(); xtty->stamp();
xtty->end_elem(); xtty->end_elem();
...@@ -742,8 +749,8 @@ bool Method::is_not_compilable(int comp_level) const { ...@@ -742,8 +749,8 @@ bool Method::is_not_compilable(int comp_level) const {
} }
// call this when compiler finds that this method is not compilable // call this when compiler finds that this method is not compilable
void Method::set_not_compilable(int comp_level, bool report) { void Method::set_not_compilable(int comp_level, bool report, const char* reason) {
print_made_not_compilable(comp_level, /*is_osr*/ false, report); print_made_not_compilable(comp_level, /*is_osr*/ false, report, reason);
if (comp_level == CompLevel_all) { if (comp_level == CompLevel_all) {
set_not_c1_compilable(); set_not_c1_compilable();
set_not_c2_compilable(); set_not_c2_compilable();
...@@ -768,8 +775,8 @@ bool Method::is_not_osr_compilable(int comp_level) const { ...@@ -768,8 +775,8 @@ bool Method::is_not_osr_compilable(int comp_level) const {
return false; return false;
} }
void Method::set_not_osr_compilable(int comp_level, bool report) { void Method::set_not_osr_compilable(int comp_level, bool report, const char* reason) {
print_made_not_compilable(comp_level, /*is_osr*/ true, report); print_made_not_compilable(comp_level, /*is_osr*/ true, report, reason);
if (comp_level == CompLevel_all) { if (comp_level == CompLevel_all) {
set_not_c1_osr_compilable(); set_not_c1_osr_compilable();
set_not_c2_osr_compilable(); set_not_c2_osr_compilable();
......
...@@ -760,18 +760,18 @@ class Method : public Metadata { ...@@ -760,18 +760,18 @@ class Method : public Metadata {
// whether it is not compilable for another reason like having a // whether it is not compilable for another reason like having a
// breakpoint set in it. // breakpoint set in it.
bool is_not_compilable(int comp_level = CompLevel_any) const; bool is_not_compilable(int comp_level = CompLevel_any) const;
void set_not_compilable(int comp_level = CompLevel_all, bool report = true); void set_not_compilable(int comp_level = CompLevel_all, bool report = true, const char* reason = NULL);
void set_not_compilable_quietly(int comp_level = CompLevel_all) { void set_not_compilable_quietly(int comp_level = CompLevel_all) {
set_not_compilable(comp_level, false); set_not_compilable(comp_level, false);
} }
bool is_not_osr_compilable(int comp_level = CompLevel_any) const; bool is_not_osr_compilable(int comp_level = CompLevel_any) const;
void set_not_osr_compilable(int comp_level = CompLevel_all, bool report = true); void set_not_osr_compilable(int comp_level = CompLevel_all, bool report = true, const char* reason = NULL);
void set_not_osr_compilable_quietly(int comp_level = CompLevel_all) { void set_not_osr_compilable_quietly(int comp_level = CompLevel_all) {
set_not_osr_compilable(comp_level, false); set_not_osr_compilable(comp_level, false);
} }
private: private:
void print_made_not_compilable(int comp_level, bool is_osr, bool report); void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason);
public: public:
bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); } bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); }
......
...@@ -1465,7 +1465,7 @@ public: ...@@ -1465,7 +1465,7 @@ public:
void inc_decompile_count() { void inc_decompile_count() {
_nof_decompiles += 1; _nof_decompiles += 1;
if (decompile_count() > (uint)PerMethodRecompilationCutoff) { if (decompile_count() > (uint)PerMethodRecompilationCutoff) {
method()->set_not_compilable(CompLevel_full_optimization); method()->set_not_compilable(CompLevel_full_optimization, true, "decompile_count > PerMethodRecompilationCutoff");
} }
} }
......
...@@ -1559,7 +1559,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra ...@@ -1559,7 +1559,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
if (trap_method() == nm->method()) { if (trap_method() == nm->method()) {
make_not_compilable = true; make_not_compilable = true;
} else { } else {
trap_method->set_not_compilable(CompLevel_full_optimization); trap_method->set_not_compilable(CompLevel_full_optimization, true, "overflow_recompile_count > PerBytecodeRecompilationCutoff");
// But give grace to the enclosing nm->method(). // But give grace to the enclosing nm->method().
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册