src/share/vm/compiler/compileBroker.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7097546 Sdiff src/share/vm/compiler

src/share/vm/compiler/compileBroker.cpp

Print this page




1705 
1706     ciMethod* target = ci_env.get_method_from_handle(target_handle);
1707 
1708     TraceTime t1("compilation", &time);
1709 
1710     compiler(task->comp_level())->compile_method(&ci_env, target, osr_bci);
1711 
1712     if (!ci_env.failing() && task->code() == NULL) {
1713       //assert(false, "compiler should always document failure");
1714       // The compiler elected, without comment, not to register a result.
1715       // Do not attempt further compilations of this method.
1716       ci_env.record_method_not_compilable("compile failed", !TieredCompilation);
1717     }
1718 
1719     if (ci_env.failing()) {
1720       // Copy this bit to the enclosing block:
1721       compilable = ci_env.compilable();
1722       if (PrintCompilation) {
1723         const char* reason = ci_env.failure_reason();
1724         if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1725             tty->print_cr("%3d   COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason);
1726         } else if (compilable == ciEnv::MethodCompilable_never) {
1727           tty->print_cr("%3d   COMPILE SKIPPED: %s (not retryable)", compile_id, reason);
1728         } else if (compilable == ciEnv::MethodCompilable) {
1729           tty->print_cr("%3d   COMPILE SKIPPED: %s", compile_id, reason);
1730         }
1731       }
1732     } else {
1733       task->mark_success();
1734       task->set_num_inlined_bytecodes(ci_env.num_inlined_bytecodes());
1735     }
1736   }
1737   pop_jni_handle_block();
1738 
1739   methodHandle method(thread,
1740                       (methodOop)JNIHandles::resolve(task->method_handle()));
1741 
1742   DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success());
1743 
1744   collect_statistics(thread, time, task);
1745 







1746   if (compilable == ciEnv::MethodCompilable_never) {
1747     if (is_osr) {
1748       method->set_not_osr_compilable();
1749     } else {
1750       method->set_not_compilable_quietly();
1751     }
1752   } else if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1753     method->set_not_compilable_quietly(task->comp_level());
1754   }
1755 
1756   // Note that the queued_for_compilation bits are cleared without
1757   // protection of a mutex. [They were set by the requester thread,
1758   // when adding the task to the complie queue -- at which time the
1759   // compile queue lock was held. Subsequently, we acquired the compile
1760   // queue lock to get this task off the compile queue; thus (to belabour
1761   // the point somewhat) our clearing of the bits must be occurring
1762   // only after the setting of the bits. See also 14012000 above.
1763   method->clear_queued_for_compilation();
1764 
1765 #ifdef ASSERT




1705 
1706     ciMethod* target = ci_env.get_method_from_handle(target_handle);
1707 
1708     TraceTime t1("compilation", &time);
1709 
1710     compiler(task->comp_level())->compile_method(&ci_env, target, osr_bci);
1711 
1712     if (!ci_env.failing() && task->code() == NULL) {
1713       //assert(false, "compiler should always document failure");
1714       // The compiler elected, without comment, not to register a result.
1715       // Do not attempt further compilations of this method.
1716       ci_env.record_method_not_compilable("compile failed", !TieredCompilation);
1717     }
1718 
1719     if (ci_env.failing()) {
1720       // Copy this bit to the enclosing block:
1721       compilable = ci_env.compilable();
1722       if (PrintCompilation) {
1723         const char* reason = ci_env.failure_reason();
1724         if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1725           tty->print_cr("%4d   COMPILE SKIPPED: %s (retry at different tier)", compile_id, reason);
1726         } else if (compilable == ciEnv::MethodCompilable_never) {
1727           tty->print_cr("%4d   COMPILE SKIPPED: %s (not retryable)", compile_id, reason);
1728         } else if (compilable == ciEnv::MethodCompilable) {
1729           tty->print_cr("%4d   COMPILE SKIPPED: %s", compile_id, reason);
1730         }
1731       }
1732     } else {
1733       task->mark_success();
1734       task->set_num_inlined_bytecodes(ci_env.num_inlined_bytecodes());
1735     }
1736   }
1737   pop_jni_handle_block();
1738 
1739   methodHandle method(thread,
1740                       (methodOop)JNIHandles::resolve(task->method_handle()));
1741 
1742   DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success());
1743 
1744   collect_statistics(thread, time, task);
1745 
1746   if (PrintCompilation && PrintInlining) {
1747     tty->print("%7d ", (int) tty->time_stamp().milliseconds());  // print timestamp
1748     tty->print("%4d ", compile_id);    // print compilation number
1749     tty->print("%s ", (is_osr ? "%" : " "));
1750     tty->print_cr("size: %d time: %d inlined: %d bytes", task->code()->total_size(), time.milliseconds(), task->num_inlined_bytecodes());
1751   }
1752 
1753   if (compilable == ciEnv::MethodCompilable_never) {
1754     if (is_osr) {
1755       method->set_not_osr_compilable();
1756     } else {
1757       method->set_not_compilable_quietly();
1758     }
1759   } else if (compilable == ciEnv::MethodCompilable_not_at_tier) {
1760     method->set_not_compilable_quietly(task->comp_level());
1761   }
1762 
1763   // Note that the queued_for_compilation bits are cleared without
1764   // protection of a mutex. [They were set by the requester thread,
1765   // when adding the task to the complie queue -- at which time the
1766   // compile queue lock was held. Subsequently, we acquired the compile
1767   // queue lock to get this task off the compile queue; thus (to belabour
1768   // the point somewhat) our clearing of the bits must be occurring
1769   // only after the setting of the bits. See also 14012000 above.
1770   method->clear_queued_for_compilation();
1771 
1772 #ifdef ASSERT


src/share/vm/compiler/compileBroker.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File