990
991 // If reallocation of scalar replaced objects fails, we throw OOM
992 // and during exception propagation, pop the top
993 // _frames_to_pop_failed_realloc frames, the ones that reference
994 // failed reallocations.
995 int _frames_to_pop_failed_realloc;
996
997 #ifndef PRODUCT
998 int _jmp_ring_index;
999 struct {
1000 // We use intptr_t instead of address so debugger doesn't try and display strings
1001 intptr_t _target;
1002 intptr_t _instruction;
1003 const char* _file;
1004 int _line;
1005 } _jmp_ring[jump_ring_buffer_size];
1006 #endif // PRODUCT
1007
1008 #if INCLUDE_ALL_GCS
1009 // Support for G1 barriers
1010
1011 SATBMarkQueue _satb_mark_queue; // Thread-local log for SATB barrier.
1012 // Set of all such queues.
1013 static SATBMarkQueueSet _satb_mark_queue_set;
1014
1015 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards.
1016 // Set of all such queues.
1017 static DirtyCardQueueSet _dirty_card_queue_set;
1018
1019 void flush_barrier_queues();
1020 #endif // INCLUDE_ALL_GCS
1021
1022 friend class VMThread;
1023 friend class ThreadWaitTransition;
1024 friend class VM_Exit;
1025
1026 void initialize(); // Initialized the instance variables
1027
1028 public:
1029 // Constructor
1030 JavaThread(bool is_attaching_via_jni = false); // for main thread and JNI attached threads
1031 JavaThread(ThreadFunction entry_point, size_t stack_size = 0);
1032 ~JavaThread();
1033
1034 #ifdef ASSERT
1035 // verify this JavaThread hasn't be published in the Threads::list yet
1036 void verify_not_published();
1037 #endif
1038
1039 //JNI functiontable getter/setter for JVMTI jni function table interception API.
1856
1857 private:
1858 ThreadStatistics *_thread_stat;
1859
1860 public:
1861 ThreadStatistics* get_thread_stat() const { return _thread_stat; }
1862
1863 // Return a blocker object for which this thread is blocked parking.
1864 oop current_park_blocker();
1865
1866 private:
1867 static size_t _stack_size_at_create;
1868
1869 public:
1870 static inline size_t stack_size_at_create(void) {
1871 return _stack_size_at_create;
1872 }
1873 static inline void set_stack_size_at_create(size_t value) {
1874 _stack_size_at_create = value;
1875 }
1876
1877 #if INCLUDE_ALL_GCS
1878 // SATB marking queue support
1879 SATBMarkQueue& satb_mark_queue() { return _satb_mark_queue; }
1880 static SATBMarkQueueSet& satb_mark_queue_set() {
1881 return _satb_mark_queue_set;
1882 }
1883
1884 // Dirty card queue support
1885 DirtyCardQueue& dirty_card_queue() { return _dirty_card_queue; }
1886 static DirtyCardQueueSet& dirty_card_queue_set() {
1887 return _dirty_card_queue_set;
1888 }
1889 #endif // INCLUDE_ALL_GCS
1890
1891 // This method initializes the SATB and dirty card queues before a
1892 // JavaThread is added to the Java thread list. Right now, we don't
1893 // have to do anything to the dirty card queue (it should have been
1894 // activated when the thread was created), but we have to activate
1895 // the SATB queue if the thread is created while a marking cycle is
1896 // in progress. The activation / de-activation of the SATB queues at
1897 // the beginning / end of a marking cycle is done during safepoints
1898 // so we have to make sure this method is called outside one to be
1899 // able to safely read the active field of the SATB queue set. Right
1900 // now, it is called just before the thread is added to the Java
1901 // thread list in the Threads::add() method. That method is holding
1902 // the Threads_lock which ensures we are outside a safepoint. We
1903 // cannot do the obvious and set the active field of the SATB queue
1904 // when the thread is created given that, in some cases, safepoints
1905 // might happen between the JavaThread constructor being called and the
1906 // thread being added to the Java thread list (an example of this is
1907 // when the structure for the DestroyJavaVM thread is created).
1908 #if INCLUDE_ALL_GCS
1909 void initialize_queues();
1910 #else // INCLUDE_ALL_GCS
1911 void initialize_queues() { }
1912 #endif // INCLUDE_ALL_GCS
1913
1914 // Machine dependent stuff
1915 #include OS_CPU_HEADER(thread)
1916
1917 public:
1918 void set_blocked_on_compilation(bool value) {
1919 _blocked_on_compilation = value;
1920 }
1921
1922 bool blocked_on_compilation() {
1923 return _blocked_on_compilation;
1924 }
1925 protected:
1926 bool _blocked_on_compilation;
1927
1928
1929 // JSR166 per-thread parker
1930 private:
1931 Parker* _parker;
1932 public:
|
990
991 // If reallocation of scalar replaced objects fails, we throw OOM
992 // and during exception propagation, pop the top
993 // _frames_to_pop_failed_realloc frames, the ones that reference
994 // failed reallocations.
995 int _frames_to_pop_failed_realloc;
996
997 #ifndef PRODUCT
998 int _jmp_ring_index;
999 struct {
1000 // We use intptr_t instead of address so debugger doesn't try and display strings
1001 intptr_t _target;
1002 intptr_t _instruction;
1003 const char* _file;
1004 int _line;
1005 } _jmp_ring[jump_ring_buffer_size];
1006 #endif // PRODUCT
1007
1008 #if INCLUDE_ALL_GCS
1009 // Support for G1 barriers
1010 private:
1011 SATBMarkQueue _satb_mark_queue; // Thread-local log for SATB barrier.
1012 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards.
1013
1014 public:
1015 SATBMarkQueue& satb_mark_queue() { return _satb_mark_queue; }
1016 DirtyCardQueue& dirty_card_queue() { return _dirty_card_queue; }
1017 #endif // INCLUDE_ALL_GCS
1018
1019 friend class VMThread;
1020 friend class ThreadWaitTransition;
1021 friend class VM_Exit;
1022
1023 void initialize(); // Initialized the instance variables
1024
1025 public:
1026 // Constructor
1027 JavaThread(bool is_attaching_via_jni = false); // for main thread and JNI attached threads
1028 JavaThread(ThreadFunction entry_point, size_t stack_size = 0);
1029 ~JavaThread();
1030
1031 #ifdef ASSERT
1032 // verify this JavaThread hasn't be published in the Threads::list yet
1033 void verify_not_published();
1034 #endif
1035
1036 //JNI functiontable getter/setter for JVMTI jni function table interception API.
1853
1854 private:
1855 ThreadStatistics *_thread_stat;
1856
1857 public:
1858 ThreadStatistics* get_thread_stat() const { return _thread_stat; }
1859
1860 // Return a blocker object for which this thread is blocked parking.
1861 oop current_park_blocker();
1862
1863 private:
1864 static size_t _stack_size_at_create;
1865
1866 public:
1867 static inline size_t stack_size_at_create(void) {
1868 return _stack_size_at_create;
1869 }
1870 static inline void set_stack_size_at_create(size_t value) {
1871 _stack_size_at_create = value;
1872 }
1873
1874 // Machine dependent stuff
1875 #include OS_CPU_HEADER(thread)
1876
1877 public:
1878 void set_blocked_on_compilation(bool value) {
1879 _blocked_on_compilation = value;
1880 }
1881
1882 bool blocked_on_compilation() {
1883 return _blocked_on_compilation;
1884 }
1885 protected:
1886 bool _blocked_on_compilation;
1887
1888
1889 // JSR166 per-thread parker
1890 private:
1891 Parker* _parker;
1892 public:
|