提交 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() {
// ciMethod::set_not_compilable
//
// 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();
VM_ENTRY_MARK;
ciEnv* env = CURRENT_ENV;
......@@ -986,7 +986,7 @@ void ciMethod::set_not_compilable() {
} else {
_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 {
bool has_option(const char *option);
bool can_be_compiled();
bool can_be_osr_compiled(int entry_bci);
void set_not_compilable();
void set_not_compilable(const char* reason = NULL);
bool has_compiled_code();
void log_nmethod_identity(xmlStream* log);
bool is_not_reached(int bci);
......
......@@ -1398,7 +1398,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
method->print_short_name(tty);
tty->cr();
}
method->set_not_compilable_quietly();
method->set_not_compilable(CompLevel_all, !quietly, "excluded by CompilerOracle");
}
return false;
......
......@@ -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) {
ttyLocker ttyl;
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)
}
this->print_short_name(tty);
int size = this->code_size();
if (size > 0)
if (size > 0) {
tty->print(" (%d bytes)", size);
}
if (reason != NULL) {
tty->print(" %s", reason);
}
tty->cr();
}
if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) {
ttyLocker ttyl;
xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'",
is_osr ? "osr_" : "", os::current_thread_id());
if (reason != NULL) {
xtty->print(" reason=\'%s\'", reason);
}
xtty->method(this);
xtty->stamp();
xtty->end_elem();
......@@ -742,8 +749,8 @@ bool Method::is_not_compilable(int comp_level) const {
}
// call this when compiler finds that this method is not compilable
void Method::set_not_compilable(int comp_level, bool report) {
print_made_not_compilable(comp_level, /*is_osr*/ false, report);
void Method::set_not_compilable(int comp_level, bool report, const char* reason) {
print_made_not_compilable(comp_level, /*is_osr*/ false, report, reason);
if (comp_level == CompLevel_all) {
set_not_c1_compilable();
set_not_c2_compilable();
......@@ -768,8 +775,8 @@ bool Method::is_not_osr_compilable(int comp_level) const {
return false;
}
void Method::set_not_osr_compilable(int comp_level, bool report) {
print_made_not_compilable(comp_level, /*is_osr*/ true, 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, reason);
if (comp_level == CompLevel_all) {
set_not_c1_osr_compilable();
set_not_c2_osr_compilable();
......
......@@ -760,18 +760,18 @@ class Method : public Metadata {
// whether it is not compilable for another reason like having a
// breakpoint set in it.
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) {
set_not_compilable(comp_level, false);
}
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) {
set_not_osr_compilable(comp_level, false);
}
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:
bool is_not_c1_compilable() const { return access_flags().is_not_c1_compilable(); }
......
......@@ -1465,7 +1465,7 @@ public:
void inc_decompile_count() {
_nof_decompiles += 1;
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
if (trap_method() == nm->method()) {
make_not_compilable = true;
} 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().
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册