32
33 // This is the abstracted interface for the safepoint implementation
34 class SafepointMechanism : public AllStatic {
35 enum PollingType {
36 _global_page_poll,
37 _thread_local_poll
38 };
39 static PollingType _polling_type;
40 static void* _poll_armed_value;
41 static void* _poll_disarmed_value;
42 static void set_uses_thread_local_poll() { _polling_type = _thread_local_poll; }
43
44 static void* poll_armed_value() { return _poll_armed_value; }
45 static void* poll_disarmed_value() { return _poll_disarmed_value; }
46
47 static inline bool local_poll_armed(JavaThread* thread);
48
49 static inline bool local_poll(Thread* thread);
50 static inline bool global_poll();
51
52 static inline void block_if_requested_local_poll(JavaThread *thread);
53
54 static void default_initialize();
55
56 static void pd_initialize() NOT_AIX({ default_initialize(); });
57
58 // By adding 8 to the base address of the protected polling page we can differentiate
59 // between the armed and disarmed value by masking out this bit.
60 const static intptr_t _poll_bit = 8;
61 public:
62 static intptr_t poll_bit() { return _poll_bit; }
63
64 static bool uses_global_page_poll() { return _polling_type == _global_page_poll; }
65 static bool uses_thread_local_poll() { return _polling_type == _thread_local_poll; }
66
67 static bool supports_thread_local_poll() {
68 #ifdef THREAD_LOCAL_POLL
69 return true;
70 #else
71 return false;
72 #endif
|
32
33 // This is the abstracted interface for the safepoint implementation
34 class SafepointMechanism : public AllStatic {
35 enum PollingType {
36 _global_page_poll,
37 _thread_local_poll
38 };
39 static PollingType _polling_type;
40 static void* _poll_armed_value;
41 static void* _poll_disarmed_value;
42 static void set_uses_thread_local_poll() { _polling_type = _thread_local_poll; }
43
44 static void* poll_armed_value() { return _poll_armed_value; }
45 static void* poll_disarmed_value() { return _poll_disarmed_value; }
46
47 static inline bool local_poll_armed(JavaThread* thread);
48
49 static inline bool local_poll(Thread* thread);
50 static inline bool global_poll();
51
52 static void block_if_requested_slow(JavaThread *thread);
53
54 static void default_initialize();
55
56 static void pd_initialize() NOT_AIX({ default_initialize(); });
57
58 // By adding 8 to the base address of the protected polling page we can differentiate
59 // between the armed and disarmed value by masking out this bit.
60 const static intptr_t _poll_bit = 8;
61 public:
62 static intptr_t poll_bit() { return _poll_bit; }
63
64 static bool uses_global_page_poll() { return _polling_type == _global_page_poll; }
65 static bool uses_thread_local_poll() { return _polling_type == _thread_local_poll; }
66
67 static bool supports_thread_local_poll() {
68 #ifdef THREAD_LOCAL_POLL
69 return true;
70 #else
71 return false;
72 #endif
|