mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
Merge
This commit is contained in:
commit
c45d65f8eb
71 changed files with 8299 additions and 226 deletions
|
@ -110,6 +110,7 @@
|
|||
|
||||
// Only bother with this argument setup if dtrace is available
|
||||
|
||||
#ifndef USDT2
|
||||
HS_DTRACE_PROBE_DECL(hotspot, vm__init__begin);
|
||||
HS_DTRACE_PROBE_DECL(hotspot, vm__init__end);
|
||||
HS_DTRACE_PROBE_DECL5(hotspot, thread__start, char*, intptr_t,
|
||||
|
@ -130,6 +131,26 @@ HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t,
|
|||
java_lang_Thread::is_daemon((javathread)->threadObj())); \
|
||||
}
|
||||
|
||||
#else /* USDT2 */
|
||||
|
||||
#define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_PROBE_START
|
||||
#define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_PROBE_STOP
|
||||
|
||||
#define DTRACE_THREAD_PROBE(probe, javathread) \
|
||||
{ \
|
||||
ResourceMark rm(this); \
|
||||
int len = 0; \
|
||||
const char* name = (javathread)->get_thread_name(); \
|
||||
len = strlen(name); \
|
||||
HOTSPOT_THREAD_PROBE_##probe( /* probe = start, stop */ \
|
||||
(char *) name, len, \
|
||||
java_lang_Thread::thread_id((javathread)->threadObj()), \
|
||||
(uintptr_t) (javathread)->osthread()->thread_id(), \
|
||||
java_lang_Thread::is_daemon((javathread)->threadObj())); \
|
||||
}
|
||||
|
||||
#endif /* USDT2 */
|
||||
|
||||
#else // ndef DTRACE_ENABLED
|
||||
|
||||
#define DTRACE_THREAD_PROBE(probe, javathread)
|
||||
|
@ -1328,7 +1349,7 @@ SATBMarkQueueSet JavaThread::_satb_mark_queue_set;
|
|||
DirtyCardQueueSet JavaThread::_dirty_card_queue_set;
|
||||
#endif // !SERIALGC
|
||||
|
||||
JavaThread::JavaThread(bool is_attaching) :
|
||||
JavaThread::JavaThread(bool is_attaching_via_jni) :
|
||||
Thread()
|
||||
#ifndef SERIALGC
|
||||
, _satb_mark_queue(&_satb_mark_queue_set),
|
||||
|
@ -1336,7 +1357,11 @@ JavaThread::JavaThread(bool is_attaching) :
|
|||
#endif // !SERIALGC
|
||||
{
|
||||
initialize();
|
||||
_is_attaching = is_attaching;
|
||||
if (is_attaching_via_jni) {
|
||||
_jni_attach_state = _attaching_via_jni;
|
||||
} else {
|
||||
_jni_attach_state = _not_attaching_via_jni;
|
||||
}
|
||||
assert(_deferred_card_mark.is_empty(), "Default MemRegion ctor");
|
||||
}
|
||||
|
||||
|
@ -1392,7 +1417,7 @@ JavaThread::JavaThread(ThreadFunction entry_point, size_t stack_sz) :
|
|||
tty->print_cr("creating thread %p", this);
|
||||
}
|
||||
initialize();
|
||||
_is_attaching = false;
|
||||
_jni_attach_state = _not_attaching_via_jni;
|
||||
set_entry_point(entry_point);
|
||||
// Create the native thread itself.
|
||||
// %note runtime_23
|
||||
|
@ -1504,6 +1529,10 @@ void JavaThread::thread_main_inner() {
|
|||
// Note: Due to JVM_StopThread we can have pending exceptions already!
|
||||
if (!this->has_pending_exception() &&
|
||||
!java_lang_Thread::is_stillborn(this->threadObj())) {
|
||||
{
|
||||
ResourceMark rm(this);
|
||||
this->set_native_thread_name(this->get_thread_name());
|
||||
}
|
||||
HandleMark hm(this);
|
||||
this->entry_point()(this, this);
|
||||
}
|
||||
|
@ -2683,7 +2712,7 @@ const char* JavaThread::get_thread_name_string(char* buf, int buflen) const {
|
|||
name_str = UNICODE::as_utf8((jchar*) name->base(T_CHAR), name->length(), buf, buflen);
|
||||
}
|
||||
}
|
||||
else if (is_attaching()) { // workaround for 6412693 - see 6404306
|
||||
else if (is_attaching_via_jni()) { // workaround for 6412693 - see 6404306
|
||||
name_str = "<no-name - thread is attaching>";
|
||||
}
|
||||
else {
|
||||
|
@ -3079,7 +3108,11 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
os::pause();
|
||||
}
|
||||
|
||||
#ifndef USDT2
|
||||
HS_DTRACE_PROBE(hotspot, vm__init__begin);
|
||||
#else /* USDT2 */
|
||||
HOTSPOT_VM_INIT_BEGIN();
|
||||
#endif /* USDT2 */
|
||||
|
||||
// Record VM creation timing statistics
|
||||
TraceVmCreationTime create_vm_timer;
|
||||
|
@ -3334,7 +3367,11 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
// debug stuff, that does not work until all basic classes have been initialized.
|
||||
set_init_completed();
|
||||
|
||||
#ifndef USDT2
|
||||
HS_DTRACE_PROBE(hotspot, vm__init__end);
|
||||
#else /* USDT2 */
|
||||
HOTSPOT_VM_INIT_END();
|
||||
#endif /* USDT2 */
|
||||
|
||||
// record VM initialization completion time
|
||||
Management::record_vm_init_completed();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue