1611 int java_lang_Thread::_stillborn_offset = 0; |
1611 int java_lang_Thread::_stillborn_offset = 0; |
1612 int java_lang_Thread::_stackSize_offset = 0; |
1612 int java_lang_Thread::_stackSize_offset = 0; |
1613 int java_lang_Thread::_tid_offset = 0; |
1613 int java_lang_Thread::_tid_offset = 0; |
1614 int java_lang_Thread::_thread_status_offset = 0; |
1614 int java_lang_Thread::_thread_status_offset = 0; |
1615 int java_lang_Thread::_park_blocker_offset = 0; |
1615 int java_lang_Thread::_park_blocker_offset = 0; |
1616 int java_lang_Thread::_park_event_offset = 0 ; |
|
1617 |
1616 |
1618 #define THREAD_FIELDS_DO(macro) \ |
1617 #define THREAD_FIELDS_DO(macro) \ |
1619 macro(_name_offset, k, vmSymbols::name_name(), string_signature, false); \ |
1618 macro(_name_offset, k, vmSymbols::name_name(), string_signature, false); \ |
1620 macro(_group_offset, k, vmSymbols::group_name(), threadgroup_signature, false); \ |
1619 macro(_group_offset, k, vmSymbols::group_name(), threadgroup_signature, false); \ |
1621 macro(_contextClassLoader_offset, k, vmSymbols::contextClassLoader_name(), classloader_signature, false); \ |
1620 macro(_contextClassLoader_offset, k, vmSymbols::contextClassLoader_name(), classloader_signature, false); \ |
1625 macro(_eetop_offset, k, "eetop", long_signature, false); \ |
1624 macro(_eetop_offset, k, "eetop", long_signature, false); \ |
1626 macro(_stillborn_offset, k, "stillborn", bool_signature, false); \ |
1625 macro(_stillborn_offset, k, "stillborn", bool_signature, false); \ |
1627 macro(_stackSize_offset, k, "stackSize", long_signature, false); \ |
1626 macro(_stackSize_offset, k, "stackSize", long_signature, false); \ |
1628 macro(_tid_offset, k, "tid", long_signature, false); \ |
1627 macro(_tid_offset, k, "tid", long_signature, false); \ |
1629 macro(_thread_status_offset, k, "threadStatus", int_signature, false); \ |
1628 macro(_thread_status_offset, k, "threadStatus", int_signature, false); \ |
1630 macro(_park_blocker_offset, k, "parkBlocker", object_signature, false); \ |
1629 macro(_park_blocker_offset, k, "parkBlocker", object_signature, false) |
1631 macro(_park_event_offset, k, "nativeParkEventPointer", long_signature, false) |
|
1632 |
1630 |
1633 void java_lang_Thread::compute_offsets() { |
1631 void java_lang_Thread::compute_offsets() { |
1634 assert(_group_offset == 0, "offsets should be initialized only once"); |
1632 assert(_group_offset == 0, "offsets should be initialized only once"); |
1635 |
1633 |
1636 InstanceKlass* k = SystemDictionary::Thread_klass(); |
1634 InstanceKlass* k = SystemDictionary::Thread_klass(); |
1741 oop java_lang_Thread::park_blocker(oop java_thread) { |
1739 oop java_lang_Thread::park_blocker(oop java_thread) { |
1742 assert(JDK_Version::current().supports_thread_park_blocker(), |
1740 assert(JDK_Version::current().supports_thread_park_blocker(), |
1743 "Must support parkBlocker field"); |
1741 "Must support parkBlocker field"); |
1744 |
1742 |
1745 return java_thread->obj_field(_park_blocker_offset); |
1743 return java_thread->obj_field(_park_blocker_offset); |
1746 } |
|
1747 |
|
1748 jlong java_lang_Thread::park_event(oop java_thread) { |
|
1749 return java_thread->long_field(_park_event_offset); |
|
1750 } |
|
1751 |
|
1752 bool java_lang_Thread::set_park_event(oop java_thread, jlong ptr) { |
|
1753 java_thread->long_field_put(_park_event_offset, ptr); |
|
1754 return true; |
|
1755 } |
1744 } |
1756 |
1745 |
1757 const char* java_lang_Thread::thread_status_name(oop java_thread) { |
1746 const char* java_lang_Thread::thread_status_name(oop java_thread) { |
1758 ThreadStatus status = (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset); |
1747 ThreadStatus status = (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset); |
1759 switch (status) { |
1748 switch (status) { |