# HG changeset patch # User Christian Haeubl # Date 1330977782 28800 # Node ID e77a7d510c85e0399efe3900f1427e0028563c30 # Parent 8e6db1a5c5370c714e37fcf89f0d73a68344942f# Parent df0deec2af088763a8e03d634d7163d04edd862e Merge diff -r df0deec2af08 -r e77a7d510c85 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Mon Mar 05 14:38:43 2012 +0100 +++ b/src/share/vm/code/nmethod.cpp Mon Mar 05 12:03:02 2012 -0800 @@ -1178,7 +1178,9 @@ } void nmethod::inc_decompile_count() { +#ifndef GRAAL if (!is_compiled_by_c2()) return; +#endif // Could be gated by ProfileTraps, but do not bother... methodOop m = method(); if (m == NULL) return; diff -r df0deec2af08 -r e77a7d510c85 src/share/vm/oops/methodDataOop.cpp --- a/src/share/vm/oops/methodDataOop.cpp Mon Mar 05 14:38:43 2012 +0100 +++ b/src/share/vm/oops/methodDataOop.cpp Mon Mar 05 12:03:02 2012 -0800 @@ -861,6 +861,19 @@ return CompilationPolicy::policy()->is_mature(_method); } +void methodDataOopDesc::inc_decompile_count() { + _nof_decompiles += 1; + if (decompile_count() > (uint)PerMethodRecompilationCutoff) { +#ifdef GRAAL + // TODO (ch) enable this in the fastdebug build only once we are more stable + ResourceMark m; + tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string()); + vm_exit(1); +#endif + method()->set_not_compilable(CompLevel_full_optimization); + } +} + // Translate a bci to its corresponding data index (di). address methodDataOopDesc::bci_to_dp(int bci) { ResourceMark rm; diff -r df0deec2af08 -r e77a7d510c85 src/share/vm/oops/methodDataOop.hpp --- a/src/share/vm/oops/methodDataOop.hpp Mon Mar 05 14:38:43 2012 +0100 +++ b/src/share/vm/oops/methodDataOop.hpp Mon Mar 05 12:03:02 2012 -0800 @@ -1507,12 +1507,7 @@ uint decompile_count() const { return _nof_decompiles; } - void inc_decompile_count() { - _nof_decompiles += 1; - if (decompile_count() > (uint)PerMethodRecompilationCutoff) { - method()->set_not_compilable(CompLevel_full_optimization); - } - } + void inc_decompile_count(); // Support for code generation static ByteSize data_offset() {