Mercurial > hg > truffle
diff src/share/vm/runtime/thread.cpp @ 14407:94c202aa2646
Merge
author | kvn |
---|---|
date | Thu, 01 Aug 2013 17:25:10 -0700 |
parents | 438e13354adf 02d7aa1456c9 |
children | e2722a66aba7 |
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp Fri Jul 26 10:12:15 2013 +0200 +++ b/src/share/vm/runtime/thread.cpp Thu Aug 01 17:25:10 2013 -0700 @@ -218,6 +218,7 @@ // allocated data structures set_osthread(NULL); set_resource_area(new (mtThread)ResourceArea()); + DEBUG_ONLY(_current_resource_mark = NULL;) set_handle_area(new (mtThread) HandleArea(NULL)); set_metadata_handles(new (ResourceObj::C_HEAP, mtClass) GrowableArray<Metadata*>(30, true)); set_active_handles(NULL); @@ -956,6 +957,14 @@ } +bool Thread::is_in_usable_stack(address adr) const { + size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + size_t usable_stack_size = _stack_size - stack_guard_size; + + return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size)); +} + + // We had to move these methods here, because vm threads get into ObjectSynchronizer::enter // However, there is a note in JavaThread::is_lock_owned() about the VM threads not being // used for compilation in the future. If that change is made, the need for these methods @@ -1220,7 +1229,7 @@ bool WatcherThread::_startable = false; volatile bool WatcherThread::_should_terminate = false; -WatcherThread::WatcherThread() : Thread() { +WatcherThread::WatcherThread() : Thread(), _crash_protection(NULL) { assert(watcher_thread() == NULL, "we can only allocate one WatcherThread"); if (os::create_thread(this, os::watcher_thread)) { _watcher_thread = this; @@ -3484,44 +3493,6 @@ initialize_class(vmSymbols::java_lang_String(), CHECK_0); - if (AggressiveOpts) { - { - // Forcibly initialize java/util/HashMap and mutate the private - // static final "frontCacheEnabled" field before we start creating instances -#ifdef ASSERT - Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0); - assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); -#endif - Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0); - KlassHandle k = KlassHandle(THREAD, k_o); - guarantee(k.not_null(), "Must find java/util/HashMap"); - instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); - ik->initialize(CHECK_0); - fieldDescriptor fd; - // Possible we might not find this field; if so, don't break - if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { - k()->java_mirror()->bool_field_put(fd.offset(), true); - } - } - - if (UseStringCache) { - // Forcibly initialize java/lang/StringValue and mutate the private - // static final "stringCacheEnabled" field before we start creating instances - Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0); - // Possible that StringValue isn't present: if so, silently don't break - if (k_o != NULL) { - KlassHandle k = KlassHandle(THREAD, k_o); - instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); - ik->initialize(CHECK_0); - fieldDescriptor fd; - // Possible we might not find this field: if so, silently don't break - if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { - k()->java_mirror()->bool_field_put(fd.offset(), true); - } - } - } - } - // Initialize java_lang.System (needed before creating the thread) initialize_class(vmSymbols::java_lang_System(), CHECK_0); initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0); @@ -3639,6 +3610,7 @@ // Start Attach Listener if +StartAttachListener or it can't be started lazily if (!DisableAttachMechanism) { + AttachListener::vm_start(); if (StartAttachListener || AttachListener::init_at_startup()) { AttachListener::init(); }