46 } 47 48 public: 49 static void create(Thread* thread) { 50 new (data(thread)) ZThreadLocalData(); 51 } 52 53 static void destroy(Thread* thread) { 54 data(thread)->~ZThreadLocalData(); 55 } 56 57 static void set_address_bad_mask(Thread* thread, uintptr_t mask) { 58 data(thread)->_address_bad_mask = mask; 59 } 60 61 static ZMarkThreadLocalStacks* stacks(Thread* thread) { 62 return &data(thread)->_stacks; 63 } 64 65 static void set_invisible_root(Thread* thread, oop* root) { 66 assert(!has_invisible_root(thread), "Already set"); 67 data(thread)->_invisible_root = root; 68 } 69 70 static void clear_invisible_root(Thread* thread) { 71 assert(has_invisible_root(thread), "Should be set"); 72 data(thread)->_invisible_root = NULL; 73 } 74 75 static bool has_invisible_root(Thread* thread) { 76 return data(thread)->_invisible_root != NULL; 77 } 78 79 static oop* invisible_root(Thread* thread) { 80 assert(has_invisible_root(thread), "Should be set"); 81 return data(thread)->_invisible_root; 82 } 83 84 static ByteSize address_bad_mask_offset() { 85 return Thread::gc_data_offset() + byte_offset_of(ZThreadLocalData, _address_bad_mask); 86 } 87 88 static ByteSize nmethod_disarmed_offset() { 89 return address_bad_mask_offset() + in_ByteSize(ZNMethodDisarmedOffset); 90 } 91 }; 92 93 #endif // SHARE_GC_Z_ZTHREADLOCALDATA_HPP | 46 } 47 48 public: 49 static void create(Thread* thread) { 50 new (data(thread)) ZThreadLocalData(); 51 } 52 53 static void destroy(Thread* thread) { 54 data(thread)->~ZThreadLocalData(); 55 } 56 57 static void set_address_bad_mask(Thread* thread, uintptr_t mask) { 58 data(thread)->_address_bad_mask = mask; 59 } 60 61 static ZMarkThreadLocalStacks* stacks(Thread* thread) { 62 return &data(thread)->_stacks; 63 } 64 65 static void set_invisible_root(Thread* thread, oop* root) { 66 assert(data(thread)->_invisible_root == NULL, "Already set"); 67 data(thread)->_invisible_root = root; 68 } 69 70 static void clear_invisible_root(Thread* thread) { 71 assert(data(thread)->_invisible_root != NULL, "Should be set"); 72 data(thread)->_invisible_root = NULL; 73 } 74 75 template <typename T> 76 static void do_invisible_root(Thread* thread, T f) { 77 if (data(thread)->_invisible_root != NULL) { 78 f(data(thread)->_invisible_root); 79 } 80 } 81 82 static ByteSize address_bad_mask_offset() { 83 return Thread::gc_data_offset() + byte_offset_of(ZThreadLocalData, _address_bad_mask); 84 } 85 86 static ByteSize nmethod_disarmed_offset() { 87 return address_bad_mask_offset() + in_ByteSize(ZNMethodDisarmedOffset); 88 } 89 }; 90 91 #endif // SHARE_GC_Z_ZTHREADLOCALDATA_HPP |