[PATCH 4/4 v2] fix build errors with gcc6
Guido Trentalancia
guido at trentalancia.net
Thu May 12 00:56:45 UTC 2016
Hello David !
Thanks very much for your expert advice...
On Thu, 12/05/2016 at 08.47 +1000, David Holmes wrote:
> Hi Guido,
>
> I don't see how a backport of 8068975 can be considered "fixing
> build
> errors with gcc6". patches like that build on other changes that are
> in
> 9 but not in 8.
That's the reason of the runtime error !
> I would not expect that backport to be approved as it
> removes part of the Unsafe API.
Here is a revised, essential 4/4 patch that should work (no runtime
crash):
The following (RFC) patch aims to fix the following build error
with gcc6:
/home/guido/new/openjdk/mercurial-rep/jdk8u-build1/hotspot/src/share/vm/prims/unsafe.cpp:1378:17: error: unable to find string literal operator ‘operator""OBJ’ with ‘const char [40]’, ‘long unsigned int’ arguments
#define CLS LANG"Class;"
^
/home/guido/new/openjdk/mercurial-rep/jdk8u-build1/hotspot/src/share/vm/prims/unsafe.cpp:1696:48: note: in expansion of macro ‘CLS’
{CC"defineAnonymousClass", CC"("DAC_Args")"CLS, FN_PTR(Unsafe_DefineAnonymousClass)},
^~~
It should be a backport from openjdk9 of the following:
changeset: 8638:767f36deb0dc
parent: 8599:3ebc4f430a74
user: bpittore
date: Wed Jun 24 12:12:25 2015 -0400
summary: 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
Signed-off-by: Guido Trentalancia <guido at trentalancia.net>
---
hotspot/src/share/vm/prims/unsafe.cpp | 350 +++++++++++++++++-----------------
1 file changed, 175 insertions(+), 175 deletions(-)
--- jdk8u-build1/hotspot/src/share/vm/prims/unsafe.cpp.orig 2016-05-11 00:11:14.578791627 +0200
+++ jdk8u-build1/hotspot/src/share/vm/prims/unsafe.cpp 2016-05-11 14:28:02.122385186 +0200
@@ -1009,7 +1009,7 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass0
UNSAFE_END
-#define DAC_Args CLS"[B["OBJ
+#define DAC_Args CLS "[B[" OBJ
// define a class but do not make it known to the class loader or system dictionary
// - host_class: supplies context for linkage, access control, protection domain, and class loader
// - data: bytes of a class file, a raw memory address (length gives the number of bytes)
@@ -1374,47 +1374,47 @@ UNSAFE_END
#define LANG "Ljava/lang/"
-#define OBJ LANG"Object;"
-#define CLS LANG"Class;"
-#define CTR LANG"reflect/Constructor;"
-#define FLD LANG"reflect/Field;"
-#define MTH LANG"reflect/Method;"
-#define THR LANG"Throwable;"
+#define OBJ LANG "Object;"
+#define CLS LANG "Class;"
+#define CTR LANG "reflect/Constructor;"
+#define FLD LANG "reflect/Field;"
+#define MTH LANG "reflect/Method;"
+#define THR LANG "Throwable;"
-#define DC0_Args LANG"String;[BII"
-#define DC_Args DC0_Args LANG"ClassLoader;" "Ljava/security/ProtectionDomain;"
+#define DC0_Args LANG "String;[BII"
+#define DC_Args LANG "String;[BII" LANG "ClassLoader;" "Ljava/security/ProtectionDomain;"
#define CC (char*) /*cast a literal from (const char*)*/
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f)
// define deprecated accessors for compabitility with 1.4.0
#define DECLARE_GETSETOOP_140(Boolean, Z) \
- {CC"get"#Boolean, CC"("OBJ"I)"#Z, FN_PTR(Unsafe_Get##Boolean##140)}, \
- {CC"put"#Boolean, CC"("OBJ"I"#Z")V", FN_PTR(Unsafe_Set##Boolean##140)}
+ {CC "get" #Boolean, CC "(" OBJ "I)" #Z, FN_PTR(Unsafe_Get##Boolean##140)}, \
+ {CC "put" #Boolean, CC "(" OBJ "I" #Z ")V", FN_PTR(Unsafe_Set##Boolean##140)}
// Note: In 1.4.1, getObject and kin take both int and long offsets.
#define DECLARE_GETSETOOP_141(Boolean, Z) \
- {CC"get"#Boolean, CC"("OBJ"J)"#Z, FN_PTR(Unsafe_Get##Boolean)}, \
- {CC"put"#Boolean, CC"("OBJ"J"#Z")V", FN_PTR(Unsafe_Set##Boolean)}
+ {CC "get" #Boolean, CC "(" OBJ "J)" #Z, FN_PTR(Unsafe_Get##Boolean)}, \
+ {CC "put" #Boolean, CC "(" OBJ "J" #Z ")V", FN_PTR(Unsafe_Set##Boolean)}
// Note: In 1.5.0, there are volatile versions too
#define DECLARE_GETSETOOP(Boolean, Z) \
- {CC"get"#Boolean, CC"("OBJ"J)"#Z, FN_PTR(Unsafe_Get##Boolean)}, \
- {CC"put"#Boolean, CC"("OBJ"J"#Z")V", FN_PTR(Unsafe_Set##Boolean)}, \
- {CC"get"#Boolean"Volatile", CC"("OBJ"J)"#Z, FN_PTR(Unsafe_Get##Boolean##Volatile)}, \
- {CC"put"#Boolean"Volatile", CC"("OBJ"J"#Z")V", FN_PTR(Unsafe_Set##Boolean##Volatile)}
+ {CC "get" #Boolean, CC "(" OBJ "J)" #Z, FN_PTR(Unsafe_Get##Boolean)}, \
+ {CC "put" #Boolean, CC "(" OBJ "J" #Z ")V", FN_PTR(Unsafe_Set##Boolean)}, \
+ {CC "get" #Boolean"Volatile", CC "(" OBJ "J)" #Z, FN_PTR(Unsafe_Get##Boolean##Volatile)}, \
+ {CC "put" #Boolean"Volatile", CC "(" OBJ "J" #Z ")V", FN_PTR(Unsafe_Set##Boolean##Volatile)}
#define DECLARE_GETSETNATIVE(Byte, B) \
- {CC"get"#Byte, CC"("ADR")"#B, FN_PTR(Unsafe_GetNative##Byte)}, \
- {CC"put"#Byte, CC"("ADR#B")V", FN_PTR(Unsafe_SetNative##Byte)}
+ {CC "get" #Byte, CC "(" ADR ")" #B, FN_PTR(Unsafe_GetNative##Byte)}, \
+ {CC "put" #Byte, CC "(" ADR#B ")V", FN_PTR(Unsafe_SetNative##Byte)}
// These are the methods for 1.4.0
static JNINativeMethod methods_140[] = {
- {CC"getObject", CC"("OBJ"I)"OBJ"", FN_PTR(Unsafe_GetObject140)},
- {CC"putObject", CC"("OBJ"I"OBJ")V", FN_PTR(Unsafe_SetObject140)},
+ {CC "getObject", CC "(" OBJ "I)" OBJ "", FN_PTR(Unsafe_GetObject140)},
+ {CC "putObject", CC "(" OBJ "I" OBJ ")V", FN_PTR(Unsafe_SetObject140)},
DECLARE_GETSETOOP_140(Boolean, Z),
DECLARE_GETSETOOP_140(Byte, B),
@@ -1433,33 +1433,33 @@ static JNINativeMethod methods_140[] = {
DECLARE_GETSETNATIVE(Float, F),
DECLARE_GETSETNATIVE(Double, D),
- {CC"getAddress", CC"("ADR")"ADR, FN_PTR(Unsafe_GetNativeAddress)},
- {CC"putAddress", CC"("ADR""ADR")V", FN_PTR(Unsafe_SetNativeAddress)},
+ {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)},
+ {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)},
- {CC"allocateMemory", CC"(J)"ADR, FN_PTR(Unsafe_AllocateMemory)},
- {CC"reallocateMemory", CC"("ADR"J)"ADR, FN_PTR(Unsafe_ReallocateMemory)},
- {CC"freeMemory", CC"("ADR")V", FN_PTR(Unsafe_FreeMemory)},
-
- {CC"fieldOffset", CC"("FLD")I", FN_PTR(Unsafe_FieldOffset)},
- {CC"staticFieldBase", CC"("CLS")"OBJ, FN_PTR(Unsafe_StaticFieldBaseFromClass)},
- {CC"ensureClassInitialized",CC"("CLS")V", FN_PTR(Unsafe_EnsureClassInitialized)},
- {CC"arrayBaseOffset", CC"("CLS")I", FN_PTR(Unsafe_ArrayBaseOffset)},
- {CC"arrayIndexScale", CC"("CLS")I", FN_PTR(Unsafe_ArrayIndexScale)},
- {CC"addressSize", CC"()I", FN_PTR(Unsafe_AddressSize)},
- {CC"pageSize", CC"()I", FN_PTR(Unsafe_PageSize)},
-
- {CC"defineClass", CC"("DC0_Args")"CLS, FN_PTR(Unsafe_DefineClass0)},
- {CC"defineClass", CC"("DC_Args")"CLS, FN_PTR(Unsafe_DefineClass)},
- {CC"allocateInstance", CC"("CLS")"OBJ, FN_PTR(Unsafe_AllocateInstance)},
- {CC"monitorEnter", CC"("OBJ")V", FN_PTR(Unsafe_MonitorEnter)},
- {CC"monitorExit", CC"("OBJ")V", FN_PTR(Unsafe_MonitorExit)},
- {CC"throwException", CC"("THR")V", FN_PTR(Unsafe_ThrowException)}
+ {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)},
+ {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)},
+ {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)},
+
+ {CC "fieldOffset", CC "(" FLD ")I", FN_PTR(Unsafe_FieldOffset)},
+ {CC "staticFieldBase", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromClass)},
+ {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)},
+ {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)},
+ {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)},
+ {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)},
+ {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)},
+
+ {CC "defineClass", CC "(" DC0_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)},
+ {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)},
+ {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)},
+ {CC "monitorEnter", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorEnter)},
+ {CC "monitorExit", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorExit)},
+ {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}
};
// These are the methods prior to the JSR 166 changes in 1.5.0
static JNINativeMethod methods_141[] = {
- {CC"getObject", CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObject)},
- {CC"putObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObject)},
+ {CC "getObject", CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObject)},
+ {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)},
DECLARE_GETSETOOP_141(Boolean, Z),
DECLARE_GETSETOOP_141(Byte, B),
@@ -1478,37 +1478,37 @@ static JNINativeMethod methods_141[] = {
DECLARE_GETSETNATIVE(Float, F),
DECLARE_GETSETNATIVE(Double, D),
- {CC"getAddress", CC"("ADR")"ADR, FN_PTR(Unsafe_GetNativeAddress)},
- {CC"putAddress", CC"("ADR""ADR")V", FN_PTR(Unsafe_SetNativeAddress)},
+ {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)},
+ {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)},
- {CC"allocateMemory", CC"(J)"ADR, FN_PTR(Unsafe_AllocateMemory)},
- {CC"reallocateMemory", CC"("ADR"J)"ADR, FN_PTR(Unsafe_ReallocateMemory)},
- {CC"freeMemory", CC"("ADR")V", FN_PTR(Unsafe_FreeMemory)},
-
- {CC"objectFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_ObjectFieldOffset)},
- {CC"staticFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_StaticFieldOffset)},
- {CC"staticFieldBase", CC"("FLD")"OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
- {CC"ensureClassInitialized",CC"("CLS")V", FN_PTR(Unsafe_EnsureClassInitialized)},
- {CC"arrayBaseOffset", CC"("CLS")I", FN_PTR(Unsafe_ArrayBaseOffset)},
- {CC"arrayIndexScale", CC"("CLS")I", FN_PTR(Unsafe_ArrayIndexScale)},
- {CC"addressSize", CC"()I", FN_PTR(Unsafe_AddressSize)},
- {CC"pageSize", CC"()I", FN_PTR(Unsafe_PageSize)},
-
- {CC"defineClass", CC"("DC0_Args")"CLS, FN_PTR(Unsafe_DefineClass0)},
- {CC"defineClass", CC"("DC_Args")"CLS, FN_PTR(Unsafe_DefineClass)},
- {CC"allocateInstance", CC"("CLS")"OBJ, FN_PTR(Unsafe_AllocateInstance)},
- {CC"monitorEnter", CC"("OBJ")V", FN_PTR(Unsafe_MonitorEnter)},
- {CC"monitorExit", CC"("OBJ")V", FN_PTR(Unsafe_MonitorExit)},
- {CC"throwException", CC"("THR")V", FN_PTR(Unsafe_ThrowException)}
+ {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)},
+ {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)},
+ {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)},
+
+ {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)},
+ {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)},
+ {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
+ {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)},
+ {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)},
+ {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)},
+ {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)},
+ {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)},
+
+ {CC "defineClass", CC "(" DC0_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)},
+ {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)},
+ {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)},
+ {CC "monitorEnter", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorEnter)},
+ {CC "monitorExit", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorExit)},
+ {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}
};
// These are the methods prior to the JSR 166 changes in 1.6.0
static JNINativeMethod methods_15[] = {
- {CC"getObject", CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObject)},
- {CC"putObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObject)},
- {CC"getObjectVolatile",CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
- {CC"putObjectVolatile",CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObjectVolatile)},
+ {CC "getObject", CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObject)},
+ {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)},
+ {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
+ {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObjectVolatile)},
DECLARE_GETSETOOP(Boolean, Z),
@@ -1528,42 +1528,42 @@ static JNINativeMethod methods_15[] = {
DECLARE_GETSETNATIVE(Float, F),
DECLARE_GETSETNATIVE(Double, D),
- {CC"getAddress", CC"("ADR")"ADR, FN_PTR(Unsafe_GetNativeAddress)},
- {CC"putAddress", CC"("ADR""ADR")V", FN_PTR(Unsafe_SetNativeAddress)},
+ {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)},
+ {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)},
- {CC"allocateMemory", CC"(J)"ADR, FN_PTR(Unsafe_AllocateMemory)},
- {CC"reallocateMemory", CC"("ADR"J)"ADR, FN_PTR(Unsafe_ReallocateMemory)},
- {CC"freeMemory", CC"("ADR")V", FN_PTR(Unsafe_FreeMemory)},
-
- {CC"objectFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_ObjectFieldOffset)},
- {CC"staticFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_StaticFieldOffset)},
- {CC"staticFieldBase", CC"("FLD")"OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
- {CC"ensureClassInitialized",CC"("CLS")V", FN_PTR(Unsafe_EnsureClassInitialized)},
- {CC"arrayBaseOffset", CC"("CLS")I", FN_PTR(Unsafe_ArrayBaseOffset)},
- {CC"arrayIndexScale", CC"("CLS")I", FN_PTR(Unsafe_ArrayIndexScale)},
- {CC"addressSize", CC"()I", FN_PTR(Unsafe_AddressSize)},
- {CC"pageSize", CC"()I", FN_PTR(Unsafe_PageSize)},
-
- {CC"defineClass", CC"("DC0_Args")"CLS, FN_PTR(Unsafe_DefineClass0)},
- {CC"defineClass", CC"("DC_Args")"CLS, FN_PTR(Unsafe_DefineClass)},
- {CC"allocateInstance", CC"("CLS")"OBJ, FN_PTR(Unsafe_AllocateInstance)},
- {CC"monitorEnter", CC"("OBJ")V", FN_PTR(Unsafe_MonitorEnter)},
- {CC"monitorExit", CC"("OBJ")V", FN_PTR(Unsafe_MonitorExit)},
- {CC"throwException", CC"("THR")V", FN_PTR(Unsafe_ThrowException)},
- {CC"compareAndSwapObject", CC"("OBJ"J"OBJ""OBJ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
- {CC"compareAndSwapInt", CC"("OBJ"J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
- {CC"compareAndSwapLong", CC"("OBJ"J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
- {CC"park", CC"(ZJ)V", FN_PTR(Unsafe_Park)},
- {CC"unpark", CC"("OBJ")V", FN_PTR(Unsafe_Unpark)}
+ {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)},
+ {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)},
+ {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)},
+
+ {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)},
+ {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)},
+ {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
+ {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)},
+ {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)},
+ {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)},
+ {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)},
+ {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)},
+
+ {CC "defineClass", CC "(" DC0_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)},
+ {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)},
+ {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)},
+ {CC "monitorEnter", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorEnter)},
+ {CC "monitorExit", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorExit)},
+ {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)},
+ {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
+ {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
+ {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
+ {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)},
+ {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}
};
// These are the methods for 1.6.0 and 1.7.0
static JNINativeMethod methods_16[] = {
- {CC"getObject", CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObject)},
- {CC"putObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObject)},
- {CC"getObjectVolatile",CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
- {CC"putObjectVolatile",CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObjectVolatile)},
+ {CC "getObject", CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObject)},
+ {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)},
+ {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
+ {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObjectVolatile)},
DECLARE_GETSETOOP(Boolean, Z),
DECLARE_GETSETOOP(Byte, B),
@@ -1582,45 +1582,45 @@ static JNINativeMethod methods_16[] = {
DECLARE_GETSETNATIVE(Float, F),
DECLARE_GETSETNATIVE(Double, D),
- {CC"getAddress", CC"("ADR")"ADR, FN_PTR(Unsafe_GetNativeAddress)},
- {CC"putAddress", CC"("ADR""ADR")V", FN_PTR(Unsafe_SetNativeAddress)},
+ {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)},
+ {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)},
- {CC"allocateMemory", CC"(J)"ADR, FN_PTR(Unsafe_AllocateMemory)},
- {CC"reallocateMemory", CC"("ADR"J)"ADR, FN_PTR(Unsafe_ReallocateMemory)},
- {CC"freeMemory", CC"("ADR")V", FN_PTR(Unsafe_FreeMemory)},
-
- {CC"objectFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_ObjectFieldOffset)},
- {CC"staticFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_StaticFieldOffset)},
- {CC"staticFieldBase", CC"("FLD")"OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
- {CC"ensureClassInitialized",CC"("CLS")V", FN_PTR(Unsafe_EnsureClassInitialized)},
- {CC"arrayBaseOffset", CC"("CLS")I", FN_PTR(Unsafe_ArrayBaseOffset)},
- {CC"arrayIndexScale", CC"("CLS")I", FN_PTR(Unsafe_ArrayIndexScale)},
- {CC"addressSize", CC"()I", FN_PTR(Unsafe_AddressSize)},
- {CC"pageSize", CC"()I", FN_PTR(Unsafe_PageSize)},
-
- {CC"defineClass", CC"("DC0_Args")"CLS, FN_PTR(Unsafe_DefineClass0)},
- {CC"defineClass", CC"("DC_Args")"CLS, FN_PTR(Unsafe_DefineClass)},
- {CC"allocateInstance", CC"("CLS")"OBJ, FN_PTR(Unsafe_AllocateInstance)},
- {CC"monitorEnter", CC"("OBJ")V", FN_PTR(Unsafe_MonitorEnter)},
- {CC"monitorExit", CC"("OBJ")V", FN_PTR(Unsafe_MonitorExit)},
- {CC"tryMonitorEnter", CC"("OBJ")Z", FN_PTR(Unsafe_TryMonitorEnter)},
- {CC"throwException", CC"("THR")V", FN_PTR(Unsafe_ThrowException)},
- {CC"compareAndSwapObject", CC"("OBJ"J"OBJ""OBJ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
- {CC"compareAndSwapInt", CC"("OBJ"J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
- {CC"compareAndSwapLong", CC"("OBJ"J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
- {CC"putOrderedObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetOrderedObject)},
- {CC"putOrderedInt", CC"("OBJ"JI)V", FN_PTR(Unsafe_SetOrderedInt)},
- {CC"putOrderedLong", CC"("OBJ"JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
- {CC"park", CC"(ZJ)V", FN_PTR(Unsafe_Park)},
- {CC"unpark", CC"("OBJ")V", FN_PTR(Unsafe_Unpark)}
+ {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)},
+ {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)},
+ {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)},
+
+ {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)},
+ {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)},
+ {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
+ {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)},
+ {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)},
+ {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)},
+ {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)},
+ {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)},
+
+ {CC "defineClass", CC "(" DC0_Args ")" CLS, FN_PTR(Unsafe_DefineClass0)},
+ {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)},
+ {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)},
+ {CC "monitorEnter", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorEnter)},
+ {CC "monitorExit", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorExit)},
+ {CC "tryMonitorEnter", CC "(" OBJ ")Z", FN_PTR(Unsafe_TryMonitorEnter)},
+ {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)},
+ {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
+ {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
+ {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
+ {CC "putOrderedObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetOrderedObject)},
+ {CC "putOrderedInt", CC "(" OBJ "JI)V", FN_PTR(Unsafe_SetOrderedInt)},
+ {CC "putOrderedLong", CC "(" OBJ "JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
+ {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)},
+ {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}
};
// These are the methods for 1.8.0
static JNINativeMethod methods_18[] = {
- {CC"getObject", CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObject)},
- {CC"putObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObject)},
- {CC"getObjectVolatile",CC"("OBJ"J)"OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
- {CC"putObjectVolatile",CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetObjectVolatile)},
+ {CC "getObject", CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObject)},
+ {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)},
+ {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ"", FN_PTR(Unsafe_GetObjectVolatile)},
+ {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObjectVolatile)},
DECLARE_GETSETOOP(Boolean, Z),
DECLARE_GETSETOOP(Byte, B),
@@ -1639,71 +1639,71 @@ static JNINativeMethod methods_18[] = {
DECLARE_GETSETNATIVE(Float, F),
DECLARE_GETSETNATIVE(Double, D),
- {CC"getAddress", CC"("ADR")"ADR, FN_PTR(Unsafe_GetNativeAddress)},
- {CC"putAddress", CC"("ADR""ADR")V", FN_PTR(Unsafe_SetNativeAddress)},
+ {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)},
+ {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)},
- {CC"allocateMemory", CC"(J)"ADR, FN_PTR(Unsafe_AllocateMemory)},
- {CC"reallocateMemory", CC"("ADR"J)"ADR, FN_PTR(Unsafe_ReallocateMemory)},
- {CC"freeMemory", CC"("ADR")V", FN_PTR(Unsafe_FreeMemory)},
-
- {CC"objectFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_ObjectFieldOffset)},
- {CC"staticFieldOffset", CC"("FLD")J", FN_PTR(Unsafe_StaticFieldOffset)},
- {CC"staticFieldBase", CC"("FLD")"OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
- {CC"ensureClassInitialized",CC"("CLS")V", FN_PTR(Unsafe_EnsureClassInitialized)},
- {CC"arrayBaseOffset", CC"("CLS")I", FN_PTR(Unsafe_ArrayBaseOffset)},
- {CC"arrayIndexScale", CC"("CLS")I", FN_PTR(Unsafe_ArrayIndexScale)},
- {CC"addressSize", CC"()I", FN_PTR(Unsafe_AddressSize)},
- {CC"pageSize", CC"()I", FN_PTR(Unsafe_PageSize)},
-
- {CC"defineClass", CC"("DC_Args")"CLS, FN_PTR(Unsafe_DefineClass)},
- {CC"allocateInstance", CC"("CLS")"OBJ, FN_PTR(Unsafe_AllocateInstance)},
- {CC"monitorEnter", CC"("OBJ")V", FN_PTR(Unsafe_MonitorEnter)},
- {CC"monitorExit", CC"("OBJ")V", FN_PTR(Unsafe_MonitorExit)},
- {CC"tryMonitorEnter", CC"("OBJ")Z", FN_PTR(Unsafe_TryMonitorEnter)},
- {CC"throwException", CC"("THR")V", FN_PTR(Unsafe_ThrowException)},
- {CC"compareAndSwapObject", CC"("OBJ"J"OBJ""OBJ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
- {CC"compareAndSwapInt", CC"("OBJ"J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
- {CC"compareAndSwapLong", CC"("OBJ"J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
- {CC"putOrderedObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetOrderedObject)},
- {CC"putOrderedInt", CC"("OBJ"JI)V", FN_PTR(Unsafe_SetOrderedInt)},
- {CC"putOrderedLong", CC"("OBJ"JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
- {CC"park", CC"(ZJ)V", FN_PTR(Unsafe_Park)},
- {CC"unpark", CC"("OBJ")V", FN_PTR(Unsafe_Unpark)}
+ {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)},
+ {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)},
+ {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)},
+
+ {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)},
+ {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)},
+ {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)},
+ {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)},
+ {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)},
+ {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)},
+ {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)},
+ {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)},
+
+ {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)},
+ {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)},
+ {CC "monitorEnter", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorEnter)},
+ {CC "monitorExit", CC "(" OBJ ")V", FN_PTR(Unsafe_MonitorExit)},
+ {CC "tryMonitorEnter", CC "(" OBJ ")Z", FN_PTR(Unsafe_TryMonitorEnter)},
+ {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)},
+ {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)},
+ {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)},
+ {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)},
+ {CC "putOrderedObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetOrderedObject)},
+ {CC "putOrderedInt", CC "(" OBJ "JI)V", FN_PTR(Unsafe_SetOrderedInt)},
+ {CC "putOrderedLong", CC "(" OBJ "JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
+ {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)},
+ {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}
};
JNINativeMethod loadavg_method[] = {
- {CC"getLoadAverage", CC"([DI)I", FN_PTR(Unsafe_Loadavg)}
+ {CC "getLoadAverage", CC "([DI)I", FN_PTR(Unsafe_Loadavg)}
};
JNINativeMethod prefetch_methods[] = {
- {CC"prefetchRead", CC"("OBJ"J)V", FN_PTR(Unsafe_PrefetchRead)},
- {CC"prefetchWrite", CC"("OBJ"J)V", FN_PTR(Unsafe_PrefetchWrite)},
- {CC"prefetchReadStatic", CC"("OBJ"J)V", FN_PTR(Unsafe_PrefetchRead)},
- {CC"prefetchWriteStatic",CC"("OBJ"J)V", FN_PTR(Unsafe_PrefetchWrite)}
+ {CC "prefetchRead", CC "(" OBJ "J)V", FN_PTR(Unsafe_PrefetchRead)},
+ {CC "prefetchWrite", CC "(" OBJ "J)V", FN_PTR(Unsafe_PrefetchWrite)},
+ {CC "prefetchReadStatic", CC "(" OBJ "J)V", FN_PTR(Unsafe_PrefetchRead)},
+ {CC "prefetchWriteStatic",CC "(" OBJ "J)V", FN_PTR(Unsafe_PrefetchWrite)}
};
JNINativeMethod memcopy_methods_17[] = {
- {CC"copyMemory", CC"("OBJ"J"OBJ"JJ)V", FN_PTR(Unsafe_CopyMemory2)},
- {CC"setMemory", CC"("OBJ"JJB)V", FN_PTR(Unsafe_SetMemory2)}
+ {CC "copyMemory", CC "(" OBJ "J" OBJ "JJ)V", FN_PTR(Unsafe_CopyMemory2)},
+ {CC "setMemory", CC "(" OBJ "JJB)V", FN_PTR(Unsafe_SetMemory2)}
};
JNINativeMethod memcopy_methods_15[] = {
- {CC"setMemory", CC"("ADR"JB)V", FN_PTR(Unsafe_SetMemory)},
- {CC"copyMemory", CC"("ADR ADR"J)V", FN_PTR(Unsafe_CopyMemory)}
+ {CC "setMemory", CC "(" ADR "JB)V", FN_PTR(Unsafe_SetMemory)},
+ {CC "copyMemory", CC "(" ADR ADR "J)V", FN_PTR(Unsafe_CopyMemory)}
};
JNINativeMethod anonk_methods[] = {
- {CC"defineAnonymousClass", CC"("DAC_Args")"CLS, FN_PTR(Unsafe_DefineAnonymousClass)},
+ {CC "defineAnonymousClass", CC "(" DAC_Args ")" CLS, FN_PTR(Unsafe_DefineAnonymousClass)},
};
JNINativeMethod lform_methods[] = {
- {CC"shouldBeInitialized",CC"("CLS")Z", FN_PTR(Unsafe_ShouldBeInitialized)},
+ {CC "shouldBeInitialized", CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized)},
};
JNINativeMethod fence_methods[] = {
- {CC"loadFence", CC"()V", FN_PTR(Unsafe_LoadFence)},
- {CC"storeFence", CC"()V", FN_PTR(Unsafe_StoreFence)},
- {CC"fullFence", CC"()V", FN_PTR(Unsafe_FullFence)},
+ {CC "loadFence", CC "()V", FN_PTR(Unsafe_LoadFence)},
+ {CC "storeFence", CC "()V", FN_PTR(Unsafe_StoreFence)},
+ {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)},
};
#undef CC
More information about the jdk8u-dev
mailing list