mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
Merge
This commit is contained in:
commit
2da4580684
273 changed files with 8851 additions and 4006 deletions
|
@ -324,6 +324,10 @@ void Thread::record_stack_base_and_size() {
|
|||
// record thread's native stack, stack grows downward
|
||||
MemTracker::record_thread_stack(stack_end(), stack_size());
|
||||
#endif // INCLUDE_NMT
|
||||
log_debug(os, thread)("Thread " UINTX_FORMAT " stack dimensions: "
|
||||
PTR_FORMAT "-" PTR_FORMAT " (" SIZE_FORMAT "k).",
|
||||
os::current_thread_id(), p2i(stack_base() - stack_size()),
|
||||
p2i(stack_base()), stack_size()/1024);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1690,7 +1694,7 @@ void JavaThread::run() {
|
|||
|
||||
EventThreadStart event;
|
||||
if (event.should_commit()) {
|
||||
event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj()));
|
||||
event.set_thread(THREAD_TRACE_ID(this));
|
||||
event.commit();
|
||||
}
|
||||
|
||||
|
@ -1795,7 +1799,7 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
|
|||
// from java_lang_Thread object
|
||||
EventThreadEnd event;
|
||||
if (event.should_commit()) {
|
||||
event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj()));
|
||||
event.set_thread(THREAD_TRACE_ID(this));
|
||||
event.commit();
|
||||
}
|
||||
|
||||
|
@ -1924,6 +1928,10 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
|
|||
}
|
||||
#endif // INCLUDE_ALL_GCS
|
||||
|
||||
log_info(os, thread)("JavaThread %s (tid: " UINTX_FORMAT ").",
|
||||
exit_type == JavaThread::normal_exit ? "exiting" : "detaching",
|
||||
os::current_thread_id());
|
||||
|
||||
// Remove from list of active threads list, and notify VM thread if we are the last non-daemon thread
|
||||
Threads::remove(this);
|
||||
}
|
||||
|
@ -2491,18 +2499,25 @@ void JavaThread::create_stack_guard_pages() {
|
|||
// warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len);
|
||||
|
||||
if (allocate && !os::create_stack_guard_pages((char *) low_addr, len)) {
|
||||
warning("Attempt to allocate stack guard pages failed.");
|
||||
log_warning(os, thread)("Attempt to allocate stack guard pages failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (os::guard_memory((char *) low_addr, len)) {
|
||||
_stack_guard_state = stack_guard_enabled;
|
||||
} else {
|
||||
warning("Attempt to protect stack guard pages failed.");
|
||||
log_warning(os, thread)("Attempt to protect stack guard pages failed ("
|
||||
PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len));
|
||||
if (os::uncommit_memory((char *) low_addr, len)) {
|
||||
warning("Attempt to deallocate stack guard pages failed.");
|
||||
log_warning(os, thread)("Attempt to deallocate stack guard pages failed.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
log_debug(os, thread)("Thread " UINTX_FORMAT " stack guard pages activated: "
|
||||
PTR_FORMAT "-" PTR_FORMAT ".",
|
||||
os::current_thread_id(), p2i(low_addr), p2i(low_addr + len));
|
||||
|
||||
}
|
||||
|
||||
void JavaThread::remove_stack_guard_pages() {
|
||||
|
@ -2515,16 +2530,25 @@ void JavaThread::remove_stack_guard_pages() {
|
|||
if (os::remove_stack_guard_pages((char *) low_addr, len)) {
|
||||
_stack_guard_state = stack_guard_unused;
|
||||
} else {
|
||||
warning("Attempt to deallocate stack guard pages failed.");
|
||||
log_warning(os, thread)("Attempt to deallocate stack guard pages failed ("
|
||||
PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (_stack_guard_state == stack_guard_unused) return;
|
||||
if (os::unguard_memory((char *) low_addr, len)) {
|
||||
_stack_guard_state = stack_guard_unused;
|
||||
} else {
|
||||
warning("Attempt to unprotect stack guard pages failed.");
|
||||
log_warning(os, thread)("Attempt to unprotect stack guard pages failed ("
|
||||
PTR_FORMAT "-" PTR_FORMAT ").", p2i(low_addr), p2i(low_addr + len));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
log_debug(os, thread)("Thread " UINTX_FORMAT " stack guard pages removed: "
|
||||
PTR_FORMAT "-" PTR_FORMAT ".",
|
||||
os::current_thread_id(), p2i(low_addr), p2i(low_addr + len));
|
||||
|
||||
}
|
||||
|
||||
void JavaThread::enable_stack_reserved_zone() {
|
||||
|
@ -3530,6 +3554,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
return status;
|
||||
}
|
||||
|
||||
if (TRACE_INITIALIZE() != JNI_OK) {
|
||||
vm_exit_during_initialization("Failed to initialize tracing backend");
|
||||
}
|
||||
|
||||
// Should be done after the heap is fully created
|
||||
main_thread->cache_global_variables();
|
||||
|
||||
|
@ -3598,11 +3626,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
|
||||
quicken_jni_functions();
|
||||
|
||||
// Must be run after init_ft which initializes ft_enabled
|
||||
if (TRACE_INITIALIZE() != JNI_OK) {
|
||||
vm_exit_during_initialization("Failed to initialize tracing backend");
|
||||
}
|
||||
|
||||
// No more stub generation allowed after that point.
|
||||
StubCodeDesc::freeze();
|
||||
|
||||
|
@ -4110,6 +4133,7 @@ jboolean Threads::is_supported_jni_version(jint version) {
|
|||
if (version == JNI_VERSION_1_4) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_1_6) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_1_8) return JNI_TRUE;
|
||||
if (version == JNI_VERSION_9) return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue