Fri, 07 May 2010 15:12:28 -0700
Merge
1.1 --- a/make/jprt.properties Thu May 06 18:25:58 2010 -0700 1.2 +++ b/make/jprt.properties Fri May 07 15:12:28 2010 -0700 1.3 @@ -51,6 +51,8 @@ 1.4 jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8 1.5 jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8 1.6 jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 1.7 +jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 1.8 +jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 1.9 jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} 1.10 1.11 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 1.12 @@ -58,6 +60,8 @@ 1.13 jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8 1.14 jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8 1.15 jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 1.16 +jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 1.17 +jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 1.18 jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} 1.19 1.20 jprt.my.solaris.i586.jdk7=solaris_i586_5.10 1.21 @@ -65,6 +69,8 @@ 1.22 jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8 1.23 jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8 1.24 jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 1.25 +jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 1.26 +jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 1.27 jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} 1.28 1.29 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 1.30 @@ -72,6 +78,8 @@ 1.31 jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10 1.32 jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10 1.33 jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 1.34 +jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 1.35 +jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 1.36 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} 1.37 1.38 jprt.my.linux.i586.jdk7=linux_i586_2.6 1.39 @@ -79,6 +87,8 @@ 1.40 jprt.my.linux.i586.jdk6perf=linux_i586_2.4 1.41 jprt.my.linux.i586.jdk6u10=linux_i586_2.4 1.42 jprt.my.linux.i586.jdk6u14=linux_i586_2.4 1.43 +jprt.my.linux.i586.jdk6u18=linux_i586_2.4 1.44 +jprt.my.linux.i586.jdk6u20=linux_i586_2.4 1.45 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} 1.46 1.47 jprt.my.linux.x64.jdk7=linux_x64_2.6 1.48 @@ -86,6 +96,8 @@ 1.49 jprt.my.linux.x64.jdk6perf=linux_x64_2.4 1.50 jprt.my.linux.x64.jdk6u10=linux_x64_2.4 1.51 jprt.my.linux.x64.jdk6u14=linux_x64_2.4 1.52 +jprt.my.linux.x64.jdk6u18=linux_x64_2.4 1.53 +jprt.my.linux.x64.jdk6u20=linux_x64_2.4 1.54 jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} 1.55 1.56 jprt.my.windows.i586.jdk7=windows_i586_5.0 1.57 @@ -93,6 +105,8 @@ 1.58 jprt.my.windows.i586.jdk6perf=windows_i586_5.0 1.59 jprt.my.windows.i586.jdk6u10=windows_i586_5.0 1.60 jprt.my.windows.i586.jdk6u14=windows_i586_5.0 1.61 +jprt.my.windows.i586.jdk6u18=windows_i586_5.0 1.62 +jprt.my.windows.i586.jdk6u20=windows_i586_5.0 1.63 jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} 1.64 1.65 jprt.my.windows.x64.jdk7=windows_x64_5.2 1.66 @@ -100,6 +114,8 @@ 1.67 jprt.my.windows.x64.jdk6perf=windows_x64_5.2 1.68 jprt.my.windows.x64.jdk6u10=windows_x64_5.2 1.69 jprt.my.windows.x64.jdk6u14=windows_x64_5.2 1.70 +jprt.my.windows.x64.jdk6u18=windows_x64_5.2 1.71 +jprt.my.windows.x64.jdk6u20=windows_x64_5.2 1.72 jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} 1.73 1.74 # Standard list of jprt build targets for this source tree
2.1 --- a/src/cpu/sparc/vm/assembler_sparc.cpp Thu May 06 18:25:58 2010 -0700 2.2 +++ b/src/cpu/sparc/vm/assembler_sparc.cpp Fri May 07 15:12:28 2010 -0700 2.3 @@ -4082,7 +4082,7 @@ 2.4 // make it work. 2.5 static void check_index(int ind) { 2.6 assert(0 <= ind && ind <= 64*K && ((ind % oopSize) == 0), 2.7 - "Invariants.") 2.8 + "Invariants."); 2.9 } 2.10 2.11 static void generate_satb_log_enqueue(bool with_frame) {
3.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp Thu May 06 18:25:58 2010 -0700 3.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp Fri May 07 15:12:28 2010 -0700 3.3 @@ -1062,7 +1062,7 @@ 3.4 } 3.5 void assert_not_delayed(const char* msg) { 3.6 #ifdef CHECK_DELAY 3.7 - assert_msg ( delay_state == no_delay, msg); 3.8 + assert(delay_state == no_delay, msg); 3.9 #endif 3.10 } 3.11
4.1 --- a/src/cpu/x86/vm/assembler_x86.cpp Thu May 06 18:25:58 2010 -0700 4.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp Fri May 07 15:12:28 2010 -0700 4.3 @@ -7975,7 +7975,7 @@ 4.4 case 2: return "special"; 4.5 case 3: return "empty"; 4.6 } 4.7 - ShouldNotReachHere() 4.8 + ShouldNotReachHere(); 4.9 return NULL; 4.10 } 4.11
5.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Thu May 06 18:25:58 2010 -0700 5.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Fri May 07 15:12:28 2010 -0700 5.3 @@ -2838,7 +2838,7 @@ 5.4 // On 64bit this will die since it will take a movq & jmp, must be only a jmp 5.5 __ jump(RuntimeAddress(__ pc())); 5.6 5.7 - assert(__ offset() - start <= call_stub_size, "stub too big") 5.8 + assert(__ offset() - start <= call_stub_size, "stub too big"); 5.9 __ end_a_stub(); 5.10 } 5.11
6.1 --- a/src/cpu/x86/vm/frame_x86.cpp Thu May 06 18:25:58 2010 -0700 6.2 +++ b/src/cpu/x86/vm/frame_x86.cpp Fri May 07 15:12:28 2010 -0700 6.3 @@ -291,8 +291,8 @@ 6.4 BasicObjectLock* frame::interpreter_frame_monitor_end() const { 6.5 BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset); 6.6 // make sure the pointer points inside the frame 6.7 - assert((intptr_t) fp() > (intptr_t) result, "result must < than frame pointer"); 6.8 - assert((intptr_t) sp() <= (intptr_t) result, "result must >= than stack pointer"); 6.9 + assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer"); 6.10 + assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer"); 6.11 return result; 6.12 } 6.13
7.1 --- a/src/os/linux/vm/os_linux.cpp Thu May 06 18:25:58 2010 -0700 7.2 +++ b/src/os/linux/vm/os_linux.cpp Fri May 07 15:12:28 2010 -0700 7.3 @@ -3495,7 +3495,8 @@ 7.4 // libjsig also interposes the sigaction() call below and saves the 7.5 // old sigaction on it own. 7.6 } else { 7.7 - fatal2("Encountered unexpected pre-existing sigaction handler %#lx for signal %d.", (long)oldhand, sig); 7.8 + fatal(err_msg("Encountered unexpected pre-existing sigaction handler " 7.9 + "%#lx for signal %d.", (long)oldhand, sig)); 7.10 } 7.11 } 7.12 7.13 @@ -3817,7 +3818,8 @@ 7.14 7.15 Linux::set_page_size(sysconf(_SC_PAGESIZE)); 7.16 if (Linux::page_size() == -1) { 7.17 - fatal1("os_linux.cpp: os::init: sysconf failed (%s)", strerror(errno)); 7.18 + fatal(err_msg("os_linux.cpp: os::init: sysconf failed (%s)", 7.19 + strerror(errno))); 7.20 } 7.21 init_page_sizes((size_t) Linux::page_size()); 7.22
8.1 --- a/src/os/solaris/vm/os_solaris.cpp Thu May 06 18:25:58 2010 -0700 8.2 +++ b/src/os/solaris/vm/os_solaris.cpp Fri May 07 15:12:28 2010 -0700 8.3 @@ -1567,7 +1567,8 @@ 8.4 // treat %g2 as a caller-save register, preserving it in a %lN. 8.5 thread_key_t tk; 8.6 if (thr_keycreate( &tk, NULL ) ) 8.7 - fatal1("os::allocate_thread_local_storage: thr_keycreate failed (%s)", strerror(errno)); 8.8 + fatal(err_msg("os::allocate_thread_local_storage: thr_keycreate failed " 8.9 + "(%s)", strerror(errno))); 8.10 return int(tk); 8.11 } 8.12 8.13 @@ -1585,7 +1586,8 @@ 8.14 if (errno == ENOMEM) { 8.15 vm_exit_out_of_memory(SMALLINT, "thr_setspecific: out of swap space"); 8.16 } else { 8.17 - fatal1("os::thread_local_storage_at_put: thr_setspecific failed (%s)", strerror(errno)); 8.18 + fatal(err_msg("os::thread_local_storage_at_put: thr_setspecific failed " 8.19 + "(%s)", strerror(errno))); 8.20 } 8.21 } else { 8.22 ThreadLocalStorage::set_thread_in_slot ((Thread *) value) ; 8.23 @@ -1738,7 +1740,7 @@ 8.24 jlong os::javaTimeMillis() { 8.25 timeval t; 8.26 if (gettimeofday( &t, NULL) == -1) 8.27 - fatal1("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)); 8.28 + fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno))); 8.29 return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; 8.30 } 8.31 8.32 @@ -4233,7 +4235,8 @@ 8.33 // libjsig also interposes the sigaction() call below and saves the 8.34 // old sigaction on it own. 8.35 } else { 8.36 - fatal2("Encountered unexpected pre-existing sigaction handler %#lx for signal %d.", (long)oldhand, sig); 8.37 + fatal(err_msg("Encountered unexpected pre-existing sigaction handler " 8.38 + "%#lx for signal %d.", (long)oldhand, sig)); 8.39 } 8.40 } 8.41 8.42 @@ -4764,7 +4767,8 @@ 8.43 8.44 page_size = sysconf(_SC_PAGESIZE); 8.45 if (page_size == -1) 8.46 - fatal1("os_solaris.cpp: os::init: sysconf failed (%s)", strerror(errno)); 8.47 + fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)", 8.48 + strerror(errno))); 8.49 init_page_sizes((size_t) page_size); 8.50 8.51 Solaris::initialize_system_info(); 8.52 @@ -4775,7 +4779,7 @@ 8.53 8.54 int fd = open("/dev/zero", O_RDWR); 8.55 if (fd < 0) { 8.56 - fatal1("os::init: cannot open /dev/zero (%s)", strerror(errno)); 8.57 + fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno))); 8.58 } else { 8.59 Solaris::set_dev_zero_fd(fd); 8.60
9.1 --- a/src/os/solaris/vm/threadCritical_solaris.cpp Thu May 06 18:25:58 2010 -0700 9.2 +++ b/src/os/solaris/vm/threadCritical_solaris.cpp Fri May 07 15:12:28 2010 -0700 9.3 @@ -47,7 +47,8 @@ 9.4 thread_t owner = thr_self(); 9.5 if (global_mut_owner != owner) { 9.6 if (os::Solaris::mutex_lock(&global_mut)) 9.7 - fatal1("ThreadCritical::ThreadCritical: mutex_lock failed (%s)", strerror(errno)); 9.8 + fatal(err_msg("ThreadCritical::ThreadCritical: mutex_lock failed (%s)", 9.9 + strerror(errno))); 9.10 assert(global_mut_count == 0, "must have clean count"); 9.11 assert(global_mut_owner == -1, "must have clean owner"); 9.12 } 9.13 @@ -66,7 +67,8 @@ 9.14 if (global_mut_count == 0) { 9.15 global_mut_owner = -1; 9.16 if (os::Solaris::mutex_unlock(&global_mut)) 9.17 - fatal1("ThreadCritical::~ThreadCritical: mutex_unlock failed (%s)", strerror(errno)); 9.18 + fatal(err_msg("ThreadCritical::~ThreadCritical: mutex_unlock failed " 9.19 + "(%s)", strerror(errno))); 9.20 } 9.21 } else { 9.22 assert (Threads::number_of_threads() == 0, "valid only during initialization");
10.1 --- a/src/os/windows/vm/os_windows.cpp Thu May 06 18:25:58 2010 -0700 10.2 +++ b/src/os/windows/vm/os_windows.cpp Fri May 07 15:12:28 2010 -0700 10.3 @@ -724,7 +724,7 @@ 10.4 java_origin.wMilliseconds = 0; 10.5 FILETIME jot; 10.6 if (!SystemTimeToFileTime(&java_origin, &jot)) { 10.7 - fatal1("Error = %d\nWindows error", GetLastError()); 10.8 + fatal(err_msg("Error = %d\nWindows error", GetLastError())); 10.9 } 10.10 _calculated_offset = jlong_from(jot.dwHighDateTime, jot.dwLowDateTime); 10.11 _has_calculated_offset = 1; 10.12 @@ -4095,7 +4095,7 @@ 10.13 } 10.14 int err = GetLastError(); 10.15 if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) { 10.16 - fatal1("heap walk aborted with error %d", err); 10.17 + fatal(err_msg("heap walk aborted with error %d", err)); 10.18 } 10.19 HeapUnlock(heap); 10.20 }
11.1 --- a/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Thu May 06 18:25:58 2010 -0700 11.2 +++ b/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Fri May 07 15:12:28 2010 -0700 11.3 @@ -153,7 +153,7 @@ 11.4 if (rslt == ENOMEM) { 11.5 vm_exit_out_of_memory(0, "pthread_getattr_np"); 11.6 } else { 11.7 - fatal1("pthread_getattr_np failed with errno = %d", rslt); 11.8 + fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt)); 11.9 } 11.10 } 11.11
12.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Thu May 06 18:25:58 2010 -0700 12.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri May 07 15:12:28 2010 -0700 12.3 @@ -680,7 +680,7 @@ 12.4 if (rslt == ENOMEM) { 12.5 vm_exit_out_of_memory(0, "pthread_getattr_np"); 12.6 } else { 12.7 - fatal1("pthread_getattr_np failed with errno = %d", rslt); 12.8 + fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt)); 12.9 } 12.10 } 12.11
13.1 --- a/src/share/vm/adlc/output_c.cpp Thu May 06 18:25:58 2010 -0700 13.2 +++ b/src/share/vm/adlc/output_c.cpp Fri May 07 15:12:28 2010 -0700 13.3 @@ -721,8 +721,8 @@ 13.4 fprintf(fp_cpp, " }\n"); 13.5 fprintf(fp_cpp, "#endif\n\n"); 13.6 #endif 13.7 - fprintf(fp_cpp, " assert(this, \"NULL pipeline info\")\n"); 13.8 - fprintf(fp_cpp, " assert(pred, \"NULL predecessor pipline info\")\n\n"); 13.9 + fprintf(fp_cpp, " assert(this, \"NULL pipeline info\");\n"); 13.10 + fprintf(fp_cpp, " assert(pred, \"NULL predecessor pipline info\");\n\n"); 13.11 fprintf(fp_cpp, " if (pred->hasFixedLatency())\n return (pred->fixedLatency());\n\n"); 13.12 fprintf(fp_cpp, " // If this is not an operand, then assume a dependence with 0 latency\n"); 13.13 fprintf(fp_cpp, " if (opnd > _read_stage_count)\n return (0);\n\n");
14.1 --- a/src/share/vm/asm/assembler.cpp Thu May 06 18:25:58 2010 -0700 14.2 +++ b/src/share/vm/asm/assembler.cpp Fri May 07 15:12:28 2010 -0700 14.3 @@ -43,7 +43,8 @@ 14.4 _code_pos = cs->end(); 14.5 _oop_recorder= code->oop_recorder(); 14.6 if (_code_begin == NULL) { 14.7 - vm_exit_out_of_memory1(0, "CodeCache: no room for %s", code->name()); 14.8 + vm_exit_out_of_memory(0, err_msg("CodeCache: no room for %s", 14.9 + code->name())); 14.10 } 14.11 } 14.12
15.1 --- a/src/share/vm/classfile/classFileParser.cpp Thu May 06 18:25:58 2010 -0700 15.2 +++ b/src/share/vm/classfile/classFileParser.cpp Fri May 07 15:12:28 2010 -0700 15.3 @@ -334,7 +334,8 @@ 15.4 } 15.5 break; 15.6 default: 15.7 - fatal1("bad constant pool tag value %u", cp->tag_at(index).value()); 15.8 + fatal(err_msg("bad constant pool tag value %u", 15.9 + cp->tag_at(index).value())); 15.10 ShouldNotReachHere(); 15.11 break; 15.12 } // end of switch
16.1 --- a/src/share/vm/classfile/dictionary.cpp Thu May 06 18:25:58 2010 -0700 16.2 +++ b/src/share/vm/classfile/dictionary.cpp Fri May 07 15:12:28 2010 -0700 16.3 @@ -127,7 +127,7 @@ 16.4 16.5 16.6 bool Dictionary::do_unloading(BoolObjectClosure* is_alive) { 16.7 - assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint") 16.8 + assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); 16.9 bool class_was_unloaded = false; 16.10 int index = 0; // Defined here for portability! Do not move 16.11
17.1 --- a/src/share/vm/classfile/loaderConstraints.cpp Thu May 06 18:25:58 2010 -0700 17.2 +++ b/src/share/vm/classfile/loaderConstraints.cpp Fri May 07 15:12:28 2010 -0700 17.3 @@ -103,7 +103,7 @@ 17.4 17.5 17.6 void LoaderConstraintTable::purge_loader_constraints(BoolObjectClosure* is_alive) { 17.7 - assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint") 17.8 + assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); 17.9 // Remove unloaded entries from constraint table 17.10 for (int index = 0; index < table_size(); index++) { 17.11 LoaderConstraintEntry** p = bucket_addr(index);
18.1 --- a/src/share/vm/classfile/resolutionErrors.cpp Thu May 06 18:25:58 2010 -0700 18.2 +++ b/src/share/vm/classfile/resolutionErrors.cpp Fri May 07 15:12:28 2010 -0700 18.3 @@ -102,7 +102,7 @@ 18.4 18.5 // Remove unloaded entries from the table 18.6 void ResolutionErrorTable::purge_resolution_errors(BoolObjectClosure* is_alive) { 18.7 - assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint") 18.8 + assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); 18.9 for (int i = 0; i < table_size(); i++) { 18.10 for (ResolutionErrorEntry** p = bucket_addr(i); *p != NULL; ) { 18.11 ResolutionErrorEntry* entry = *p;
19.1 --- a/src/share/vm/code/exceptionHandlerTable.cpp Thu May 06 18:25:58 2010 -0700 19.2 +++ b/src/share/vm/code/exceptionHandlerTable.cpp Fri May 07 15:12:28 2010 -0700 19.3 @@ -221,6 +221,6 @@ 19.4 for (uint i = 0; i < len(); i++) { 19.5 if ((*adr(i) > (unsigned int)nm->code_size()) || 19.6 (*(adr(i)+1) > (unsigned int)nm->code_size())) 19.7 - fatal1("Invalid offset in ImplicitExceptionTable at %lx", _data); 19.8 + fatal(err_msg("Invalid offset in ImplicitExceptionTable at " PTR_FORMAT, _data)); 19.9 } 19.10 }
20.1 --- a/src/share/vm/code/nmethod.cpp Thu May 06 18:25:58 2010 -0700 20.2 +++ b/src/share/vm/code/nmethod.cpp Fri May 07 15:12:28 2010 -0700 20.3 @@ -1534,7 +1534,8 @@ 20.4 } 20.5 } 20.6 ic->set_to_clean(); 20.7 - assert(ic->cached_oop() == NULL, "cached oop in IC should be cleared") 20.8 + assert(ic->cached_oop() == NULL, 20.9 + "cached oop in IC should be cleared"); 20.10 } 20.11 } 20.12 } 20.13 @@ -2123,7 +2124,7 @@ 20.14 ResourceMark rm; 20.15 20.16 if (!CodeCache::contains(this)) { 20.17 - fatal1("nmethod at " INTPTR_FORMAT " not in zone", this); 20.18 + fatal(err_msg("nmethod at " INTPTR_FORMAT " not in zone", this)); 20.19 } 20.20 20.21 if(is_native_method() ) 20.22 @@ -2131,7 +2132,8 @@ 20.23 20.24 nmethod* nm = CodeCache::find_nmethod(verified_entry_point()); 20.25 if (nm != this) { 20.26 - fatal1("findNMethod did not find this nmethod (" INTPTR_FORMAT ")", this); 20.27 + fatal(err_msg("findNMethod did not find this nmethod (" INTPTR_FORMAT ")", 20.28 + this)); 20.29 } 20.30 20.31 for (PcDesc* p = scopes_pcs_begin(); p < scopes_pcs_end(); p++) {
21.1 --- a/src/share/vm/code/stubs.cpp Thu May 06 18:25:58 2010 -0700 21.2 +++ b/src/share/vm/code/stubs.cpp Fri May 07 15:12:28 2010 -0700 21.3 @@ -62,7 +62,9 @@ 21.4 Mutex* lock, const char* name) : _mutex(lock) { 21.5 intptr_t size = round_to(buffer_size, 2*BytesPerWord); 21.6 BufferBlob* blob = BufferBlob::create(name, size); 21.7 - if( blob == NULL ) vm_exit_out_of_memory1(size, "CodeCache: no room for %s", name); 21.8 + if( blob == NULL) { 21.9 + vm_exit_out_of_memory(size, err_msg("CodeCache: no room for %s", name)); 21.10 + } 21.11 _stub_interface = stub_interface; 21.12 _buffer_size = blob->instructions_size(); 21.13 _buffer_limit = blob->instructions_size();
22.1 --- a/src/share/vm/code/vtableStubs.cpp Thu May 06 18:25:58 2010 -0700 22.2 +++ b/src/share/vm/code/vtableStubs.cpp Fri May 07 15:12:28 2010 -0700 22.3 @@ -45,7 +45,9 @@ 22.4 if (_chunk == NULL || _chunk + real_size > _chunk_end) { 22.5 const int bytes = chunk_factor * real_size + pd_code_alignment(); 22.6 BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); 22.7 - if( blob == NULL ) vm_exit_out_of_memory1(bytes, "CodeCache: no room for %s", "vtable chunks"); 22.8 + if (blob == NULL) { 22.9 + vm_exit_out_of_memory(bytes, "CodeCache: no room for vtable chunks"); 22.10 + } 22.11 _chunk = blob->instructions_begin(); 22.12 _chunk_end = _chunk + bytes; 22.13 VTune::register_stub("vtable stub", _chunk, _chunk_end); 22.14 @@ -189,7 +191,9 @@ 22.15 instanceKlass* ik = instanceKlass::cast(klass); 22.16 klassVtable* vt = ik->vtable(); 22.17 klass->print(); 22.18 - fatal3("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", index %d (vtable length %d)", (address)receiver, index, vt->length()); 22.19 + fatal(err_msg("bad compiled vtable dispatch: receiver " INTPTR_FORMAT ", " 22.20 + "index %d (vtable length %d)", 22.21 + (address)receiver, index, vt->length())); 22.22 } 22.23 22.24 #endif // Product
23.1 --- a/src/share/vm/compiler/compileBroker.hpp Thu May 06 18:25:58 2010 -0700 23.2 +++ b/src/share/vm/compiler/compileBroker.hpp Fri May 07 15:12:28 2010 -0700 23.3 @@ -310,7 +310,7 @@ 23.4 23.5 static AbstractCompiler* compiler(int level ) { 23.6 if (level == CompLevel_fast_compile) return _compilers[0]; 23.7 - assert(level == CompLevel_highest_tier, "what level?") 23.8 + assert(level == CompLevel_highest_tier, "what level?"); 23.9 return _compilers[1]; 23.10 } 23.11
24.1 --- a/src/share/vm/compiler/compileLog.cpp Thu May 06 18:25:58 2010 -0700 24.2 +++ b/src/share/vm/compiler/compileLog.cpp Fri May 07 15:12:28 2010 -0700 24.3 @@ -68,7 +68,7 @@ 24.4 return attrs; 24.5 } else { 24.6 // park it in the buffer, so we can put a null on the end 24.7 - assert(!(kind >= buffer && kind < buffer+100), "not obviously in buffer") 24.8 + assert(!(kind >= buffer && kind < buffer+100), "not obviously in buffer"); 24.9 int klen = attrs - kind; 24.10 strncpy(buffer, kind, klen); 24.11 buffer[klen] = 0;
25.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp Thu May 06 18:25:58 2010 -0700 25.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp Fri May 07 15:12:28 2010 -0700 25.3 @@ -118,7 +118,7 @@ 25.4 // TreeList from the first chunk to the next chunk and update all 25.5 // the TreeList pointers in the chunks in the list. 25.6 if (nextTC == NULL) { 25.7 - assert(prevFC == NULL, "Not last chunk in the list") 25.8 + assert(prevFC == NULL, "Not last chunk in the list"); 25.9 set_tail(NULL); 25.10 set_head(NULL); 25.11 } else {
26.1 --- a/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Thu May 06 18:25:58 2010 -0700 26.2 +++ b/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp Fri May 07 15:12:28 2010 -0700 26.3 @@ -517,7 +517,7 @@ 26.4 assert(blk_start != NULL && blk_end > blk_start, 26.5 "phantom block"); 26.6 assert(blk_end > threshold, "should be past threshold"); 26.7 - assert(blk_start <= threshold, "blk_start should be at or before threshold") 26.8 + assert(blk_start <= threshold, "blk_start should be at or before threshold"); 26.9 assert(pointer_delta(threshold, blk_start) <= N_words, 26.10 "offset should be <= BlockOffsetSharedArray::N"); 26.11 assert(Universe::heap()->is_in_reserved(blk_start),
27.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu May 06 18:25:58 2010 -0700 27.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri May 07 15:12:28 2010 -0700 27.3 @@ -4965,7 +4965,7 @@ 27.4 MutexLockerEx x(ZF_mon, Mutex::_no_safepoint_check_flag); 27.5 while (pop_unclean_region_list_locked() != NULL) ; 27.6 assert(_unclean_region_list.hd() == NULL && _unclean_region_list.sz() == 0, 27.7 - "Postconditions of loop.") 27.8 + "Postconditions of loop."); 27.9 while (pop_free_region_list_locked() != NULL) ; 27.10 assert(_free_region_list == NULL, "Postcondition of loop."); 27.11 if (_free_region_list_size != 0) {
28.1 --- a/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Thu May 06 18:25:58 2010 -0700 28.2 +++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp Fri May 07 15:12:28 2010 -0700 28.3 @@ -325,7 +325,7 @@ 28.4 28.5 eden_size = align_size_down(eden_size, alignment); 28.6 eden_end = eden_start + eden_size; 28.7 - assert(eden_end >= eden_start, "addition overflowed") 28.8 + assert(eden_end >= eden_start, "addition overflowed"); 28.9 28.10 // To may resize into from space as long as it is clear of live data. 28.11 // From space must remain page aligned, though, so we need to do some
29.1 --- a/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Thu May 06 18:25:58 2010 -0700 29.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Fri May 07 15:12:28 2010 -0700 29.3 @@ -326,7 +326,7 @@ 29.4 } 29.5 29.6 eden_end = eden_start + eden_size; 29.7 - assert(eden_end >= eden_start, "addition overflowed") 29.8 + assert(eden_end >= eden_start, "addition overflowed"); 29.9 29.10 // To may resize into from space as long as it is clear of live data. 29.11 // From space must remain page aligned, though, so we need to do some 29.12 @@ -413,7 +413,7 @@ 29.13 pointer_delta(to_start, eden_start, sizeof(char))); 29.14 } 29.15 eden_end = eden_start + eden_size; 29.16 - assert(eden_end >= eden_start, "addition overflowed") 29.17 + assert(eden_end >= eden_start, "addition overflowed"); 29.18 29.19 // Don't let eden shrink down to 0 or less. 29.20 eden_end = MAX2(eden_end, eden_start + alignment);
30.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Thu May 06 18:25:58 2010 -0700 30.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psOldGen.hpp Fri May 07 15:12:28 2010 -0700 30.3 @@ -65,7 +65,7 @@ 30.4 // and releasing the heap lock, which is held during gc's anyway. This method is not 30.5 // safe for use at the same time as allocate_noexpand()! 30.6 HeapWord* cas_allocate_noexpand(size_t word_size) { 30.7 - assert(SafepointSynchronize::is_at_safepoint(), "Must only be called at safepoint") 30.8 + assert(SafepointSynchronize::is_at_safepoint(), "Must only be called at safepoint"); 30.9 HeapWord* res = object_space()->cas_allocate(word_size); 30.10 if (res != NULL) { 30.11 _start_array.allocate_block(res);
31.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Thu May 06 18:25:58 2010 -0700 31.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Fri May 07 15:12:28 2010 -0700 31.3 @@ -3277,7 +3277,7 @@ 31.4 if (status == ParMarkBitMap::incomplete) { 31.5 // The last obj that starts in the source region does not end in the 31.6 // region. 31.7 - assert(closure.source() < end_addr, "sanity") 31.8 + assert(closure.source() < end_addr, "sanity"); 31.9 HeapWord* const obj_beg = closure.source(); 31.10 HeapWord* const range_end = MIN2(obj_beg + closure.words_remaining(), 31.11 src_space_top);
32.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Thu May 06 18:25:58 2010 -0700 32.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp Fri May 07 15:12:28 2010 -0700 32.3 @@ -521,7 +521,7 @@ 32.4 } 32.5 32.6 eden_end = eden_start + eden_size; 32.7 - assert(eden_end >= eden_start, "addition overflowed") 32.8 + assert(eden_end >= eden_start, "addition overflowed"); 32.9 32.10 // To may resize into from space as long as it is clear of live data. 32.11 // From space must remain page aligned, though, so we need to do some 32.12 @@ -605,7 +605,7 @@ 32.13 pointer_delta(to_start, eden_start, sizeof(char))); 32.14 } 32.15 eden_end = eden_start + eden_size; 32.16 - assert(eden_end >= eden_start, "addition overflowed") 32.17 + assert(eden_end >= eden_start, "addition overflowed"); 32.18 32.19 // Could choose to not let eden shrink 32.20 // to_start = MAX2(to_start, eden_end);
33.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Thu May 06 18:25:58 2010 -0700 33.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri May 07 15:12:28 2010 -0700 33.3 @@ -2339,8 +2339,8 @@ 33.4 goto opcode_switch; 33.5 } 33.6 #endif 33.7 - fatal2("\t*** Unimplemented opcode: %d = %s\n", 33.8 - opcode, Bytecodes::name((Bytecodes::Code)opcode)); 33.9 + fatal(err_msg("Unimplemented opcode %d = %s", opcode, 33.10 + Bytecodes::name((Bytecodes::Code)opcode))); 33.11 goto finish; 33.12 33.13 } /* switch(opc) */
34.1 --- a/src/share/vm/interpreter/bytecodes.cpp Thu May 06 18:25:58 2010 -0700 34.2 +++ b/src/share/vm/interpreter/bytecodes.cpp Fri May 07 15:12:28 2010 -0700 34.3 @@ -426,7 +426,9 @@ 34.4 if (is_defined(i)) { 34.5 Code code = cast(i); 34.6 Code java = java_code(code); 34.7 - if (can_trap(code) && !can_trap(java)) fatal2("%s can trap => %s can trap, too", name(code), name(java)); 34.8 + if (can_trap(code) && !can_trap(java)) 34.9 + fatal(err_msg("%s can trap => %s can trap, too", name(code), 34.10 + name(java))); 34.11 } 34.12 } 34.13 }
35.1 --- a/src/share/vm/interpreter/oopMapCache.cpp Thu May 06 18:25:58 2010 -0700 35.2 +++ b/src/share/vm/interpreter/oopMapCache.cpp Fri May 07 15:12:28 2010 -0700 35.3 @@ -224,8 +224,8 @@ 35.4 // If we are doing mark sweep _method may not have a valid header 35.5 // $$$ This used to happen only for m/s collections; we might want to 35.6 // think of an appropriate generalization of this distinction. 35.7 - guarantee(Universe::heap()->is_gc_active() || 35.8 - _method->is_oop_or_null(), "invalid oop in oopMapCache") 35.9 + guarantee(Universe::heap()->is_gc_active() || _method->is_oop_or_null(), 35.10 + "invalid oop in oopMapCache"); 35.11 } 35.12 35.13 #ifdef ENABLE_ZAP_DEAD_LOCALS
36.1 --- a/src/share/vm/interpreter/templateInterpreter.cpp Thu May 06 18:25:58 2010 -0700 36.2 +++ b/src/share/vm/interpreter/templateInterpreter.cpp Fri May 07 15:12:28 2010 -0700 36.3 @@ -457,7 +457,7 @@ 36.4 36.5 void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) { 36.6 assert(t->is_valid(), "template must exist"); 36.7 - assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions") 36.8 + assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions"); 36.9 wep = __ pc(); generate_and_dispatch(t); 36.10 } 36.11
37.1 --- a/src/share/vm/memory/blockOffsetTable.cpp Thu May 06 18:25:58 2010 -0700 37.2 +++ b/src/share/vm/memory/blockOffsetTable.cpp Fri May 07 15:12:28 2010 -0700 37.3 @@ -689,7 +689,7 @@ 37.4 assert(blk_end > _next_offset_threshold, 37.5 "should be past threshold"); 37.6 assert(blk_start <= _next_offset_threshold, 37.7 - "blk_start should be at or before threshold") 37.8 + "blk_start should be at or before threshold"); 37.9 assert(pointer_delta(_next_offset_threshold, blk_start) <= N_words, 37.10 "offset should be <= BlockOffsetSharedArray::N"); 37.11 assert(Universe::heap()->is_in_reserved(blk_start),
38.1 --- a/src/share/vm/memory/heapInspection.cpp Thu May 06 18:25:58 2010 -0700 38.2 +++ b/src/share/vm/memory/heapInspection.cpp Fri May 07 15:12:28 2010 -0700 38.3 @@ -315,7 +315,7 @@ 38.4 38.5 void HeapInspection::find_instances_at_safepoint(klassOop k, GrowableArray<oop>* result) { 38.6 assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped"); 38.7 - assert(Heap_lock->is_locked(), "should have the Heap_lock") 38.8 + assert(Heap_lock->is_locked(), "should have the Heap_lock"); 38.9 38.10 // Ensure that the heap is parsable 38.11 Universe::heap()->ensure_parsability(false); // no need to retire TALBs
39.1 --- a/src/share/vm/oops/generateOopMap.cpp Thu May 06 18:25:58 2010 -0700 39.2 +++ b/src/share/vm/oops/generateOopMap.cpp Fri May 07 15:12:28 2010 -0700 39.3 @@ -807,7 +807,7 @@ 39.4 } 39.5 39.6 CellTypeState GenerateOopMap::get_var(int localNo) { 39.7 - assert(localNo < _max_locals + _nof_refval_conflicts, "variable read error") 39.8 + assert(localNo < _max_locals + _nof_refval_conflicts, "variable read error"); 39.9 if (localNo < 0 || localNo > _max_locals) { 39.10 verify_error("variable read error: r%d", localNo); 39.11 return valCTS; // just to pick something;
40.1 --- a/src/share/vm/oops/instanceKlass.cpp Thu May 06 18:25:58 2010 -0700 40.2 +++ b/src/share/vm/oops/instanceKlass.cpp Fri May 07 15:12:28 2010 -0700 40.3 @@ -966,7 +966,7 @@ 40.4 // not found 40.5 #ifdef ASSERT 40.6 int index = linear_search(methods, name, signature); 40.7 - if (index != -1) fatal1("binary search bug: should have found entry %d", index); 40.8 + assert(index == -1, err_msg("binary search should have found entry %d", index)); 40.9 #endif 40.10 return NULL; 40.11 } else if (res < 0) { 40.12 @@ -977,7 +977,7 @@ 40.13 } 40.14 #ifdef ASSERT 40.15 int index = linear_search(methods, name, signature); 40.16 - if (index != -1) fatal1("binary search bug: should have found entry %d", index); 40.17 + assert(index == -1, err_msg("binary search should have found entry %d", index)); 40.18 #endif 40.19 return NULL; 40.20 }
41.1 --- a/src/share/vm/oops/instanceKlassKlass.cpp Thu May 06 18:25:58 2010 -0700 41.2 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Fri May 07 15:12:28 2010 -0700 41.3 @@ -712,10 +712,10 @@ 41.4 int sib_count = 0; 41.5 while (sib != NULL) { 41.6 if (sib == ik) { 41.7 - fatal1("subclass cycle of length %d", sib_count); 41.8 + fatal(err_msg("subclass cycle of length %d", sib_count)); 41.9 } 41.10 if (sib_count >= 100000) { 41.11 - fatal1("suspiciously long subclass list %d", sib_count); 41.12 + fatal(err_msg("suspiciously long subclass list %d", sib_count)); 41.13 } 41.14 guarantee(sib->as_klassOop()->is_klass(), "should be klass"); 41.15 guarantee(sib->as_klassOop()->is_perm(), "should be in permspace");
42.1 --- a/src/share/vm/oops/klassVtable.cpp Thu May 06 18:25:58 2010 -0700 42.2 +++ b/src/share/vm/oops/klassVtable.cpp Fri May 07 15:12:28 2010 -0700 42.3 @@ -899,7 +899,7 @@ 42.4 int nof_methods = methods()->length(); 42.5 HandleMark hm; 42.6 KlassHandle klass = _klass; 42.7 - assert(nof_methods > 0, "at least one method must exist for interface to be in vtable") 42.8 + assert(nof_methods > 0, "at least one method must exist for interface to be in vtable"); 42.9 Handle interface_loader (THREAD, instanceKlass::cast(interf_h())->class_loader()); 42.10 int ime_num = 0; 42.11 42.12 @@ -1180,8 +1180,8 @@ 42.13 oop* end_of_obj = (oop*)_klass() + _klass()->size(); 42.14 oop* end_of_vtable = (oop *)&table()[_length]; 42.15 if (end_of_vtable > end_of_obj) { 42.16 - fatal1("klass %s: klass object too short (vtable extends beyond end)", 42.17 - _klass->internal_name()); 42.18 + fatal(err_msg("klass %s: klass object too short (vtable extends beyond " 42.19 + "end)", _klass->internal_name())); 42.20 } 42.21 42.22 for (int i = 0; i < _length; i++) table()[i].verify(this, st); 42.23 @@ -1224,7 +1224,7 @@ 42.24 #ifndef PRODUCT 42.25 print(); 42.26 #endif 42.27 - fatal1("vtableEntry %#lx: method is from subclass", this); 42.28 + fatal(err_msg("vtableEntry " PTR_FORMAT ": method is from subclass", this)); 42.29 } 42.30 } 42.31
43.1 --- a/src/share/vm/opto/idealGraphPrinter.cpp Thu May 06 18:25:58 2010 -0700 43.2 +++ b/src/share/vm/opto/idealGraphPrinter.cpp Fri May 07 15:12:28 2010 -0700 43.3 @@ -151,7 +151,8 @@ 43.4 } else { 43.5 // It would be nice if we could shut down cleanly but it should 43.6 // be an error if we can't connect to the visualizer. 43.7 - fatal2("Couldn't connect to visualizer at %s:%d", PrintIdealGraphAddress, PrintIdealGraphPort); 43.8 + fatal(err_msg("Couldn't connect to visualizer at %s:%d", 43.9 + PrintIdealGraphAddress, PrintIdealGraphPort)); 43.10 } 43.11 } 43.12
44.1 --- a/src/share/vm/opto/node.cpp Thu May 06 18:25:58 2010 -0700 44.2 +++ b/src/share/vm/opto/node.cpp Fri May 07 15:12:28 2010 -0700 44.3 @@ -1188,7 +1188,7 @@ 44.4 Node* use = dead->last_out(k); 44.5 igvn->hash_delete(use); // Yank from hash table prior to mod 44.6 if (use->in(0) == dead) { // Found another dead node 44.7 - assert (!use->is_Con(), "Control for Con node should be Root node.") 44.8 + assert (!use->is_Con(), "Control for Con node should be Root node."); 44.9 use->set_req(0, top); // Cut dead edge to prevent processing 44.10 nstack.push(use); // the dead node again. 44.11 } else { // Else found a not-dead user
45.1 --- a/src/share/vm/opto/output.cpp Thu May 06 18:25:58 2010 -0700 45.2 +++ b/src/share/vm/opto/output.cpp Fri May 07 15:12:28 2010 -0700 45.3 @@ -1231,7 +1231,7 @@ 45.4 if (is_sfn && !is_mcall && padding == 0 && current_offset == last_call_offset ) { 45.5 padding = nop_size; 45.6 } 45.7 - assert( labels_not_set || padding == 0, "instruction should already be aligned") 45.8 + assert( labels_not_set || padding == 0, "instruction should already be aligned"); 45.9 45.10 if(padding > 0) { 45.11 assert((padding % nop_size) == 0, "padding is not a multiple of NOP size"); 45.12 @@ -2407,7 +2407,7 @@ 45.13 n->dump(); 45.14 tty->print_cr("..."); 45.15 prior_use->dump(); 45.16 - assert_msg(edge_from_to(prior_use,n),msg); 45.17 + assert(edge_from_to(prior_use,n),msg); 45.18 } 45.19 _reg_node.map(def,NULL); // Kill live USEs 45.20 } 45.21 @@ -2446,11 +2446,11 @@ 45.22 OptoReg::Name reg_lo = _regalloc->get_reg_first(def); 45.23 OptoReg::Name reg_hi = _regalloc->get_reg_second(def); 45.24 if( OptoReg::is_valid(reg_lo) ) { 45.25 - assert_msg(!_reg_node[reg_lo] || edge_from_to(_reg_node[reg_lo],def), msg ); 45.26 + assert(!_reg_node[reg_lo] || edge_from_to(_reg_node[reg_lo],def), msg); 45.27 _reg_node.map(reg_lo,n); 45.28 } 45.29 if( OptoReg::is_valid(reg_hi) ) { 45.30 - assert_msg(!_reg_node[reg_hi] || edge_from_to(_reg_node[reg_hi],def), msg ); 45.31 + assert(!_reg_node[reg_hi] || edge_from_to(_reg_node[reg_hi],def), msg); 45.32 _reg_node.map(reg_hi,n); 45.33 } 45.34 }
46.1 --- a/src/share/vm/opto/phaseX.hpp Thu May 06 18:25:58 2010 -0700 46.2 +++ b/src/share/vm/opto/phaseX.hpp Fri May 07 15:12:28 2010 -0700 46.3 @@ -310,7 +310,7 @@ 46.4 void dump_nodes_and_types_recur( const Node *n, uint depth, bool only_ctrl, VectorSet &visited); 46.5 46.6 uint _count_progress; // For profiling, count transforms that make progress 46.7 - void set_progress() { ++_count_progress; assert( allow_progress(),"No progress allowed during verification") } 46.8 + void set_progress() { ++_count_progress; assert( allow_progress(),"No progress allowed during verification"); } 46.9 void clear_progress() { _count_progress = 0; } 46.10 uint made_progress() const { return _count_progress; } 46.11
47.1 --- a/src/share/vm/prims/forte.cpp Thu May 06 18:25:58 2010 -0700 47.2 +++ b/src/share/vm/prims/forte.cpp Fri May 07 15:12:28 2010 -0700 47.3 @@ -647,7 +647,7 @@ 47.4 void Forte::register_stub(const char* name, address start, address end) { 47.5 #if !defined(_WINDOWS) && !defined(IA64) 47.6 assert(pointer_delta(end, start, sizeof(jbyte)) < INT_MAX, 47.7 - "Code size exceeds maximum range") 47.8 + "Code size exceeds maximum range"); 47.9 47.10 collector_func_load((char*)name, NULL, NULL, start, 47.11 pointer_delta(end, start, sizeof(jbyte)), 0, NULL);
48.1 --- a/src/share/vm/prims/jni.cpp Thu May 06 18:25:58 2010 -0700 48.2 +++ b/src/share/vm/prims/jni.cpp Fri May 07 15:12:28 2010 -0700 48.3 @@ -3311,6 +3311,7 @@ 48.4 OrderAccess::release_store(&vm_created, 0); 48.5 } 48.6 48.7 + NOT_PRODUCT(test_error_handler(ErrorHandlerTest)); 48.8 return result; 48.9 } 48.10
49.1 --- a/src/share/vm/runtime/frame.cpp Thu May 06 18:25:58 2010 -0700 49.2 +++ b/src/share/vm/runtime/frame.cpp Fri May 07 15:12:28 2010 -0700 49.3 @@ -844,7 +844,7 @@ 49.4 } 49.5 49.6 void oop_at_offset_do(int offset) { 49.7 - assert (offset >= 0, "illegal offset") 49.8 + assert (offset >= 0, "illegal offset"); 49.9 oop* addr = (oop*) _fr->entry_frame_argument_at(offset); 49.10 _f->do_oop(addr); 49.11 }
50.1 --- a/src/share/vm/runtime/globals.hpp Thu May 06 18:25:58 2010 -0700 50.2 +++ b/src/share/vm/runtime/globals.hpp Fri May 07 15:12:28 2010 -0700 50.3 @@ -652,6 +652,11 @@ 50.4 product(bool, PrintGCApplicationStoppedTime, false, \ 50.5 "Print the time the application has been stopped") \ 50.6 \ 50.7 + notproduct(uintx, ErrorHandlerTest, 0, \ 50.8 + "If > 0, provokes an error after VM initialization; the value" \ 50.9 + "determines which error to provoke. See test_error_handler()" \ 50.10 + "in debug.cpp.") \ 50.11 + \ 50.12 develop(bool, Verbose, false, \ 50.13 "Prints additional debugging information from other modes") \ 50.14 \
51.1 --- a/src/share/vm/runtime/memprofiler.cpp Thu May 06 18:25:58 2010 -0700 51.2 +++ b/src/share/vm/runtime/memprofiler.cpp Fri May 07 15:12:28 2010 -0700 51.3 @@ -62,7 +62,7 @@ 51.4 // Create log file 51.5 _log_fp = fopen(log_name , "w+"); 51.6 if (_log_fp == NULL) { 51.7 - fatal1("MemProfiler: Cannot create log file: %s", log_name); 51.8 + fatal(err_msg("MemProfiler: Cannot create log file: %s", log_name)); 51.9 } 51.10 fprintf(_log_fp, "MemProfiler: sizes are in Kb, time is in seconds since startup\n\n"); 51.11 fprintf(_log_fp, " time, #thr, #cls, heap, heap, perm, perm, code, hndls, rescs, oopmp\n");
52.1 --- a/src/share/vm/runtime/mutex.cpp Thu May 06 18:25:58 2010 -0700 52.2 +++ b/src/share/vm/runtime/mutex.cpp Fri May 07 15:12:28 2010 -0700 52.3 @@ -1288,8 +1288,9 @@ 52.4 !(this == Safepoint_lock && contains(locks, Terminator_lock) && 52.5 SafepointSynchronize::is_synchronizing())) { 52.6 new_owner->print_owned_locks(); 52.7 - fatal4("acquiring lock %s/%d out of order with lock %s/%d -- possible deadlock", 52.8 - this->name(), this->rank(), locks->name(), locks->rank()); 52.9 + fatal(err_msg("acquiring lock %s/%d out of order with lock %s/%d -- " 52.10 + "possible deadlock", this->name(), this->rank(), 52.11 + locks->name(), locks->rank())); 52.12 } 52.13 52.14 this->_next = new_owner->_owned_locks; 52.15 @@ -1342,7 +1343,8 @@ 52.16 || rank() == Mutex::special, "wrong thread state for using locks"); 52.17 if (StrictSafepointChecks) { 52.18 if (thread->is_VM_thread() && !allow_vm_block()) { 52.19 - fatal1("VM thread using lock %s (not allowed to block on)", name()); 52.20 + fatal(err_msg("VM thread using lock %s (not allowed to block on)", 52.21 + name())); 52.22 } 52.23 debug_only(if (rank() != Mutex::special) \ 52.24 thread->check_for_valid_safepoint_state(false);)
53.1 --- a/src/share/vm/runtime/mutexLocker.cpp Thu May 06 18:25:58 2010 -0700 53.2 +++ b/src/share/vm/runtime/mutexLocker.cpp Fri May 07 15:12:28 2010 -0700 53.3 @@ -136,7 +136,7 @@ 53.4 // see if invoker of VM operation owns it 53.5 VM_Operation* op = VMThread::vm_operation(); 53.6 if (op != NULL && op->calling_thread() == lock->owner()) return; 53.7 - fatal1("must own lock %s", lock->name()); 53.8 + fatal(err_msg("must own lock %s", lock->name())); 53.9 } 53.10 53.11 // a stronger assertion than the above 53.12 @@ -144,7 +144,7 @@ 53.13 if (IgnoreLockingAssertions) return; 53.14 assert(lock != NULL, "Need non-NULL lock"); 53.15 if (lock->owned_by_self()) return; 53.16 - fatal1("must own lock %s", lock->name()); 53.17 + fatal(err_msg("must own lock %s", lock->name())); 53.18 } 53.19 #endif 53.20
54.1 --- a/src/share/vm/runtime/os.cpp Thu May 06 18:25:58 2010 -0700 54.2 +++ b/src/share/vm/runtime/os.cpp Fri May 07 15:12:28 2010 -0700 54.3 @@ -406,8 +406,10 @@ 54.4 #ifdef ASSERT 54.5 inline size_t get_size(void* obj) { 54.6 size_t size = *size_addr_from_obj(obj); 54.7 - if (size < 0 ) 54.8 - fatal2("free: size field of object #%p was overwritten (%lu)", obj, size); 54.9 + if (size < 0) { 54.10 + fatal(err_msg("free: size field of object #" PTR_FORMAT " was overwritten (" 54.11 + SIZE_FORMAT ")", obj, size)); 54.12 + } 54.13 return size; 54.14 } 54.15
55.1 --- a/src/share/vm/runtime/safepoint.cpp Thu May 06 18:25:58 2010 -0700 55.2 +++ b/src/share/vm/runtime/safepoint.cpp Fri May 07 15:12:28 2010 -0700 55.3 @@ -594,7 +594,7 @@ 55.4 break; 55.5 55.6 default: 55.7 - fatal1("Illegal threadstate encountered: %d", state); 55.8 + fatal(err_msg("Illegal threadstate encountered: %d", state)); 55.9 } 55.10 55.11 // Check for pending. async. exceptions or suspends - except if the
56.1 --- a/src/share/vm/runtime/signature.cpp Thu May 06 18:25:58 2010 -0700 56.2 +++ b/src/share/vm/runtime/signature.cpp Fri May 07 15:12:28 2010 -0700 56.3 @@ -57,7 +57,7 @@ 56.4 } 56.5 56.6 void SignatureIterator::expect(char c) { 56.7 - if (_signature->byte_at(_index) != c) fatal1("expecting %c", c); 56.8 + if (_signature->byte_at(_index) != c) fatal(err_msg("expecting %c", c)); 56.9 _index++; 56.10 } 56.11
57.1 --- a/src/share/vm/runtime/stubRoutines.cpp Thu May 06 18:25:58 2010 -0700 57.2 +++ b/src/share/vm/runtime/stubRoutines.cpp Fri May 07 15:12:28 2010 -0700 57.3 @@ -118,7 +118,10 @@ 57.4 ResourceMark rm; 57.5 TraceTime timer("StubRoutines generation 1", TraceStartupTime); 57.6 _code1 = BufferBlob::create("StubRoutines (1)", code_size1); 57.7 - if( _code1 == NULL) vm_exit_out_of_memory1(code_size1, "CodeCache: no room for %s", "StubRoutines (1)"); 57.8 + if (_code1 == NULL) { 57.9 + vm_exit_out_of_memory(code_size1, 57.10 + "CodeCache: no room for StubRoutines (1)"); 57.11 + } 57.12 CodeBuffer buffer(_code1->instructions_begin(), _code1->instructions_size()); 57.13 StubGenerator_generate(&buffer, false); 57.14 } 57.15 @@ -164,7 +167,10 @@ 57.16 ResourceMark rm; 57.17 TraceTime timer("StubRoutines generation 2", TraceStartupTime); 57.18 _code2 = BufferBlob::create("StubRoutines (2)", code_size2); 57.19 - if( _code2 == NULL) vm_exit_out_of_memory1(code_size2, "CodeCache: no room for %s", "StubRoutines (2)"); 57.20 + if (_code2 == NULL) { 57.21 + vm_exit_out_of_memory(code_size2, 57.22 + "CodeCache: no room for StubRoutines (2)"); 57.23 + } 57.24 CodeBuffer buffer(_code2->instructions_begin(), _code2->instructions_size()); 57.25 StubGenerator_generate(&buffer, true); 57.26 }
58.1 --- a/src/share/vm/runtime/vmThread.cpp Thu May 06 18:25:58 2010 -0700 58.2 +++ b/src/share/vm/runtime/vmThread.cpp Fri May 07 15:12:28 2010 -0700 58.3 @@ -106,7 +106,7 @@ 58.4 // restore queue to empty state 58.5 _queue[prio]->set_next(_queue[prio]); 58.6 _queue[prio]->set_prev(_queue[prio]); 58.7 - assert(queue_empty(prio), "drain corrupted queue") 58.8 + assert(queue_empty(prio), "drain corrupted queue"); 58.9 #ifdef DEBUG 58.10 int len = 0; 58.11 VM_Operation* cur; 58.12 @@ -593,7 +593,8 @@ 58.13 // Check the VM operation allows nested VM operation. This normally not the case, e.g., the compiler 58.14 // does not allow nested scavenges or compiles. 58.15 if (!prev_vm_operation->allow_nested_vm_operations()) { 58.16 - fatal2("Nested VM operation %s requested by operation %s", op->name(), vm_operation()->name()); 58.17 + fatal(err_msg("Nested VM operation %s requested by operation %s", 58.18 + op->name(), vm_operation()->name())); 58.19 } 58.20 op->set_calling_thread(prev_vm_operation->calling_thread(), prev_vm_operation->priority()); 58.21 }
59.1 --- a/src/share/vm/utilities/debug.cpp Thu May 06 18:25:58 2010 -0700 59.2 +++ b/src/share/vm/utilities/debug.cpp Fri May 07 15:12:28 2010 -0700 59.3 @@ -72,7 +72,7 @@ 59.4 // assert/guarantee/... may happen very early during VM initialization. 59.5 // Don't rely on anything that is initialized by Threads::create_vm(). For 59.6 // example, don't use tty. 59.7 -bool assert_is_suppressed(const char* file_name, int line_no) { 59.8 +bool error_is_suppressed(const char* file_name, int line_no) { 59.9 // The following 1-element cache requires that passed-in 59.10 // file names are always only constant literals. 59.11 if (file_name == last_file_name && line_no == last_line_no) return true; 59.12 @@ -163,38 +163,30 @@ 59.13 #else 59.14 59.15 // Place-holder for non-existent suppression check: 59.16 -#define assert_is_suppressed(file_name, line_no) (false) 59.17 +#define error_is_suppressed(file_name, line_no) (false) 59.18 59.19 #endif //PRODUCT 59.20 59.21 -void report_assertion_failure(const char* file_name, int line_no, const char* message) { 59.22 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.23 - VMError err(ThreadLocalStorage::get_thread_slow(), message, file_name, line_no); 59.24 +void report_vm_error(const char* file, int line, const char* error_msg, 59.25 + const char* detail_msg) 59.26 +{ 59.27 + if (Debugging || error_is_suppressed(file, line)) return; 59.28 + Thread* const thread = ThreadLocalStorage::get_thread_slow(); 59.29 + VMError err(thread, file, line, error_msg, detail_msg); 59.30 err.report_and_die(); 59.31 } 59.32 59.33 -void report_fatal(const char* file_name, int line_no, const char* message) { 59.34 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.35 - VMError err(ThreadLocalStorage::get_thread_slow(), message, file_name, line_no); 59.36 - err.report_and_die(); 59.37 +void report_fatal(const char* file, int line, const char* message) 59.38 +{ 59.39 + report_vm_error(file, line, "fatal error", message); 59.40 } 59.41 59.42 -void report_fatal_vararg(const char* file_name, int line_no, const char* format, ...) { 59.43 - char buffer[256]; 59.44 - va_list ap; 59.45 - va_start(ap, format); 59.46 - jio_vsnprintf(buffer, sizeof(buffer), format, ap); 59.47 - va_end(ap); 59.48 - report_fatal(file_name, line_no, buffer); 59.49 -} 59.50 - 59.51 - 59.52 // Used by report_vm_out_of_memory to detect recursion. 59.53 static jint _exiting_out_of_mem = 0; 59.54 59.55 -// Just passing the flow to VMError to handle error 59.56 -void report_vm_out_of_memory(const char* file_name, int line_no, size_t size, const char* message) { 59.57 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.58 +void report_vm_out_of_memory(const char* file, int line, size_t size, 59.59 + const char* message) { 59.60 + if (Debugging || error_is_suppressed(file, line)) return; 59.61 59.62 // We try to gather additional information for the first out of memory 59.63 // error only; gathering additional data might cause an allocation and a 59.64 @@ -206,46 +198,28 @@ 59.65 59.66 if (first_time_here) { 59.67 Thread* thread = ThreadLocalStorage::get_thread_slow(); 59.68 - VMError(thread, size, message, file_name, line_no).report_and_die(); 59.69 + VMError(thread, file, line, size, message).report_and_die(); 59.70 } 59.71 59.72 // Dump core and abort 59.73 vm_abort(true); 59.74 } 59.75 59.76 -void report_vm_out_of_memory_vararg(const char* file_name, int line_no, size_t size, const char* format, ...) { 59.77 - char buffer[256]; 59.78 - va_list ap; 59.79 - va_start(ap, format); 59.80 - jio_vsnprintf(buffer, sizeof(buffer), format, ap); 59.81 - va_end(ap); 59.82 - report_vm_out_of_memory(file_name, line_no, size, buffer); 59.83 +void report_should_not_call(const char* file, int line) { 59.84 + report_vm_error(file, line, "ShouldNotCall()"); 59.85 } 59.86 59.87 -void report_should_not_call(const char* file_name, int line_no) { 59.88 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.89 - VMError err(ThreadLocalStorage::get_thread_slow(), "ShouldNotCall()", file_name, line_no); 59.90 - err.report_and_die(); 59.91 +void report_should_not_reach_here(const char* file, int line) { 59.92 + report_vm_error(file, line, "ShouldNotReachHere()"); 59.93 } 59.94 59.95 - 59.96 -void report_should_not_reach_here(const char* file_name, int line_no) { 59.97 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.98 - VMError err(ThreadLocalStorage::get_thread_slow(), "ShouldNotReachHere()", file_name, line_no); 59.99 - err.report_and_die(); 59.100 +void report_unimplemented(const char* file, int line) { 59.101 + report_vm_error(file, line, "Unimplemented()"); 59.102 } 59.103 59.104 - 59.105 -void report_unimplemented(const char* file_name, int line_no) { 59.106 - if (Debugging || assert_is_suppressed(file_name, line_no)) return; 59.107 - VMError err(ThreadLocalStorage::get_thread_slow(), "Unimplemented()", file_name, line_no); 59.108 - err.report_and_die(); 59.109 -} 59.110 - 59.111 - 59.112 -void report_untested(const char* file_name, int line_no, const char* msg) { 59.113 +void report_untested(const char* file, int line, const char* message) { 59.114 #ifndef PRODUCT 59.115 - warning("Untested: %s in %s: %d\n", msg, file_name, line_no); 59.116 + warning("Untested: %s in %s: %d\n", message, file, line); 59.117 #endif // PRODUCT 59.118 } 59.119 59.120 @@ -284,6 +258,51 @@ 59.121 return error_reported; 59.122 } 59.123 59.124 +#ifndef PRODUCT 59.125 +#include <signal.h> 59.126 + 59.127 +void test_error_handler(size_t test_num) 59.128 +{ 59.129 + if (test_num == 0) return; 59.130 + 59.131 + // If asserts are disabled, use the corresponding guarantee instead. 59.132 + size_t n = test_num; 59.133 + NOT_DEBUG(if (n <= 2) n += 2); 59.134 + 59.135 + const char* const str = "hello"; 59.136 + const size_t num = (size_t)os::vm_page_size(); 59.137 + 59.138 + const char* const eol = os::line_separator(); 59.139 + const char* const msg = "this message should be truncated during formatting"; 59.140 + 59.141 + // Keep this in sync with test/runtime/6888954/vmerrors.sh. 59.142 + switch (n) { 59.143 + case 1: assert(str == NULL, "expected null"); 59.144 + case 2: assert(num == 1023 && *str == 'X', 59.145 + err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str)); 59.146 + case 3: guarantee(str == NULL, "expected null"); 59.147 + case 4: guarantee(num == 1023 && *str == 'X', 59.148 + err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str)); 59.149 + case 5: fatal("expected null"); 59.150 + case 6: fatal(err_msg("num=" SIZE_FORMAT " str=\"%s\"", num, str)); 59.151 + case 7: fatal(err_msg("%s%s# %s%s# %s%s# %s%s# %s%s# " 59.152 + "%s%s# %s%s# %s%s# %s%s# %s%s# " 59.153 + "%s%s# %s%s# %s%s# %s%s# %s", 59.154 + msg, eol, msg, eol, msg, eol, msg, eol, msg, eol, 59.155 + msg, eol, msg, eol, msg, eol, msg, eol, msg, eol, 59.156 + msg, eol, msg, eol, msg, eol, msg, eol, msg)); 59.157 + case 8: vm_exit_out_of_memory(num, "ChunkPool::allocate"); 59.158 + case 9: ShouldNotCallThis(); 59.159 + case 10: ShouldNotReachHere(); 59.160 + case 11: Unimplemented(); 59.161 + // This is last because it does not generate an hs_err* file on Windows. 59.162 + case 12: os::signal_raise(SIGSEGV); 59.163 + 59.164 + default: ShouldNotReachHere(); 59.165 + } 59.166 +} 59.167 +#endif // #ifndef PRODUCT 59.168 + 59.169 // ------ helper functions for debugging go here ------------ 59.170 59.171 #ifndef PRODUCT
60.1 --- a/src/share/vm/utilities/debug.hpp Thu May 06 18:25:58 2010 -0700 60.2 +++ b/src/share/vm/utilities/debug.hpp Fri May 07 15:12:28 2010 -0700 60.3 @@ -22,28 +22,54 @@ 60.4 * 60.5 */ 60.6 60.7 +#include <stdarg.h> 60.8 + 60.9 +// Simple class to format the ctor arguments into a fixed-sized buffer. 60.10 +template <size_t bufsz = 256> 60.11 +class FormatBuffer { 60.12 +public: 60.13 + inline FormatBuffer(const char * format, ...); 60.14 + operator const char *() const { return _buf; } 60.15 + 60.16 +private: 60.17 + FormatBuffer(const FormatBuffer &); // prevent copies 60.18 + 60.19 +private: 60.20 + char _buf[bufsz]; 60.21 +}; 60.22 + 60.23 +template <size_t bufsz> 60.24 +FormatBuffer<bufsz>::FormatBuffer(const char * format, ...) { 60.25 + va_list argp; 60.26 + va_start(argp, format); 60.27 + vsnprintf(_buf, bufsz, format, argp); 60.28 + va_end(argp); 60.29 +} 60.30 + 60.31 +// Used to format messages for assert(), guarantee(), fatal(), etc. 60.32 +typedef FormatBuffer<> err_msg; 60.33 + 60.34 // assertions 60.35 #ifdef ASSERT 60.36 -// Turn this off by default: 60.37 -//#define USE_REPEATED_ASSERTS 60.38 -#ifdef USE_REPEATED_ASSERTS 60.39 - #define assert(p,msg) \ 60.40 - { for (int __i = 0; __i < AssertRepeat; __i++) { \ 60.41 - if (!(p)) { \ 60.42 - report_assertion_failure(__FILE__, __LINE__, \ 60.43 - "assert(" XSTR(p) ",\"" msg "\")");\ 60.44 - BREAKPOINT; \ 60.45 - } \ 60.46 - } \ 60.47 - } 60.48 -#else 60.49 - #define assert(p,msg) \ 60.50 - if (!(p)) { \ 60.51 - report_assertion_failure(__FILE__, __LINE__, \ 60.52 - "assert(" XSTR(p) ",\"" msg "\")");\ 60.53 - BREAKPOINT; \ 60.54 - } 60.55 -#endif 60.56 +#ifndef USE_REPEATED_ASSERTS 60.57 +#define assert(p, msg) \ 60.58 +do { \ 60.59 + if (!(p)) { \ 60.60 + report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ 60.61 + BREAKPOINT; \ 60.62 + } \ 60.63 +} while (0) 60.64 +#else // #ifndef USE_REPEATED_ASSERTS 60.65 +#define assert(p, msg) 60.66 +do { \ 60.67 + for (int __i = 0; __i < AssertRepeat; __i++) { \ 60.68 + if (!(p)) { \ 60.69 + report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ 60.70 + BREAKPOINT; \ 60.71 + } \ 60.72 + } \ 60.73 +} while (0) 60.74 +#endif // #ifndef USE_REPEATED_ASSERTS 60.75 60.76 // This version of assert is for use with checking return status from 60.77 // library calls that return actual error values eg. EINVAL, 60.78 @@ -52,70 +78,83 @@ 60.79 // what status was actually returned, so we pass the status variable as 60.80 // an extra arg and use strerror to convert it to a meaningful string 60.81 // like "Invalid argument", "out of memory" etc 60.82 -#define assert_status(p, status, msg) \ 60.83 - do { \ 60.84 - if (!(p)) { \ 60.85 - char buf[128]; \ 60.86 - snprintf(buf, 127, \ 60.87 - "assert_status(" XSTR(p) ", error: %s(%d), \"" msg "\")" , \ 60.88 - strerror((status)), (status)); \ 60.89 - report_assertion_failure(__FILE__, __LINE__, buf); \ 60.90 - BREAKPOINT; \ 60.91 - } \ 60.92 - } while (0) 60.93 - 60.94 -// Another version of assert where the message is not a string literal 60.95 -// The boolean condition is not printed out because cpp doesn't like it. 60.96 -#define assert_msg(p, msg) \ 60.97 - if (!(p)) { \ 60.98 - report_assertion_failure(__FILE__, __LINE__, msg); \ 60.99 - BREAKPOINT; \ 60.100 - } 60.101 +#define assert_status(p, status, msg) \ 60.102 +do { \ 60.103 + if (!(p)) { \ 60.104 + report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", \ 60.105 + err_msg("error %s(%d) %s", strerror(status), \ 60.106 + status, msg)); \ 60.107 + BREAKPOINT; \ 60.108 + } \ 60.109 +} while (0) 60.110 60.111 // Do not assert this condition if there's already another error reported. 60.112 #define assert_if_no_error(cond,msg) assert((cond) || is_error_reported(), msg) 60.113 -#else 60.114 +#else // #ifdef ASSERT 60.115 #define assert(p,msg) 60.116 #define assert_status(p,status,msg) 60.117 #define assert_if_no_error(cond,msg) 60.118 - #define assert_msg(cond,msg) 60.119 -#endif 60.120 +#endif // #ifdef ASSERT 60.121 60.122 +// guarantee is like assert except it's always executed -- use it for 60.123 +// cheap tests that catch errors that would otherwise be hard to find. 60.124 +// guarantee is also used for Verify options. 60.125 +#define guarantee(p, msg) \ 60.126 +do { \ 60.127 + if (!(p)) { \ 60.128 + report_vm_error(__FILE__, __LINE__, "guarantee(" #p ") failed", msg); \ 60.129 + BREAKPOINT; \ 60.130 + } \ 60.131 +} while (0) 60.132 60.133 -// fatals 60.134 -#define fatal(m) { report_fatal(__FILE__, __LINE__, m ); BREAKPOINT; } 60.135 -#define fatal1(m,x1) { report_fatal_vararg(__FILE__, __LINE__, m, x1 ); BREAKPOINT; } 60.136 -#define fatal2(m,x1,x2) { report_fatal_vararg(__FILE__, __LINE__, m, x1, x2 ); BREAKPOINT; } 60.137 -#define fatal3(m,x1,x2,x3) { report_fatal_vararg(__FILE__, __LINE__, m, x1, x2, x3 ); BREAKPOINT; } 60.138 -#define fatal4(m,x1,x2,x3,x4) { report_fatal_vararg(__FILE__, __LINE__, m, x1, x2, x3, x4 ); BREAKPOINT; } 60.139 +#define fatal(msg) \ 60.140 +do { \ 60.141 + report_fatal(__FILE__, __LINE__, msg); \ 60.142 + BREAKPOINT; \ 60.143 +} while (0) 60.144 60.145 // out of memory 60.146 -#define vm_exit_out_of_memory(s,m) { report_vm_out_of_memory(__FILE__, __LINE__, s, m ); BREAKPOINT; } 60.147 -#define vm_exit_out_of_memory1(s,m,x1) { report_vm_out_of_memory_vararg(__FILE__, __LINE__, s, m, x1 ); BREAKPOINT; } 60.148 -#define vm_exit_out_of_memory2(s,m,x1,x2) { report_vm_out_of_memory_vararg(__FILE__, __LINE__, s, m, x1, x2 ); BREAKPOINT; } 60.149 -#define vm_exit_out_of_memory3(s,m,x1,x2,x3) { report_vm_out_of_memory_vararg(__FILE__, __LINE__, s, m, x1, x2, x3 ); BREAKPOINT; } 60.150 -#define vm_exit_out_of_memory4(s,m,x1,x2,x3,x4) { report_vm_out_of_memory_vararg(__FILE__, __LINE__, s, m, x1, x2, x3, x4); BREAKPOINT; } 60.151 +#define vm_exit_out_of_memory(size, msg) \ 60.152 +do { \ 60.153 + report_vm_out_of_memory(__FILE__, __LINE__, size, msg); \ 60.154 + BREAKPOINT; \ 60.155 +} while (0) 60.156 60.157 -// guarantee is like assert except it's always executed -- use it for 60.158 -// cheap tests that catch errors that would otherwise be hard to find 60.159 -// guarantee is also used for Verify options. 60.160 -#define guarantee(b,msg) { if (!(b)) fatal("guarantee(" XSTR(b) ",\"" msg "\")"); } 60.161 +#define ShouldNotCallThis() \ 60.162 +do { \ 60.163 + report_should_not_call(__FILE__, __LINE__); \ 60.164 + BREAKPOINT; \ 60.165 +} while (0) 60.166 60.167 -#define ShouldNotCallThis() { report_should_not_call (__FILE__, __LINE__); BREAKPOINT; } 60.168 -#define ShouldNotReachHere() { report_should_not_reach_here (__FILE__, __LINE__); BREAKPOINT; } 60.169 -#define Unimplemented() { report_unimplemented (__FILE__, __LINE__); BREAKPOINT; } 60.170 -#define Untested(msg) { report_untested (__FILE__, __LINE__, msg); BREAKPOINT; } 60.171 +#define ShouldNotReachHere() \ 60.172 +do { \ 60.173 + report_should_not_reach_here(__FILE__, __LINE__); \ 60.174 + BREAKPOINT; \ 60.175 +} while (0) 60.176 + 60.177 +#define Unimplemented() \ 60.178 +do { \ 60.179 + report_unimplemented(__FILE__, __LINE__); \ 60.180 + BREAKPOINT; \ 60.181 +} while (0) 60.182 + 60.183 +#define Untested(msg) \ 60.184 +do { \ 60.185 + report_untested(__FILE__, __LINE__, msg); \ 60.186 + BREAKPOINT; \ 60.187 +} while (0); 60.188 60.189 // error reporting helper functions 60.190 -void report_assertion_failure(const char* file_name, int line_no, const char* message); 60.191 -void report_fatal_vararg(const char* file_name, int line_no, const char* format, ...); 60.192 -void report_fatal(const char* file_name, int line_no, const char* message); 60.193 -void report_vm_out_of_memory_vararg(const char* file_name, int line_no, size_t size, const char* format, ...); 60.194 -void report_vm_out_of_memory(const char* file_name, int line_no, size_t size, const char* message); 60.195 -void report_should_not_call(const char* file_name, int line_no); 60.196 -void report_should_not_reach_here(const char* file_name, int line_no); 60.197 -void report_unimplemented(const char* file_name, int line_no); 60.198 -void report_untested(const char* file_name, int line_no, const char* msg); 60.199 +void report_vm_error(const char* file, int line, const char* error_msg, 60.200 + const char* detail_msg = NULL); 60.201 +void report_fatal(const char* file, int line, const char* message); 60.202 +void report_vm_out_of_memory(const char* file, int line, size_t size, 60.203 + const char* message); 60.204 +void report_should_not_call(const char* file, int line); 60.205 +void report_should_not_reach_here(const char* file, int line); 60.206 +void report_unimplemented(const char* file, int line); 60.207 +void report_untested(const char* file, int line, const char* message); 60.208 + 60.209 void warning(const char* format, ...); 60.210 60.211 // out of memory reporting 60.212 @@ -125,5 +164,8 @@ 60.213 bool is_error_reported(); 60.214 void set_error_reported(); 60.215 60.216 +/* Test assert(), fatal(), guarantee(), etc. */ 60.217 +NOT_PRODUCT(void test_error_handler(size_t test_num);) 60.218 + 60.219 void pd_ps(frame f); 60.220 void pd_obfuscate_location(char *buf, size_t buflen);
61.1 --- a/src/share/vm/utilities/exceptions.cpp Thu May 06 18:25:58 2010 -0700 61.2 +++ b/src/share/vm/utilities/exceptions.cpp Fri May 07 15:12:28 2010 -0700 61.3 @@ -378,7 +378,7 @@ 61.4 void Exceptions::debug_check_abort(const char *value_string) { 61.5 if (AbortVMOnException != NULL && value_string != NULL && 61.6 strstr(value_string, AbortVMOnException)) { 61.7 - fatal1("Saw %s, aborting", value_string); 61.8 + fatal(err_msg("Saw %s, aborting", value_string)); 61.9 } 61.10 } 61.11
62.1 --- a/src/share/vm/utilities/macros.hpp Thu May 06 18:25:58 2010 -0700 62.2 +++ b/src/share/vm/utilities/macros.hpp Fri May 07 15:12:28 2010 -0700 62.3 @@ -188,6 +188,4 @@ 62.4 #define NOT_SPARC(code) code 62.5 #endif 62.6 62.7 -#define FIX_THIS(code) report_assertion_failure("FIX_THIS",__FILE__, __LINE__, "") 62.8 - 62.9 #define define_pd_global(type, name, value) const type pd_##name = value;
63.1 --- a/src/share/vm/utilities/vmError.cpp Thu May 06 18:25:58 2010 -0700 63.2 +++ b/src/share/vm/utilities/vmError.cpp Fri May 07 15:12:28 2010 -0700 63.3 @@ -65,7 +65,8 @@ 63.4 _current_step = 0; 63.5 _current_step_info = NULL; 63.6 63.7 - _message = ""; 63.8 + _message = NULL; 63.9 + _detail_msg = NULL; 63.10 _filename = NULL; 63.11 _lineno = 0; 63.12 63.13 @@ -73,31 +74,36 @@ 63.14 } 63.15 63.16 // Constructor for internal errors 63.17 -VMError::VMError(Thread* thread, const char* message, const char* filename, int lineno) { 63.18 +VMError::VMError(Thread* thread, const char* filename, int lineno, 63.19 + const char* message, const char * detail_msg) 63.20 +{ 63.21 + _thread = thread; 63.22 + _id = internal_error; // Value that's not an OS exception/signal 63.23 + _filename = filename; 63.24 + _lineno = lineno; 63.25 + _message = message; 63.26 + _detail_msg = detail_msg; 63.27 + 63.28 + _verbose = false; 63.29 + _current_step = 0; 63.30 + _current_step_info = NULL; 63.31 + 63.32 + _pc = NULL; 63.33 + _siginfo = NULL; 63.34 + _context = NULL; 63.35 + 63.36 + _size = 0; 63.37 +} 63.38 + 63.39 +// Constructor for OOM errors 63.40 +VMError::VMError(Thread* thread, const char* filename, int lineno, size_t size, 63.41 + const char* message) { 63.42 _thread = thread; 63.43 - _id = internal_error; // set it to a value that's not an OS exception/signal 63.44 + _id = oom_error; // Value that's not an OS exception/signal 63.45 _filename = filename; 63.46 _lineno = lineno; 63.47 _message = message; 63.48 - 63.49 - _verbose = false; 63.50 - _current_step = 0; 63.51 - _current_step_info = NULL; 63.52 - 63.53 - _pc = NULL; 63.54 - _siginfo = NULL; 63.55 - _context = NULL; 63.56 - 63.57 - _size = 0; 63.58 -} 63.59 - 63.60 -// Constructor for OOM errors 63.61 -VMError::VMError(Thread* thread, size_t size, const char* message, const char* filename, int lineno) { 63.62 - _thread = thread; 63.63 - _id = oom_error; // set it to a value that's not an OS exception/signal 63.64 - _filename = filename; 63.65 - _lineno = lineno; 63.66 - _message = message; 63.67 + _detail_msg = NULL; 63.68 63.69 _verbose = false; 63.70 _current_step = 0; 63.71 @@ -114,10 +120,11 @@ 63.72 // Constructor for non-fatal errors 63.73 VMError::VMError(const char* message) { 63.74 _thread = NULL; 63.75 - _id = internal_error; // set it to a value that's not an OS exception/signal 63.76 + _id = internal_error; // Value that's not an OS exception/signal 63.77 _filename = NULL; 63.78 _lineno = 0; 63.79 _message = message; 63.80 + _detail_msg = NULL; 63.81 63.82 _verbose = false; 63.83 _current_step = 0; 63.84 @@ -191,22 +198,27 @@ 63.85 "%s (0x%x) at pc=" PTR_FORMAT ", pid=%d, tid=" UINTX_FORMAT, 63.86 signame, _id, _pc, 63.87 os::current_process_id(), os::current_thread_id()); 63.88 + } else if (_filename != NULL && _lineno > 0) { 63.89 + // skip directory names 63.90 + char separator = os::file_separator()[0]; 63.91 + const char *p = strrchr(_filename, separator); 63.92 + int n = jio_snprintf(buf, buflen, 63.93 + "Internal Error at %s:%d, pid=%d, tid=" UINTX_FORMAT, 63.94 + p ? p + 1 : _filename, _lineno, 63.95 + os::current_process_id(), os::current_thread_id()); 63.96 + if (n >= 0 && n < buflen && _message) { 63.97 + if (_detail_msg) { 63.98 + jio_snprintf(buf + n, buflen - n, "%s%s: %s", 63.99 + os::line_separator(), _message, _detail_msg); 63.100 + } else { 63.101 + jio_snprintf(buf + n, buflen - n, "%sError: %s", 63.102 + os::line_separator(), _message); 63.103 + } 63.104 + } 63.105 } else { 63.106 - if (_filename != NULL && _lineno > 0) { 63.107 - // skip directory names 63.108 - char separator = os::file_separator()[0]; 63.109 - const char *p = strrchr(_filename, separator); 63.110 - 63.111 - jio_snprintf(buf, buflen, 63.112 - "Internal Error at %s:%d, pid=%d, tid=" UINTX_FORMAT " \nError: %s", 63.113 - p ? p + 1 : _filename, _lineno, 63.114 - os::current_process_id(), os::current_thread_id(), 63.115 - _message ? _message : ""); 63.116 - } else { 63.117 - jio_snprintf(buf, buflen, 63.118 - "Internal Error (0x%x), pid=%d, tid=" UINTX_FORMAT, 63.119 - _id, os::current_process_id(), os::current_thread_id()); 63.120 - } 63.121 + jio_snprintf(buf, buflen, 63.122 + "Internal Error (0x%x), pid=%d, tid=" UINTX_FORMAT, 63.123 + _id, os::current_process_id(), os::current_thread_id()); 63.124 } 63.125 63.126 return buf; 63.127 @@ -369,7 +381,9 @@ 63.128 STEP(40, "(printing error message)") 63.129 63.130 // error message 63.131 - if (_message && _message[0] != '\0') { 63.132 + if (_detail_msg) { 63.133 + st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); 63.134 + } else if (_message) { 63.135 st->print_cr("# Error: %s", _message); 63.136 } 63.137
64.1 --- a/src/share/vm/utilities/vmError.hpp Thu May 06 18:25:58 2010 -0700 64.2 +++ b/src/share/vm/utilities/vmError.hpp Fri May 07 15:12:28 2010 -0700 64.3 @@ -37,6 +37,7 @@ 64.4 // 0x8xxxxxxx system warnings 64.5 64.6 const char * _message; 64.7 + const char * _detail_msg; 64.8 64.9 Thread * _thread; // NULL if it's native thread 64.10 64.11 @@ -75,16 +76,19 @@ 64.12 char* buf, int buflen, bool verbose = false); 64.13 64.14 // accessor 64.15 - const char* message() { return _message; } 64.16 + const char* message() const { return _message; } 64.17 + const char* detail_msg() const { return _detail_msg; } 64.18 64.19 public: 64.20 // Constructor for crashes 64.21 VMError(Thread* thread, int sig, address pc, void* siginfo, void* context); 64.22 // Constructor for VM internal errors 64.23 - VMError(Thread* thread, const char* message, const char* filename, int lineno); 64.24 + VMError(Thread* thread, const char* filename, int lineno, 64.25 + const char* message, const char * detail_msg); 64.26 64.27 - // Constructors for VM OOM errors 64.28 - VMError(Thread* thread, size_t size, const char* message, const char* filename, int lineno); 64.29 + // Constructor for VM OOM errors 64.30 + VMError(Thread* thread, const char* filename, int lineno, size_t size, 64.31 + const char* message); 64.32 // Constructor for non-fatal errors 64.33 VMError(const char* message); 64.34
65.1 --- a/src/share/vm/utilities/xmlstream.cpp Thu May 06 18:25:58 2010 -0700 65.2 +++ b/src/share/vm/utilities/xmlstream.cpp Fri May 07 15:12:28 2010 -0700 65.3 @@ -328,7 +328,7 @@ 65.4 // ------------------------------------------------------------------ 65.5 void xmlStream::va_done(const char* format, va_list ap) { 65.6 char buffer[200]; 65.7 - guarantee(strlen(format) + 10 < sizeof(buffer), "bigger format buffer") 65.8 + guarantee(strlen(format) + 10 < sizeof(buffer), "bigger format buffer"); 65.9 const char* kind = format; 65.10 const char* kind_end = strchr(kind, ' '); 65.11 size_t kind_len = (kind_end != NULL) ? (kind_end - kind) : strlen(kind);
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 66.2 +++ b/test/runtime/6888954/vmerrors.sh Fri May 07 15:12:28 2010 -0700 66.3 @@ -0,0 +1,71 @@ 66.4 +# @test 66.5 +# @bug 6888954 66.6 +# @summary exercise HotSpot error handling code 66.7 +# @author John Coomes 66.8 +# @run shell vmerrors.sh 66.9 + 66.10 +# Repeatedly invoke java with a command-line option that causes HotSpot to 66.11 +# produce an error report and terminate just after initialization. Each 66.12 +# invocation is identified by a small integer, <n>, which provokes a different 66.13 +# error (assertion failure, guarantee failure, fatal error, etc.). The output 66.14 +# from stdout/stderr is written to <n>.out and the hs_err_pidXXX.log file is 66.15 +# renamed to <n>.log. 66.16 +# 66.17 +# The automated checking done by this script is minimal. When updating the 66.18 +# fatal error handler it is more useful to run it manually or to use the -retain 66.19 +# option with the jtreg so that test directories are not removed automatically. 66.20 +# To run stand-alone: 66.21 +# 66.22 +# TESTJAVA=/java/home/dir 66.23 +# TESTVMOPTS=... 66.24 +# export TESTJAVA TESTVMOPTS 66.25 +# sh test/runtime/6888954/vmerrors.sh 66.26 + 66.27 +ulimit -c 0 # no core files 66.28 + 66.29 +i=1 66.30 +rc=0 66.31 + 66.32 +assert_re='(assert|guarantee)[(](str|num).*failed: *' 66.33 +guarantee_re='guarantee[(](str|num).*failed: *' 66.34 +fatal_re='fatal error: *' 66.35 +signal_re='(SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc=' 66.36 +tail_1='.*expected null' 66.37 +tail_2='.*num=' 66.38 + 66.39 +for re in \ 66.40 + "${assert_re}${tail_1}" "${assert_re}${tail_2}" \ 66.41 + "${guarantee_re}${tail_1}" "${guarantee_re}${tail_2}" \ 66.42 + "${fatal_re}${tail_1}" "${fatal_re}${tail_2}" \ 66.43 + "${fatal_re}.*truncated" "ChunkPool::allocate" \ 66.44 + "ShouldNotCall" "ShouldNotReachHere" \ 66.45 + "Unimplemented" "$signal_re" 66.46 + 66.47 +do 66.48 + i2=$i 66.49 + [ $i -lt 10 ] && i2=0$i 66.50 + 66.51 + "$TESTJAVA/bin/java" $TESTVMOPTS -XX:+IgnoreUnrecognizedVMOptions \ 66.52 + -XX:ErrorHandlerTest=${i} -version > ${i2}.out 2>&1 66.53 + 66.54 + # If ErrorHandlerTest is ignored (product build), stop. 66.55 + # 66.56 + # Using the built-in variable $! to get the pid does not work reliably on 66.57 + # windows; use a wildcard instead. 66.58 + mv hs_err_pid*.log ${i2}.log || exit $rc 66.59 + 66.60 + for f in ${i2}.log ${i2}.out 66.61 + do 66.62 + egrep -- "$re" $f > $$ 66.63 + if [ $? -ne 0 ] 66.64 + then 66.65 + echo "ErrorHandlerTest=$i failed ($f)" 66.66 + rc=1 66.67 + fi 66.68 + done 66.69 + rm -f $$ 66.70 + 66.71 + i=$(expr $i + 1) 66.72 +done 66.73 + 66.74 +exit $rc