comparison src/share/vm/runtime/thread.hpp @ 8124:5fc51c1ecdeb

Merge.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 05 Mar 2013 23:44:54 +0100
parents c6c72de0537e db9981fd3124
children b8f261ba79c6
comparison
equal deleted inserted replaced
7943:a413bcd552a4 8124:5fc51c1ecdeb
39 #include "runtime/park.hpp" 39 #include "runtime/park.hpp"
40 #include "runtime/safepoint.hpp" 40 #include "runtime/safepoint.hpp"
41 #include "runtime/stubRoutines.hpp" 41 #include "runtime/stubRoutines.hpp"
42 #include "runtime/threadLocalStorage.hpp" 42 #include "runtime/threadLocalStorage.hpp"
43 #include "runtime/unhandledOops.hpp" 43 #include "runtime/unhandledOops.hpp"
44 #include "utilities/macros.hpp"
44 45
45 #if INCLUDE_NMT 46 #if INCLUDE_NMT
46 #include "services/memRecorder.hpp" 47 #include "services/memRecorder.hpp"
47 #endif // INCLUDE_NMT 48 #endif // INCLUDE_NMT
48 49
49 #include "trace/tracing.hpp" 50 #include "trace/tracing.hpp"
50 #include "utilities/exceptions.hpp" 51 #include "utilities/exceptions.hpp"
51 #include "utilities/top.hpp" 52 #include "utilities/top.hpp"
52 #ifndef SERIALGC 53 #if INCLUDE_ALL_GCS
53 #include "gc_implementation/g1/dirtyCardQueue.hpp" 54 #include "gc_implementation/g1/dirtyCardQueue.hpp"
54 #include "gc_implementation/g1/satbQueue.hpp" 55 #include "gc_implementation/g1/satbQueue.hpp"
55 #endif 56 #endif // INCLUDE_ALL_GCS
56 #ifdef ZERO 57 #ifdef ZERO
57 #ifdef TARGET_ARCH_zero 58 #ifdef TARGET_ARCH_zero
58 # include "stack_zero.hpp" 59 # include "stack_zero.hpp"
59 #endif 60 #endif
60 #endif 61 #endif
941 const char* _file; 942 const char* _file;
942 int _line; 943 int _line;
943 } _jmp_ring[ jump_ring_buffer_size ]; 944 } _jmp_ring[ jump_ring_buffer_size ];
944 #endif /* PRODUCT */ 945 #endif /* PRODUCT */
945 946
946 #ifndef SERIALGC 947 #if INCLUDE_ALL_GCS
947 // Support for G1 barriers 948 // Support for G1 barriers
948 949
949 ObjPtrQueue _satb_mark_queue; // Thread-local log for SATB barrier. 950 ObjPtrQueue _satb_mark_queue; // Thread-local log for SATB barrier.
950 // Set of all such queues. 951 // Set of all such queues.
951 static SATBMarkQueueSet _satb_mark_queue_set; 952 static SATBMarkQueueSet _satb_mark_queue_set;
953 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards. 954 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards.
954 // Set of all such queues. 955 // Set of all such queues.
955 static DirtyCardQueueSet _dirty_card_queue_set; 956 static DirtyCardQueueSet _dirty_card_queue_set;
956 957
957 void flush_barrier_queues(); 958 void flush_barrier_queues();
958 #endif // !SERIALGC 959 #endif // INCLUDE_ALL_GCS
959 960
960 friend class VMThread; 961 friend class VMThread;
961 friend class ThreadWaitTransition; 962 friend class ThreadWaitTransition;
962 friend class VM_Exit; 963 friend class VM_Exit;
963 964
1386 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } 1387 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); }
1387 static ByteSize should_post_on_exceptions_flag_offset() { 1388 static ByteSize should_post_on_exceptions_flag_offset() {
1388 return byte_offset_of(JavaThread, _should_post_on_exceptions_flag); 1389 return byte_offset_of(JavaThread, _should_post_on_exceptions_flag);
1389 } 1390 }
1390 1391
1391 #ifndef SERIALGC 1392 #if INCLUDE_ALL_GCS
1392 static ByteSize satb_mark_queue_offset() { return byte_offset_of(JavaThread, _satb_mark_queue); } 1393 static ByteSize satb_mark_queue_offset() { return byte_offset_of(JavaThread, _satb_mark_queue); }
1393 static ByteSize dirty_card_queue_offset() { return byte_offset_of(JavaThread, _dirty_card_queue); } 1394 static ByteSize dirty_card_queue_offset() { return byte_offset_of(JavaThread, _dirty_card_queue); }
1394 #endif // !SERIALGC 1395 #endif // INCLUDE_ALL_GCS
1395 1396
1396 // Returns the jni environment for this thread 1397 // Returns the jni environment for this thread
1397 JNIEnv* jni_environment() { return &_jni_environment; } 1398 JNIEnv* jni_environment() { return &_jni_environment; }
1398 1399
1399 static JavaThread* thread_from_jni_environment(JNIEnv* env) { 1400 static JavaThread* thread_from_jni_environment(JNIEnv* env) {
1678 } 1679 }
1679 static inline void set_stack_size_at_create(size_t value) { 1680 static inline void set_stack_size_at_create(size_t value) {
1680 _stack_size_at_create = value; 1681 _stack_size_at_create = value;
1681 } 1682 }
1682 1683
1683 #ifndef SERIALGC 1684 #if INCLUDE_ALL_GCS
1684 // SATB marking queue support 1685 // SATB marking queue support
1685 ObjPtrQueue& satb_mark_queue() { return _satb_mark_queue; } 1686 ObjPtrQueue& satb_mark_queue() { return _satb_mark_queue; }
1686 static SATBMarkQueueSet& satb_mark_queue_set() { 1687 static SATBMarkQueueSet& satb_mark_queue_set() {
1687 return _satb_mark_queue_set; 1688 return _satb_mark_queue_set;
1688 } 1689 }
1690 // Dirty card queue support 1691 // Dirty card queue support
1691 DirtyCardQueue& dirty_card_queue() { return _dirty_card_queue; } 1692 DirtyCardQueue& dirty_card_queue() { return _dirty_card_queue; }
1692 static DirtyCardQueueSet& dirty_card_queue_set() { 1693 static DirtyCardQueueSet& dirty_card_queue_set() {
1693 return _dirty_card_queue_set; 1694 return _dirty_card_queue_set;
1694 } 1695 }
1695 #endif // !SERIALGC 1696 #endif // INCLUDE_ALL_GCS
1696 1697
1697 // This method initializes the SATB and dirty card queues before a 1698 // This method initializes the SATB and dirty card queues before a
1698 // JavaThread is added to the Java thread list. Right now, we don't 1699 // JavaThread is added to the Java thread list. Right now, we don't
1699 // have to do anything to the dirty card queue (it should have been 1700 // have to do anything to the dirty card queue (it should have been
1700 // activated when the thread was created), but we have to activate 1701 // activated when the thread was created), but we have to activate
1709 // cannot do the obvious and set the active field of the SATB queue 1710 // cannot do the obvious and set the active field of the SATB queue
1710 // when the thread is created given that, in some cases, safepoints 1711 // when the thread is created given that, in some cases, safepoints
1711 // might happen between the JavaThread constructor being called and the 1712 // might happen between the JavaThread constructor being called and the
1712 // thread being added to the Java thread list (an example of this is 1713 // thread being added to the Java thread list (an example of this is
1713 // when the structure for the DestroyJavaVM thread is created). 1714 // when the structure for the DestroyJavaVM thread is created).
1714 #ifndef SERIALGC 1715 #if INCLUDE_ALL_GCS
1715 void initialize_queues(); 1716 void initialize_queues();
1716 #else // !SERIALGC 1717 #else // INCLUDE_ALL_GCS
1717 void initialize_queues() { } 1718 void initialize_queues() { }
1718 #endif // !SERIALGC 1719 #endif // INCLUDE_ALL_GCS
1719 1720
1720 // Machine dependent stuff 1721 // Machine dependent stuff
1721 #ifdef TARGET_OS_ARCH_linux_x86 1722 #ifdef TARGET_OS_ARCH_linux_x86
1722 # include "thread_linux_x86.hpp" 1723 # include "thread_linux_x86.hpp"
1723 #endif 1724 #endif