27
28 #include "memory/gcLocker.hpp"
29 #include "runtime/handles.inline.hpp"
30 #include "runtime/mutexLocker.hpp"
31 #include "runtime/orderAccess.hpp"
32 #include "runtime/os.hpp"
33 #include "runtime/safepoint.hpp"
34 #include "runtime/vmThread.hpp"
35 #include "utilities/globalDefinitions.hpp"
36 #include "utilities/preserveException.hpp"
37 #include "utilities/top.hpp"
38 #ifdef TARGET_OS_FAMILY_linux
39 # include "thread_linux.inline.hpp"
40 #endif
41 #ifdef TARGET_OS_FAMILY_solaris
42 # include "thread_solaris.inline.hpp"
43 #endif
44 #ifdef TARGET_OS_FAMILY_windows
45 # include "thread_windows.inline.hpp"
46 #endif
47
48 // Wrapper for all entry points to the virtual machine.
49 // The HandleMarkCleaner is a faster version of HandleMark.
50 // It relies on the fact that there is a HandleMark further
51 // down the stack (in JavaCalls::call_helper), and just resets
52 // to the saved values in that HandleMark.
53
54 class HandleMarkCleaner: public StackObj {
55 private:
56 Thread* _thread;
57 public:
58 HandleMarkCleaner(Thread* thread) {
59 _thread = thread;
60 _thread->last_handle_mark()->push();
61 }
62 ~HandleMarkCleaner() {
63 _thread->last_handle_mark()->pop_and_restore();
64 }
65
66 private:
98
99 static void zombieAll();
100 static void unlinkSymbols();
101 static void deoptimizeAll();
102 static void stress_derived_pointers();
103 static void verify_stack();
104 static void verify_last_frame();
105 # endif
106
107 public:
108 // OS dependent stuff
109 #ifdef TARGET_OS_FAMILY_linux
110 # include "interfaceSupport_linux.hpp"
111 #endif
112 #ifdef TARGET_OS_FAMILY_solaris
113 # include "interfaceSupport_solaris.hpp"
114 #endif
115 #ifdef TARGET_OS_FAMILY_windows
116 # include "interfaceSupport_windows.hpp"
117 #endif
118
119 };
120
121
122 // Basic class for all thread transition classes.
123
124 class ThreadStateTransition : public StackObj {
125 protected:
126 JavaThread* _thread;
127 public:
128 ThreadStateTransition(JavaThread *thread) {
129 _thread = thread;
130 assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
131 }
132
133 // Change threadstate in a manner, so safepoint can detect changes.
134 // Time-critical: called on exit from every runtime routine
135 static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
136 assert(from != _thread_in_Java, "use transition_from_java");
137 assert(from != _thread_in_native, "use transition_from_native");
|
27
28 #include "memory/gcLocker.hpp"
29 #include "runtime/handles.inline.hpp"
30 #include "runtime/mutexLocker.hpp"
31 #include "runtime/orderAccess.hpp"
32 #include "runtime/os.hpp"
33 #include "runtime/safepoint.hpp"
34 #include "runtime/vmThread.hpp"
35 #include "utilities/globalDefinitions.hpp"
36 #include "utilities/preserveException.hpp"
37 #include "utilities/top.hpp"
38 #ifdef TARGET_OS_FAMILY_linux
39 # include "thread_linux.inline.hpp"
40 #endif
41 #ifdef TARGET_OS_FAMILY_solaris
42 # include "thread_solaris.inline.hpp"
43 #endif
44 #ifdef TARGET_OS_FAMILY_windows
45 # include "thread_windows.inline.hpp"
46 #endif
47 #ifdef TARGET_OS_FAMILY_bsd
48 # include "thread_bsd.inline.hpp"
49 #endif
50
51 // Wrapper for all entry points to the virtual machine.
52 // The HandleMarkCleaner is a faster version of HandleMark.
53 // It relies on the fact that there is a HandleMark further
54 // down the stack (in JavaCalls::call_helper), and just resets
55 // to the saved values in that HandleMark.
56
57 class HandleMarkCleaner: public StackObj {
58 private:
59 Thread* _thread;
60 public:
61 HandleMarkCleaner(Thread* thread) {
62 _thread = thread;
63 _thread->last_handle_mark()->push();
64 }
65 ~HandleMarkCleaner() {
66 _thread->last_handle_mark()->pop_and_restore();
67 }
68
69 private:
101
102 static void zombieAll();
103 static void unlinkSymbols();
104 static void deoptimizeAll();
105 static void stress_derived_pointers();
106 static void verify_stack();
107 static void verify_last_frame();
108 # endif
109
110 public:
111 // OS dependent stuff
112 #ifdef TARGET_OS_FAMILY_linux
113 # include "interfaceSupport_linux.hpp"
114 #endif
115 #ifdef TARGET_OS_FAMILY_solaris
116 # include "interfaceSupport_solaris.hpp"
117 #endif
118 #ifdef TARGET_OS_FAMILY_windows
119 # include "interfaceSupport_windows.hpp"
120 #endif
121 #ifdef TARGET_OS_FAMILY_bsd
122 # include "interfaceSupport_bsd.hpp"
123 #endif
124
125 };
126
127
128 // Basic class for all thread transition classes.
129
130 class ThreadStateTransition : public StackObj {
131 protected:
132 JavaThread* _thread;
133 public:
134 ThreadStateTransition(JavaThread *thread) {
135 _thread = thread;
136 assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
137 }
138
139 // Change threadstate in a manner, so safepoint can detect changes.
140 // Time-critical: called on exit from every runtime routine
141 static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
142 assert(from != _thread_in_Java, "use transition_from_java");
143 assert(from != _thread_in_native, "use transition_from_native");
|