Mercurial > hg > graal-compiler
comparison src/share/vm/compiler/compileBroker.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | aed758eda82a |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
29 #include "compiler/compileBroker.hpp" | 29 #include "compiler/compileBroker.hpp" |
30 #include "compiler/compileLog.hpp" | 30 #include "compiler/compileLog.hpp" |
31 #include "compiler/compilerOracle.hpp" | 31 #include "compiler/compilerOracle.hpp" |
32 #include "interpreter/linkResolver.hpp" | 32 #include "interpreter/linkResolver.hpp" |
33 #include "memory/allocation.inline.hpp" | 33 #include "memory/allocation.inline.hpp" |
34 #include "oops/methodDataOop.hpp" | 34 #include "oops/methodData.hpp" |
35 #include "oops/methodOop.hpp" | 35 #include "oops/method.hpp" |
36 #include "oops/oop.inline.hpp" | 36 #include "oops/oop.inline.hpp" |
37 #include "prims/nativeLookup.hpp" | 37 #include "prims/nativeLookup.hpp" |
38 #include "runtime/arguments.hpp" | 38 #include "runtime/arguments.hpp" |
39 #include "runtime/compilationPolicy.hpp" | 39 #include "runtime/compilationPolicy.hpp" |
40 #include "runtime/init.hpp" | 40 #include "runtime/init.hpp" |
240 CompileTask* task = thread->task(); | 240 CompileTask* task = thread->task(); |
241 CompileLog* log = thread->log(); | 241 CompileLog* log = thread->log(); |
242 if (log != NULL) task->log_task_done(log); | 242 if (log != NULL) task->log_task_done(log); |
243 thread->set_task(NULL); | 243 thread->set_task(NULL); |
244 task->set_code_handle(NULL); | 244 task->set_code_handle(NULL); |
245 DEBUG_ONLY(thread->set_env((ciEnv*)badAddress)); | 245 thread->set_env(NULL); |
246 if (task->is_blocking()) { | 246 if (task->is_blocking()) { |
247 MutexLocker notifier(task->lock(), thread); | 247 MutexLocker notifier(task->lock(), thread); |
248 task->mark_complete(); | 248 task->mark_complete(); |
249 // Notify the waiting thread that the compilation has completed. | 249 // Notify the waiting thread that the compilation has completed. |
250 task->lock()->notify_all(); | 250 task->lock()->notify_all(); |
269 const char* comment, | 269 const char* comment, |
270 bool is_blocking) { | 270 bool is_blocking) { |
271 assert(!_lock->is_locked(), "bad locking"); | 271 assert(!_lock->is_locked(), "bad locking"); |
272 | 272 |
273 _compile_id = compile_id; | 273 _compile_id = compile_id; |
274 _method = JNIHandles::make_global(method); | 274 _method = method(); |
275 _method_loader = JNIHandles::make_global(_method->method_holder()->class_loader()); | |
275 _osr_bci = osr_bci; | 276 _osr_bci = osr_bci; |
276 _is_blocking = is_blocking; | 277 _is_blocking = is_blocking; |
277 _comp_level = comp_level; | 278 _comp_level = comp_level; |
278 _num_inlined_bytecodes = 0; | 279 _num_inlined_bytecodes = 0; |
279 | 280 |
280 _is_complete = false; | 281 _is_complete = false; |
281 _is_success = false; | 282 _is_success = false; |
282 _code_handle = NULL; | 283 _code_handle = NULL; |
283 | 284 |
284 _hot_method = NULL; | 285 _hot_method = NULL; |
286 _hot_method_loader = NULL; | |
285 _hot_count = hot_count; | 287 _hot_count = hot_count; |
286 _time_queued = 0; // tidy | 288 _time_queued = 0; // tidy |
287 _comment = comment; | 289 _comment = comment; |
288 | 290 |
289 if (LogCompilation) { | 291 if (LogCompilation) { |
290 _time_queued = os::elapsed_counter(); | 292 _time_queued = os::elapsed_counter(); |
291 if (hot_method.not_null()) { | 293 if (hot_method.not_null()) { |
292 if (hot_method == method) { | 294 if (hot_method == method) { |
293 _hot_method = _method; | 295 _hot_method = _method; |
294 } else { | 296 } else { |
295 _hot_method = JNIHandles::make_global(hot_method); | 297 _hot_method = hot_method(); |
296 } | 298 } |
299 _hot_method_loader = JNIHandles::make_global(_hot_method->method_holder()->class_loader()); | |
297 } | 300 } |
298 } | 301 } |
299 | 302 |
300 _next = NULL; | 303 _next = NULL; |
301 } | 304 } |
316 // ------------------------------------------------------------------ | 319 // ------------------------------------------------------------------ |
317 // CompileTask::free | 320 // CompileTask::free |
318 void CompileTask::free() { | 321 void CompileTask::free() { |
319 set_code(NULL); | 322 set_code(NULL); |
320 assert(!_lock->is_locked(), "Should not be locked when freed"); | 323 assert(!_lock->is_locked(), "Should not be locked when freed"); |
321 if (_hot_method != NULL && _hot_method != _method) { | 324 JNIHandles::destroy_global(_method_loader); |
322 JNIHandles::destroy_global(_hot_method); | 325 JNIHandles::destroy_global(_hot_method_loader); |
323 } | 326 } |
324 JNIHandles::destroy_global(_method); | 327 |
325 } | 328 |
326 | 329 void CompileTask::mark_on_stack() { |
330 // Mark these methods as something redefine classes cannot remove. | |
331 _method->set_on_stack(true); | |
332 if (_hot_method != NULL) { | |
333 _hot_method->set_on_stack(true); | |
334 } | |
335 } | |
327 | 336 |
328 // ------------------------------------------------------------------ | 337 // ------------------------------------------------------------------ |
329 // CompileTask::print | 338 // CompileTask::print |
330 void CompileTask::print() { | 339 void CompileTask::print() { |
331 tty->print("<CompileTask compile_id=%d ", _compile_id); | 340 tty->print("<CompileTask compile_id=%d ", _compile_id); |
332 tty->print("method="); | 341 tty->print("method="); |
333 ((methodOop)JNIHandles::resolve(_method))->print_name(tty); | 342 _method->print_name(tty); |
334 tty->print_cr(" osr_bci=%d is_blocking=%s is_complete=%s is_success=%s>", | 343 tty->print_cr(" osr_bci=%d is_blocking=%s is_complete=%s is_success=%s>", |
335 _osr_bci, bool_to_str(_is_blocking), | 344 _osr_bci, bool_to_str(_is_blocking), |
336 bool_to_str(_is_complete), bool_to_str(_is_success)); | 345 bool_to_str(_is_complete), bool_to_str(_is_success)); |
337 } | 346 } |
338 | 347 |
363 } | 372 } |
364 | 373 |
365 | 374 |
366 // ------------------------------------------------------------------ | 375 // ------------------------------------------------------------------ |
367 // CompileTask::print_compilation_impl | 376 // CompileTask::print_compilation_impl |
368 void CompileTask::print_compilation_impl(outputStream* st, methodOop method, int compile_id, int comp_level, | 377 void CompileTask::print_compilation_impl(outputStream* st, Method* method, int compile_id, int comp_level, |
369 bool is_osr_method, int osr_bci, bool is_blocking, | 378 bool is_osr_method, int osr_bci, bool is_blocking, |
370 const char* msg, bool short_form) { | 379 const char* msg, bool short_form) { |
371 if (!short_form) { | 380 if (!short_form) { |
372 st->print("%7d ", (int) st->time_stamp().milliseconds()); // print timestamp | 381 st->print("%7d ", (int) st->time_stamp().milliseconds()); // print timestamp |
373 } | 382 } |
481 } | 490 } |
482 | 491 |
483 // ------------------------------------------------------------------ | 492 // ------------------------------------------------------------------ |
484 // CompileTask::print_compilation | 493 // CompileTask::print_compilation |
485 void CompileTask::print_compilation(outputStream* st, bool short_form) { | 494 void CompileTask::print_compilation(outputStream* st, bool short_form) { |
486 oop rem = JNIHandles::resolve(method_handle()); | |
487 assert(rem != NULL && rem->is_method(), "must be"); | |
488 methodOop method = (methodOop) rem; | |
489 bool is_osr_method = osr_bci() != InvocationEntryBci; | 495 bool is_osr_method = osr_bci() != InvocationEntryBci; |
490 print_compilation_impl(st, method, compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), NULL, short_form); | 496 print_compilation_impl(st, method(), compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), NULL, short_form); |
491 } | 497 } |
492 | 498 |
493 // ------------------------------------------------------------------ | 499 // ------------------------------------------------------------------ |
494 // CompileTask::log_task | 500 // CompileTask::log_task |
495 void CompileTask::log_task(xmlStream* log) { | 501 void CompileTask::log_task(xmlStream* log) { |
496 Thread* thread = Thread::current(); | 502 Thread* thread = Thread::current(); |
497 methodHandle method(thread, | 503 methodHandle method(thread, this->method()); |
498 (methodOop)JNIHandles::resolve(method_handle())); | |
499 ResourceMark rm(thread); | 504 ResourceMark rm(thread); |
500 | 505 |
501 // <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'> | 506 // <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'> |
502 if (_compile_id != 0) log->print(" compile_id='%d'", _compile_id); | 507 if (_compile_id != 0) log->print(" compile_id='%d'", _compile_id); |
503 if (_osr_bci != CompileBroker::standard_entry_bci) { | 508 if (_osr_bci != CompileBroker::standard_entry_bci) { |
528 log_task(xtty); | 533 log_task(xtty); |
529 if (_comment != NULL) { | 534 if (_comment != NULL) { |
530 xtty->print(" comment='%s'", _comment); | 535 xtty->print(" comment='%s'", _comment); |
531 } | 536 } |
532 if (_hot_method != NULL) { | 537 if (_hot_method != NULL) { |
533 methodHandle hot(thread, | 538 methodHandle hot(thread, _hot_method); |
534 (methodOop)JNIHandles::resolve(_hot_method)); | 539 methodHandle method(thread, _method); |
535 methodHandle method(thread, | |
536 (methodOop)JNIHandles::resolve(_method)); | |
537 if (hot() != method()) { | 540 if (hot() != method()) { |
538 xtty->method(hot); | 541 xtty->method(hot); |
539 } | 542 } |
540 } | 543 } |
541 if (_hot_count != 0) { | 544 if (_hot_count != 0) { |
556 | 559 |
557 // ------------------------------------------------------------------ | 560 // ------------------------------------------------------------------ |
558 // CompileTask::log_task_done | 561 // CompileTask::log_task_done |
559 void CompileTask::log_task_done(CompileLog* log) { | 562 void CompileTask::log_task_done(CompileLog* log) { |
560 Thread* thread = Thread::current(); | 563 Thread* thread = Thread::current(); |
561 methodHandle method(thread, | 564 methodHandle method(thread, this->method()); |
562 (methodOop)JNIHandles::resolve(method_handle())); | |
563 ResourceMark rm(thread); | 565 ResourceMark rm(thread); |
564 | 566 |
565 // <task_done ... stamp='1.234'> </task> | 567 // <task_done ... stamp='1.234'> </task> |
566 nmethod* nm = code(); | 568 nmethod* nm = code(); |
567 log->begin_elem("task_done success='%d' nmsize='%d' count='%d'", | 569 log->begin_elem("task_done success='%d' nmsize='%d' count='%d'", |
608 _last = task; | 610 _last = task; |
609 } | 611 } |
610 ++_size; | 612 ++_size; |
611 | 613 |
612 // Mark the method as being in the compile queue. | 614 // Mark the method as being in the compile queue. |
613 ((methodOop)JNIHandles::resolve(task->method_handle()))->set_queued_for_compilation(); | 615 task->method()->set_queued_for_compilation(); |
614 | 616 |
615 if (CIPrintCompileQueue) { | 617 if (CIPrintCompileQueue) { |
616 print(); | 618 print(); |
617 } | 619 } |
618 | 620 |
672 _last = task->prev(); | 674 _last = task->prev(); |
673 } | 675 } |
674 --_size; | 676 --_size; |
675 } | 677 } |
676 | 678 |
679 // methods in the compile queue need to be marked as used on the stack | |
680 // so that they don't get reclaimed by Redefine Classes | |
681 void CompileQueue::mark_on_stack() { | |
682 CompileTask* task = _first; | |
683 while (task != NULL) { | |
684 task->mark_on_stack(); | |
685 task = task->next(); | |
686 } | |
687 } | |
688 | |
677 // ------------------------------------------------------------------ | 689 // ------------------------------------------------------------------ |
678 // CompileQueue::print | 690 // CompileQueue::print |
679 void CompileQueue::print() { | 691 void CompileQueue::print() { |
680 tty->print_cr("Contents of %s", name()); | 692 tty->print_cr("Contents of %s", name()); |
681 tty->print_cr("----------------------"); | 693 tty->print_cr("----------------------"); |
866 // ------------------------------------------------------------------ | 878 // ------------------------------------------------------------------ |
867 // CompileBroker::make_compiler_thread | 879 // CompileBroker::make_compiler_thread |
868 CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS) { | 880 CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS) { |
869 CompilerThread* compiler_thread = NULL; | 881 CompilerThread* compiler_thread = NULL; |
870 | 882 |
871 klassOop k = | 883 Klass* k = |
872 SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), | 884 SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), |
873 true, CHECK_0); | 885 true, CHECK_0); |
874 instanceKlassHandle klass (THREAD, k); | 886 instanceKlassHandle klass (THREAD, k); |
875 instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_0); | 887 instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_0); |
876 Handle string = java_lang_String::create_from_str(name, CHECK_0); | 888 Handle string = java_lang_String::create_from_str(name, CHECK_0); |
982 } | 994 } |
983 | 995 |
984 if (UsePerfData) { | 996 if (UsePerfData) { |
985 PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes, | 997 PerfDataManager::create_constant(SUN_CI, "threads", PerfData::U_Bytes, |
986 compiler_count, CHECK); | 998 compiler_count, CHECK); |
999 } | |
1000 } | |
1001 | |
1002 | |
1003 // Set the methods on the stack as on_stack so that redefine classes doesn't | |
1004 // reclaim them | |
1005 void CompileBroker::mark_on_stack() { | |
1006 if (_c2_method_queue != NULL) { | |
1007 _c2_method_queue->mark_on_stack(); | |
1008 } | |
1009 if (_c1_method_queue != NULL) { | |
1010 _c1_method_queue->mark_on_stack(); | |
987 } | 1011 } |
988 } | 1012 } |
989 | 1013 |
990 // ------------------------------------------------------------------ | 1014 // ------------------------------------------------------------------ |
991 // CompileBroker::is_idle | 1015 // CompileBroker::is_idle |
1023 if (!_initialized ) { | 1047 if (!_initialized ) { |
1024 return; | 1048 return; |
1025 } | 1049 } |
1026 | 1050 |
1027 guarantee(!method->is_abstract(), "cannot compile abstract methods"); | 1051 guarantee(!method->is_abstract(), "cannot compile abstract methods"); |
1028 assert(method->method_holder()->klass_part()->oop_is_instance(), | 1052 assert(method->method_holder()->oop_is_instance(), |
1029 "sanity check"); | 1053 "sanity check"); |
1030 assert(!instanceKlass::cast(method->method_holder())->is_not_initialized(), | 1054 assert(!InstanceKlass::cast(method->method_holder())->is_not_initialized(), |
1031 "method holder must be initialized"); | 1055 "method holder must be initialized"); |
1032 assert(!method->is_method_handle_intrinsic(), "do not enqueue these guys"); | 1056 assert(!method->is_method_handle_intrinsic(), "do not enqueue these guys"); |
1033 | 1057 |
1034 if (CIPrintRequests) { | 1058 if (CIPrintRequests) { |
1035 tty->print("request: "); | 1059 tty->print("request: "); |
1177 nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, | 1201 nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, |
1178 int comp_level, | 1202 int comp_level, |
1179 methodHandle hot_method, int hot_count, | 1203 methodHandle hot_method, int hot_count, |
1180 const char* comment, Thread* THREAD) { | 1204 const char* comment, Thread* THREAD) { |
1181 // make sure arguments make sense | 1205 // make sure arguments make sense |
1182 assert(method->method_holder()->klass_part()->oop_is_instance(), "not an instance method"); | 1206 assert(method->method_holder()->oop_is_instance(), "not an instance method"); |
1183 assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range"); | 1207 assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range"); |
1184 assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods"); | 1208 assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods"); |
1185 assert(!instanceKlass::cast(method->method_holder())->is_not_initialized(), "method holder must be initialized"); | 1209 assert(!InstanceKlass::cast(method->method_holder())->is_not_initialized(), "method holder must be initialized"); |
1186 | 1210 |
1187 if (!TieredCompilation) { | 1211 if (!TieredCompilation) { |
1188 comp_level = CompLevel_highest_tier; | 1212 comp_level = CompLevel_highest_tier; |
1189 } | 1213 } |
1190 | 1214 |
1232 // some prerequisites that are compiler specific | 1256 // some prerequisites that are compiler specific |
1233 if (compiler(comp_level)->is_c2() || compiler(comp_level)->is_shark()) { | 1257 if (compiler(comp_level)->is_c2() || compiler(comp_level)->is_shark()) { |
1234 method->constants()->resolve_string_constants(CHECK_AND_CLEAR_NULL); | 1258 method->constants()->resolve_string_constants(CHECK_AND_CLEAR_NULL); |
1235 // Resolve all classes seen in the signature of the method | 1259 // Resolve all classes seen in the signature of the method |
1236 // we are compiling. | 1260 // we are compiling. |
1237 methodOopDesc::load_signature_classes(method, CHECK_AND_CLEAR_NULL); | 1261 Method::load_signature_classes(method, CHECK_AND_CLEAR_NULL); |
1238 } | 1262 } |
1239 | 1263 |
1240 // If the method is native, do the lookup in the thread requesting | 1264 // If the method is native, do the lookup in the thread requesting |
1241 // the compilation. Native lookups can load code, which is not | 1265 // the compilation. Native lookups can load code, which is not |
1242 // permitted during compilation. | 1266 // permitted during compilation. |
1495 assert(task->is_blocking(), "can only wait on blocking task"); | 1519 assert(task->is_blocking(), "can only wait on blocking task"); |
1496 | 1520 |
1497 JavaThread *thread = JavaThread::current(); | 1521 JavaThread *thread = JavaThread::current(); |
1498 thread->set_blocked_on_compilation(true); | 1522 thread->set_blocked_on_compilation(true); |
1499 | 1523 |
1500 methodHandle method(thread, | 1524 methodHandle method(thread, task->method()); |
1501 (methodOop)JNIHandles::resolve(task->method_handle())); | |
1502 { | 1525 { |
1503 MutexLocker waiter(task->lock(), thread); | 1526 MutexLocker waiter(task->lock(), thread); |
1504 | 1527 |
1505 while (!task->is_complete()) | 1528 while (!task->is_complete()) |
1506 task->lock()->wait(); | 1529 task->lock()->wait(); |
1581 // Assign the task to the current thread. Mark this compilation | 1604 // Assign the task to the current thread. Mark this compilation |
1582 // thread as active for the profiler. | 1605 // thread as active for the profiler. |
1583 CompileTaskWrapper ctw(task); | 1606 CompileTaskWrapper ctw(task); |
1584 nmethodLocker result_handle; // (handle for the nmethod produced by this task) | 1607 nmethodLocker result_handle; // (handle for the nmethod produced by this task) |
1585 task->set_code_handle(&result_handle); | 1608 task->set_code_handle(&result_handle); |
1586 methodHandle method(thread, | 1609 methodHandle method(thread, task->method()); |
1587 (methodOop)JNIHandles::resolve(task->method_handle())); | |
1588 | 1610 |
1589 // Never compile a method if breakpoints are present in it | 1611 // Never compile a method if breakpoints are present in it |
1590 if (method()->number_of_breakpoints() == 0) { | 1612 if (method()->number_of_breakpoints() == 0) { |
1591 // Compile the method. | 1613 // Compile the method. |
1592 if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) { | 1614 if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) { |
1688 #endif | 1710 #endif |
1689 ThreadInVMfromNative tivfn(JavaThread::current()); | 1711 ThreadInVMfromNative tivfn(JavaThread::current()); |
1690 } | 1712 } |
1691 } | 1713 } |
1692 | 1714 |
1693 | |
1694 // ------------------------------------------------------------------ | 1715 // ------------------------------------------------------------------ |
1695 // CompileBroker::invoke_compiler_on_method | 1716 // CompileBroker::invoke_compiler_on_method |
1696 // | 1717 // |
1697 // Compile a method. | 1718 // Compile a method. |
1698 // | 1719 // |
1719 { | 1740 { |
1720 // create the handle inside it's own block so it can't | 1741 // create the handle inside it's own block so it can't |
1721 // accidentally be referenced once the thread transitions to | 1742 // accidentally be referenced once the thread transitions to |
1722 // native. The NoHandleMark before the transition should catch | 1743 // native. The NoHandleMark before the transition should catch |
1723 // any cases where this occurs in the future. | 1744 // any cases where this occurs in the future. |
1724 methodHandle method(thread, | 1745 methodHandle method(thread, task->method()); |
1725 (methodOop)JNIHandles::resolve(task->method_handle())); | |
1726 should_break = check_break_at(method, compile_id, is_osr); | 1746 should_break = check_break_at(method, compile_id, is_osr); |
1727 if (should_log && !CompilerOracle::should_log(method)) { | 1747 if (should_log && !CompilerOracle::should_log(method)) { |
1728 should_log = false; | 1748 should_log = false; |
1729 } | 1749 } |
1730 assert(!method->is_native(), "no longer compile natives"); | 1750 assert(!method->is_native(), "no longer compile natives"); |
1735 DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler(task->comp_level()), method); | 1755 DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler(task->comp_level()), method); |
1736 } | 1756 } |
1737 | 1757 |
1738 // Allocate a new set of JNI handles. | 1758 // Allocate a new set of JNI handles. |
1739 push_jni_handle_block(); | 1759 push_jni_handle_block(); |
1740 jobject target_handle = JNIHandles::make_local(thread, JNIHandles::resolve(task->method_handle())); | 1760 Method* target_handle = task->method(); |
1741 int compilable = ciEnv::MethodCompilable; | 1761 int compilable = ciEnv::MethodCompilable; |
1742 { | 1762 { |
1743 int system_dictionary_modification_counter; | 1763 int system_dictionary_modification_counter; |
1744 { | 1764 { |
1745 MutexLocker locker(Compile_lock, thread); | 1765 MutexLocker locker(Compile_lock, thread); |
1804 } | 1824 } |
1805 } | 1825 } |
1806 } | 1826 } |
1807 pop_jni_handle_block(); | 1827 pop_jni_handle_block(); |
1808 | 1828 |
1809 methodHandle method(thread, | 1829 methodHandle method(thread, task->method()); |
1810 (methodOop)JNIHandles::resolve(task->method_handle())); | |
1811 | 1830 |
1812 DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success()); | 1831 DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success()); |
1813 | 1832 |
1814 collect_statistics(thread, time, task); | 1833 collect_statistics(thread, time, task); |
1815 | 1834 |
1899 strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length); | 1918 strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length); |
1900 char current_method[CompilerCounters::cmname_buffer_length]; | 1919 char current_method[CompilerCounters::cmname_buffer_length]; |
1901 size_t maxLen = CompilerCounters::cmname_buffer_length; | 1920 size_t maxLen = CompilerCounters::cmname_buffer_length; |
1902 | 1921 |
1903 if (UsePerfData) { | 1922 if (UsePerfData) { |
1904 const char* class_name = method->method_holder()->klass_part()->name()->as_C_string(); | 1923 const char* class_name = method->method_holder()->name()->as_C_string(); |
1905 | 1924 |
1906 size_t s1len = strlen(class_name); | 1925 size_t s1len = strlen(class_name); |
1907 size_t s2len = strlen(method_name); | 1926 size_t s2len = strlen(method_name); |
1908 | 1927 |
1909 // check if we need to truncate the string | 1928 // check if we need to truncate the string |
1993 // | 2012 // |
1994 // Collect statistics about the compilation. | 2013 // Collect statistics about the compilation. |
1995 | 2014 |
1996 void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task) { | 2015 void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time, CompileTask* task) { |
1997 bool success = task->is_success(); | 2016 bool success = task->is_success(); |
1998 methodHandle method (thread, (methodOop)JNIHandles::resolve(task->method_handle())); | 2017 methodHandle method (thread, task->method()); |
1999 uint compile_id = task->compile_id(); | 2018 uint compile_id = task->compile_id(); |
2000 bool is_osr = (task->osr_bci() != standard_entry_bci); | 2019 bool is_osr = (task->osr_bci() != standard_entry_bci); |
2001 nmethod* code = task->code(); | 2020 nmethod* code = task->code(); |
2002 CompilerCounters* counters = thread->counters(); | 2021 CompilerCounters* counters = thread->counters(); |
2003 | 2022 |