# HG changeset patch # User jmasa # Date 1304105619 25200 # Node ID c6033dad9fd3847f0ac17e36741e111b9df15636 # Parent df22fe9c5a9306a28ac0aa84313636e9f774d5c0# Parent 86ebb26bcdeb46a0c46b74ec9fb57ea713cecd21 Merge diff -r 86ebb26bcdeb -r c6033dad9fd3 .hgtags --- a/.hgtags Wed Apr 27 14:40:41 2011 -0700 +++ b/.hgtags Fri Apr 29 12:33:39 2011 -0700 @@ -162,3 +162,7 @@ bd586e392d93b7ed7a1636dcc8da2b6a4203a102 hs21-b06 2dbcb4a4d8dace5fe78ceb563b134f1fb296cd8f jdk7-b137 2dbcb4a4d8dace5fe78ceb563b134f1fb296cd8f hs21-b07 +0930dc920c185afbf40fed9a655290b8e5b16783 jdk7-b138 +0930dc920c185afbf40fed9a655290b8e5b16783 hs21-b08 +611e19a16519d6fb5deea9ab565336e6e6ee475d jdk7-b139 +611e19a16519d6fb5deea9ab565336e6e6ee475d hs21-b09 diff -r 86ebb26bcdeb -r c6033dad9fd3 make/hotspot_version --- a/make/hotspot_version Wed Apr 27 14:40:41 2011 -0700 +++ b/make/hotspot_version Fri Apr 29 12:33:39 2011 -0700 @@ -35,7 +35,7 @@ HS_MAJOR_VER=21 HS_MINOR_VER=0 -HS_BUILD_NUMBER=08 +HS_BUILD_NUMBER=10 JDK_MAJOR_VER=1 JDK_MINOR_VER=7 diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/c1/c1_Runtime1.cpp --- a/src/share/vm/c1/c1_Runtime1.cpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/c1/c1_Runtime1.cpp Fri Apr 29 12:33:39 2011 -0700 @@ -1026,9 +1026,21 @@ // first replace the tail, then the call #ifdef ARM if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) { + nmethod* nm = CodeCache::find_nmethod(instr_pc); + oop* oop_addr = NULL; + assert(nm != NULL, "invalid nmethod_pc"); + RelocIterator oops(nm, copy_buff, copy_buff + 1); + while (oops.next()) { + if (oops.type() == relocInfo::oop_type) { + oop_Relocation* r = oops.oop_reloc(); + oop_addr = r->oop_addr(); + break; + } + } + assert(oop_addr != NULL, "oop relocation must exist"); copy_buff -= *byte_count; NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff); - n_copy2->set_data((intx) (load_klass()), instr_pc); + n_copy2->set_pc_relative_offset((address)oop_addr, instr_pc); } #endif diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/classfile/javaClasses.cpp --- a/src/share/vm/classfile/javaClasses.cpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/classfile/javaClasses.cpp Fri Apr 29 12:33:39 2011 -0700 @@ -1357,7 +1357,7 @@ }; -void java_lang_Throwable::fill_in_stack_trace(Handle throwable, TRAPS) { +void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS) { if (!StackTraceInThrowable) return; ResourceMark rm(THREAD); @@ -1374,6 +1374,16 @@ JavaThread* thread = (JavaThread*)THREAD; BacktraceBuilder bt(CHECK); + // If there is no Java frame just return the method that was being called + // with bci 0 + if (!thread->has_last_Java_frame()) { + if (max_depth >= 1 && method() != NULL) { + bt.push(method(), 0, CHECK); + set_backtrace(throwable(), bt.backtrace()); + } + return; + } + // Instead of using vframe directly, this version of fill_in_stack_trace // basically handles everything by hand. This significantly improved the // speed of this method call up to 28.5% on Solaris sparc. 27.1% on Windows. @@ -1477,7 +1487,7 @@ set_backtrace(throwable(), bt.backtrace()); } -void java_lang_Throwable::fill_in_stack_trace(Handle throwable) { +void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle method) { // No-op if stack trace is disabled if (!StackTraceInThrowable) { return; @@ -1491,7 +1501,7 @@ PRESERVE_EXCEPTION_MARK; JavaThread* thread = JavaThread::active(); - fill_in_stack_trace(throwable, thread); + fill_in_stack_trace(throwable, method, thread); // ignore exceptions thrown during stack trace filling CLEAR_PENDING_EXCEPTION; } diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/classfile/javaClasses.hpp --- a/src/share/vm/classfile/javaClasses.hpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/classfile/javaClasses.hpp Fri Apr 29 12:33:39 2011 -0700 @@ -440,8 +440,8 @@ static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable); // Fill in current stack trace, can cause GC - static void fill_in_stack_trace(Handle throwable, TRAPS); - static void fill_in_stack_trace(Handle throwable); + static void fill_in_stack_trace(Handle throwable, methodHandle method, TRAPS); + static void fill_in_stack_trace(Handle throwable, methodHandle method = methodHandle()); // Programmatic access to stack trace static oop get_stack_trace_element(oop throwable, int index, TRAPS); static int get_stack_trace_depth(oop throwable, TRAPS); diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/runtime/javaCalls.cpp --- a/src/share/vm/runtime/javaCalls.cpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/runtime/javaCalls.cpp Fri Apr 29 12:33:39 2011 -0700 @@ -389,7 +389,7 @@ // to Java if (!os::stack_shadow_pages_available(THREAD, method)) { // Throw stack overflow exception with preinitialized exception. - Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__); + Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); return; } else { // Touch pages checked if the OS needs them to be touched to be mapped. diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/utilities/exceptions.cpp --- a/src/share/vm/utilities/exceptions.cpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/utilities/exceptions.cpp Fri Apr 29 12:33:39 2011 -0700 @@ -207,7 +207,7 @@ } -void Exceptions::throw_stack_overflow_exception(Thread* THREAD, const char* file, int line) { +void Exceptions::throw_stack_overflow_exception(Thread* THREAD, const char* file, int line, methodHandle method) { Handle exception; if (!THREAD->has_pending_exception()) { klassOop k = SystemDictionary::StackOverflowError_klass(); @@ -215,13 +215,13 @@ exception = Handle(THREAD, e); // fill_in_stack trace does gc assert(instanceKlass::cast(k)->is_initialized(), "need to increase min_stack_allowed calculation"); if (StackTraceInThrowable) { - java_lang_Throwable::fill_in_stack_trace(exception); + java_lang_Throwable::fill_in_stack_trace(exception, method()); } } else { // if prior exception, throw that one instead exception = Handle(THREAD, THREAD->pending_exception()); } - _throw_oop(THREAD, file, line, exception()); + _throw(THREAD, file, line, exception); } void Exceptions::fthrow(Thread* thread, const char* file, int line, Symbol* h_name, const char* format, ...) { diff -r 86ebb26bcdeb -r c6033dad9fd3 src/share/vm/utilities/exceptions.hpp --- a/src/share/vm/utilities/exceptions.hpp Wed Apr 27 14:40:41 2011 -0700 +++ b/src/share/vm/utilities/exceptions.hpp Fri Apr 29 12:33:39 2011 -0700 @@ -144,7 +144,7 @@ const char* message, ExceptionMsgToUtf8Mode to_utf8_safe = safe_to_utf8); - static void throw_stack_overflow_exception(Thread* thread, const char* file, int line); + static void throw_stack_overflow_exception(Thread* thread, const char* file, int line, methodHandle method); // for AbortVMOnException flag NOT_PRODUCT(static void debug_check_abort(Handle exception, const char* message = NULL);)