comparison src/share/vm/runtime/thread.hpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents a61af66fc99e
children da9cb4e97a5f
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
781 const char* _file; 781 const char* _file;
782 int _line; 782 int _line;
783 } _jmp_ring[ jump_ring_buffer_size ]; 783 } _jmp_ring[ jump_ring_buffer_size ];
784 #endif /* PRODUCT */ 784 #endif /* PRODUCT */
785 785
786 #ifndef SERIALGC
787 // Support for G1 barriers
788
789 ObjPtrQueue _satb_mark_queue; // Thread-local log for SATB barrier.
790 // Set of all such queues.
791 static SATBMarkQueueSet _satb_mark_queue_set;
792
793 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards.
794 // Set of all such queues.
795 static DirtyCardQueueSet _dirty_card_queue_set;
796 #endif // !SERIALGC
797
786 friend class VMThread; 798 friend class VMThread;
787 friend class ThreadWaitTransition; 799 friend class ThreadWaitTransition;
788 friend class VM_Exit; 800 friend class VM_Exit;
789 801
790 void initialize(); // Initialized the instance variables 802 void initialize(); // Initialized the instance variables
1165 static ByteSize exception_stack_size_offset() { return byte_offset_of(JavaThread, _exception_stack_size); } 1177 static ByteSize exception_stack_size_offset() { return byte_offset_of(JavaThread, _exception_stack_size); }
1166 static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state ); } 1178 static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state ); }
1167 static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags ); } 1179 static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags ); }
1168 1180
1169 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } 1181 static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); }
1182
1183 #ifndef SERIALGC
1184 static ByteSize satb_mark_queue_offset() { return byte_offset_of(JavaThread, _satb_mark_queue); }
1185 static ByteSize dirty_card_queue_offset() { return byte_offset_of(JavaThread, _dirty_card_queue); }
1186 #endif // !SERIALGC
1170 1187
1171 // Returns the jni environment for this thread 1188 // Returns the jni environment for this thread
1172 JNIEnv* jni_environment() { return &_jni_environment; } 1189 JNIEnv* jni_environment() { return &_jni_environment; }
1173 1190
1174 static JavaThread* thread_from_jni_environment(JNIEnv* env) { 1191 static JavaThread* thread_from_jni_environment(JNIEnv* env) {
1412 } 1429 }
1413 static inline void set_stack_size_at_create(size_t value) { 1430 static inline void set_stack_size_at_create(size_t value) {
1414 _stack_size_at_create = value; 1431 _stack_size_at_create = value;
1415 } 1432 }
1416 1433
1434 #ifndef SERIALGC
1435 // SATB marking queue support
1436 ObjPtrQueue& satb_mark_queue() { return _satb_mark_queue; }
1437 static SATBMarkQueueSet& satb_mark_queue_set() {
1438 return _satb_mark_queue_set;
1439 }
1440
1441 // Dirty card queue support
1442 DirtyCardQueue& dirty_card_queue() { return _dirty_card_queue; }
1443 static DirtyCardQueueSet& dirty_card_queue_set() {
1444 return _dirty_card_queue_set;
1445 }
1446 #endif // !SERIALGC
1447
1417 // Machine dependent stuff 1448 // Machine dependent stuff
1418 #include "incls/_thread_pd.hpp.incl" 1449 #include "incls/_thread_pd.hpp.incl"
1419 1450
1420 public: 1451 public:
1421 void set_blocked_on_compilation(bool value) { 1452 void set_blocked_on_compilation(bool value) {
1443 void set_cached_monitor_info(GrowableArray<MonitorInfo*>* info) { _cached_monitor_info = info; } 1474 void set_cached_monitor_info(GrowableArray<MonitorInfo*>* info) { _cached_monitor_info = info; }
1444 1475
1445 // clearing/querying jni attach status 1476 // clearing/querying jni attach status
1446 bool is_attaching() const { return _is_attaching; } 1477 bool is_attaching() const { return _is_attaching; }
1447 void set_attached() { _is_attaching = false; OrderAccess::fence(); } 1478 void set_attached() { _is_attaching = false; OrderAccess::fence(); }
1479 private:
1480 // This field is used to determine if a thread has claimed
1481 // a par_id: it is -1 if the thread has not claimed a par_id;
1482 // otherwise its value is the par_id that has been claimed.
1483 int _claimed_par_id;
1484 public:
1485 int get_claimed_par_id() { return _claimed_par_id; }
1486 void set_claimed_par_id(int id) { _claimed_par_id = id;}
1448 }; 1487 };
1449 1488
1450 // Inline implementation of JavaThread::current 1489 // Inline implementation of JavaThread::current
1451 inline JavaThread* JavaThread::current() { 1490 inline JavaThread* JavaThread::current() {
1452 Thread* thread = ThreadLocalStorage::thread(); 1491 Thread* thread = ThreadLocalStorage::thread();