comparison src/share/vm/compiler/compileBroker.cpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 1b8d02e10ee8 1d7922586cf6
children e522a00b91aa
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
408 } else { 408 } else {
409 method->print_short_name(st); 409 method->print_short_name(st);
410 if (is_osr_method) { 410 if (is_osr_method) {
411 st->print(" @ %d", osr_bci); 411 st->print(" @ %d", osr_bci);
412 } 412 }
413 st->print(" (%d bytes)", method->code_size()); 413 if (method->is_native())
414 st->print(" (native)");
415 else
416 st->print(" (%d bytes)", method->code_size());
414 } 417 }
415 418
416 if (msg != NULL) { 419 if (msg != NULL) {
417 st->print(" %s", msg); 420 st->print(" %s", msg);
418 } 421 }
428 st->print(" "); // print timestamp 431 st->print(" "); // print timestamp
429 // 1234 432 // 1234
430 st->print(" "); // print compilation number 433 st->print(" "); // print compilation number
431 434
432 // method attributes 435 // method attributes
433 const char sync_char = method->is_synchronized() ? 's' : ' '; 436 if (method->is_loaded()) {
434 const char exception_char = method->has_exception_handlers() ? '!' : ' '; 437 const char sync_char = method->is_synchronized() ? 's' : ' ';
435 const char monitors_char = method->has_monitor_bytecodes() ? 'm' : ' '; 438 const char exception_char = method->has_exception_handlers() ? '!' : ' ';
436 439 const char monitors_char = method->has_monitor_bytecodes() ? 'm' : ' ';
437 // print method attributes 440
438 st->print(" %c%c%c ", sync_char, exception_char, monitors_char); 441 // print method attributes
442 st->print(" %c%c%c ", sync_char, exception_char, monitors_char);
443 } else {
444 // %s!bn
445 st->print(" "); // print method attributes
446 }
439 447
440 if (TieredCompilation) { 448 if (TieredCompilation) {
441 st->print(" "); 449 st->print(" ");
442 } 450 }
443 st->print(" "); // more indent 451 st->print(" "); // more indent
445 453
446 for (int i = 0; i < inline_level; i++) st->print(" "); 454 for (int i = 0; i < inline_level; i++) st->print(" ");
447 455
448 st->print("@ %d ", bci); // print bci 456 st->print("@ %d ", bci); // print bci
449 method->print_short_name(st); 457 method->print_short_name(st);
450 st->print(" (%d bytes)", method->code_size()); 458 if (method->is_loaded())
459 st->print(" (%d bytes)", method->code_size());
460 else
461 st->print(" (not loaded)");
451 462
452 if (msg != NULL) { 463 if (msg != NULL) {
453 st->print(" %s", msg); 464 st->print(" %s", msg);
454 } 465 }
455 st->cr(); 466 st->cr();
956 } 967 }
957 968
958 int compiler_count = c1_compiler_count + c2_compiler_count; 969 int compiler_count = c1_compiler_count + c2_compiler_count;
959 970
960 _method_threads = 971 _method_threads =
961 new (ResourceObj::C_HEAP) GrowableArray<CompilerThread*>(compiler_count, true); 972 new (ResourceObj::C_HEAP, mtCompiler) GrowableArray<CompilerThread*>(compiler_count, true);
962 973
963 char name_buffer[256]; 974 char name_buffer[256];
964 for (int i = 0; i < c2_compiler_count; i++) { 975 for (int i = 0; i < c2_compiler_count; i++) {
965 // Create a name for our thread. 976 // Create a name for our thread.
966 sprintf(name_buffer, "C2 CompilerThread%d", i); 977 sprintf(name_buffer, "C2 CompilerThread%d", i);
1024 guarantee(!method->is_abstract(), "cannot compile abstract methods"); 1035 guarantee(!method->is_abstract(), "cannot compile abstract methods");
1025 assert(method->method_holder()->klass_part()->oop_is_instance(), 1036 assert(method->method_holder()->klass_part()->oop_is_instance(),
1026 "sanity check"); 1037 "sanity check");
1027 assert(!instanceKlass::cast(method->method_holder())->is_not_initialized(), 1038 assert(!instanceKlass::cast(method->method_holder())->is_not_initialized(),
1028 "method holder must be initialized"); 1039 "method holder must be initialized");
1040 assert(!method->is_method_handle_intrinsic(), "do not enqueue these guys");
1029 1041
1030 if (CIPrintRequests) { 1042 if (CIPrintRequests) {
1031 tty->print("request: "); 1043 tty->print("request: ");
1032 method->print_short_name(tty); 1044 method->print_short_name(tty);
1033 if (osr_bci != InvocationEntryBci) { 1045 if (osr_bci != InvocationEntryBci) {
1246 // the compilation. Native lookups can load code, which is not 1258 // the compilation. Native lookups can load code, which is not
1247 // permitted during compilation. 1259 // permitted during compilation.
1248 // 1260 //
1249 // Note: A native method implies non-osr compilation which is 1261 // Note: A native method implies non-osr compilation which is
1250 // checked with an assertion at the entry of this method. 1262 // checked with an assertion at the entry of this method.
1251 if (method->is_native()) { 1263 if (method->is_native() && !method->is_method_handle_intrinsic()) {
1252 bool in_base_library; 1264 bool in_base_library;
1253 address adr = NativeLookup::lookup(method, in_base_library, THREAD); 1265 address adr = NativeLookup::lookup(method, in_base_library, THREAD);
1254 if (HAS_PENDING_EXCEPTION) { 1266 if (HAS_PENDING_EXCEPTION) {
1255 // In case of an exception looking up the method, we just forget 1267 // In case of an exception looking up the method, we just forget
1256 // about it. The interpreter will kick-in and throw the exception. 1268 // about it. The interpreter will kick-in and throw the exception.
1279 return NULL; 1291 return NULL;
1280 } 1292 }
1281 1293
1282 // do the compilation 1294 // do the compilation
1283 if (method->is_native()) { 1295 if (method->is_native()) {
1284 if (!PreferInterpreterNativeStubs) { 1296 if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) {
1285 // Acquire our lock. 1297 // Acquire our lock.
1286 int compile_id; 1298 int compile_id;
1287 { 1299 {
1288 MutexLocker locker(MethodCompileQueue_lock, THREAD); 1300 MutexLocker locker(MethodCompileQueue_lock, THREAD);
1289 compile_id = assign_compile_id(method, standard_entry_bci); 1301 compile_id = assign_compile_id(method, standard_entry_bci);
1642 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir, 1654 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir,
1643 os::file_separator(), thread_id, os::current_process_id()); 1655 os::file_separator(), thread_id, os::current_process_id());
1644 } 1656 }
1645 fp = fopen(fileBuf, "at"); 1657 fp = fopen(fileBuf, "at");
1646 if (fp != NULL) { 1658 if (fp != NULL) {
1647 file = NEW_C_HEAP_ARRAY(char, strlen(fileBuf)+1); 1659 file = NEW_C_HEAP_ARRAY(char, strlen(fileBuf)+1, mtCompiler);
1648 strcpy(file, fileBuf); 1660 strcpy(file, fileBuf);
1649 break; 1661 break;
1650 } 1662 }
1651 } 1663 }
1652 if (fp == NULL) { 1664 if (fp == NULL) {
1653 warning("Cannot open log file: %s", fileBuf); 1665 warning("Cannot open log file: %s", fileBuf);
1654 } else { 1666 } else {
1655 if (LogCompilation && Verbose) 1667 if (LogCompilation && Verbose)
1656 tty->print_cr("Opening compilation log %s", file); 1668 tty->print_cr("Opening compilation log %s", file);
1657 CompileLog* log = new(ResourceObj::C_HEAP) CompileLog(file, fp, thread_id); 1669 CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file, fp, thread_id);
1658 thread->init_log(log); 1670 thread->init_log(log);
1659 1671
1660 if (xtty != NULL) { 1672 if (xtty != NULL) {
1661 ttyLocker ttyl; 1673 ttyLocker ttyl;
1662 1674