2 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
4 Contributed-by: Omair Majid <omajid@redhat.com>
6 --- openjdk.orig/hotspot/src/share/vm/prims/jniCheck.cpp Tue Oct 25 04:07:20 2011 -0700
7 +++ openjdk/hotspot/src/share/vm/prims/jniCheck.cpp Tue Oct 25 08:17:15 2011 -0700
8 @@ -107,7 +107,7 @@ extern "C" {
10 NativeReportJNIFatalError(thr, warn_wrong_jnienv); \
12 - __ENTRY(result_type, header, thr)
13 + VM_ENTRY_BASE(result_type, header, thr)
16 #define UNCHECKED() (unchecked_jni_NativeInterface)
17 --- openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Oct 25 04:07:20 2011 -0700
18 +++ openjdk/hotspot/src/share/vm/prims/jvmtiEnter.xsl Tue Oct 25 08:17:15 2011 -0700
19 @@ -426,7 +426,7 @@ struct jvmtiInterface_1_ jvmti</xsl:text
20 <xsl:value-of select="$space"/>
21 <xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
22 <xsl:value-of select="$space"/>
23 - <xsl:text>__ENTRY(jvmtiError, </xsl:text>
24 + <xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
25 <xsl:apply-templates select="." mode="functionid"/>
26 <xsl:text> , current_thread)</xsl:text>
27 <xsl:value-of select="$space"/>
28 --- openjdk.orig/hotspot/src/share/vm/prims/jvmtiEnv.cpp Tue Oct 25 04:07:20 2011 -0700
29 +++ openjdk/hotspot/src/share/vm/prims/jvmtiEnv.cpp Tue Oct 25 08:17:15 2011 -0700
30 @@ -173,7 +173,7 @@ JvmtiEnv::GetThreadLocalStorage(jthread
31 // from native so as to resolve the jthread.
33 ThreadInVMfromNative __tiv(current_thread);
34 - __ENTRY(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
35 + VM_ENTRY_BASE(jvmtiError, JvmtiEnv::GetThreadLocalStorage , current_thread)
36 debug_only(VMNativeEntryWrapper __vew;)
38 oop thread_oop = JNIHandles::resolve_external_guard(thread);
39 --- openjdk.orig/hotspot/src/share/vm/prims/jvmtiExport.cpp Tue Oct 25 04:07:20 2011 -0700
40 +++ openjdk/hotspot/src/share/vm/prims/jvmtiExport.cpp Tue Oct 25 08:17:15 2011 -0700
41 @@ -373,7 +373,7 @@ JvmtiExport::get_jvmti_interface(JavaVM
42 JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread();
43 // transition code: native to VM
44 ThreadInVMfromNative __tiv(current_thread);
45 - __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
46 + VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
47 debug_only(VMNativeEntryWrapper __vew;)
49 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
50 --- openjdk.orig/hotspot/src/share/vm/runtime/interfaceSupport.hpp Tue Oct 25 04:07:20 2011 -0700
51 +++ openjdk/hotspot/src/share/vm/runtime/interfaceSupport.hpp Tue Oct 25 08:17:15 2011 -0700
52 @@ -72,9 +72,9 @@ class HandleMarkCleaner: public StackObj
56 -// InterfaceSupport provides functionality used by the __LEAF and __ENTRY
57 -// macros. These macros are used to guard entry points into the VM and
58 -// perform checks upon leave of the VM.
59 +// InterfaceSupport provides functionality used by the VM_LEAF_BASE and
60 +// VM_ENTRY_BASE macros. These macros are used to guard entry points into
61 +// the VM and perform checks upon leave of the VM.
64 class InterfaceSupport: AllStatic {
65 @@ -433,7 +433,7 @@ class RuntimeHistogramElement : public H
67 // LEAF routines do not lock, GC or throw exceptions
69 -#define __LEAF(result_type, header) \
70 +#define VM_LEAF_BASE(result_type, header) \
71 TRACE_CALL(result_type, header) \
72 debug_only(NoHandleMark __hm;) \
74 @@ -441,7 +441,7 @@ class RuntimeHistogramElement : public H
76 // ENTRY routines may lock, GC and throw exceptions
78 -#define __ENTRY(result_type, header, thread) \
79 +#define VM_ENTRY_BASE(result_type, header, thread) \
80 TRACE_CALL(result_type, header) \
81 HandleMarkCleaner __hm(thread); \
82 Thread* THREAD = thread; \
83 @@ -450,7 +450,7 @@ class RuntimeHistogramElement : public H
85 // QUICK_ENTRY routines behave like ENTRY but without a handle mark
87 -#define __QUICK_ENTRY(result_type, header, thread) \
88 +#define VM_QUICK_ENTRY_BASE(result_type, header, thread) \
89 TRACE_CALL(result_type, header) \
90 debug_only(NoHandleMark __hm;) \
91 Thread* THREAD = thread; \
92 @@ -463,20 +463,20 @@ class RuntimeHistogramElement : public H
93 #define IRT_ENTRY(result_type, header) \
94 result_type header { \
95 ThreadInVMfromJava __tiv(thread); \
96 - __ENTRY(result_type, header, thread) \
97 + VM_ENTRY_BASE(result_type, header, thread) \
98 debug_only(VMEntryWrapper __vew;)
101 #define IRT_LEAF(result_type, header) \
102 result_type header { \
103 - __LEAF(result_type, header) \
104 + VM_LEAF_BASE(result_type, header) \
105 debug_only(No_Safepoint_Verifier __nspv(true);)
108 #define IRT_ENTRY_NO_ASYNC(result_type, header) \
109 result_type header { \
110 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
111 - __ENTRY(result_type, header, thread) \
112 + VM_ENTRY_BASE(result_type, header, thread) \
113 debug_only(VMEntryWrapper __vew;)
115 // Another special case for nmethod_entry_point so the nmethod that the
116 @@ -487,7 +487,7 @@ class RuntimeHistogramElement : public H
117 result_type header { \
118 nmethodLocker _nmlock(nm); \
119 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
120 - __ENTRY(result_type, header, thread)
121 + VM_ENTRY_BASE(result_type, header, thread)
125 @@ -497,20 +497,20 @@ class RuntimeHistogramElement : public H
126 #define JRT_ENTRY(result_type, header) \
127 result_type header { \
128 ThreadInVMfromJava __tiv(thread); \
129 - __ENTRY(result_type, header, thread) \
130 + VM_ENTRY_BASE(result_type, header, thread) \
131 debug_only(VMEntryWrapper __vew;)
134 #define JRT_LEAF(result_type, header) \
135 result_type header { \
136 - __LEAF(result_type, header) \
137 + VM_LEAF_BASE(result_type, header) \
138 debug_only(JRT_Leaf_Verifier __jlv;)
141 #define JRT_ENTRY_NO_ASYNC(result_type, header) \
142 result_type header { \
143 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
144 - __ENTRY(result_type, header, thread) \
145 + VM_ENTRY_BASE(result_type, header, thread) \
146 debug_only(VMEntryWrapper __vew;)
148 // Same as JRT Entry but allows for return value after the safepoint
149 @@ -543,11 +543,11 @@ extern "C" {
150 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
151 ThreadInVMfromNative __tiv(thread); \
152 debug_only(VMNativeEntryWrapper __vew;) \
153 - __ENTRY(result_type, header, thread)
154 + VM_ENTRY_BASE(result_type, header, thread)
157 // Ensure that the VMNativeEntryWrapper constructor, which can cause
158 -// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY).
159 +// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE).
160 #define JNI_QUICK_ENTRY(result_type, header) \
162 result_type JNICALL header { \
163 @@ -555,7 +555,7 @@ extern "C" {
164 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
165 ThreadInVMfromNative __tiv(thread); \
166 debug_only(VMNativeEntryWrapper __vew;) \
167 - __QUICK_ENTRY(result_type, header, thread)
168 + VM_QUICK_ENTRY_BASE(result_type, header, thread)
171 #define JNI_LEAF(result_type, header) \
172 @@ -563,7 +563,7 @@ extern "C" {
173 result_type JNICALL header { \
174 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
175 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
176 - __LEAF(result_type, header)
177 + VM_LEAF_BASE(result_type, header)
180 // Close the routine and the extern "C"
181 @@ -579,7 +579,7 @@ extern "C" {
182 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
183 ThreadInVMfromNative __tiv(thread); \
184 debug_only(VMNativeEntryWrapper __vew;) \
185 - __ENTRY(result_type, header, thread)
186 + VM_ENTRY_BASE(result_type, header, thread)
189 #define JVM_ENTRY_NO_ENV(result_type, header) \
190 @@ -588,7 +588,7 @@ extern "C" {
191 JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); \
192 ThreadInVMfromNative __tiv(thread); \
193 debug_only(VMNativeEntryWrapper __vew;) \
194 - __ENTRY(result_type, header, thread)
195 + VM_ENTRY_BASE(result_type, header, thread)
198 #define JVM_QUICK_ENTRY(result_type, header) \
199 @@ -597,14 +597,14 @@ extern "C" {
200 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
201 ThreadInVMfromNative __tiv(thread); \
202 debug_only(VMNativeEntryWrapper __vew;) \
203 - __QUICK_ENTRY(result_type, header, thread)
204 + VM_QUICK_ENTRY_BASE(result_type, header, thread)
207 #define JVM_LEAF(result_type, header) \
209 result_type JNICALL header { \
210 VM_Exit::block_if_vm_exited(); \
211 - __LEAF(result_type, header)
212 + VM_LEAF_BASE(result_type, header)