changeset 52287:7530494ed51d

Merge
author jdv
date Tue, 23 Oct 2018 15:29:10 +0530
parents 297450fcab26 b4b932c6001f
children 0f81b26228ec
files test/jdk/ProblemList.txt
diffstat 239 files changed, 4949 insertions(+), 2023 deletions(-) [+]
line wrap: on
line diff
--- a/make/Docs.gmk	Tue Oct 16 23:21:05 2018 +0530
+++ b/make/Docs.gmk	Tue Oct 23 15:29:10 2018 +0530
@@ -228,7 +228,7 @@
       <blockquote><dl> \
       #
     $1_OVERVIEW_TEXT += $$(foreach g, $$($1_GROUPS), \
-        <dt style="margin-top: 8px;"><a href="\#$$g">$$($$g_GROUP_NAME)</a></dt> \
+        <dt style="margin-top: 8px;">$$($$g_GROUP_NAME)</dt> \
         <dd style="margin-top: 8px;">$$($$g_GROUP_DESCRIPTION)</dd> \
     )
     $1_OVERVIEW_TEXT += \
--- a/make/gensrc/GensrcVarHandles.gmk	Tue Oct 16 23:21:05 2018 +0530
+++ b/make/gensrc/GensrcVarHandles.gmk	Tue Oct 23 15:29:10 2018 +0530
@@ -53,8 +53,8 @@
   endif
 
   $$($1_FILENAME): $(VARHANDLES_SRC_DIR)/X-VarHandle.java.template $(BUILD_TOOLS_JDK)
-        ifeq ($$($1_Type), Object)
-	  $$(eval $1_type := $$($1_Type))
+        ifeq ($$($1_Type), Reference)
+	  $$(eval $1_type := Object)
         else
 	  $$(eval $1_type := $$$$(shell $(TR) '[:upper:]' '[:lower:]' <<< $$$$($1_Type)))
         endif
@@ -158,7 +158,7 @@
 ################################################################################
 
 # List the types to generate source for, with capitalized first letter
-VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Object
+VARHANDLES_TYPES := Boolean Byte Short Char Int Long Float Double Reference
 $(foreach t, $(VARHANDLES_TYPES), \
   $(eval $(call GenerateVarHandle,VAR_HANDLE_$t,$t)))
 
--- a/src/hotspot/share/c1/c1_Compiler.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/c1/c1_Compiler.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -126,7 +126,7 @@
   case vmIntrinsics::_getAndSetLong:
     if (!VM_Version::supports_atomic_getset8()) return false;
     break;
-  case vmIntrinsics::_getAndSetObject:
+  case vmIntrinsics::_getAndSetReference:
 #ifdef _LP64
     if (!UseCompressedOops && !VM_Version::supports_atomic_getset8()) return false;
     if (UseCompressedOops && !VM_Version::supports_atomic_getset4()) return false;
@@ -167,7 +167,7 @@
   case vmIntrinsics::_dpow:
   case vmIntrinsics::_fmaD:
   case vmIntrinsics::_fmaF:
-  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getReference:
   case vmIntrinsics::_getBoolean:
   case vmIntrinsics::_getByte:
   case vmIntrinsics::_getShort:
@@ -176,7 +176,7 @@
   case vmIntrinsics::_getLong:
   case vmIntrinsics::_getFloat:
   case vmIntrinsics::_getDouble:
-  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putReference:
   case vmIntrinsics::_putBoolean:
   case vmIntrinsics::_putByte:
   case vmIntrinsics::_putShort:
@@ -185,7 +185,7 @@
   case vmIntrinsics::_putLong:
   case vmIntrinsics::_putFloat:
   case vmIntrinsics::_putDouble:
-  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getReferenceVolatile:
   case vmIntrinsics::_getBooleanVolatile:
   case vmIntrinsics::_getByteVolatile:
   case vmIntrinsics::_getShortVolatile:
@@ -194,7 +194,7 @@
   case vmIntrinsics::_getLongVolatile:
   case vmIntrinsics::_getFloatVolatile:
   case vmIntrinsics::_getDoubleVolatile:
-  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putReferenceVolatile:
   case vmIntrinsics::_putBooleanVolatile:
   case vmIntrinsics::_putByteVolatile:
   case vmIntrinsics::_putShortVolatile:
@@ -221,7 +221,7 @@
 #endif
   case vmIntrinsics::_vectorizedMismatch:
   case vmIntrinsics::_compareAndSetInt:
-  case vmIntrinsics::_compareAndSetObject:
+  case vmIntrinsics::_compareAndSetReference:
   case vmIntrinsics::_getCharStringU:
   case vmIntrinsics::_putCharStringU:
 #ifdef JFR_HAVE_INTRINSICS
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -3471,7 +3471,7 @@
 
   // Some intrinsics need special IR nodes.
   switch(id) {
-  case vmIntrinsics::_getObject          : append_unsafe_get_obj(callee, T_OBJECT,  false); return;
+  case vmIntrinsics::_getReference       : append_unsafe_get_obj(callee, T_OBJECT,  false); return;
   case vmIntrinsics::_getBoolean         : append_unsafe_get_obj(callee, T_BOOLEAN, false); return;
   case vmIntrinsics::_getByte            : append_unsafe_get_obj(callee, T_BYTE,    false); return;
   case vmIntrinsics::_getShort           : append_unsafe_get_obj(callee, T_SHORT,   false); return;
@@ -3480,7 +3480,7 @@
   case vmIntrinsics::_getLong            : append_unsafe_get_obj(callee, T_LONG,    false); return;
   case vmIntrinsics::_getFloat           : append_unsafe_get_obj(callee, T_FLOAT,   false); return;
   case vmIntrinsics::_getDouble          : append_unsafe_get_obj(callee, T_DOUBLE,  false); return;
-  case vmIntrinsics::_putObject          : append_unsafe_put_obj(callee, T_OBJECT,  false); return;
+  case vmIntrinsics::_putReference       : append_unsafe_put_obj(callee, T_OBJECT,  false); return;
   case vmIntrinsics::_putBoolean         : append_unsafe_put_obj(callee, T_BOOLEAN, false); return;
   case vmIntrinsics::_putByte            : append_unsafe_put_obj(callee, T_BYTE,    false); return;
   case vmIntrinsics::_putShort           : append_unsafe_put_obj(callee, T_SHORT,   false); return;
@@ -3497,7 +3497,7 @@
   case vmIntrinsics::_putCharUnaligned   : append_unsafe_put_obj(callee, T_CHAR,    false); return;
   case vmIntrinsics::_putIntUnaligned    : append_unsafe_put_obj(callee, T_INT,     false); return;
   case vmIntrinsics::_putLongUnaligned   : append_unsafe_put_obj(callee, T_LONG,    false); return;
-  case vmIntrinsics::_getObjectVolatile  : append_unsafe_get_obj(callee, T_OBJECT,  true); return;
+  case vmIntrinsics::_getReferenceVolatile  : append_unsafe_get_obj(callee, T_OBJECT,  true); return;
   case vmIntrinsics::_getBooleanVolatile : append_unsafe_get_obj(callee, T_BOOLEAN, true); return;
   case vmIntrinsics::_getByteVolatile    : append_unsafe_get_obj(callee, T_BYTE,    true); return;
   case vmIntrinsics::_getShortVolatile   : append_unsafe_get_obj(callee, T_SHORT,   true); return;
@@ -3506,7 +3506,7 @@
   case vmIntrinsics::_getLongVolatile    : append_unsafe_get_obj(callee, T_LONG,    true); return;
   case vmIntrinsics::_getFloatVolatile   : append_unsafe_get_obj(callee, T_FLOAT,   true); return;
   case vmIntrinsics::_getDoubleVolatile  : append_unsafe_get_obj(callee, T_DOUBLE,  true); return;
-  case vmIntrinsics::_putObjectVolatile  : append_unsafe_put_obj(callee, T_OBJECT,  true); return;
+  case vmIntrinsics::_putReferenceVolatile : append_unsafe_put_obj(callee, T_OBJECT,  true); return;
   case vmIntrinsics::_putBooleanVolatile : append_unsafe_put_obj(callee, T_BOOLEAN, true); return;
   case vmIntrinsics::_putByteVolatile    : append_unsafe_put_obj(callee, T_BYTE,    true); return;
   case vmIntrinsics::_putShortVolatile   : append_unsafe_put_obj(callee, T_SHORT,   true); return;
@@ -3517,12 +3517,12 @@
   case vmIntrinsics::_putDoubleVolatile  : append_unsafe_put_obj(callee, T_DOUBLE,  true); return;
   case vmIntrinsics::_compareAndSetLong:
   case vmIntrinsics::_compareAndSetInt:
-  case vmIntrinsics::_compareAndSetObject: append_unsafe_CAS(callee); return;
+  case vmIntrinsics::_compareAndSetReference : append_unsafe_CAS(callee); return;
   case vmIntrinsics::_getAndAddInt:
   case vmIntrinsics::_getAndAddLong      : append_unsafe_get_and_set_obj(callee, true); return;
   case vmIntrinsics::_getAndSetInt       :
   case vmIntrinsics::_getAndSetLong      :
-  case vmIntrinsics::_getAndSetObject    : append_unsafe_get_and_set_obj(callee, false); return;
+  case vmIntrinsics::_getAndSetReference : append_unsafe_get_and_set_obj(callee, false); return;
   case vmIntrinsics::_getCharStringU     : append_char_access(callee, false); return;
   case vmIntrinsics::_putCharStringU     : append_char_access(callee, true); return;
   default:
--- a/src/hotspot/share/c1/c1_LIRGenerator.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -3057,7 +3057,7 @@
   // java.nio.Buffer.checkIndex
   case vmIntrinsics::_checkIndex:     do_NIOCheckIndex(x); break;
 
-  case vmIntrinsics::_compareAndSetObject:
+  case vmIntrinsics::_compareAndSetReference:
     do_CompareAndSwap(x, objectType);
     break;
   case vmIntrinsics::_compareAndSetInt:
--- a/src/hotspot/share/classfile/vmSymbols.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/classfile/vmSymbols.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -527,7 +527,7 @@
     case vmIntrinsics::_getAndAddLong:
     case vmIntrinsics::_getAndSetInt:
     case vmIntrinsics::_getAndSetLong:
-    case vmIntrinsics::_getAndSetObject:
+    case vmIntrinsics::_getAndSetReference:
     case vmIntrinsics::_loadFence:
     case vmIntrinsics::_storeFence:
     case vmIntrinsics::_fullFence:
@@ -589,7 +589,7 @@
   case vmIntrinsics::_updateByteBufferCRC32:
     if (!UseCRC32Intrinsics) return true;
     break;
-  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getReference:
   case vmIntrinsics::_getBoolean:
   case vmIntrinsics::_getByte:
   case vmIntrinsics::_getShort:
@@ -598,7 +598,7 @@
   case vmIntrinsics::_getLong:
   case vmIntrinsics::_getFloat:
   case vmIntrinsics::_getDouble:
-  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putReference:
   case vmIntrinsics::_putBoolean:
   case vmIntrinsics::_putByte:
   case vmIntrinsics::_putShort:
@@ -607,7 +607,7 @@
   case vmIntrinsics::_putLong:
   case vmIntrinsics::_putFloat:
   case vmIntrinsics::_putDouble:
-  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getReferenceVolatile:
   case vmIntrinsics::_getBooleanVolatile:
   case vmIntrinsics::_getByteVolatile:
   case vmIntrinsics::_getShortVolatile:
@@ -616,7 +616,7 @@
   case vmIntrinsics::_getLongVolatile:
   case vmIntrinsics::_getFloatVolatile:
   case vmIntrinsics::_getDoubleVolatile:
-  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putReferenceVolatile:
   case vmIntrinsics::_putBooleanVolatile:
   case vmIntrinsics::_putByteVolatile:
   case vmIntrinsics::_putShortVolatile:
@@ -625,7 +625,7 @@
   case vmIntrinsics::_putLongVolatile:
   case vmIntrinsics::_putFloatVolatile:
   case vmIntrinsics::_putDoubleVolatile:
-  case vmIntrinsics::_getObjectAcquire:
+  case vmIntrinsics::_getReferenceAcquire:
   case vmIntrinsics::_getBooleanAcquire:
   case vmIntrinsics::_getByteAcquire:
   case vmIntrinsics::_getShortAcquire:
@@ -634,7 +634,7 @@
   case vmIntrinsics::_getLongAcquire:
   case vmIntrinsics::_getFloatAcquire:
   case vmIntrinsics::_getDoubleAcquire:
-  case vmIntrinsics::_putObjectRelease:
+  case vmIntrinsics::_putReferenceRelease:
   case vmIntrinsics::_putBooleanRelease:
   case vmIntrinsics::_putByteRelease:
   case vmIntrinsics::_putShortRelease:
@@ -643,7 +643,7 @@
   case vmIntrinsics::_putLongRelease:
   case vmIntrinsics::_putFloatRelease:
   case vmIntrinsics::_putDoubleRelease:
-  case vmIntrinsics::_getObjectOpaque:
+  case vmIntrinsics::_getReferenceOpaque:
   case vmIntrinsics::_getBooleanOpaque:
   case vmIntrinsics::_getByteOpaque:
   case vmIntrinsics::_getShortOpaque:
@@ -652,7 +652,7 @@
   case vmIntrinsics::_getLongOpaque:
   case vmIntrinsics::_getFloatOpaque:
   case vmIntrinsics::_getDoubleOpaque:
-  case vmIntrinsics::_putObjectOpaque:
+  case vmIntrinsics::_putReferenceOpaque:
   case vmIntrinsics::_putBooleanOpaque:
   case vmIntrinsics::_putByteOpaque:
   case vmIntrinsics::_putShortOpaque:
@@ -665,7 +665,7 @@
   case vmIntrinsics::_getAndAddLong:
   case vmIntrinsics::_getAndSetInt:
   case vmIntrinsics::_getAndSetLong:
-  case vmIntrinsics::_getAndSetObject:
+  case vmIntrinsics::_getAndSetReference:
   case vmIntrinsics::_loadFence:
   case vmIntrinsics::_storeFence:
   case vmIntrinsics::_fullFence:
@@ -679,20 +679,20 @@
   case vmIntrinsics::_weakCompareAndSetIntPlain:
   case vmIntrinsics::_weakCompareAndSetIntAcquire:
   case vmIntrinsics::_weakCompareAndSetIntRelease:
-  case vmIntrinsics::_compareAndSetObject:
-  case vmIntrinsics::_weakCompareAndSetObject:
-  case vmIntrinsics::_weakCompareAndSetObjectPlain:
-  case vmIntrinsics::_weakCompareAndSetObjectAcquire:
-  case vmIntrinsics::_weakCompareAndSetObjectRelease:
+  case vmIntrinsics::_compareAndSetReference:
+  case vmIntrinsics::_weakCompareAndSetReference:
+  case vmIntrinsics::_weakCompareAndSetReferencePlain:
+  case vmIntrinsics::_weakCompareAndSetReferenceAcquire:
+  case vmIntrinsics::_weakCompareAndSetReferenceRelease:
   case vmIntrinsics::_compareAndExchangeInt:
   case vmIntrinsics::_compareAndExchangeIntAcquire:
   case vmIntrinsics::_compareAndExchangeIntRelease:
   case vmIntrinsics::_compareAndExchangeLong:
   case vmIntrinsics::_compareAndExchangeLongAcquire:
   case vmIntrinsics::_compareAndExchangeLongRelease:
-  case vmIntrinsics::_compareAndExchangeObject:
-  case vmIntrinsics::_compareAndExchangeObjectAcquire:
-  case vmIntrinsics::_compareAndExchangeObjectRelease:
+  case vmIntrinsics::_compareAndExchangeReference:
+  case vmIntrinsics::_compareAndExchangeReferenceAcquire:
+  case vmIntrinsics::_compareAndExchangeReferenceRelease:
     if (!InlineUnsafeOps) return true;
     break;
   case vmIntrinsics::_getShortUnaligned:
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -1084,8 +1084,8 @@
    do_alias(    isCompileConstant_signature,                      object_boolean_signature)                             \
                                                                                                                         \
   /* unsafe memory references (there are a lot of them...) */                                                           \
-  do_signature(getObject_signature,       "(Ljava/lang/Object;J)Ljava/lang/Object;")                                    \
-  do_signature(putObject_signature,       "(Ljava/lang/Object;JLjava/lang/Object;)V")                                   \
+  do_signature(getReference_signature,    "(Ljava/lang/Object;J)Ljava/lang/Object;")                                    \
+  do_signature(putReference_signature,    "(Ljava/lang/Object;JLjava/lang/Object;)V")                                   \
   do_signature(getBoolean_signature,      "(Ljava/lang/Object;J)Z")                                                     \
   do_signature(putBoolean_signature,      "(Ljava/lang/Object;JZ)V")                                                    \
   do_signature(getByte_signature,         "(Ljava/lang/Object;J)B")                                                     \
@@ -1103,7 +1103,7 @@
   do_signature(getDouble_signature,       "(Ljava/lang/Object;J)D")                                                     \
   do_signature(putDouble_signature,       "(Ljava/lang/Object;JD)V")                                                    \
                                                                                                                         \
-  do_name(getObject_name,"getObject")           do_name(putObject_name,"putObject")                                     \
+  do_name(getReference_name,"getReference")     do_name(putReference_name,"putReference")                               \
   do_name(getBoolean_name,"getBoolean")         do_name(putBoolean_name,"putBoolean")                                   \
   do_name(getByte_name,"getByte")               do_name(putByte_name,"putByte")                                         \
   do_name(getShort_name,"getShort")             do_name(putShort_name,"putShort")                                       \
@@ -1113,7 +1113,7 @@
   do_name(getFloat_name,"getFloat")             do_name(putFloat_name,"putFloat")                                       \
   do_name(getDouble_name,"getDouble")           do_name(putDouble_name,"putDouble")                                     \
                                                                                                                         \
-  do_intrinsic(_getObject,          jdk_internal_misc_Unsafe,     getObject_name, getObject_signature,           F_RN)  \
+  do_intrinsic(_getReference,       jdk_internal_misc_Unsafe,     getReference_name, getReference_signature,     F_RN)  \
   do_intrinsic(_getBoolean,         jdk_internal_misc_Unsafe,     getBoolean_name, getBoolean_signature,         F_RN)  \
   do_intrinsic(_getByte,            jdk_internal_misc_Unsafe,     getByte_name, getByte_signature,               F_RN)  \
   do_intrinsic(_getShort,           jdk_internal_misc_Unsafe,     getShort_name, getShort_signature,             F_RN)  \
@@ -1122,7 +1122,7 @@
   do_intrinsic(_getLong,            jdk_internal_misc_Unsafe,     getLong_name, getLong_signature,               F_RN)  \
   do_intrinsic(_getFloat,           jdk_internal_misc_Unsafe,     getFloat_name, getFloat_signature,             F_RN)  \
   do_intrinsic(_getDouble,          jdk_internal_misc_Unsafe,     getDouble_name, getDouble_signature,           F_RN)  \
-  do_intrinsic(_putObject,          jdk_internal_misc_Unsafe,     putObject_name, putObject_signature,           F_RN)  \
+  do_intrinsic(_putReference,       jdk_internal_misc_Unsafe,     putReference_name, putReference_signature,     F_RN)  \
   do_intrinsic(_putBoolean,         jdk_internal_misc_Unsafe,     putBoolean_name, putBoolean_signature,         F_RN)  \
   do_intrinsic(_putByte,            jdk_internal_misc_Unsafe,     putByte_name, putByte_signature,               F_RN)  \
   do_intrinsic(_putShort,           jdk_internal_misc_Unsafe,     putShort_name, putShort_signature,             F_RN)  \
@@ -1132,92 +1132,92 @@
   do_intrinsic(_putFloat,           jdk_internal_misc_Unsafe,     putFloat_name, putFloat_signature,             F_RN)  \
   do_intrinsic(_putDouble,          jdk_internal_misc_Unsafe,     putDouble_name, putDouble_signature,           F_RN)  \
                                                                                                                         \
-  do_name(getObjectVolatile_name,"getObjectVolatile")   do_name(putObjectVolatile_name,"putObjectVolatile")             \
-  do_name(getBooleanVolatile_name,"getBooleanVolatile") do_name(putBooleanVolatile_name,"putBooleanVolatile")           \
-  do_name(getByteVolatile_name,"getByteVolatile")       do_name(putByteVolatile_name,"putByteVolatile")                 \
-  do_name(getShortVolatile_name,"getShortVolatile")     do_name(putShortVolatile_name,"putShortVolatile")               \
-  do_name(getCharVolatile_name,"getCharVolatile")       do_name(putCharVolatile_name,"putCharVolatile")                 \
-  do_name(getIntVolatile_name,"getIntVolatile")         do_name(putIntVolatile_name,"putIntVolatile")                   \
-  do_name(getLongVolatile_name,"getLongVolatile")       do_name(putLongVolatile_name,"putLongVolatile")                 \
-  do_name(getFloatVolatile_name,"getFloatVolatile")     do_name(putFloatVolatile_name,"putFloatVolatile")               \
-  do_name(getDoubleVolatile_name,"getDoubleVolatile")   do_name(putDoubleVolatile_name,"putDoubleVolatile")             \
+  do_name(getReferenceVolatile_name,"getReferenceVolatile")   do_name(putReferenceVolatile_name,"putReferenceVolatile") \
+  do_name(getBooleanVolatile_name,"getBooleanVolatile")       do_name(putBooleanVolatile_name,"putBooleanVolatile")     \
+  do_name(getByteVolatile_name,"getByteVolatile")             do_name(putByteVolatile_name,"putByteVolatile")           \
+  do_name(getShortVolatile_name,"getShortVolatile")           do_name(putShortVolatile_name,"putShortVolatile")         \
+  do_name(getCharVolatile_name,"getCharVolatile")             do_name(putCharVolatile_name,"putCharVolatile")           \
+  do_name(getIntVolatile_name,"getIntVolatile")               do_name(putIntVolatile_name,"putIntVolatile")             \
+  do_name(getLongVolatile_name,"getLongVolatile")             do_name(putLongVolatile_name,"putLongVolatile")           \
+  do_name(getFloatVolatile_name,"getFloatVolatile")           do_name(putFloatVolatile_name,"putFloatVolatile")         \
+  do_name(getDoubleVolatile_name,"getDoubleVolatile")         do_name(putDoubleVolatile_name,"putDoubleVolatile")       \
                                                                                                                         \
-  do_intrinsic(_getObjectVolatile,        jdk_internal_misc_Unsafe,     getObjectVolatile_name, getObject_signature,   F_RN)  \
-  do_intrinsic(_getBooleanVolatile,       jdk_internal_misc_Unsafe,     getBooleanVolatile_name, getBoolean_signature, F_RN)  \
-  do_intrinsic(_getByteVolatile,          jdk_internal_misc_Unsafe,     getByteVolatile_name, getByte_signature,       F_RN)  \
-  do_intrinsic(_getShortVolatile,         jdk_internal_misc_Unsafe,     getShortVolatile_name, getShort_signature,     F_RN)  \
-  do_intrinsic(_getCharVolatile,          jdk_internal_misc_Unsafe,     getCharVolatile_name, getChar_signature,       F_RN)  \
-  do_intrinsic(_getIntVolatile,           jdk_internal_misc_Unsafe,     getIntVolatile_name, getInt_signature,         F_RN)  \
-  do_intrinsic(_getLongVolatile,          jdk_internal_misc_Unsafe,     getLongVolatile_name, getLong_signature,       F_RN)  \
-  do_intrinsic(_getFloatVolatile,         jdk_internal_misc_Unsafe,     getFloatVolatile_name, getFloat_signature,     F_RN)  \
-  do_intrinsic(_getDoubleVolatile,        jdk_internal_misc_Unsafe,     getDoubleVolatile_name, getDouble_signature,   F_RN)  \
-  do_intrinsic(_putObjectVolatile,        jdk_internal_misc_Unsafe,     putObjectVolatile_name, putObject_signature,   F_RN)  \
-  do_intrinsic(_putBooleanVolatile,       jdk_internal_misc_Unsafe,     putBooleanVolatile_name, putBoolean_signature, F_RN)  \
-  do_intrinsic(_putByteVolatile,          jdk_internal_misc_Unsafe,     putByteVolatile_name, putByte_signature,       F_RN)  \
-  do_intrinsic(_putShortVolatile,         jdk_internal_misc_Unsafe,     putShortVolatile_name, putShort_signature,     F_RN)  \
-  do_intrinsic(_putCharVolatile,          jdk_internal_misc_Unsafe,     putCharVolatile_name, putChar_signature,       F_RN)  \
-  do_intrinsic(_putIntVolatile,           jdk_internal_misc_Unsafe,     putIntVolatile_name, putInt_signature,         F_RN)  \
-  do_intrinsic(_putLongVolatile,          jdk_internal_misc_Unsafe,     putLongVolatile_name, putLong_signature,       F_RN)  \
-  do_intrinsic(_putFloatVolatile,         jdk_internal_misc_Unsafe,     putFloatVolatile_name, putFloat_signature,     F_RN)  \
-  do_intrinsic(_putDoubleVolatile,        jdk_internal_misc_Unsafe,     putDoubleVolatile_name, putDouble_signature,   F_RN)  \
+  do_intrinsic(_getReferenceVolatile,     jdk_internal_misc_Unsafe,     getReferenceVolatile_name, getReference_signature, F_RN)  \
+  do_intrinsic(_getBooleanVolatile,       jdk_internal_misc_Unsafe,     getBooleanVolatile_name, getBoolean_signature,     F_RN)  \
+  do_intrinsic(_getByteVolatile,          jdk_internal_misc_Unsafe,     getByteVolatile_name, getByte_signature,           F_RN)  \
+  do_intrinsic(_getShortVolatile,         jdk_internal_misc_Unsafe,     getShortVolatile_name, getShort_signature,         F_RN)  \
+  do_intrinsic(_getCharVolatile,          jdk_internal_misc_Unsafe,     getCharVolatile_name, getChar_signature,           F_RN)  \
+  do_intrinsic(_getIntVolatile,           jdk_internal_misc_Unsafe,     getIntVolatile_name, getInt_signature,             F_RN)  \
+  do_intrinsic(_getLongVolatile,          jdk_internal_misc_Unsafe,     getLongVolatile_name, getLong_signature,           F_RN)  \
+  do_intrinsic(_getFloatVolatile,         jdk_internal_misc_Unsafe,     getFloatVolatile_name, getFloat_signature,         F_RN)  \
+  do_intrinsic(_getDoubleVolatile,        jdk_internal_misc_Unsafe,     getDoubleVolatile_name, getDouble_signature,       F_RN)  \
+  do_intrinsic(_putReferenceVolatile,     jdk_internal_misc_Unsafe,     putReferenceVolatile_name, putReference_signature, F_RN)  \
+  do_intrinsic(_putBooleanVolatile,       jdk_internal_misc_Unsafe,     putBooleanVolatile_name, putBoolean_signature,     F_RN)  \
+  do_intrinsic(_putByteVolatile,          jdk_internal_misc_Unsafe,     putByteVolatile_name, putByte_signature,           F_RN)  \
+  do_intrinsic(_putShortVolatile,         jdk_internal_misc_Unsafe,     putShortVolatile_name, putShort_signature,         F_RN)  \
+  do_intrinsic(_putCharVolatile,          jdk_internal_misc_Unsafe,     putCharVolatile_name, putChar_signature,           F_RN)  \
+  do_intrinsic(_putIntVolatile,           jdk_internal_misc_Unsafe,     putIntVolatile_name, putInt_signature,             F_RN)  \
+  do_intrinsic(_putLongVolatile,          jdk_internal_misc_Unsafe,     putLongVolatile_name, putLong_signature,           F_RN)  \
+  do_intrinsic(_putFloatVolatile,         jdk_internal_misc_Unsafe,     putFloatVolatile_name, putFloat_signature,         F_RN)  \
+  do_intrinsic(_putDoubleVolatile,        jdk_internal_misc_Unsafe,     putDoubleVolatile_name, putDouble_signature,       F_RN)  \
                                                                                                                         \
-  do_name(getObjectOpaque_name,"getObjectOpaque")     do_name(putObjectOpaque_name,"putObjectOpaque")                   \
-  do_name(getBooleanOpaque_name,"getBooleanOpaque")   do_name(putBooleanOpaque_name,"putBooleanOpaque")                 \
-  do_name(getByteOpaque_name,"getByteOpaque")         do_name(putByteOpaque_name,"putByteOpaque")                       \
-  do_name(getShortOpaque_name,"getShortOpaque")       do_name(putShortOpaque_name,"putShortOpaque")                     \
-  do_name(getCharOpaque_name,"getCharOpaque")         do_name(putCharOpaque_name,"putCharOpaque")                       \
-  do_name(getIntOpaque_name,"getIntOpaque")           do_name(putIntOpaque_name,"putIntOpaque")                         \
-  do_name(getLongOpaque_name,"getLongOpaque")         do_name(putLongOpaque_name,"putLongOpaque")                       \
-  do_name(getFloatOpaque_name,"getFloatOpaque")       do_name(putFloatOpaque_name,"putFloatOpaque")                     \
-  do_name(getDoubleOpaque_name,"getDoubleOpaque")     do_name(putDoubleOpaque_name,"putDoubleOpaque")                   \
+  do_name(getReferenceOpaque_name,"getReferenceOpaque") do_name(putReferenceOpaque_name,"putReferenceOpaque")           \
+  do_name(getBooleanOpaque_name,"getBooleanOpaque")     do_name(putBooleanOpaque_name,"putBooleanOpaque")               \
+  do_name(getByteOpaque_name,"getByteOpaque")           do_name(putByteOpaque_name,"putByteOpaque")                     \
+  do_name(getShortOpaque_name,"getShortOpaque")         do_name(putShortOpaque_name,"putShortOpaque")                   \
+  do_name(getCharOpaque_name,"getCharOpaque")           do_name(putCharOpaque_name,"putCharOpaque")                     \
+  do_name(getIntOpaque_name,"getIntOpaque")             do_name(putIntOpaque_name,"putIntOpaque")                       \
+  do_name(getLongOpaque_name,"getLongOpaque")           do_name(putLongOpaque_name,"putLongOpaque")                     \
+  do_name(getFloatOpaque_name,"getFloatOpaque")         do_name(putFloatOpaque_name,"putFloatOpaque")                   \
+  do_name(getDoubleOpaque_name,"getDoubleOpaque")       do_name(putDoubleOpaque_name,"putDoubleOpaque")                 \
                                                                                                                         \
-  do_intrinsic(_getObjectOpaque,          jdk_internal_misc_Unsafe,        getObjectOpaque_name, getObject_signature,   F_R)  \
-  do_intrinsic(_getBooleanOpaque,         jdk_internal_misc_Unsafe,        getBooleanOpaque_name, getBoolean_signature, F_R)  \
-  do_intrinsic(_getByteOpaque,            jdk_internal_misc_Unsafe,        getByteOpaque_name, getByte_signature,       F_R)  \
-  do_intrinsic(_getShortOpaque,           jdk_internal_misc_Unsafe,        getShortOpaque_name, getShort_signature,     F_R)  \
-  do_intrinsic(_getCharOpaque,            jdk_internal_misc_Unsafe,        getCharOpaque_name, getChar_signature,       F_R)  \
-  do_intrinsic(_getIntOpaque,             jdk_internal_misc_Unsafe,        getIntOpaque_name, getInt_signature,         F_R)  \
-  do_intrinsic(_getLongOpaque,            jdk_internal_misc_Unsafe,        getLongOpaque_name, getLong_signature,       F_R)  \
-  do_intrinsic(_getFloatOpaque,           jdk_internal_misc_Unsafe,        getFloatOpaque_name, getFloat_signature,     F_R)  \
-  do_intrinsic(_getDoubleOpaque,          jdk_internal_misc_Unsafe,        getDoubleOpaque_name, getDouble_signature,   F_R)  \
-  do_intrinsic(_putObjectOpaque,          jdk_internal_misc_Unsafe,        putObjectOpaque_name, putObject_signature,   F_R)  \
-  do_intrinsic(_putBooleanOpaque,         jdk_internal_misc_Unsafe,        putBooleanOpaque_name, putBoolean_signature, F_R)  \
-  do_intrinsic(_putByteOpaque,            jdk_internal_misc_Unsafe,        putByteOpaque_name, putByte_signature,       F_R)  \
-  do_intrinsic(_putShortOpaque,           jdk_internal_misc_Unsafe,        putShortOpaque_name, putShort_signature,     F_R)  \
-  do_intrinsic(_putCharOpaque,            jdk_internal_misc_Unsafe,        putCharOpaque_name, putChar_signature,       F_R)  \
-  do_intrinsic(_putIntOpaque,             jdk_internal_misc_Unsafe,        putIntOpaque_name, putInt_signature,         F_R)  \
-  do_intrinsic(_putLongOpaque,            jdk_internal_misc_Unsafe,        putLongOpaque_name, putLong_signature,       F_R)  \
-  do_intrinsic(_putFloatOpaque,           jdk_internal_misc_Unsafe,        putFloatOpaque_name, putFloat_signature,     F_R)  \
-  do_intrinsic(_putDoubleOpaque,          jdk_internal_misc_Unsafe,        putDoubleOpaque_name, putDouble_signature,   F_R)  \
+  do_intrinsic(_getReferenceOpaque,       jdk_internal_misc_Unsafe,        getReferenceOpaque_name, getReference_signature, F_R)  \
+  do_intrinsic(_getBooleanOpaque,         jdk_internal_misc_Unsafe,        getBooleanOpaque_name, getBoolean_signature,     F_R)  \
+  do_intrinsic(_getByteOpaque,            jdk_internal_misc_Unsafe,        getByteOpaque_name, getByte_signature,           F_R)  \
+  do_intrinsic(_getShortOpaque,           jdk_internal_misc_Unsafe,        getShortOpaque_name, getShort_signature,         F_R)  \
+  do_intrinsic(_getCharOpaque,            jdk_internal_misc_Unsafe,        getCharOpaque_name, getChar_signature,           F_R)  \
+  do_intrinsic(_getIntOpaque,             jdk_internal_misc_Unsafe,        getIntOpaque_name, getInt_signature,             F_R)  \
+  do_intrinsic(_getLongOpaque,            jdk_internal_misc_Unsafe,        getLongOpaque_name, getLong_signature,           F_R)  \
+  do_intrinsic(_getFloatOpaque,           jdk_internal_misc_Unsafe,        getFloatOpaque_name, getFloat_signature,         F_R)  \
+  do_intrinsic(_getDoubleOpaque,          jdk_internal_misc_Unsafe,        getDoubleOpaque_name, getDouble_signature,       F_R)  \
+  do_intrinsic(_putReferenceOpaque,       jdk_internal_misc_Unsafe,        putReferenceOpaque_name, putReference_signature, F_R)  \
+  do_intrinsic(_putBooleanOpaque,         jdk_internal_misc_Unsafe,        putBooleanOpaque_name, putBoolean_signature,     F_R)  \
+  do_intrinsic(_putByteOpaque,            jdk_internal_misc_Unsafe,        putByteOpaque_name, putByte_signature,           F_R)  \
+  do_intrinsic(_putShortOpaque,           jdk_internal_misc_Unsafe,        putShortOpaque_name, putShort_signature,         F_R)  \
+  do_intrinsic(_putCharOpaque,            jdk_internal_misc_Unsafe,        putCharOpaque_name, putChar_signature,           F_R)  \
+  do_intrinsic(_putIntOpaque,             jdk_internal_misc_Unsafe,        putIntOpaque_name, putInt_signature,             F_R)  \
+  do_intrinsic(_putLongOpaque,            jdk_internal_misc_Unsafe,        putLongOpaque_name, putLong_signature,           F_R)  \
+  do_intrinsic(_putFloatOpaque,           jdk_internal_misc_Unsafe,        putFloatOpaque_name, putFloat_signature,         F_R)  \
+  do_intrinsic(_putDoubleOpaque,          jdk_internal_misc_Unsafe,        putDoubleOpaque_name, putDouble_signature,       F_R)  \
                                                                                                                         \
-  do_name(getObjectAcquire_name,  "getObjectAcquire")    do_name(putObjectRelease_name,  "putObjectRelease")            \
-  do_name(getBooleanAcquire_name, "getBooleanAcquire")   do_name(putBooleanRelease_name, "putBooleanRelease")           \
-  do_name(getByteAcquire_name,    "getByteAcquire")      do_name(putByteRelease_name,    "putByteRelease")              \
-  do_name(getShortAcquire_name,   "getShortAcquire")     do_name(putShortRelease_name,   "putShortRelease")             \
-  do_name(getCharAcquire_name,    "getCharAcquire")      do_name(putCharRelease_name,    "putCharRelease")              \
-  do_name(getIntAcquire_name,     "getIntAcquire")       do_name(putIntRelease_name,     "putIntRelease")               \
-  do_name(getLongAcquire_name,    "getLongAcquire")      do_name(putLongRelease_name,    "putLongRelease")              \
-  do_name(getFloatAcquire_name,   "getFloatAcquire")     do_name(putFloatRelease_name,   "putFloatRelease")             \
-  do_name(getDoubleAcquire_name,  "getDoubleAcquire")    do_name(putDoubleRelease_name,  "putDoubleRelease")            \
+  do_name(getReferenceAcquire_name,  "getReferenceAcquire") do_name(putReferenceRelease_name,  "putReferenceRelease")   \
+  do_name(getBooleanAcquire_name, "getBooleanAcquire")      do_name(putBooleanRelease_name, "putBooleanRelease")        \
+  do_name(getByteAcquire_name,    "getByteAcquire")         do_name(putByteRelease_name,    "putByteRelease")           \
+  do_name(getShortAcquire_name,   "getShortAcquire")        do_name(putShortRelease_name,   "putShortRelease")          \
+  do_name(getCharAcquire_name,    "getCharAcquire")         do_name(putCharRelease_name,    "putCharRelease")           \
+  do_name(getIntAcquire_name,     "getIntAcquire")          do_name(putIntRelease_name,     "putIntRelease")            \
+  do_name(getLongAcquire_name,    "getLongAcquire")         do_name(putLongRelease_name,    "putLongRelease")           \
+  do_name(getFloatAcquire_name,   "getFloatAcquire")        do_name(putFloatRelease_name,   "putFloatRelease")          \
+  do_name(getDoubleAcquire_name,  "getDoubleAcquire")       do_name(putDoubleRelease_name,  "putDoubleRelease")         \
                                                                                                                         \
-  do_intrinsic(_getObjectAcquire,        jdk_internal_misc_Unsafe,        getObjectAcquire_name, getObject_signature,   F_R)  \
-  do_intrinsic(_getBooleanAcquire,       jdk_internal_misc_Unsafe,        getBooleanAcquire_name, getBoolean_signature, F_R)  \
-  do_intrinsic(_getByteAcquire,          jdk_internal_misc_Unsafe,        getByteAcquire_name, getByte_signature,       F_R)  \
-  do_intrinsic(_getShortAcquire,         jdk_internal_misc_Unsafe,        getShortAcquire_name, getShort_signature,     F_R)  \
-  do_intrinsic(_getCharAcquire,          jdk_internal_misc_Unsafe,        getCharAcquire_name, getChar_signature,       F_R)  \
-  do_intrinsic(_getIntAcquire,           jdk_internal_misc_Unsafe,        getIntAcquire_name, getInt_signature,         F_R)  \
-  do_intrinsic(_getLongAcquire,          jdk_internal_misc_Unsafe,        getLongAcquire_name, getLong_signature,       F_R)  \
-  do_intrinsic(_getFloatAcquire,         jdk_internal_misc_Unsafe,        getFloatAcquire_name, getFloat_signature,     F_R)  \
-  do_intrinsic(_getDoubleAcquire,        jdk_internal_misc_Unsafe,        getDoubleAcquire_name, getDouble_signature,   F_R)  \
-  do_intrinsic(_putObjectRelease,        jdk_internal_misc_Unsafe,        putObjectRelease_name, putObject_signature,   F_R)  \
-  do_intrinsic(_putBooleanRelease,       jdk_internal_misc_Unsafe,        putBooleanRelease_name, putBoolean_signature, F_R)  \
-  do_intrinsic(_putByteRelease,          jdk_internal_misc_Unsafe,        putByteRelease_name, putByte_signature,       F_R)  \
-  do_intrinsic(_putShortRelease,         jdk_internal_misc_Unsafe,        putShortRelease_name, putShort_signature,     F_R)  \
-  do_intrinsic(_putCharRelease,          jdk_internal_misc_Unsafe,        putCharRelease_name, putChar_signature,       F_R)  \
-  do_intrinsic(_putIntRelease,           jdk_internal_misc_Unsafe,        putIntRelease_name, putInt_signature,         F_R)  \
-  do_intrinsic(_putLongRelease,          jdk_internal_misc_Unsafe,        putLongRelease_name, putLong_signature,       F_R)  \
-  do_intrinsic(_putFloatRelease,         jdk_internal_misc_Unsafe,        putFloatRelease_name, putFloat_signature,     F_R)  \
-  do_intrinsic(_putDoubleRelease,        jdk_internal_misc_Unsafe,        putDoubleRelease_name, putDouble_signature,   F_R)  \
+  do_intrinsic(_getReferenceAcquire,     jdk_internal_misc_Unsafe,        getReferenceAcquire_name, getReference_signature, F_R)  \
+  do_intrinsic(_getBooleanAcquire,       jdk_internal_misc_Unsafe,        getBooleanAcquire_name, getBoolean_signature,     F_R)  \
+  do_intrinsic(_getByteAcquire,          jdk_internal_misc_Unsafe,        getByteAcquire_name, getByte_signature,           F_R)  \
+  do_intrinsic(_getShortAcquire,         jdk_internal_misc_Unsafe,        getShortAcquire_name, getShort_signature,         F_R)  \
+  do_intrinsic(_getCharAcquire,          jdk_internal_misc_Unsafe,        getCharAcquire_name, getChar_signature,           F_R)  \
+  do_intrinsic(_getIntAcquire,           jdk_internal_misc_Unsafe,        getIntAcquire_name, getInt_signature,             F_R)  \
+  do_intrinsic(_getLongAcquire,          jdk_internal_misc_Unsafe,        getLongAcquire_name, getLong_signature,           F_R)  \
+  do_intrinsic(_getFloatAcquire,         jdk_internal_misc_Unsafe,        getFloatAcquire_name, getFloat_signature,         F_R)  \
+  do_intrinsic(_getDoubleAcquire,        jdk_internal_misc_Unsafe,        getDoubleAcquire_name, getDouble_signature,       F_R)  \
+  do_intrinsic(_putReferenceRelease,     jdk_internal_misc_Unsafe,        putReferenceRelease_name, putReference_signature, F_R)  \
+  do_intrinsic(_putBooleanRelease,       jdk_internal_misc_Unsafe,        putBooleanRelease_name, putBoolean_signature,     F_R)  \
+  do_intrinsic(_putByteRelease,          jdk_internal_misc_Unsafe,        putByteRelease_name, putByte_signature,           F_R)  \
+  do_intrinsic(_putShortRelease,         jdk_internal_misc_Unsafe,        putShortRelease_name, putShort_signature,         F_R)  \
+  do_intrinsic(_putCharRelease,          jdk_internal_misc_Unsafe,        putCharRelease_name, putChar_signature,           F_R)  \
+  do_intrinsic(_putIntRelease,           jdk_internal_misc_Unsafe,        putIntRelease_name, putInt_signature,             F_R)  \
+  do_intrinsic(_putLongRelease,          jdk_internal_misc_Unsafe,        putLongRelease_name, putLong_signature,           F_R)  \
+  do_intrinsic(_putFloatRelease,         jdk_internal_misc_Unsafe,        putFloatRelease_name, putFloat_signature,         F_R)  \
+  do_intrinsic(_putDoubleRelease,        jdk_internal_misc_Unsafe,        putDoubleRelease_name, putDouble_signature,       F_R)  \
                                                                                                                         \
   do_name(getShortUnaligned_name,"getShortUnaligned")     do_name(putShortUnaligned_name,"putShortUnaligned")           \
   do_name(getCharUnaligned_name,"getCharUnaligned")       do_name(putCharUnaligned_name,"putCharUnaligned")             \
@@ -1233,8 +1233,8 @@
   do_intrinsic(_putIntUnaligned,           jdk_internal_misc_Unsafe,    putIntUnaligned_name, putInt_signature,         F_R)  \
   do_intrinsic(_putLongUnaligned,          jdk_internal_misc_Unsafe,    putLongUnaligned_name, putLong_signature,       F_R)  \
                                                                                                                         \
-  do_signature(compareAndSetObject_signature,      "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z")        \
-  do_signature(compareAndExchangeObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
+  do_signature(compareAndSetReference_signature,      "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z")        \
+  do_signature(compareAndExchangeReference_signature, "(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
   do_signature(compareAndSetLong_signature,        "(Ljava/lang/Object;JJJ)Z")                                          \
   do_signature(compareAndExchangeLong_signature,   "(Ljava/lang/Object;JJJ)J")                                          \
   do_signature(compareAndSetInt_signature,         "(Ljava/lang/Object;JII)Z")                                          \
@@ -1244,52 +1244,52 @@
   do_signature(compareAndSetShort_signature,       "(Ljava/lang/Object;JSS)Z")                                          \
   do_signature(compareAndExchangeShort_signature,  "(Ljava/lang/Object;JSS)S")                                          \
                                                                                                                         \
-  do_name(compareAndSetObject_name,              "compareAndSetObject")                                                 \
-  do_name(compareAndExchangeObject_name,         "compareAndExchangeObject")                                            \
-  do_name(compareAndExchangeObjectAcquire_name,  "compareAndExchangeObjectAcquire")                                     \
-  do_name(compareAndExchangeObjectRelease_name,  "compareAndExchangeObjectRelease")                                     \
-  do_name(compareAndSetLong_name,                "compareAndSetLong")                                                   \
-  do_name(compareAndExchangeLong_name,           "compareAndExchangeLong")                                              \
-  do_name(compareAndExchangeLongAcquire_name,    "compareAndExchangeLongAcquire")                                       \
-  do_name(compareAndExchangeLongRelease_name,    "compareAndExchangeLongRelease")                                       \
-  do_name(compareAndSetInt_name,                 "compareAndSetInt")                                                    \
-  do_name(compareAndExchangeInt_name,            "compareAndExchangeInt")                                               \
-  do_name(compareAndExchangeIntAcquire_name,     "compareAndExchangeIntAcquire")                                        \
-  do_name(compareAndExchangeIntRelease_name,     "compareAndExchangeIntRelease")                                        \
-  do_name(compareAndSetByte_name,                "compareAndSetByte")                                                   \
-  do_name(compareAndExchangeByte_name,           "compareAndExchangeByte")                                              \
-  do_name(compareAndExchangeByteAcquire_name,    "compareAndExchangeByteAcquire")                                       \
-  do_name(compareAndExchangeByteRelease_name,    "compareAndExchangeByteRelease")                                       \
-  do_name(compareAndSetShort_name,               "compareAndSetShort")                                                  \
-  do_name(compareAndExchangeShort_name,          "compareAndExchangeShort")                                             \
-  do_name(compareAndExchangeShortAcquire_name,   "compareAndExchangeShortAcquire")                                      \
-  do_name(compareAndExchangeShortRelease_name,   "compareAndExchangeShortRelease")                                      \
+  do_name(compareAndSetReference_name,              "compareAndSetReference")                                           \
+  do_name(compareAndExchangeReference_name,         "compareAndExchangeReference")                                      \
+  do_name(compareAndExchangeReferenceAcquire_name,  "compareAndExchangeReferenceAcquire")                               \
+  do_name(compareAndExchangeReferenceRelease_name,  "compareAndExchangeReferenceRelease")                               \
+  do_name(compareAndSetLong_name,                   "compareAndSetLong")                                                \
+  do_name(compareAndExchangeLong_name,              "compareAndExchangeLong")                                           \
+  do_name(compareAndExchangeLongAcquire_name,       "compareAndExchangeLongAcquire")                                    \
+  do_name(compareAndExchangeLongRelease_name,       "compareAndExchangeLongRelease")                                    \
+  do_name(compareAndSetInt_name,                    "compareAndSetInt")                                                 \
+  do_name(compareAndExchangeInt_name,               "compareAndExchangeInt")                                            \
+  do_name(compareAndExchangeIntAcquire_name,        "compareAndExchangeIntAcquire")                                     \
+  do_name(compareAndExchangeIntRelease_name,        "compareAndExchangeIntRelease")                                     \
+  do_name(compareAndSetByte_name,                   "compareAndSetByte")                                                \
+  do_name(compareAndExchangeByte_name,              "compareAndExchangeByte")                                           \
+  do_name(compareAndExchangeByteAcquire_name,       "compareAndExchangeByteAcquire")                                    \
+  do_name(compareAndExchangeByteRelease_name,       "compareAndExchangeByteRelease")                                    \
+  do_name(compareAndSetShort_name,                  "compareAndSetShort")                                               \
+  do_name(compareAndExchangeShort_name,             "compareAndExchangeShort")                                          \
+  do_name(compareAndExchangeShortAcquire_name,      "compareAndExchangeShortAcquire")                                   \
+  do_name(compareAndExchangeShortRelease_name,      "compareAndExchangeShortRelease")                                   \
                                                                                                                         \
-  do_name(weakCompareAndSetObjectPlain_name,     "weakCompareAndSetObjectPlain")                                        \
-  do_name(weakCompareAndSetObjectAcquire_name,   "weakCompareAndSetObjectAcquire")                                      \
-  do_name(weakCompareAndSetObjectRelease_name,   "weakCompareAndSetObjectRelease")                                      \
-  do_name(weakCompareAndSetObject_name,          "weakCompareAndSetObject")                                             \
-  do_name(weakCompareAndSetLongPlain_name,       "weakCompareAndSetLongPlain")                                          \
-  do_name(weakCompareAndSetLongAcquire_name,     "weakCompareAndSetLongAcquire")                                        \
-  do_name(weakCompareAndSetLongRelease_name,     "weakCompareAndSetLongRelease")                                        \
-  do_name(weakCompareAndSetLong_name,            "weakCompareAndSetLong")                                               \
-  do_name(weakCompareAndSetIntPlain_name,        "weakCompareAndSetIntPlain")                                           \
-  do_name(weakCompareAndSetIntAcquire_name,      "weakCompareAndSetIntAcquire")                                         \
-  do_name(weakCompareAndSetIntRelease_name,      "weakCompareAndSetIntRelease")                                         \
-  do_name(weakCompareAndSetInt_name,             "weakCompareAndSetInt")                                                \
-  do_name(weakCompareAndSetBytePlain_name,       "weakCompareAndSetBytePlain")                                          \
-  do_name(weakCompareAndSetByteAcquire_name,     "weakCompareAndSetByteAcquire")                                        \
-  do_name(weakCompareAndSetByteRelease_name,     "weakCompareAndSetByteRelease")                                        \
-  do_name(weakCompareAndSetByte_name,            "weakCompareAndSetByte")                                               \
-  do_name(weakCompareAndSetShortPlain_name,      "weakCompareAndSetShortPlain")                                         \
-  do_name(weakCompareAndSetShortAcquire_name,    "weakCompareAndSetShortAcquire")                                       \
-  do_name(weakCompareAndSetShortRelease_name,    "weakCompareAndSetShortRelease")                                       \
-  do_name(weakCompareAndSetShort_name,           "weakCompareAndSetShort")                                              \
+  do_name(weakCompareAndSetReferencePlain_name,     "weakCompareAndSetReferencePlain")                                  \
+  do_name(weakCompareAndSetReferenceAcquire_name,   "weakCompareAndSetReferenceAcquire")                                \
+  do_name(weakCompareAndSetReferenceRelease_name,   "weakCompareAndSetReferenceRelease")                                \
+  do_name(weakCompareAndSetReference_name,          "weakCompareAndSetReference")                                       \
+  do_name(weakCompareAndSetLongPlain_name,          "weakCompareAndSetLongPlain")                                       \
+  do_name(weakCompareAndSetLongAcquire_name,        "weakCompareAndSetLongAcquire")                                     \
+  do_name(weakCompareAndSetLongRelease_name,        "weakCompareAndSetLongRelease")                                     \
+  do_name(weakCompareAndSetLong_name,               "weakCompareAndSetLong")                                            \
+  do_name(weakCompareAndSetIntPlain_name,           "weakCompareAndSetIntPlain")                                        \
+  do_name(weakCompareAndSetIntAcquire_name,         "weakCompareAndSetIntAcquire")                                      \
+  do_name(weakCompareAndSetIntRelease_name,         "weakCompareAndSetIntRelease")                                      \
+  do_name(weakCompareAndSetInt_name,                "weakCompareAndSetInt")                                             \
+  do_name(weakCompareAndSetBytePlain_name,          "weakCompareAndSetBytePlain")                                       \
+  do_name(weakCompareAndSetByteAcquire_name,        "weakCompareAndSetByteAcquire")                                     \
+  do_name(weakCompareAndSetByteRelease_name,        "weakCompareAndSetByteRelease")                                     \
+  do_name(weakCompareAndSetByte_name,               "weakCompareAndSetByte")                                            \
+  do_name(weakCompareAndSetShortPlain_name,         "weakCompareAndSetShortPlain")                                      \
+  do_name(weakCompareAndSetShortAcquire_name,       "weakCompareAndSetShortAcquire")                                    \
+  do_name(weakCompareAndSetShortRelease_name,       "weakCompareAndSetShortRelease")                                    \
+  do_name(weakCompareAndSetShort_name,              "weakCompareAndSetShort")                                           \
                                                                                                                         \
-  do_intrinsic(_compareAndSetObject,              jdk_internal_misc_Unsafe,  compareAndSetObject_name,              compareAndSetObject_signature,      F_RN) \
-  do_intrinsic(_compareAndExchangeObject,         jdk_internal_misc_Unsafe,  compareAndExchangeObject_name,         compareAndExchangeObject_signature, F_RN) \
-  do_intrinsic(_compareAndExchangeObjectAcquire,  jdk_internal_misc_Unsafe,  compareAndExchangeObjectAcquire_name,  compareAndExchangeObject_signature, F_R)  \
-  do_intrinsic(_compareAndExchangeObjectRelease,  jdk_internal_misc_Unsafe,  compareAndExchangeObjectRelease_name,  compareAndExchangeObject_signature, F_R)  \
+  do_intrinsic(_compareAndSetReference,              jdk_internal_misc_Unsafe,  compareAndSetReference_name,              compareAndSetReference_signature,      F_RN) \
+  do_intrinsic(_compareAndExchangeReference,         jdk_internal_misc_Unsafe,  compareAndExchangeReference_name,         compareAndExchangeReference_signature, F_RN) \
+  do_intrinsic(_compareAndExchangeReferenceAcquire,  jdk_internal_misc_Unsafe,  compareAndExchangeReferenceAcquire_name,  compareAndExchangeReference_signature, F_R)  \
+  do_intrinsic(_compareAndExchangeReferenceRelease,  jdk_internal_misc_Unsafe,  compareAndExchangeReferenceRelease_name,  compareAndExchangeReference_signature, F_R)  \
   do_intrinsic(_compareAndSetLong,                jdk_internal_misc_Unsafe,  compareAndSetLong_name,                compareAndSetLong_signature,        F_RN) \
   do_intrinsic(_compareAndExchangeLong,           jdk_internal_misc_Unsafe,  compareAndExchangeLong_name,           compareAndExchangeLong_signature,   F_RN) \
   do_intrinsic(_compareAndExchangeLongAcquire,    jdk_internal_misc_Unsafe,  compareAndExchangeLongAcquire_name,    compareAndExchangeLong_signature,   F_R)  \
@@ -1307,10 +1307,10 @@
   do_intrinsic(_compareAndExchangeShortAcquire,   jdk_internal_misc_Unsafe,  compareAndExchangeShortAcquire_name,   compareAndExchangeShort_signature,  F_R)  \
   do_intrinsic(_compareAndExchangeShortRelease,   jdk_internal_misc_Unsafe,  compareAndExchangeShortRelease_name,   compareAndExchangeShort_signature,  F_R)  \
                                                                                                                                                              \
-  do_intrinsic(_weakCompareAndSetObjectPlain,     jdk_internal_misc_Unsafe,  weakCompareAndSetObjectPlain_name,     compareAndSetObject_signature,      F_R) \
-  do_intrinsic(_weakCompareAndSetObjectAcquire,   jdk_internal_misc_Unsafe,  weakCompareAndSetObjectAcquire_name,   compareAndSetObject_signature,      F_R) \
-  do_intrinsic(_weakCompareAndSetObjectRelease,   jdk_internal_misc_Unsafe,  weakCompareAndSetObjectRelease_name,   compareAndSetObject_signature,      F_R) \
-  do_intrinsic(_weakCompareAndSetObject,          jdk_internal_misc_Unsafe,  weakCompareAndSetObject_name,          compareAndSetObject_signature,      F_R) \
+  do_intrinsic(_weakCompareAndSetReferencePlain,  jdk_internal_misc_Unsafe,  weakCompareAndSetReferencePlain_name,     compareAndSetReference_signature,      F_R) \
+  do_intrinsic(_weakCompareAndSetReferenceAcquire,jdk_internal_misc_Unsafe,  weakCompareAndSetReferenceAcquire_name,   compareAndSetReference_signature,      F_R) \
+  do_intrinsic(_weakCompareAndSetReferenceRelease,jdk_internal_misc_Unsafe,  weakCompareAndSetReferenceRelease_name,   compareAndSetReference_signature,      F_R) \
+  do_intrinsic(_weakCompareAndSetReference,       jdk_internal_misc_Unsafe,  weakCompareAndSetReference_name,          compareAndSetReference_signature,      F_R) \
   do_intrinsic(_weakCompareAndSetLongPlain,       jdk_internal_misc_Unsafe,  weakCompareAndSetLongPlain_name,       compareAndSetLong_signature,        F_R) \
   do_intrinsic(_weakCompareAndSetLongAcquire,     jdk_internal_misc_Unsafe,  weakCompareAndSetLongAcquire_name,     compareAndSetLong_signature,        F_R) \
   do_intrinsic(_weakCompareAndSetLongRelease,     jdk_internal_misc_Unsafe,  weakCompareAndSetLongRelease_name,     compareAndSetLong_signature,        F_R) \
@@ -1352,9 +1352,9 @@
   do_intrinsic(_getAndSetShort,           jdk_internal_misc_Unsafe,     getAndSetShort_name, getAndSetShort_signature, F_R)   \
    do_name(     getAndSetShort_name,                                    "getAndSetShort")                                     \
    do_alias(    getAndSetShort_signature,                               /*"(Ljava/lang/Object;JS)S"*/ getAndAddShort_signature) \
-  do_intrinsic(_getAndSetObject,          jdk_internal_misc_Unsafe,     getAndSetObject_name, getAndSetObject_signature,  F_R)\
-   do_name(     getAndSetObject_name,                                   "getAndSetObject")                                    \
-   do_signature(getAndSetObject_signature,                              "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
+  do_intrinsic(_getAndSetReference,       jdk_internal_misc_Unsafe,     getAndSetReference_name, getAndSetReference_signature, F_R) \
+   do_name(     getAndSetReference_name,                                "getAndSetReference")                                  \
+   do_signature(getAndSetReference_signature,                           "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
                                                                                                                                \
    /* (2) Bytecode intrinsics                                                                        */                        \
                                                                                                                                \
@@ -1541,7 +1541,7 @@
     #undef VM_INTRINSIC_ENUM
 
     ID_LIMIT,
-    LAST_COMPILER_INLINE = _getAndSetObject,
+    LAST_COMPILER_INLINE = _getAndSetReference,
     FIRST_MH_SIG_POLY    = _invokeGeneric,
     FIRST_MH_STATIC      = _linkToVirtual,
     LAST_MH_SIG_POLY     = _linkToInterface,
--- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -76,7 +76,7 @@
 
   // Helper for unsafe accesses, that may or may not be on the referent field.
   // Generates the guards that check whether the result of
-  // Unsafe.getObject should be recorded in an SATB log buffer.
+  // Unsafe.getReference should be recorded in an SATB log buffer.
   void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset, Node* pre_val, bool need_mem_bar) const;
 
   static const TypeFunc* write_ref_field_pre_entry_Type();
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -25,6 +25,7 @@
 #ifndef SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP
 #define SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP
 
+#include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1ParScanThreadState.hpp"
 #include "gc/g1/g1RemSet.hpp"
 #include "oops/access.inline.hpp"
@@ -40,20 +41,24 @@
   // processed multiple times, and so we might get references into old gen here.
   // So we need to redo this check.
   const InCSetState in_cset_state = _g1h->in_cset_state(obj);
-  if (in_cset_state.is_in_cset()) {
-    markOop m = obj->mark_raw();
-    if (m->is_marked()) {
-      obj = (oop) m->decode_pointer();
-    } else {
-      obj = copy_to_survivor_space(in_cset_state, obj, m);
-    }
-    RawAccess<IS_NOT_NULL>::oop_store(p, obj);
-  } else if (in_cset_state.is_humongous()) {
-    _g1h->set_humongous_is_live(obj);
+  // References pushed onto the work stack should never point to a humongous region
+  // as they are not added to the collection set due to above precondition.
+  assert(!in_cset_state.is_humongous(),
+         "Obj " PTR_FORMAT " should not refer to humongous region %u from " PTR_FORMAT,
+         p2i(obj), _g1h->addr_to_region((HeapWord*)obj), p2i(p));
+
+  if (!in_cset_state.is_in_cset()) {
+    // In this case somebody else already did all the work.
+    return;
+  }
+
+  markOop m = obj->mark_raw();
+  if (m->is_marked()) {
+    obj = (oop) m->decode_pointer();
   } else {
-    assert(in_cset_state.is_default(),
-           "In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value());
+    obj = copy_to_survivor_space(in_cset_state, obj, m);
   }
+  RawAccess<IS_NOT_NULL>::oop_store(p, obj);
 
   assert(obj != NULL, "Must be");
   if (!HeapRegion::is_in_same_region(p, obj)) {
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -213,8 +213,8 @@
   virtual void register_potential_barrier_node(Node* node) const { }
   virtual void unregister_potential_barrier_node(Node* node) const { }
   virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
-  virtual void enqueue_useful_gc_barrier(Unique_Node_List &worklist, Node* node) const {}
-  virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful) const {}
+  virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
+  virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
   virtual void add_users_to_worklist(Unique_Node_List* worklist) const {}
 
   // Allow barrier sets to have shared state that is preserved across a compilation unit.
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -102,7 +102,7 @@
   }
 }
 
-void ZBarrierSetC2::eliminate_useless_gc_barriers(Unique_Node_List &useful) const {
+void ZBarrierSetC2::eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {
   // Remove useless LoadBarrier nodes
   ZBarrierSetC2State* s = state();
   for (int i = s->load_barrier_count()-1; i >= 0; i--) {
@@ -113,9 +113,9 @@
   }
 }
 
-void ZBarrierSetC2::enqueue_useful_gc_barrier(Unique_Node_List &worklist, Node* node) const {
+void ZBarrierSetC2::enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {
   if (node->is_LoadBarrier() && !node->as_LoadBarrier()->has_true_uses()) {
-    worklist.push(node);
+    igvn->_worklist.push(node);
   }
 }
 
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -189,9 +189,9 @@
   virtual bool has_load_barriers() const { return true; }
   virtual bool is_gc_barrier_node(Node* node) const;
   virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
-  virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful) const;
+  virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const;
   virtual void add_users_to_worklist(Unique_Node_List* worklist) const;
-  virtual void enqueue_useful_gc_barrier(Unique_Node_List &worklist, Node* node) const;
+  virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const;
   virtual void register_potential_barrier_node(Node* node) const;
   virtual void unregister_potential_barrier_node(Node* node) const;
   virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const;
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -367,7 +367,7 @@
 }
 
 void JfrCheckpointManager::write_type_set_for_unloaded_classes() {
-  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
+  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
   JfrTypeManager::write_type_set_for_unloaded_classes();
 }
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -158,7 +158,7 @@
 }
 
 void JfrTypeManager::write_type_set_for_unloaded_classes() {
-  assert(SafepointSynchronize::is_at_safepoint(), "invariant");
+  assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
   JfrCheckpointWriter writer(false, true, Thread::current());
   ClassUnloadTypeSet class_unload_set;
   class_unload_set.serialize(writer);
--- a/src/hotspot/share/oops/arrayKlass.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/oops/arrayKlass.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -61,11 +61,9 @@
   inline Klass* higher_dimension_acquire() const; // load with acquire semantics
   void set_higher_dimension(Klass* k) { _higher_dimension = k; }
   inline void release_set_higher_dimension(Klass* k); // store with release semantics
-  Klass** adr_higher_dimension()      { return (Klass**)&this->_higher_dimension;}
 
   Klass* lower_dimension() const      { return _lower_dimension; }
   void set_lower_dimension(Klass* k)  { _lower_dimension = k; }
-  Klass** adr_lower_dimension()       { return (Klass**)&this->_lower_dimension;}
 
   // offset of first element, including any padding for the sake of alignment
   int  array_header_in_bytes() const    { return layout_helper_header_size(layout_helper()); }
--- a/src/hotspot/share/opto/c2compiler.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/c2compiler.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -248,7 +248,7 @@
     break;
 
   /* CompareAndSet, Object: */
-  case vmIntrinsics::_compareAndSetObject:
+  case vmIntrinsics::_compareAndSetReference:
 #ifdef _LP64
     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapN)) return false;
     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
@@ -256,10 +256,10 @@
     if (!Matcher::match_rule_supported(Op_CompareAndSwapP)) return false;
 #endif
     break;
-  case vmIntrinsics::_weakCompareAndSetObjectPlain:
-  case vmIntrinsics::_weakCompareAndSetObjectAcquire:
-  case vmIntrinsics::_weakCompareAndSetObjectRelease:
-  case vmIntrinsics::_weakCompareAndSetObject:
+  case vmIntrinsics::_weakCompareAndSetReferencePlain:
+  case vmIntrinsics::_weakCompareAndSetReferenceAcquire:
+  case vmIntrinsics::_weakCompareAndSetReferenceRelease:
+  case vmIntrinsics::_weakCompareAndSetReference:
 #ifdef _LP64
     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapN)) return false;
     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_WeakCompareAndSwapP)) return false;
@@ -312,9 +312,9 @@
     break;
 
   /* CompareAndExchange, Object: */
-  case vmIntrinsics::_compareAndExchangeObject:
-  case vmIntrinsics::_compareAndExchangeObjectAcquire:
-  case vmIntrinsics::_compareAndExchangeObjectRelease:
+  case vmIntrinsics::_compareAndExchangeReference:
+  case vmIntrinsics::_compareAndExchangeReferenceAcquire:
+  case vmIntrinsics::_compareAndExchangeReferenceRelease:
 #ifdef _LP64
     if ( UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeN)) return false;
     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_CompareAndExchangeP)) return false;
@@ -376,7 +376,7 @@
   case vmIntrinsics::_getAndSetLong:
     if (!Matcher::match_rule_supported(Op_GetAndSetL)) return false;
     break;
-  case vmIntrinsics::_getAndSetObject:
+  case vmIntrinsics::_getAndSetReference:
 #ifdef _LP64
     if (!UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetP)) return false;
     if (UseCompressedOops && !Matcher::match_rule_supported(Op_GetAndSetN)) return false;
@@ -455,7 +455,7 @@
   case vmIntrinsics::_getCharsStringU:
   case vmIntrinsics::_getCharStringU:
   case vmIntrinsics::_putCharStringU:
-  case vmIntrinsics::_getObject:
+  case vmIntrinsics::_getReference:
   case vmIntrinsics::_getBoolean:
   case vmIntrinsics::_getByte:
   case vmIntrinsics::_getShort:
@@ -464,7 +464,7 @@
   case vmIntrinsics::_getLong:
   case vmIntrinsics::_getFloat:
   case vmIntrinsics::_getDouble:
-  case vmIntrinsics::_putObject:
+  case vmIntrinsics::_putReference:
   case vmIntrinsics::_putBoolean:
   case vmIntrinsics::_putByte:
   case vmIntrinsics::_putShort:
@@ -473,7 +473,7 @@
   case vmIntrinsics::_putLong:
   case vmIntrinsics::_putFloat:
   case vmIntrinsics::_putDouble:
-  case vmIntrinsics::_getObjectVolatile:
+  case vmIntrinsics::_getReferenceVolatile:
   case vmIntrinsics::_getBooleanVolatile:
   case vmIntrinsics::_getByteVolatile:
   case vmIntrinsics::_getShortVolatile:
@@ -482,7 +482,7 @@
   case vmIntrinsics::_getLongVolatile:
   case vmIntrinsics::_getFloatVolatile:
   case vmIntrinsics::_getDoubleVolatile:
-  case vmIntrinsics::_putObjectVolatile:
+  case vmIntrinsics::_putReferenceVolatile:
   case vmIntrinsics::_putBooleanVolatile:
   case vmIntrinsics::_putByteVolatile:
   case vmIntrinsics::_putShortVolatile:
@@ -491,7 +491,7 @@
   case vmIntrinsics::_putLongVolatile:
   case vmIntrinsics::_putFloatVolatile:
   case vmIntrinsics::_putDoubleVolatile:
-  case vmIntrinsics::_getObjectAcquire:
+  case vmIntrinsics::_getReferenceAcquire:
   case vmIntrinsics::_getBooleanAcquire:
   case vmIntrinsics::_getByteAcquire:
   case vmIntrinsics::_getShortAcquire:
@@ -500,7 +500,7 @@
   case vmIntrinsics::_getLongAcquire:
   case vmIntrinsics::_getFloatAcquire:
   case vmIntrinsics::_getDoubleAcquire:
-  case vmIntrinsics::_putObjectRelease:
+  case vmIntrinsics::_putReferenceRelease:
   case vmIntrinsics::_putBooleanRelease:
   case vmIntrinsics::_putByteRelease:
   case vmIntrinsics::_putShortRelease:
@@ -509,7 +509,7 @@
   case vmIntrinsics::_putLongRelease:
   case vmIntrinsics::_putFloatRelease:
   case vmIntrinsics::_putDoubleRelease:
-  case vmIntrinsics::_getObjectOpaque:
+  case vmIntrinsics::_getReferenceOpaque:
   case vmIntrinsics::_getBooleanOpaque:
   case vmIntrinsics::_getByteOpaque:
   case vmIntrinsics::_getShortOpaque:
@@ -518,7 +518,7 @@
   case vmIntrinsics::_getLongOpaque:
   case vmIntrinsics::_getFloatOpaque:
   case vmIntrinsics::_getDoubleOpaque:
-  case vmIntrinsics::_putObjectOpaque:
+  case vmIntrinsics::_putReferenceOpaque:
   case vmIntrinsics::_putBooleanOpaque:
   case vmIntrinsics::_putByteOpaque:
   case vmIntrinsics::_putShortOpaque:
--- a/src/hotspot/share/opto/cfgnode.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/cfgnode.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/systemDictionary.hpp"
+#include "gc/shared/c2/barrierSetC2.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
@@ -1447,7 +1448,10 @@
   } else return NULL;
 
   // Build int->bool conversion
-  Node *n = new Conv2BNode( cmp->in(1) );
+  Node *in1 = cmp->in(1);
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+  in1 = bs->step_over_gc_barrier(in1);
+  Node *n = new Conv2BNode(in1);
   if( flipped )
     n = new XorINode( phase->transform(n), phase->intcon(1) );
 
@@ -1813,7 +1817,12 @@
         if (can_reshape && igvn != NULL) {
           igvn->_worklist.push(r);
         }
-        set_req(j, top);        // Nuke it down
+        // Nuke it down
+        if (can_reshape) {
+          set_req_X(j, top, igvn);
+        } else {
+          set_req(j, top);
+        }
         progress = this;        // Record progress
       }
     }
--- a/src/hotspot/share/opto/compile.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/compile.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -421,7 +421,7 @@
     }
   }
   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-  bs->eliminate_useless_gc_barriers(useful);
+  bs->eliminate_useless_gc_barriers(useful, this);
   // clean up the late inline lists
   remove_useless_late_inlines(&_string_late_inlines, useful);
   remove_useless_late_inlines(&_boxing_late_inlines, useful);
--- a/src/hotspot/share/opto/graphKit.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/graphKit.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -3726,6 +3726,10 @@
   if (ptr == NULL) {     // reduce dumb test in callers
     return NULL;
   }
+
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+  ptr = bs->step_over_gc_barrier(ptr);
+
   if (ptr->is_CheckCastPP()) { // strip only one raw-to-oop cast
     ptr = ptr->in(1);
     if (ptr == NULL) return NULL;
--- a/src/hotspot/share/opto/library_call.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/library_call.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -587,7 +587,7 @@
   case vmIntrinsics::_inflateStringC:
   case vmIntrinsics::_inflateStringB:           return inline_string_copy(!is_compress);
 
-  case vmIntrinsics::_getObject:                return inline_unsafe_access(!is_store, T_OBJECT,   Relaxed, false);
+  case vmIntrinsics::_getReference:             return inline_unsafe_access(!is_store, T_OBJECT,   Relaxed, false);
   case vmIntrinsics::_getBoolean:               return inline_unsafe_access(!is_store, T_BOOLEAN,  Relaxed, false);
   case vmIntrinsics::_getByte:                  return inline_unsafe_access(!is_store, T_BYTE,     Relaxed, false);
   case vmIntrinsics::_getShort:                 return inline_unsafe_access(!is_store, T_SHORT,    Relaxed, false);
@@ -597,7 +597,7 @@
   case vmIntrinsics::_getFloat:                 return inline_unsafe_access(!is_store, T_FLOAT,    Relaxed, false);
   case vmIntrinsics::_getDouble:                return inline_unsafe_access(!is_store, T_DOUBLE,   Relaxed, false);
 
-  case vmIntrinsics::_putObject:                return inline_unsafe_access( is_store, T_OBJECT,   Relaxed, false);
+  case vmIntrinsics::_putReference:             return inline_unsafe_access( is_store, T_OBJECT,   Relaxed, false);
   case vmIntrinsics::_putBoolean:               return inline_unsafe_access( is_store, T_BOOLEAN,  Relaxed, false);
   case vmIntrinsics::_putByte:                  return inline_unsafe_access( is_store, T_BYTE,     Relaxed, false);
   case vmIntrinsics::_putShort:                 return inline_unsafe_access( is_store, T_SHORT,    Relaxed, false);
@@ -607,7 +607,7 @@
   case vmIntrinsics::_putFloat:                 return inline_unsafe_access( is_store, T_FLOAT,    Relaxed, false);
   case vmIntrinsics::_putDouble:                return inline_unsafe_access( is_store, T_DOUBLE,   Relaxed, false);
 
-  case vmIntrinsics::_getObjectVolatile:        return inline_unsafe_access(!is_store, T_OBJECT,   Volatile, false);
+  case vmIntrinsics::_getReferenceVolatile:     return inline_unsafe_access(!is_store, T_OBJECT,   Volatile, false);
   case vmIntrinsics::_getBooleanVolatile:       return inline_unsafe_access(!is_store, T_BOOLEAN,  Volatile, false);
   case vmIntrinsics::_getByteVolatile:          return inline_unsafe_access(!is_store, T_BYTE,     Volatile, false);
   case vmIntrinsics::_getShortVolatile:         return inline_unsafe_access(!is_store, T_SHORT,    Volatile, false);
@@ -617,7 +617,7 @@
   case vmIntrinsics::_getFloatVolatile:         return inline_unsafe_access(!is_store, T_FLOAT,    Volatile, false);
   case vmIntrinsics::_getDoubleVolatile:        return inline_unsafe_access(!is_store, T_DOUBLE,   Volatile, false);
 
-  case vmIntrinsics::_putObjectVolatile:        return inline_unsafe_access( is_store, T_OBJECT,   Volatile, false);
+  case vmIntrinsics::_putReferenceVolatile:     return inline_unsafe_access( is_store, T_OBJECT,   Volatile, false);
   case vmIntrinsics::_putBooleanVolatile:       return inline_unsafe_access( is_store, T_BOOLEAN,  Volatile, false);
   case vmIntrinsics::_putByteVolatile:          return inline_unsafe_access( is_store, T_BYTE,     Volatile, false);
   case vmIntrinsics::_putShortVolatile:         return inline_unsafe_access( is_store, T_SHORT,    Volatile, false);
@@ -637,7 +637,7 @@
   case vmIntrinsics::_putIntUnaligned:          return inline_unsafe_access( is_store, T_INT,      Relaxed, true);
   case vmIntrinsics::_putLongUnaligned:         return inline_unsafe_access( is_store, T_LONG,     Relaxed, true);
 
-  case vmIntrinsics::_getObjectAcquire:         return inline_unsafe_access(!is_store, T_OBJECT,   Acquire, false);
+  case vmIntrinsics::_getReferenceAcquire:      return inline_unsafe_access(!is_store, T_OBJECT,   Acquire, false);
   case vmIntrinsics::_getBooleanAcquire:        return inline_unsafe_access(!is_store, T_BOOLEAN,  Acquire, false);
   case vmIntrinsics::_getByteAcquire:           return inline_unsafe_access(!is_store, T_BYTE,     Acquire, false);
   case vmIntrinsics::_getShortAcquire:          return inline_unsafe_access(!is_store, T_SHORT,    Acquire, false);
@@ -647,7 +647,7 @@
   case vmIntrinsics::_getFloatAcquire:          return inline_unsafe_access(!is_store, T_FLOAT,    Acquire, false);
   case vmIntrinsics::_getDoubleAcquire:         return inline_unsafe_access(!is_store, T_DOUBLE,   Acquire, false);
 
-  case vmIntrinsics::_putObjectRelease:         return inline_unsafe_access( is_store, T_OBJECT,   Release, false);
+  case vmIntrinsics::_putReferenceRelease:      return inline_unsafe_access( is_store, T_OBJECT,   Release, false);
   case vmIntrinsics::_putBooleanRelease:        return inline_unsafe_access( is_store, T_BOOLEAN,  Release, false);
   case vmIntrinsics::_putByteRelease:           return inline_unsafe_access( is_store, T_BYTE,     Release, false);
   case vmIntrinsics::_putShortRelease:          return inline_unsafe_access( is_store, T_SHORT,    Release, false);
@@ -657,7 +657,7 @@
   case vmIntrinsics::_putFloatRelease:          return inline_unsafe_access( is_store, T_FLOAT,    Release, false);
   case vmIntrinsics::_putDoubleRelease:         return inline_unsafe_access( is_store, T_DOUBLE,   Release, false);
 
-  case vmIntrinsics::_getObjectOpaque:          return inline_unsafe_access(!is_store, T_OBJECT,   Opaque, false);
+  case vmIntrinsics::_getReferenceOpaque:       return inline_unsafe_access(!is_store, T_OBJECT,   Opaque, false);
   case vmIntrinsics::_getBooleanOpaque:         return inline_unsafe_access(!is_store, T_BOOLEAN,  Opaque, false);
   case vmIntrinsics::_getByteOpaque:            return inline_unsafe_access(!is_store, T_BYTE,     Opaque, false);
   case vmIntrinsics::_getShortOpaque:           return inline_unsafe_access(!is_store, T_SHORT,    Opaque, false);
@@ -667,7 +667,7 @@
   case vmIntrinsics::_getFloatOpaque:           return inline_unsafe_access(!is_store, T_FLOAT,    Opaque, false);
   case vmIntrinsics::_getDoubleOpaque:          return inline_unsafe_access(!is_store, T_DOUBLE,   Opaque, false);
 
-  case vmIntrinsics::_putObjectOpaque:          return inline_unsafe_access( is_store, T_OBJECT,   Opaque, false);
+  case vmIntrinsics::_putReferenceOpaque:       return inline_unsafe_access( is_store, T_OBJECT,   Opaque, false);
   case vmIntrinsics::_putBooleanOpaque:         return inline_unsafe_access( is_store, T_BOOLEAN,  Opaque, false);
   case vmIntrinsics::_putByteOpaque:            return inline_unsafe_access( is_store, T_BYTE,     Opaque, false);
   case vmIntrinsics::_putShortOpaque:           return inline_unsafe_access( is_store, T_SHORT,    Opaque, false);
@@ -677,48 +677,48 @@
   case vmIntrinsics::_putFloatOpaque:           return inline_unsafe_access( is_store, T_FLOAT,    Opaque, false);
   case vmIntrinsics::_putDoubleOpaque:          return inline_unsafe_access( is_store, T_DOUBLE,   Opaque, false);
 
-  case vmIntrinsics::_compareAndSetObject:              return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap,      Volatile);
-  case vmIntrinsics::_compareAndSetByte:                return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap,      Volatile);
-  case vmIntrinsics::_compareAndSetShort:               return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap,      Volatile);
-  case vmIntrinsics::_compareAndSetInt:                 return inline_unsafe_load_store(T_INT,    LS_cmp_swap,      Volatile);
-  case vmIntrinsics::_compareAndSetLong:                return inline_unsafe_load_store(T_LONG,   LS_cmp_swap,      Volatile);
-
-  case vmIntrinsics::_weakCompareAndSetObjectPlain:     return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Relaxed);
-  case vmIntrinsics::_weakCompareAndSetObjectAcquire:   return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Acquire);
-  case vmIntrinsics::_weakCompareAndSetObjectRelease:   return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Release);
-  case vmIntrinsics::_weakCompareAndSetObject:          return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Volatile);
-  case vmIntrinsics::_weakCompareAndSetBytePlain:       return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Relaxed);
-  case vmIntrinsics::_weakCompareAndSetByteAcquire:     return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Acquire);
-  case vmIntrinsics::_weakCompareAndSetByteRelease:     return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Release);
-  case vmIntrinsics::_weakCompareAndSetByte:            return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Volatile);
-  case vmIntrinsics::_weakCompareAndSetShortPlain:      return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Relaxed);
-  case vmIntrinsics::_weakCompareAndSetShortAcquire:    return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Acquire);
-  case vmIntrinsics::_weakCompareAndSetShortRelease:    return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Release);
-  case vmIntrinsics::_weakCompareAndSetShort:           return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Volatile);
-  case vmIntrinsics::_weakCompareAndSetIntPlain:        return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Relaxed);
-  case vmIntrinsics::_weakCompareAndSetIntAcquire:      return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Acquire);
-  case vmIntrinsics::_weakCompareAndSetIntRelease:      return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Release);
-  case vmIntrinsics::_weakCompareAndSetInt:             return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Volatile);
-  case vmIntrinsics::_weakCompareAndSetLongPlain:       return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Relaxed);
-  case vmIntrinsics::_weakCompareAndSetLongAcquire:     return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Acquire);
-  case vmIntrinsics::_weakCompareAndSetLongRelease:     return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Release);
-  case vmIntrinsics::_weakCompareAndSetLong:            return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Volatile);
-
-  case vmIntrinsics::_compareAndExchangeObject:         return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Volatile);
-  case vmIntrinsics::_compareAndExchangeObjectAcquire:  return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Acquire);
-  case vmIntrinsics::_compareAndExchangeObjectRelease:  return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Release);
-  case vmIntrinsics::_compareAndExchangeByte:           return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Volatile);
-  case vmIntrinsics::_compareAndExchangeByteAcquire:    return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Acquire);
-  case vmIntrinsics::_compareAndExchangeByteRelease:    return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Release);
-  case vmIntrinsics::_compareAndExchangeShort:          return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Volatile);
-  case vmIntrinsics::_compareAndExchangeShortAcquire:   return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Acquire);
-  case vmIntrinsics::_compareAndExchangeShortRelease:   return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Release);
-  case vmIntrinsics::_compareAndExchangeInt:            return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Volatile);
-  case vmIntrinsics::_compareAndExchangeIntAcquire:     return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Acquire);
-  case vmIntrinsics::_compareAndExchangeIntRelease:     return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Release);
-  case vmIntrinsics::_compareAndExchangeLong:           return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Volatile);
-  case vmIntrinsics::_compareAndExchangeLongAcquire:    return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Acquire);
-  case vmIntrinsics::_compareAndExchangeLongRelease:    return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Release);
+  case vmIntrinsics::_compareAndSetReference:   return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap,      Volatile);
+  case vmIntrinsics::_compareAndSetByte:        return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap,      Volatile);
+  case vmIntrinsics::_compareAndSetShort:       return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap,      Volatile);
+  case vmIntrinsics::_compareAndSetInt:         return inline_unsafe_load_store(T_INT,    LS_cmp_swap,      Volatile);
+  case vmIntrinsics::_compareAndSetLong:        return inline_unsafe_load_store(T_LONG,   LS_cmp_swap,      Volatile);
+
+  case vmIntrinsics::_weakCompareAndSetReferencePlain:     return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Relaxed);
+  case vmIntrinsics::_weakCompareAndSetReferenceAcquire:   return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Acquire);
+  case vmIntrinsics::_weakCompareAndSetReferenceRelease:   return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Release);
+  case vmIntrinsics::_weakCompareAndSetReference:          return inline_unsafe_load_store(T_OBJECT, LS_cmp_swap_weak, Volatile);
+  case vmIntrinsics::_weakCompareAndSetBytePlain:          return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Relaxed);
+  case vmIntrinsics::_weakCompareAndSetByteAcquire:        return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Acquire);
+  case vmIntrinsics::_weakCompareAndSetByteRelease:        return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Release);
+  case vmIntrinsics::_weakCompareAndSetByte:               return inline_unsafe_load_store(T_BYTE,   LS_cmp_swap_weak, Volatile);
+  case vmIntrinsics::_weakCompareAndSetShortPlain:         return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Relaxed);
+  case vmIntrinsics::_weakCompareAndSetShortAcquire:       return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Acquire);
+  case vmIntrinsics::_weakCompareAndSetShortRelease:       return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Release);
+  case vmIntrinsics::_weakCompareAndSetShort:              return inline_unsafe_load_store(T_SHORT,  LS_cmp_swap_weak, Volatile);
+  case vmIntrinsics::_weakCompareAndSetIntPlain:           return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Relaxed);
+  case vmIntrinsics::_weakCompareAndSetIntAcquire:         return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Acquire);
+  case vmIntrinsics::_weakCompareAndSetIntRelease:         return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Release);
+  case vmIntrinsics::_weakCompareAndSetInt:                return inline_unsafe_load_store(T_INT,    LS_cmp_swap_weak, Volatile);
+  case vmIntrinsics::_weakCompareAndSetLongPlain:          return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Relaxed);
+  case vmIntrinsics::_weakCompareAndSetLongAcquire:        return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Acquire);
+  case vmIntrinsics::_weakCompareAndSetLongRelease:        return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Release);
+  case vmIntrinsics::_weakCompareAndSetLong:               return inline_unsafe_load_store(T_LONG,   LS_cmp_swap_weak, Volatile);
+
+  case vmIntrinsics::_compareAndExchangeReference:         return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Volatile);
+  case vmIntrinsics::_compareAndExchangeReferenceAcquire:  return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Acquire);
+  case vmIntrinsics::_compareAndExchangeReferenceRelease:  return inline_unsafe_load_store(T_OBJECT, LS_cmp_exchange,  Release);
+  case vmIntrinsics::_compareAndExchangeByte:              return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Volatile);
+  case vmIntrinsics::_compareAndExchangeByteAcquire:       return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Acquire);
+  case vmIntrinsics::_compareAndExchangeByteRelease:       return inline_unsafe_load_store(T_BYTE,   LS_cmp_exchange,  Release);
+  case vmIntrinsics::_compareAndExchangeShort:             return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Volatile);
+  case vmIntrinsics::_compareAndExchangeShortAcquire:      return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Acquire);
+  case vmIntrinsics::_compareAndExchangeShortRelease:      return inline_unsafe_load_store(T_SHORT,  LS_cmp_exchange,  Release);
+  case vmIntrinsics::_compareAndExchangeInt:               return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Volatile);
+  case vmIntrinsics::_compareAndExchangeIntAcquire:        return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Acquire);
+  case vmIntrinsics::_compareAndExchangeIntRelease:        return inline_unsafe_load_store(T_INT,    LS_cmp_exchange,  Release);
+  case vmIntrinsics::_compareAndExchangeLong:              return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Volatile);
+  case vmIntrinsics::_compareAndExchangeLongAcquire:       return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Acquire);
+  case vmIntrinsics::_compareAndExchangeLongRelease:       return inline_unsafe_load_store(T_LONG,   LS_cmp_exchange,  Release);
 
   case vmIntrinsics::_getAndAddByte:                    return inline_unsafe_load_store(T_BYTE,   LS_get_add,       Volatile);
   case vmIntrinsics::_getAndAddShort:                   return inline_unsafe_load_store(T_SHORT,  LS_get_add,       Volatile);
@@ -729,7 +729,7 @@
   case vmIntrinsics::_getAndSetShort:                   return inline_unsafe_load_store(T_SHORT,  LS_get_set,       Volatile);
   case vmIntrinsics::_getAndSetInt:                     return inline_unsafe_load_store(T_INT,    LS_get_set,       Volatile);
   case vmIntrinsics::_getAndSetLong:                    return inline_unsafe_load_store(T_LONG,   LS_get_set,       Volatile);
-  case vmIntrinsics::_getAndSetObject:                  return inline_unsafe_load_store(T_OBJECT, LS_get_set,       Volatile);
+  case vmIntrinsics::_getAndSetReference:               return inline_unsafe_load_store(T_OBJECT, LS_get_set,       Volatile);
 
   case vmIntrinsics::_loadFence:
   case vmIntrinsics::_storeFence:
@@ -2344,14 +2344,14 @@
     ciSignature* sig = callee()->signature();
 #ifdef ASSERT
     if (!is_store) {
-      // Object getObject(Object base, int/long offset), etc.
+      // Object getReference(Object base, int/long offset), etc.
       BasicType rtype = sig->return_type()->basic_type();
       assert(rtype == type, "getter must return the expected value");
       assert(sig->count() == 2, "oop getter has 2 arguments");
       assert(sig->type_at(0)->basic_type() == T_OBJECT, "getter base is object");
       assert(sig->type_at(1)->basic_type() == T_LONG, "getter offset is correct");
     } else {
-      // void putObject(Object base, int/long offset, Object x), etc.
+      // void putReference(Object base, int/long offset, Object x), etc.
       assert(sig->return_type()->basic_type() == T_VOID, "putter must not return a value");
       assert(sig->count() == 3, "oop putter has 3 arguments");
       assert(sig->type_at(0)->basic_type() == T_OBJECT, "putter base is object");
@@ -2422,7 +2422,7 @@
       bt = adr_type->is_aryptr()->elem()->array_element_basic_type();
     }
     if (bt == T_ARRAY || bt == T_NARROWOOP) {
-      // accessing an array field with getObject is not a mismatch
+      // accessing an array field with getReference is not a mismatch
       bt = T_OBJECT;
     }
     if ((bt == T_OBJECT) != (type == T_OBJECT)) {
@@ -2521,16 +2521,16 @@
 //
 // LS_cmp_swap:
 //
-//   boolean compareAndSetObject(Object o, long offset, Object expected, Object x);
+//   boolean compareAndSetReference(Object o, long offset, Object expected, Object x);
 //   boolean compareAndSetInt(   Object o, long offset, int    expected, int    x);
 //   boolean compareAndSetLong(  Object o, long offset, long   expected, long   x);
 //
 // LS_cmp_swap_weak:
 //
-//   boolean weakCompareAndSetObject(       Object o, long offset, Object expected, Object x);
-//   boolean weakCompareAndSetObjectPlain(  Object o, long offset, Object expected, Object x);
-//   boolean weakCompareAndSetObjectAcquire(Object o, long offset, Object expected, Object x);
-//   boolean weakCompareAndSetObjectRelease(Object o, long offset, Object expected, Object x);
+//   boolean weakCompareAndSetReference(       Object o, long offset, Object expected, Object x);
+//   boolean weakCompareAndSetReferencePlain(  Object o, long offset, Object expected, Object x);
+//   boolean weakCompareAndSetReferenceAcquire(Object o, long offset, Object expected, Object x);
+//   boolean weakCompareAndSetReferenceRelease(Object o, long offset, Object expected, Object x);
 //
 //   boolean weakCompareAndSetInt(          Object o, long offset, int    expected, int    x);
 //   boolean weakCompareAndSetIntPlain(     Object o, long offset, int    expected, int    x);
@@ -2544,9 +2544,9 @@
 //
 // LS_cmp_exchange:
 //
-//   Object compareAndExchangeObjectVolatile(Object o, long offset, Object expected, Object x);
-//   Object compareAndExchangeObjectAcquire( Object o, long offset, Object expected, Object x);
-//   Object compareAndExchangeObjectRelease( Object o, long offset, Object expected, Object x);
+//   Object compareAndExchangeReferenceVolatile(Object o, long offset, Object expected, Object x);
+//   Object compareAndExchangeReferenceAcquire( Object o, long offset, Object expected, Object x);
+//   Object compareAndExchangeReferenceRelease( Object o, long offset, Object expected, Object x);
 //
 //   Object compareAndExchangeIntVolatile(   Object o, long offset, Object expected, Object x);
 //   Object compareAndExchangeIntAcquire(    Object o, long offset, Object expected, Object x);
--- a/src/hotspot/share/opto/macro.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/macro.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -434,7 +434,10 @@
       if (val == mem) {
         values.at_put(j, mem);
       } else if (val->is_Store()) {
-        values.at_put(j, val->in(MemNode::ValueIn));
+        Node* n = val->in(MemNode::ValueIn);
+        BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+        n = bs->step_over_gc_barrier(n);
+        values.at_put(j, n);
       } else if(val->is_Proj() && val->in(0) == alloc) {
         values.at_put(j, _igvn.zerocon(ft));
       } else if (val->is_Phi()) {
@@ -546,7 +549,10 @@
       // hit a sentinel, return appropriate 0 value
       return _igvn.zerocon(ft);
     } else if (mem->is_Store()) {
-      return mem->in(MemNode::ValueIn);
+      Node* n = mem->in(MemNode::ValueIn);
+      BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+      n = bs->step_over_gc_barrier(n);
+      return n;
     } else if (mem->is_Phi()) {
       // attempt to produce a Phi reflecting the values on the input paths of the Phi
       Node_Stack value_phis(a, 8);
--- a/src/hotspot/share/opto/memnode.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/memnode.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -924,8 +924,10 @@
     if (ac->as_ArrayCopy()->is_clonebasic()) {
       assert(ld_alloc != NULL, "need an alloc");
       assert(addp->is_AddP(), "address must be addp");
-      assert(addp->in(AddPNode::Base) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Base), "strange pattern");
-      assert(addp->in(AddPNode::Address) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Address), "strange pattern");
+      assert(ac->in(ArrayCopyNode::Dest)->is_AddP(), "dest must be an address");
+      BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+      assert(bs->step_over_gc_barrier(addp->in(AddPNode::Base)) == bs->step_over_gc_barrier(ac->in(ArrayCopyNode::Dest)->in(AddPNode::Base)), "strange pattern");
+      assert(bs->step_over_gc_barrier(addp->in(AddPNode::Address)) == bs->step_over_gc_barrier(ac->in(ArrayCopyNode::Dest)->in(AddPNode::Address)), "strange pattern");
       addp->set_req(AddPNode::Base, src->in(AddPNode::Base));
       addp->set_req(AddPNode::Address, src->in(AddPNode::Address));
     } else {
@@ -1081,6 +1083,8 @@
         (tp != NULL) && tp->is_ptr_to_boxed_value()) {
       intptr_t ignore = 0;
       Node* base = AddPNode::Ideal_base_and_offset(ld_adr, phase, ignore);
+      BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+      base = bs->step_over_gc_barrier(base);
       if (base != NULL && base->is_Proj() &&
           base->as_Proj()->_con == TypeFunc::Parms &&
           base->in(0)->is_CallStaticJava() &&
--- a/src/hotspot/share/opto/node.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/node.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -1396,7 +1396,7 @@
             // and remove_globally_dead_node().
             igvn->add_users_to_worklist( n );
           } else {
-            BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn->_worklist, n);
+            BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn, n);
           }
         }
       }
--- a/src/hotspot/share/opto/phaseX.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/phaseX.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -1375,7 +1375,7 @@
                 assert(!(i < imax), "sanity");
               }
             } else {
-              BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(_worklist, in);
+              BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(this, in);
             }
             if (ReduceFieldZeroing && dead->is_Load() && i == MemNode::Memory &&
                 in->is_Proj() && in->in(0) != NULL && in->in(0)->is_Initialize()) {
@@ -2089,6 +2089,8 @@
     default:
       break;
     }
+
+    BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn, old);
   }
 
 }
--- a/src/hotspot/share/opto/subnode.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/opto/subnode.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -883,9 +883,7 @@
   //   LoadBarrier?(LoadP(LoadP(AddP(foo:Klass, #java_mirror))))
   //   or NULL if not matching.
   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
-  if (bs->is_gc_barrier_node(n)) {
     n = bs->step_over_gc_barrier(n);
-  }
 
   if (n->Opcode() != Op_LoadP) return NULL;
 
@@ -959,8 +957,14 @@
     if (k1 && (k2 || conk2)) {
       Node* lhs = k1;
       Node* rhs = (k2 != NULL) ? k2 : conk2;
-      this->set_req(1, lhs);
-      this->set_req(2, rhs);
+      PhaseIterGVN* igvn = phase->is_IterGVN();
+      if (igvn != NULL) {
+        set_req_X(1, lhs, igvn);
+        set_req_X(2, rhs, igvn);
+      } else {
+        set_req(1, lhs);
+        set_req(2, rhs);
+      }
       return this;
     }
   }
--- a/src/hotspot/share/prims/jvmtiExport.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/prims/jvmtiExport.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -538,7 +538,7 @@
   JvmtiSampledObjectAllocEventCollector()  NOT_JVMTI_RETURN;
   ~JvmtiSampledObjectAllocEventCollector()  NOT_JVMTI_RETURN;
   bool is_sampled_object_alloc_event()    { return true; }
-  static bool object_alloc_is_safe_to_sample();
+  static bool object_alloc_is_safe_to_sample() NOT_JVMTI_RETURN_(false);
 };
 
 // Marker class to disable the posting of VMObjectAlloc events
--- a/src/hotspot/share/prims/unsafe.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/prims/unsafe.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -257,28 +257,28 @@
 // These functions allow a null base pointer with an arbitrary address.
 // But if the base pointer is non-null, the offset should make some sense.
 // That is, it should be in the range [0, MAX_OBJECT_SIZE].
-UNSAFE_ENTRY(jobject, Unsafe_GetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) {
+UNSAFE_ENTRY(jobject, Unsafe_GetReference(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) {
   oop p = JNIHandles::resolve(obj);
   assert_field_offset_sane(p, offset);
   oop v = HeapAccess<ON_UNKNOWN_OOP_REF>::oop_load_at(p, offset);
   return JNIHandles::make_local(env, v);
 } UNSAFE_END
 
-UNSAFE_ENTRY(void, Unsafe_PutObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) {
+UNSAFE_ENTRY(void, Unsafe_PutReference(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) {
   oop x = JNIHandles::resolve(x_h);
   oop p = JNIHandles::resolve(obj);
   assert_field_offset_sane(p, offset);
   HeapAccess<ON_UNKNOWN_OOP_REF>::oop_store_at(p, offset, x);
 } UNSAFE_END
 
-UNSAFE_ENTRY(jobject, Unsafe_GetObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) {
+UNSAFE_ENTRY(jobject, Unsafe_GetReferenceVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset)) {
   oop p = JNIHandles::resolve(obj);
   assert_field_offset_sane(p, offset);
   oop v = HeapAccess<MO_SEQ_CST | ON_UNKNOWN_OOP_REF>::oop_load_at(p, offset);
   return JNIHandles::make_local(env, v);
 } UNSAFE_END
 
-UNSAFE_ENTRY(void, Unsafe_PutObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) {
+UNSAFE_ENTRY(void, Unsafe_PutReferenceVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) {
   oop x = JNIHandles::resolve(x_h);
   oop p = JNIHandles::resolve(obj);
   assert_field_offset_sane(p, offset);
@@ -864,7 +864,7 @@
 
 // JSR166 ------------------------------------------------------------------
 
-UNSAFE_ENTRY(jobject, Unsafe_CompareAndExchangeObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) {
+UNSAFE_ENTRY(jobject, Unsafe_CompareAndExchangeReference(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) {
   oop x = JNIHandles::resolve(x_h);
   oop e = JNIHandles::resolve(e_h);
   oop p = JNIHandles::resolve(obj);
@@ -895,7 +895,7 @@
   }
 } UNSAFE_END
 
-UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) {
+UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSetReference(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject e_h, jobject x_h)) {
   oop x = JNIHandles::resolve(x_h);
   oop e = JNIHandles::resolve(e_h);
   oop p = JNIHandles::resolve(obj);
@@ -1034,10 +1034,10 @@
 
 
 static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = {
-    {CC "getObject",        CC "(" OBJ "J)" OBJ "",   FN_PTR(Unsafe_GetObject)},
-    {CC "putObject",        CC "(" OBJ "J" OBJ ")V",  FN_PTR(Unsafe_PutObject)},
-    {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ "",   FN_PTR(Unsafe_GetObjectVolatile)},
-    {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V",  FN_PTR(Unsafe_PutObjectVolatile)},
+    {CC "getReference",         CC "(" OBJ "J)" OBJ "",   FN_PTR(Unsafe_GetReference)},
+    {CC "putReference",         CC "(" OBJ "J" OBJ ")V",  FN_PTR(Unsafe_PutReference)},
+    {CC "getReferenceVolatile", CC "(" OBJ "J)" OBJ,      FN_PTR(Unsafe_GetReferenceVolatile)},
+    {CC "putReferenceVolatile", CC "(" OBJ "J" OBJ ")V",  FN_PTR(Unsafe_PutReferenceVolatile)},
 
     {CC "getUncompressedObject", CC "(" ADR ")" OBJ,  FN_PTR(Unsafe_GetUncompressedObject)},
 
@@ -1067,10 +1067,10 @@
     {CC "defineClass0",       CC "(" DC_Args ")" CLS,    FN_PTR(Unsafe_DefineClass0)},
     {CC "allocateInstance",   CC "(" CLS ")" OBJ,        FN_PTR(Unsafe_AllocateInstance)},
     {CC "throwException",     CC "(" THR ")V",           FN_PTR(Unsafe_ThrowException)},
-    {CC "compareAndSetObject",CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSetObject)},
+    {CC "compareAndSetReference",CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSetReference)},
     {CC "compareAndSetInt",   CC "(" OBJ "J""I""I"")Z",  FN_PTR(Unsafe_CompareAndSetInt)},
     {CC "compareAndSetLong",  CC "(" OBJ "J""J""J"")Z",  FN_PTR(Unsafe_CompareAndSetLong)},
-    {CC "compareAndExchangeObject", CC "(" OBJ "J" OBJ "" OBJ ")" OBJ, FN_PTR(Unsafe_CompareAndExchangeObject)},
+    {CC "compareAndExchangeReference", CC "(" OBJ "J" OBJ "" OBJ ")" OBJ, FN_PTR(Unsafe_CompareAndExchangeReference)},
     {CC "compareAndExchangeInt",  CC "(" OBJ "J""I""I"")I", FN_PTR(Unsafe_CompareAndExchangeInt)},
     {CC "compareAndExchangeLong", CC "(" OBJ "J""J""J"")J", FN_PTR(Unsafe_CompareAndExchangeLong)},
 
--- a/src/hotspot/share/runtime/reflection.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/runtime/reflection.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -326,13 +326,6 @@
   }
 }
 
-#ifdef ASSERT
-static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS) {
-  BasicType type = TypeArrayKlass::cast(basic_type_arrayklass)->element_type();
-  return Universe::java_mirror(type);
-}
-#endif
-
 arrayOop Reflection::reflect_new_array(oop element_mirror, jint length, TRAPS) {
   if (element_mirror == NULL) {
     THROW_0(vmSymbols::java_lang_NullPointerException());
@@ -396,35 +389,6 @@
 }
 
 
-oop Reflection::array_component_type(oop mirror, TRAPS) {
-  if (java_lang_Class::is_primitive(mirror)) {
-    return NULL;
-  }
-
-  Klass* klass = java_lang_Class::as_Klass(mirror);
-  if (!klass->is_array_klass()) {
-    return NULL;
-  }
-
-  oop result = java_lang_Class::component_mirror(mirror);
-#ifdef ASSERT
-  oop result2 = NULL;
-  if (ArrayKlass::cast(klass)->dimension() == 1) {
-    if (klass->is_typeArray_klass()) {
-      result2 = basic_type_arrayklass_to_mirror(klass, CHECK_NULL);
-    } else {
-      result2 = ObjArrayKlass::cast(klass)->element_klass()->java_mirror();
-    }
-  } else {
-    Klass* lower_dim = ArrayKlass::cast(klass)->lower_dimension();
-    assert(lower_dim->is_array_klass(), "just checking");
-    result2 = lower_dim->java_mirror();
-  }
-  assert(oopDesc::equals(result, result2), "results must be consistent");
-#endif //ASSERT
-  return result;
-}
-
 static bool under_unsafe_anonymous_host(const InstanceKlass* ik, const InstanceKlass* unsafe_anonymous_host) {
   DEBUG_ONLY(int inf_loop_check = 1000 * 1000 * 1000);
   for (;;) {
--- a/src/hotspot/share/runtime/reflection.hpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/hotspot/share/runtime/reflection.hpp	Tue Oct 23 15:29:10 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,8 +73,6 @@
   // Reflective array access. Returns type code. Throws ArrayIndexOutOfBoundsException.
   static BasicType array_get(jvalue* value, arrayOop a, int index, TRAPS);
   static void      array_set(jvalue* value, arrayOop a, int index, BasicType value_type, TRAPS);
-  // Returns mirror on array element type (NULL for basic type arrays and non-arrays).
-  static oop       array_component_type(oop mirror, TRAPS);
 
   // Object creation
   static arrayOop reflect_new_array(oop element_mirror, jint length, TRAPS);
--- a/src/java.base/share/classes/java/io/BufferedInputStream.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/io/BufferedInputStream.java	Tue Oct 23 15:29:10 2018 +0530
@@ -238,7 +238,7 @@
                     nsz = marklimit;
                 byte[] nbuf = new byte[nsz];
                 System.arraycopy(buffer, 0, nbuf, 0, pos);
-                if (!U.compareAndSetObject(this, BUF_OFFSET, buffer, nbuf)) {
+                if (!U.compareAndSetReference(this, BUF_OFFSET, buffer, nbuf)) {
                     // Can't replace buf if there was an async close.
                     // Note: This would need to be changed if fill()
                     // is ever made accessible to multiple threads.
@@ -482,7 +482,7 @@
     public void close() throws IOException {
         byte[] buffer;
         while ( (buffer = buf) != null) {
-            if (U.compareAndSetObject(this, BUF_OFFSET, buffer, null)) {
+            if (U.compareAndSetReference(this, BUF_OFFSET, buffer, null)) {
                 InputStream input = in;
                 in = null;
                 if (input != null)
--- a/src/java.base/share/classes/java/io/File.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/io/File.java	Tue Oct 23 15:29:10 2018 +0530
@@ -2237,7 +2237,7 @@
         if (sep != separatorChar)
             pathField = pathField.replace(sep, separatorChar);
         String path = fs.normalize(pathField);
-        UNSAFE.putObject(this, PATH_OFFSET, path);
+        UNSAFE.putReference(this, PATH_OFFSET, path);
         UNSAFE.putIntVolatile(this, PREFIX_LENGTH_OFFSET, fs.prefixLength(path));
     }
 
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java	Tue Oct 23 15:29:10 2018 +0530
@@ -2135,7 +2135,7 @@
                 switch (typeCodes[i]) {
                     case 'L':
                     case '[':
-                        vals[offsets[i]] = unsafe.getObject(obj, readKeys[i]);
+                        vals[offsets[i]] = unsafe.getReference(obj, readKeys[i]);
                         break;
 
                     default:
@@ -2190,7 +2190,7 @@
                                 obj.getClass().getName());
                         }
                         if (!dryRun)
-                            unsafe.putObject(obj, key, val);
+                            unsafe.putReference(obj, key, val);
                         break;
 
                     default:
--- a/src/java.base/share/classes/java/lang/Class.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/Class.java	Tue Oct 23 15:29:10 2018 +0530
@@ -405,7 +405,7 @@
 
 
     /**
-     * Returns the {@code Class} with the given <a href="ClassLoader.html#name">
+     * Returns the {@code Class} with the given <a href="ClassLoader.html#binary-name">
      * binary name</a> in the given module.
      *
      * <p> This method attempts to locate, load, and link the class or interface.
@@ -427,7 +427,7 @@
      * loads a class in another module.
      *
      * @param  module   A module
-     * @param  name     The <a href="ClassLoader.html#name">binary name</a>
+     * @param  name     The <a href="ClassLoader.html#binary-name">binary name</a>
      *                  of the class
      * @return {@code Class} object of the given name defined in the given module;
      *         {@code null} if not found.
@@ -2904,19 +2904,19 @@
         static <T> boolean casReflectionData(Class<?> clazz,
                                              SoftReference<ReflectionData<T>> oldData,
                                              SoftReference<ReflectionData<T>> newData) {
-            return unsafe.compareAndSetObject(clazz, reflectionDataOffset, oldData, newData);
+            return unsafe.compareAndSetReference(clazz, reflectionDataOffset, oldData, newData);
         }
 
         static <T> boolean casAnnotationType(Class<?> clazz,
                                              AnnotationType oldType,
                                              AnnotationType newType) {
-            return unsafe.compareAndSetObject(clazz, annotationTypeOffset, oldType, newType);
+            return unsafe.compareAndSetReference(clazz, annotationTypeOffset, oldType, newType);
         }
 
         static <T> boolean casAnnotationData(Class<?> clazz,
                                              AnnotationData oldData,
                                              AnnotationData newData) {
-            return unsafe.compareAndSetObject(clazz, annotationDataOffset, oldData, newData);
+            return unsafe.compareAndSetReference(clazz, annotationDataOffset, oldData, newData);
         }
     }
 
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Tue Oct 23 15:29:10 2018 +0530
@@ -3002,7 +3002,7 @@
         Class<?> k = ClassLoader.class;
         long offset;
         offset = unsafe.objectFieldOffset(k, name);
-        return unsafe.compareAndSetObject(this, offset, null, obj);
+        return unsafe.compareAndSetReference(this, offset, null, obj);
     }
 }
 
--- a/src/java.base/share/classes/java/lang/StackWalker.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/StackWalker.java	Tue Oct 23 15:29:10 2018 +0530
@@ -100,7 +100,7 @@
      */
     public interface StackFrame {
         /**
-         * Gets the <a href="ClassLoader.html#name">binary name</a>
+         * Gets the <a href="ClassLoader.html#binary-name">binary name</a>
          * of the declaring class of the method represented by this stack frame.
          *
          * @return the binary name of the declaring class of the method
--- a/src/java.base/share/classes/java/lang/invoke/CallSite.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/CallSite.java	Tue Oct 23 15:29:10 2018 +0530
@@ -287,7 +287,7 @@
     }
     /*package-private*/
     MethodHandle getTargetVolatile() {
-        return (MethodHandle) UNSAFE.getObjectVolatile(this, getTargetOffset());
+        return (MethodHandle) UNSAFE.getReferenceVolatile(this, getTargetOffset());
     }
     /*package-private*/
     void setTargetVolatile(MethodHandle newTarget) {
--- a/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/ClassSpecializer.java	Tue Oct 23 15:29:10 2018 +0530
@@ -940,7 +940,7 @@
                 Object base = MethodHandleNatives.staticFieldBase(sdField);
                 long offset = MethodHandleNatives.staticFieldOffset(sdField);
                 UNSAFE.loadFence();
-                return metaType.cast(UNSAFE.getObject(base, offset));
+                return metaType.cast(UNSAFE.getReference(base, offset));
             } catch (Error err) {
                 throw err;
             } catch (Exception ex) {
@@ -970,7 +970,7 @@
                 Object base = MethodHandleNatives.staticFieldBase(sdField);
                 long offset = MethodHandleNatives.staticFieldOffset(sdField);
                 UNSAFE.storeFence();
-                UNSAFE.putObject(base, offset, speciesData);
+                UNSAFE.putReference(base, offset, speciesData);
                 UNSAFE.storeFence();
             } catch (Error err) {
                 throw err;
--- a/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java	Tue Oct 23 15:29:10 2018 +0530
@@ -655,7 +655,7 @@
                     case LONG:    return GET_LONG_VOLATILE;
                     case FLOAT:   return GET_FLOAT_VOLATILE;
                     case DOUBLE:  return GET_DOUBLE_VOLATILE;
-                    case OBJECT:  return GET_OBJECT_VOLATILE;
+                    case OBJECT:  return GET_REFERENCE_VOLATILE;
                 }
             } else {
                 switch (wrapper) {
@@ -667,7 +667,7 @@
                     case LONG:    return GET_LONG;
                     case FLOAT:   return GET_FLOAT;
                     case DOUBLE:  return GET_DOUBLE;
-                    case OBJECT:  return GET_OBJECT;
+                    case OBJECT:  return GET_REFERENCE;
                 }
             }
         } else {
@@ -681,7 +681,7 @@
                     case LONG:    return PUT_LONG_VOLATILE;
                     case FLOAT:   return PUT_FLOAT_VOLATILE;
                     case DOUBLE:  return PUT_DOUBLE_VOLATILE;
-                    case OBJECT:  return PUT_OBJECT_VOLATILE;
+                    case OBJECT:  return PUT_REFERENCE_VOLATILE;
                 }
             } else {
                 switch (wrapper) {
@@ -693,7 +693,7 @@
                     case LONG:    return PUT_LONG;
                     case FLOAT:   return PUT_FLOAT;
                     case DOUBLE:  return PUT_DOUBLE;
-                    case OBJECT:  return PUT_OBJECT;
+                    case OBJECT:  return PUT_REFERENCE;
                 }
             }
         }
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Oct 23 15:29:10 2018 +0530
@@ -653,7 +653,7 @@
             case LINK_TO_TARGET_METHOD:     // fall-through
             case GENERIC_INVOKER:           // fall-through
             case GENERIC_LINKER:            return resolveFrom(name, invokerType.basicType(), Invokers.Holder.class);
-            case GET_OBJECT:                // fall-through
+            case GET_REFERENCE:             // fall-through
             case GET_BOOLEAN:               // fall-through
             case GET_BYTE:                  // fall-through
             case GET_CHAR:                  // fall-through
@@ -662,7 +662,7 @@
             case GET_LONG:                  // fall-through
             case GET_FLOAT:                 // fall-through
             case GET_DOUBLE:                // fall-through
-            case PUT_OBJECT:                // fall-through
+            case PUT_REFERENCE:             // fall-through
             case PUT_BOOLEAN:               // fall-through
             case PUT_BYTE:                  // fall-through
             case PUT_CHAR:                  // fall-through
--- a/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaForm.java	Tue Oct 23 15:29:10 2018 +0530
@@ -296,10 +296,10 @@
         DIRECT_NEW_INVOKE_SPECIAL("DMH.newInvokeSpecial", "newInvokeSpecial"),
         DIRECT_INVOKE_INTERFACE("DMH.invokeInterface", "invokeInterface"),
         DIRECT_INVOKE_STATIC_INIT("DMH.invokeStaticInit", "invokeStaticInit"),
-        GET_OBJECT("getObject"),
-        PUT_OBJECT("putObject"),
-        GET_OBJECT_VOLATILE("getObjectVolatile"),
-        PUT_OBJECT_VOLATILE("putObjectVolatile"),
+        GET_REFERENCE("getReference"),
+        PUT_REFERENCE("putReference"),
+        GET_REFERENCE_VOLATILE("getReferenceVolatile"),
+        PUT_REFERENCE_VOLATILE("putReferenceVolatile"),
         GET_INT("getInt"),
         PUT_INT("putInt"),
         GET_INT_VOLATILE("getIntVolatile"),
--- a/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -85,7 +85,8 @@
                 PERMUTE_ARGS = 13,
                 LOCAL_TYPES = 14,
                 FOLD_SELECT_ARGS = 15,
-                FOLD_SELECT_ARGS_TO_VOID = 16;
+                FOLD_SELECT_ARGS_TO_VOID = 16,
+                FILTER_SELECT_ARGS = 17;
 
         private static final boolean STRESS_TEST = false; // turn on to disable most packing
         private static final int
@@ -730,21 +731,23 @@
         Name getCombiner = new Name(newData.getterFunction(oldData.fieldCount()), newBaseAddress);
         Object[] combinerArgs = new Object[1 + combinerArity];
         combinerArgs[0] = getCombiner;
-        Name[] newParams;
+        Name newParam = null;
         if (keepArguments) {
-            newParams = new Name[0];
             for (int i = 0; i < combinerArity; i++) {
                 combinerArgs[i + 1] = lambdaForm.parameter(1 + argPositions[i]);
                 assert (basicType(combinerType.parameterType(i)) == lambdaForm.parameterType(1 + argPositions[i]));
             }
         } else {
-            newParams = new Name[combinerArity];
-            for (int i = 0; i < newParams.length; i++) {
-                newParams[i] = lambdaForm.parameter(1 + argPositions[i]);
+            newParam = new Name(pos, BasicType.basicType(combinerType.returnType()));
+            for (int i = 0; i < combinerArity; i++) {
+                int argPos = 1 + argPositions[i];
+                if (argPos == pos) {
+                    combinerArgs[i + 1] = newParam;
+                } else {
+                    combinerArgs[i + 1] = lambdaForm.parameter(argPos);
+                }
                 assert (basicType(combinerType.parameterType(i)) == lambdaForm.parameterType(1 + argPositions[i]));
             }
-            System.arraycopy(newParams, 0,
-                             combinerArgs, 1, combinerArity);
         }
         Name callCombiner = new Name(combinerType, combinerArgs);
 
@@ -755,12 +758,13 @@
 
         // insert new arguments, if needed
         int argPos = pos + resultArity;  // skip result parameter
-        for (Name newParam : newParams) {
+        if (newParam != null) {
             buf.insertParameter(argPos++, newParam);
+            exprPos++;
         }
-        assert(buf.lastIndexOf(callCombiner) == exprPos+1+newParams.length);
+        assert(buf.lastIndexOf(callCombiner) == exprPos+1);
         if (!dropResult) {
-            buf.replaceParameterByCopy(pos, exprPos+1+newParams.length);
+            buf.replaceParameterByCopy(pos, exprPos+1);
         }
 
         return buf.endEdit();
@@ -845,6 +849,20 @@
         return putInCache(key, form);
     }
 
+    LambdaForm filterArgumentsForm(int filterPos, MethodType combinerType, int ... argPositions) {
+        byte kind = Transform.FILTER_SELECT_ARGS;
+        int[] keyArgs = Arrays.copyOf(argPositions, argPositions.length + 1);
+        keyArgs[argPositions.length] = filterPos;
+        Transform key = Transform.of(kind, keyArgs);
+        LambdaForm form = getInCache(key);
+        if (form != null) {
+            assert(form.arity == lambdaForm.arity);
+            return form;
+        }
+        form = makeArgumentCombinationForm(filterPos, combinerType, argPositions, false, false);
+        return putInCache(key, form);
+    }
+
     LambdaForm permuteArgumentsForm(int skip, int[] reorder) {
         assert(skip == 1);  // skip only the leading MH argument, names[0]
         int length = lambdaForm.names.length;
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1663,7 +1663,7 @@
         assert(newForm.customized == null || newForm.customized == this);
         if (form == newForm)  return;
         newForm.prepare();  // as in MethodHandle.<init>
-        UNSAFE.putObject(this, FORM_OFFSET, newForm);
+        UNSAFE.putReference(this, FORM_OFFSET, newForm);
         UNSAFE.fullFence();
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Tue Oct 23 15:29:10 2018 +0530
@@ -4316,28 +4316,6 @@
         return result;
     }
 
-    /**
-     * As {@see foldArguments(MethodHandle, int, MethodHandle)}, but with the
-     * added capability of selecting the arguments from the targets parameters
-     * to call the combiner with. This allows us to avoid some simple cases of
-     * permutations and padding the combiner with dropArguments to select the
-     * right argument, which may ultimately produce fewer intermediaries.
-     */
-    static MethodHandle foldArguments(MethodHandle target, int pos, MethodHandle combiner, int ... argPositions) {
-        MethodType targetType = target.type();
-        MethodType combinerType = combiner.type();
-        Class<?> rtype = foldArgumentChecks(pos, targetType, combinerType, argPositions);
-        BoundMethodHandle result = target.rebind();
-        boolean dropResult = rtype == void.class;
-        LambdaForm lform = result.editor().foldArgumentsForm(1 + pos, dropResult, combinerType.basicType(), argPositions);
-        MethodType newType = targetType;
-        if (!dropResult) {
-            newType = newType.dropParameterTypes(pos, pos + 1);
-        }
-        result = result.copyWithExtendL(newType, lform, combiner);
-        return result;
-    }
-
     private static Class<?> foldArgumentChecks(int foldPos, MethodType targetType, MethodType combinerType) {
         int foldArgs   = combinerType.parameterCount();
         Class<?> rtype = combinerType.returnType();
@@ -4359,15 +4337,78 @@
         return rtype;
     }
 
-    private static Class<?> foldArgumentChecks(int foldPos, MethodType targetType, MethodType combinerType, int ... argPos) {
-        int foldArgs = combinerType.parameterCount();
-        if (argPos.length != foldArgs) {
+    /**
+     * Adapts a target method handle by pre-processing some of its arguments, then calling the target with the result
+     * of the pre-processing replacing the argument at the given position.
+     *
+     * @param target the method handle to invoke after arguments are combined
+     * @param position the position at which to start folding and at which to insert the folding result; if this is {@code
+     *            0}, the effect is the same as for {@link #foldArguments(MethodHandle, MethodHandle)}.
+     * @param combiner method handle to call initially on the incoming arguments
+     * @param argPositions indexes of the target to pick arguments sent to the combiner from
+     * @return method handle which incorporates the specified argument folding logic
+     * @throws NullPointerException if either argument is null
+     * @throws IllegalArgumentException if either of the following two conditions holds:
+     *          (1) {@code combiner}'s return type is not the same as the argument type at position
+     *              {@code pos} of the target signature;
+     *          (2) the {@code N} argument types at positions {@code argPositions[1...N]} of the target signature are
+     *              not identical with the argument types of {@code combiner}.
+     */
+    /*non-public*/ static MethodHandle filterArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
+        return argumentsWithCombiner(true, target, position, combiner, argPositions);
+    }
+
+    /**
+     * Adapts a target method handle by pre-processing some of its arguments, calling the target with the result of
+     * the pre-processing inserted into the original sequence of arguments at the given position.
+     *
+     * @param target the method handle to invoke after arguments are combined
+     * @param position the position at which to start folding and at which to insert the folding result; if this is {@code
+     *            0}, the effect is the same as for {@link #foldArguments(MethodHandle, MethodHandle)}.
+     * @param combiner method handle to call initially on the incoming arguments
+     * @param argPositions indexes of the target to pick arguments sent to the combiner from
+     * @return method handle which incorporates the specified argument folding logic
+     * @throws NullPointerException if either argument is null
+     * @throws IllegalArgumentException if either of the following two conditions holds:
+     *          (1) {@code combiner}'s return type is non-{@code void} and not the same as the argument type at position
+     *              {@code pos} of the target signature;
+     *          (2) the {@code N} argument types at positions {@code argPositions[1...N]} of the target signature
+     *              (skipping {@code position} where the {@code combiner}'s return will be folded in) are not identical
+     *              with the argument types of {@code combiner}.
+     */
+    /*non-public*/ static MethodHandle foldArgumentsWithCombiner(MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
+        return argumentsWithCombiner(false, target, position, combiner, argPositions);
+    }
+
+    private static MethodHandle argumentsWithCombiner(boolean filter, MethodHandle target, int position, MethodHandle combiner, int ... argPositions) {
+        MethodType targetType = target.type();
+        MethodType combinerType = combiner.type();
+        Class<?> rtype = argumentsWithCombinerChecks(position, filter, targetType, combinerType, argPositions);
+        BoundMethodHandle result = target.rebind();
+
+        MethodType newType = targetType;
+        LambdaForm lform;
+        if (filter) {
+            lform = result.editor().filterArgumentsForm(1 + position, combinerType.basicType(), argPositions);
+        } else {
+            boolean dropResult = rtype == void.class;
+            lform = result.editor().foldArgumentsForm(1 + position, dropResult, combinerType.basicType(), argPositions);
+            if (!dropResult) {
+                newType = newType.dropParameterTypes(position, position + 1);
+            }
+        }
+        result = result.copyWithExtendL(newType, lform, combiner);
+        return result;
+    }
+
+    private static Class<?> argumentsWithCombinerChecks(int position, boolean filter, MethodType targetType, MethodType combinerType, int ... argPos) {
+        int combinerArgs = combinerType.parameterCount();
+        if (argPos.length != combinerArgs) {
             throw newIllegalArgumentException("combiner and argument map must be equal size", combinerType, argPos.length);
         }
         Class<?> rtype = combinerType.returnType();
-        int foldVals = rtype == void.class ? 0 : 1;
-        boolean ok = true;
-        for (int i = 0; i < foldArgs; i++) {
+
+        for (int i = 0; i < combinerArgs; i++) {
             int arg = argPos[i];
             if (arg < 0 || arg > targetType.parameterCount()) {
                 throw newIllegalArgumentException("arg outside of target parameterRange", targetType, arg);
@@ -4378,11 +4419,9 @@
                         + " -> " + combinerType + ", map: " + Arrays.toString(argPos));
             }
         }
-        if (ok && foldVals != 0 && combinerType.returnType() != targetType.parameterType(foldPos)) {
-            ok = false;
+        if (filter && combinerType.returnType() != targetType.parameterType(position)) {
+            throw misMatchedTypes("target and combiner types", targetType, combinerType);
         }
-        if (!ok)
-            throw misMatchedTypes("target and combiner types", targetType, combinerType);
         return rtype;
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/MethodType.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/MethodType.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1245,8 +1245,8 @@
         // store them into the implementation-specific final fields.
         checkRtype(rtype);
         checkPtypes(ptypes);
-        UNSAFE.putObject(this, OffsetHolder.rtypeOffset, rtype);
-        UNSAFE.putObject(this, OffsetHolder.ptypesOffset, ptypes);
+        UNSAFE.putReference(this, OffsetHolder.rtypeOffset, rtype);
+        UNSAFE.putReference(this, OffsetHolder.ptypesOffset, ptypes);
     }
 
     // Support for resetting final fields while deserializing. Implement Holder
--- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1533,21 +1533,20 @@
             // *ending* index.
             for (RecipeElement el : recipe.getElements()) {
                 // Do the prepend, and put "new" index at index 1
-                mh = MethodHandles.dropArguments(mh, 2, int.class);
                 switch (el.getTag()) {
                     case TAG_CONST: {
                         MethodHandle prepender = MethodHandles.insertArguments(prepender(String.class), 3, el.getValue());
-                        mh = MethodHandles.foldArguments(mh, 1, prepender,
-                                2, 0, 3 // index, storage, coder
+                        mh = MethodHandles.filterArgumentsWithCombiner(mh, 1, prepender,
+                                1, 0, 2 // index, storage, coder
                         );
                         break;
                     }
                     case TAG_ARG: {
                         int pos = el.getArgPos();
                         MethodHandle prepender = prepender(ptypes[pos]);
-                        mh = MethodHandles.foldArguments(mh, 1, prepender,
-                                2, 0, 3, // index, storage, coder
-                                4 + pos  // selected argument
+                        mh = MethodHandles.filterArgumentsWithCombiner(mh, 1, prepender,
+                                1, 0, 2, // index, storage, coder
+                                3 + pos  // selected argument
                         );
                         break;
                     }
@@ -1557,7 +1556,7 @@
             }
 
             // Fold in byte[] instantiation at argument 0
-            mh = MethodHandles.foldArguments(mh, 0, NEW_ARRAY,
+            mh = MethodHandles.foldArgumentsWithCombiner(mh, 0, NEW_ARRAY,
                     1, 2 // index, coder
             );
 
@@ -1572,7 +1571,7 @@
             // and deduce the coder from there. Arguments would be either converted to Strings
             // during the initial filtering, or handled by primitive specializations in CODER_MIXERS.
             //
-            // The method handle shape after all length and coder mixers is:
+            // The method handle shape before and after all length and coder mixers is:
             //   (int, byte, <args>)String = ("index", "coder", <args>)
             byte initialCoder = INITIAL_CODER;
             int initialLen = 0;    // initial length, in characters
@@ -1589,44 +1588,27 @@
                         Class<?> argClass = ptypes[ac];
                         MethodHandle lm = lengthMixer(argClass);
 
-                        // Read these bottom up:
-
                         if (argClass.isPrimitive() && argClass != char.class) {
-
-                            // 3. Drop old index, producing ("new-index", "coder", <args>)
-                            mh = MethodHandles.dropArguments(mh, 1, int.class);
-
-                            // 2. Compute "new-index", producing ("new-index", "old-index", "coder", <args>)
-                            //    Length mixer needs old index, plus the appropriate argument
-                            mh = MethodHandles.foldArguments(mh, 0, lm,
-                                    1, // old-index
-                                    3 + ac // selected argument
+                            // Compute new "index" in-place using old value plus the appropriate argument.
+                            mh = MethodHandles.filterArgumentsWithCombiner(mh, 0, lm,
+                                    0, // old-index
+                                    2 + ac // selected argument
                             );
 
-                            // 1. The mh shape here is ("old-index", "coder", <args>); we don't need to recalculate
-                            //    the coder for non-char primitive arguments
-
                         } else {
                             MethodHandle cm = coderMixer(argClass);
 
-                            // 4. Drop old index and coder, producing ("new-index", "new-coder", <args>)
-                            mh = MethodHandles.dropArguments(mh, 2, int.class, byte.class);
-
-                            // 3. Compute "new-index", producing ("new-index", "new-coder", "old-index", "old-coder", <args>)
-                            //    Length mixer needs old index, plus the appropriate argument
-                            mh = MethodHandles.foldArguments(mh, 0, lm,
-                                    2, // old-index
-                                    4 + ac // selected argument
+                            // Compute new "index" in-place using old value plus the appropriate argument.
+                            mh = MethodHandles.filterArgumentsWithCombiner(mh, 0, lm,
+                                    0, // old-index
+                                    2 + ac // selected argument
                             );
 
-                            // 2. Compute "new-coder", producing ("new-coder", "old-index", "old-coder", <args>)
-                            //    Coder mixer needs old coder, plus the appropriate argument.
-                            mh = MethodHandles.foldArguments(mh, 0, cm,
-                                    2, // old-coder
-                                    3 + ac // selected argument
+                            // Compute new "coder" in-place using old value plus the appropriate argument.
+                            mh = MethodHandles.filterArgumentsWithCombiner(mh, 1, cm,
+                                    1, // old-coder
+                                    2 + ac // selected argument
                             );
-
-                            // 1. The mh shape here is ("old-index", "old-coder", <args>)
                         }
 
                         break;
--- a/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandle.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1999,7 +1999,7 @@
     /*non-public*/
     final void updateVarForm(VarForm newVForm) {
         if (vform == newVForm) return;
-        UNSAFE.putObject(this, VFORM_OFFSET, newVForm);
+        UNSAFE.putReference(this, VFORM_OFFSET, newVForm);
         UNSAFE.fullFence();
     }
 
--- a/src/java.base/share/classes/java/lang/invoke/VarHandles.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/VarHandles.java	Tue Oct 23 15:29:10 2018 +0530
@@ -34,8 +34,8 @@
             long foffset = MethodHandleNatives.objectFieldOffset(f);
             if (!type.isPrimitive()) {
                 return f.isFinal() && !isWriteAllowedOnFinalFields
-                       ? new VarHandleObjects.FieldInstanceReadOnly(refc, foffset, type)
-                       : new VarHandleObjects.FieldInstanceReadWrite(refc, foffset, type);
+                       ? new VarHandleReferences.FieldInstanceReadOnly(refc, foffset, type)
+                       : new VarHandleReferences.FieldInstanceReadWrite(refc, foffset, type);
             }
             else if (type == boolean.class) {
                 return f.isFinal() && !isWriteAllowedOnFinalFields
@@ -95,8 +95,8 @@
             long foffset = MethodHandleNatives.staticFieldOffset(f);
             if (!type.isPrimitive()) {
                 return f.isFinal() && !isWriteAllowedOnFinalFields
-                       ? new VarHandleObjects.FieldStaticReadOnly(base, foffset, type)
-                       : new VarHandleObjects.FieldStaticReadWrite(base, foffset, type);
+                       ? new VarHandleReferences.FieldStaticReadOnly(base, foffset, type)
+                       : new VarHandleReferences.FieldStaticReadWrite(base, foffset, type);
             }
             else if (type == boolean.class) {
                 return f.isFinal() && !isWriteAllowedOnFinalFields
@@ -155,7 +155,7 @@
         int ashift = 31 - Integer.numberOfLeadingZeros(ascale);
 
         if (!componentType.isPrimitive()) {
-            return new VarHandleObjects.Array(aoffset, ashift, arrayClass);
+            return new VarHandleReferences.Array(aoffset, ashift, arrayClass);
         }
         else if (componentType == boolean.class) {
             return new VarHandleBooleans.Array(aoffset, ashift);
--- a/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/X-VarHandleByteArrayView.java.template	Tue Oct 23 15:29:10 2018 +0530
@@ -186,10 +186,17 @@
         @ForceInline
         static boolean compareAndSet(ArrayHandle handle, Object oba, int index, $type$ expected, $type$ value) {
             byte[] ba = (byte[]) oba;
+#if[Object]
+            return UNSAFE.compareAndSetReference(
+                    ba,
+                    address(ba, index(ba, index)),
+                    convEndian(handle.be, expected), convEndian(handle.be, value));
+#else[Object]
             return UNSAFE.compareAndSet$RawType$(
                     ba,
                     address(ba, index(ba, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
+#end[Object]
         }
 
         @ForceInline
@@ -261,11 +268,19 @@
         @ForceInline
         static $type$ getAndSet(ArrayHandle handle, Object oba, int index, $type$ value) {
             byte[] ba = (byte[]) oba;
+#if[Object]
+            return convEndian(handle.be,
+                              UNSAFE.getAndSetReference(
+                                      ba,
+                                      address(ba, index(ba, index)),
+                                      convEndian(handle.be, value)));
+#else[Object]
             return convEndian(handle.be,
                               UNSAFE.getAndSet$RawType$(
                                       ba,
                                       address(ba, index(ba, index)),
                                       convEndian(handle.be, value)));
+#end[Object]
         }
 
         @ForceInline
@@ -537,13 +552,13 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
 #if[floatingPoint]
             $rawType$ rawValue = UNSAFE.get$RawType$Unaligned(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     ((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
                     handle.be);
             return $Type$.$rawType$BitsTo$Type$(rawValue);
 #else[floatingPoint]
             return UNSAFE.get$Type$Unaligned(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     ((long) index(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
                     handle.be);
 #end[floatingPoint]
@@ -554,13 +569,13 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
 #if[floatingPoint]
             UNSAFE.put$RawType$Unaligned(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     ((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
                     $Type$.$type$ToRaw$RawType$Bits(value),
                     handle.be);
 #else[floatingPoint]
             UNSAFE.put$Type$Unaligned(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     ((long) indexRO(bb, index)) + UNSAFE.getLong(bb, BUFFER_ADDRESS),
                     value,
                     handle.be);
@@ -572,7 +587,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.get$RawType$Volatile(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, index(bb, index))));
         }
 
@@ -580,7 +595,7 @@
         static void setVolatile(ByteBufferHandle handle, Object obb, int index, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             UNSAFE.put$RawType$Volatile(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, value));
         }
@@ -590,7 +605,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.get$RawType$Acquire(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, index(bb, index))));
         }
 
@@ -598,7 +613,7 @@
         static void setRelease(ByteBufferHandle handle, Object obb, int index, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             UNSAFE.put$RawType$Release(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, value));
         }
@@ -608,7 +623,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.get$RawType$Opaque(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, index(bb, index))));
         }
 
@@ -616,7 +631,7 @@
         static void setOpaque(ByteBufferHandle handle, Object obb, int index, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             UNSAFE.put$RawType$Opaque(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, value));
         }
@@ -625,10 +640,17 @@
         @ForceInline
         static boolean compareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
-            return UNSAFE.compareAndSet$RawType$(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+#if[Object]
+            return UNSAFE.compareAndSetReference(
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
+#else[Object]
+            return UNSAFE.compareAndSet$RawType$(
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
+                    address(bb, indexRO(bb, index)),
+                    convEndian(handle.be, expected), convEndian(handle.be, value));
+#end[Object]
         }
 
         @ForceInline
@@ -636,7 +658,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.compareAndExchange$RawType$(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
         }
@@ -646,7 +668,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.compareAndExchange$RawType$Acquire(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
         }
@@ -656,7 +678,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.compareAndExchange$RawType$Release(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, expected), convEndian(handle.be, value)));
         }
@@ -665,7 +687,7 @@
         static boolean weakCompareAndSetPlain(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return UNSAFE.weakCompareAndSet$RawType$Plain(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
         }
@@ -674,7 +696,7 @@
         static boolean weakCompareAndSet(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return UNSAFE.weakCompareAndSet$RawType$(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
         }
@@ -683,7 +705,7 @@
         static boolean weakCompareAndSetAcquire(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return UNSAFE.weakCompareAndSet$RawType$Acquire(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
         }
@@ -692,7 +714,7 @@
         static boolean weakCompareAndSetRelease(ByteBufferHandle handle, Object obb, int index, $type$ expected, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return UNSAFE.weakCompareAndSet$RawType$Release(
-                    UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                    UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                     address(bb, indexRO(bb, index)),
                     convEndian(handle.be, expected), convEndian(handle.be, value));
         }
@@ -700,11 +722,19 @@
         @ForceInline
         static $type$ getAndSet(ByteBufferHandle handle, Object obb, int index, $type$ value) {
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
+#if[Object]
+            return convEndian(handle.be,
+                              UNSAFE.getAndSetReference(
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
+                                      address(bb, indexRO(bb, index)),
+                                      convEndian(handle.be, value)));
+#else[Object]
             return convEndian(handle.be,
                               UNSAFE.getAndSet$RawType$(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, value)));
+#end[Object]
         }
 
         @ForceInline
@@ -712,7 +742,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.getAndSet$RawType$Acquire(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, value)));
         }
@@ -722,7 +752,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             return convEndian(handle.be,
                               UNSAFE.getAndSet$RawType$Release(
-                                      UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                                      UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                                       address(bb, indexRO(bb, index)),
                                       convEndian(handle.be, value)));
         }
@@ -734,7 +764,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndAdd$RawType$(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         delta);
             } else {
@@ -747,7 +777,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndAdd$RawType$Acquire(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         delta);
             } else {
@@ -760,7 +790,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndAdd$RawType$Release(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         delta);
             } else {
@@ -771,7 +801,7 @@
         @ForceInline
         static $type$ getAndAddConvEndianWithCAS(ByteBuffer bb, int index, $type$ delta) {
             $type$ nativeExpectedValue, expectedValue;
-            Object base = UNSAFE.getObject(bb, BYTE_BUFFER_HB);
+            Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB);
             long offset = address(bb, indexRO(bb, index));
             do {
                 nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset);
@@ -788,7 +818,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseOr$RawType$(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -801,7 +831,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseOr$RawType$Release(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -814,7 +844,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseOr$RawType$Acquire(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -825,7 +855,7 @@
         @ForceInline
         static $type$ getAndBitwiseOrConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) {
             $type$ nativeExpectedValue, expectedValue;
-            Object base = UNSAFE.getObject(bb, BYTE_BUFFER_HB);
+            Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB);
             long offset = address(bb, indexRO(bb, index));
             do {
                 nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset);
@@ -840,7 +870,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseAnd$RawType$(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -853,7 +883,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseAnd$RawType$Release(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -866,7 +896,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseAnd$RawType$Acquire(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -877,7 +907,7 @@
         @ForceInline
         static $type$ getAndBitwiseAndConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) {
             $type$ nativeExpectedValue, expectedValue;
-            Object base = UNSAFE.getObject(bb, BYTE_BUFFER_HB);
+            Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB);
             long offset = address(bb, indexRO(bb, index));
             do {
                 nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset);
@@ -893,7 +923,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseXor$RawType$(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -906,7 +936,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseXor$RawType$Release(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -919,7 +949,7 @@
             ByteBuffer bb = (ByteBuffer) Objects.requireNonNull(obb);
             if (handle.be == BE) {
                 return UNSAFE.getAndBitwiseXor$RawType$Acquire(
-                        UNSAFE.getObject(bb, BYTE_BUFFER_HB),
+                        UNSAFE.getReference(bb, BYTE_BUFFER_HB),
                         address(bb, indexRO(bb, index)),
                         value);
             } else {
@@ -930,7 +960,7 @@
         @ForceInline
         static $type$ getAndBitwiseXorConvEndianWithCAS(ByteBuffer bb, int index, $type$ value) {
             $type$ nativeExpectedValue, expectedValue;
-            Object base = UNSAFE.getObject(bb, BYTE_BUFFER_HB);
+            Object base = UNSAFE.getReference(bb, BYTE_BUFFER_HB);
             long offset = address(bb, indexRO(bb, index));
             do {
                 nativeExpectedValue = UNSAFE.get$RawType$Volatile(base, offset);
--- a/src/java.base/share/classes/java/math/BigDecimal.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/math/BigDecimal.java	Tue Oct 23 15:29:10 2018 +0530
@@ -4079,7 +4079,7 @@
         }
 
         static void setIntValVolatile(BigDecimal bd, BigInteger val) {
-            unsafe.putObjectVolatile(bd, intValOffset, val);
+            unsafe.putReferenceVolatile(bd, intValOffset, val);
         }
     }
 
--- a/src/java.base/share/classes/java/math/BigInteger.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/math/BigInteger.java	Tue Oct 23 15:29:10 2018 +0530
@@ -4600,7 +4600,7 @@
         }
 
         static void putMag(BigInteger bi, int[] magnitude) {
-            unsafe.putObject(bi, magOffset, magnitude);
+            unsafe.putReference(bi, magOffset, magnitude);
         }
     }
 
--- a/src/java.base/share/classes/java/net/Inet6Address.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/net/Inet6Address.java	Tue Oct 23 15:29:10 2018 +0530
@@ -641,7 +641,7 @@
             ipaddress, scope_id, scope_id_set, scope_ifname, scope_ifname_set
         );
 
-        UNSAFE.putObject(this, FIELDS_OFFSET, h);
+        UNSAFE.putReference(this, FIELDS_OFFSET, h);
     }
 
     /**
--- a/src/java.base/share/classes/java/net/InetAddress.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/net/InetAddress.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1734,7 +1734,7 @@
             throw new InvalidObjectException("invalid address family type: " + family);
         }
         InetAddressHolder h = new InetAddressHolder(host, address, family);
-        UNSAFE.putObject(this, FIELDS_OFFSET, h);
+        UNSAFE.putReference(this, FIELDS_OFFSET, h);
     }
 
     /* needed because the serializable fields no longer exist */
--- a/src/java.base/share/classes/java/net/InetSocketAddress.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/net/InetSocketAddress.java	Tue Oct 23 15:29:10 2018 +0530
@@ -293,7 +293,7 @@
         InetSocketAddressHolder h = new InetSocketAddressHolder(oisHostname,
                                                                 oisAddr,
                                                                 oisPort);
-        UNSAFE.putObject(this, FIELDS_OFFSET, h);
+        UNSAFE.putReference(this, FIELDS_OFFSET, h);
     }
 
     private void readObjectNoData()
--- a/src/java.base/share/classes/java/net/SocketInputStream.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/net/SocketInputStream.java	Tue Oct 23 15:29:10 2018 +0530
@@ -232,11 +232,8 @@
      * @return the number of immediately available bytes
      */
     public int available() throws IOException {
-        if (eof) {
-            return 0;
-        } else {
-            return impl.available();
-        }
+        int available = impl.available();
+        return eof ? 0 : available;
     }
 
     /**
--- a/src/java.base/share/classes/java/util/Random.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/Random.java	Tue Oct 23 15:29:10 2018 +0530
@@ -1222,6 +1222,6 @@
         } catch (Exception ex) { throw new Error(ex); }
     }
     private void resetSeed(long seedVal) {
-        unsafe.putObjectVolatile(this, seedOffset, new AtomicLong(seedVal));
+        unsafe.putReferenceVolatile(this, seedOffset, new AtomicLong(seedVal));
     }
 }
--- a/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java	Tue Oct 23 15:29:10 2018 +0530
@@ -757,16 +757,16 @@
 
     @SuppressWarnings("unchecked")
     static final <K,V> Node<K,V> tabAt(Node<K,V>[] tab, int i) {
-        return (Node<K,V>)U.getObjectAcquire(tab, ((long)i << ASHIFT) + ABASE);
+        return (Node<K,V>)U.getReferenceAcquire(tab, ((long)i << ASHIFT) + ABASE);
     }
 
     static final <K,V> boolean casTabAt(Node<K,V>[] tab, int i,
                                         Node<K,V> c, Node<K,V> v) {
-        return U.compareAndSetObject(tab, ((long)i << ASHIFT) + ABASE, c, v);
+        return U.compareAndSetReference(tab, ((long)i << ASHIFT) + ABASE, c, v);
     }
 
     static final <K,V> void setTabAt(Node<K,V>[] tab, int i, Node<K,V> v) {
-        U.putObjectRelease(tab, ((long)i << ASHIFT) + ABASE, v);
+        U.putReferenceRelease(tab, ((long)i << ASHIFT) + ABASE, v);
     }
 
     /* ---------------- Fields -------------- */
--- a/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/concurrent/ThreadLocalRandom.java	Tue Oct 23 15:29:10 2018 +0530
@@ -976,13 +976,13 @@
      * Erases ThreadLocals by nulling out Thread maps.
      */
     static final void eraseThreadLocals(Thread thread) {
-        U.putObject(thread, THREADLOCALS, null);
-        U.putObject(thread, INHERITABLETHREADLOCALS, null);
+        U.putReference(thread, THREADLOCALS, null);
+        U.putReference(thread, INHERITABLETHREADLOCALS, null);
     }
 
     static final void setInheritedAccessControlContext(Thread thread,
                                                        AccessControlContext acc) {
-        U.putObjectRelease(thread, INHERITEDACCESSCONTROLCONTEXT, acc);
+        U.putReferenceRelease(thread, INHERITEDACCESSCONTROLCONTEXT, acc);
     }
 
     // Serialization support
--- a/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java	Tue Oct 23 15:29:10 2018 +0530
@@ -439,39 +439,39 @@
         public final boolean compareAndSet(T obj, V expect, V update) {
             accessCheck(obj);
             valueCheck(update);
-            return U.compareAndSetObject(obj, offset, expect, update);
+            return U.compareAndSetReference(obj, offset, expect, update);
         }
 
         public final boolean weakCompareAndSet(T obj, V expect, V update) {
             // same implementation as strong form for now
             accessCheck(obj);
             valueCheck(update);
-            return U.compareAndSetObject(obj, offset, expect, update);
+            return U.compareAndSetReference(obj, offset, expect, update);
         }
 
         public final void set(T obj, V newValue) {
             accessCheck(obj);
             valueCheck(newValue);
-            U.putObjectVolatile(obj, offset, newValue);
+            U.putReferenceVolatile(obj, offset, newValue);
         }
 
         public final void lazySet(T obj, V newValue) {
             accessCheck(obj);
             valueCheck(newValue);
-            U.putObjectRelease(obj, offset, newValue);
+            U.putReferenceRelease(obj, offset, newValue);
         }
 
         @SuppressWarnings("unchecked")
         public final V get(T obj) {
             accessCheck(obj);
-            return (V)U.getObjectVolatile(obj, offset);
+            return (V)U.getReferenceVolatile(obj, offset);
         }
 
         @SuppressWarnings("unchecked")
         public final V getAndSet(T obj, V newValue) {
             accessCheck(obj);
             valueCheck(newValue);
-            return (V)U.getAndSetObject(obj, offset, newValue);
+            return (V)U.getAndSetReference(obj, offset, newValue);
         }
     }
 }
--- a/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/concurrent/locks/LockSupport.java	Tue Oct 23 15:29:10 2018 +0530
@@ -141,7 +141,7 @@
 
     private static void setBlocker(Thread t, Object arg) {
         // Even though volatile, hotspot doesn't need a write barrier here.
-        U.putObject(t, PARKBLOCKER, arg);
+        U.putReference(t, PARKBLOCKER, arg);
     }
 
     /**
@@ -291,7 +291,7 @@
     public static Object getBlocker(Thread t) {
         if (t == null)
             throw new NullPointerException();
-        return U.getObjectVolatile(t, PARKBLOCKER);
+        return U.getReferenceVolatile(t, PARKBLOCKER);
     }
 
     /**
--- a/src/java.base/share/classes/java/util/zip/ZipUtils.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/java/util/zip/ZipUtils.java	Tue Oct 23 15:29:10 2018 +0530
@@ -25,7 +25,6 @@
 
 package java.util.zip;
 
-import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.nio.file.attribute.FileTime;
 import java.security.AccessController;
@@ -40,7 +39,6 @@
 import static java.util.zip.ZipConstants.ENDHDR;
 
 import jdk.internal.misc.Unsafe;
-import sun.nio.ch.DirectBuffer;
 
 class ZipUtils {
 
@@ -295,7 +293,7 @@
     private static final long byteBufferOffsetOffset = unsafe.objectFieldOffset(ByteBuffer.class, "offset");
 
     static byte[] getBufferArray(ByteBuffer byteBuffer) {
-        return (byte[]) unsafe.getObject(byteBuffer, byteBufferArrayOffset);
+        return (byte[]) unsafe.getReference(byteBuffer, byteBufferArrayOffset);
     }
 
     static int getBufferOffset(ByteBuffer byteBuffer) {
--- a/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java	Tue Oct 23 15:29:10 2018 +0530
@@ -98,8 +98,8 @@
 
     private InnocuousThread(ThreadGroup group, Runnable target, String name, ClassLoader tccl) {
         super(group, target, name, 0L, false);
-        UNSAFE.putObjectRelease(this, INHERITEDACCESSCONTROLCONTEXT, ACC);
-        UNSAFE.putObjectRelease(this, CONTEXTCLASSLOADER, tccl);
+        UNSAFE.putReferenceRelease(this, INHERITEDACCESSCONTROLCONTEXT, ACC);
+        UNSAFE.putReferenceRelease(this, CONTEXTCLASSLOADER, tccl);
     }
 
     @Override
@@ -120,8 +120,8 @@
      * Drops all thread locals (and inherited thread locals).
      */
     public final void eraseThreadLocals() {
-        UNSAFE.putObject(this, THREAD_LOCALS, null);
-        UNSAFE.putObject(this, INHERITABLE_THREAD_LOCALS, null);
+        UNSAFE.putReference(this, THREAD_LOCALS, null);
+        UNSAFE.putReference(this, INHERITABLE_THREAD_LOCALS, null);
     }
 
     // ensure run method is run only once
@@ -158,10 +158,10 @@
             long tg = UNSAFE.objectFieldOffset(tk, "group");
             long gp = UNSAFE.objectFieldOffset(gk, "parent");
             ThreadGroup group = (ThreadGroup)
-                UNSAFE.getObject(Thread.currentThread(), tg);
+                UNSAFE.getReference(Thread.currentThread(), tg);
 
             while (group != null) {
-                ThreadGroup parent = (ThreadGroup)UNSAFE.getObject(group, gp);
+                ThreadGroup parent = (ThreadGroup)UNSAFE.getReference(group, gp);
                 if (parent == null)
                     break;
                 group = parent;
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java	Tue Oct 23 15:29:10 2018 +0530
@@ -179,7 +179,7 @@
      * @see #getInt(Object, long)
      */
     @HotSpotIntrinsicCandidate
-    public native Object getObject(Object o, long offset);
+    public native Object getReference(Object o, long offset);
 
     /**
      * Stores a reference value into a given Java variable.
@@ -192,7 +192,7 @@
      * @see #putInt(Object, long, int)
      */
     @HotSpotIntrinsicCandidate
-    public native void putObject(Object o, long offset, Object x);
+    public native void putReference(Object o, long offset, Object x);
 
     /** @see #getInt(Object, long) */
     @HotSpotIntrinsicCandidate
@@ -1297,55 +1297,55 @@
      * @return {@code true} if successful
      */
     @HotSpotIntrinsicCandidate
-    public final native boolean compareAndSetObject(Object o, long offset,
+    public final native boolean compareAndSetReference(Object o, long offset,
+                                                       Object expected,
+                                                       Object x);
+
+    @HotSpotIntrinsicCandidate
+    public final native Object compareAndExchangeReference(Object o, long offset,
+                                                           Object expected,
+                                                           Object x);
+
+    @HotSpotIntrinsicCandidate
+    public final Object compareAndExchangeReferenceAcquire(Object o, long offset,
+                                                           Object expected,
+                                                           Object x) {
+        return compareAndExchangeReference(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final Object compareAndExchangeReferenceRelease(Object o, long offset,
+                                                           Object expected,
+                                                           Object x) {
+        return compareAndExchangeReference(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSetReferencePlain(Object o, long offset,
+                                                         Object expected,
+                                                         Object x) {
+        return compareAndSetReference(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSetReferenceAcquire(Object o, long offset,
+                                                           Object expected,
+                                                           Object x) {
+        return compareAndSetReference(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSetReferenceRelease(Object o, long offset,
+                                                           Object expected,
+                                                           Object x) {
+        return compareAndSetReference(o, offset, expected, x);
+    }
+
+    @HotSpotIntrinsicCandidate
+    public final boolean weakCompareAndSetReference(Object o, long offset,
                                                     Object expected,
-                                                    Object x);
-
-    @HotSpotIntrinsicCandidate
-    public final native Object compareAndExchangeObject(Object o, long offset,
-                                                        Object expected,
-                                                        Object x);
-
-    @HotSpotIntrinsicCandidate
-    public final Object compareAndExchangeObjectAcquire(Object o, long offset,
-                                                               Object expected,
-                                                               Object x) {
-        return compareAndExchangeObject(o, offset, expected, x);
-    }
-
-    @HotSpotIntrinsicCandidate
-    public final Object compareAndExchangeObjectRelease(Object o, long offset,
-                                                               Object expected,
-                                                               Object x) {
-        return compareAndExchangeObject(o, offset, expected, x);
-    }
-
-    @HotSpotIntrinsicCandidate
-    public final boolean weakCompareAndSetObjectPlain(Object o, long offset,
-                                                      Object expected,
-                                                      Object x) {
-        return compareAndSetObject(o, offset, expected, x);
-    }
-
-    @HotSpotIntrinsicCandidate
-    public final boolean weakCompareAndSetObjectAcquire(Object o, long offset,
-                                                        Object expected,
-                                                        Object x) {
-        return compareAndSetObject(o, offset, expected, x);
-    }
-
-    @HotSpotIntrinsicCandidate
-    public final boolean weakCompareAndSetObjectRelease(Object o, long offset,
-                                                        Object expected,
-                                                        Object x) {
-        return compareAndSetObject(o, offset, expected, x);
-    }
-
-    @HotSpotIntrinsicCandidate
-    public final boolean weakCompareAndSetObject(Object o, long offset,
-                                                 Object expected,
-                                                 Object x) {
-        return compareAndSetObject(o, offset, expected, x);
+                                                    Object x) {
+        return compareAndSetReference(o, offset, expected, x);
     }
 
     /**
@@ -1958,17 +1958,17 @@
 
     /**
      * Fetches a reference value from a given Java variable, with volatile
-     * load semantics. Otherwise identical to {@link #getObject(Object, long)}
+     * load semantics. Otherwise identical to {@link #getReference(Object, long)}
      */
     @HotSpotIntrinsicCandidate
-    public native Object getObjectVolatile(Object o, long offset);
+    public native Object getReferenceVolatile(Object o, long offset);
 
     /**
      * Stores a reference value into a given Java variable, with
-     * volatile store semantics. Otherwise identical to {@link #putObject(Object, long, Object)}
+     * volatile store semantics. Otherwise identical to {@link #putReference(Object, long, Object)}
      */
     @HotSpotIntrinsicCandidate
-    public native void    putObjectVolatile(Object o, long offset, Object x);
+    public native void putReferenceVolatile(Object o, long offset, Object x);
 
     /** Volatile version of {@link #getInt(Object, long)}  */
     @HotSpotIntrinsicCandidate
@@ -2036,10 +2036,10 @@
 
 
 
-    /** Acquire version of {@link #getObjectVolatile(Object, long)} */
+    /** Acquire version of {@link #getReferenceVolatile(Object, long)} */
     @HotSpotIntrinsicCandidate
-    public final Object getObjectAcquire(Object o, long offset) {
-        return getObjectVolatile(o, offset);
+    public final Object getReferenceAcquire(Object o, long offset) {
+        return getReferenceVolatile(o, offset);
     }
 
     /** Acquire version of {@link #getBooleanVolatile(Object, long)} */
@@ -2091,7 +2091,7 @@
     }
 
     /*
-      * Versions of {@link #putObjectVolatile(Object, long, Object)}
+      * Versions of {@link #putReferenceVolatile(Object, long, Object)}
       * that do not guarantee immediate visibility of the store to
       * other threads. This method is generally only useful if the
       * underlying field is a Java volatile (or if an array cell, one
@@ -2100,10 +2100,10 @@
       * Corresponds to C11 atomic_store_explicit(..., memory_order_release).
       */
 
-    /** Release version of {@link #putObjectVolatile(Object, long, Object)} */
+    /** Release version of {@link #putReferenceVolatile(Object, long, Object)} */
     @HotSpotIntrinsicCandidate
-    public final void putObjectRelease(Object o, long offset, Object x) {
-        putObjectVolatile(o, offset, x);
+    public final void putReferenceRelease(Object o, long offset, Object x) {
+        putReferenceVolatile(o, offset, x);
     }
 
     /** Release version of {@link #putBooleanVolatile(Object, long, boolean)} */
@@ -2156,10 +2156,10 @@
 
     // ------------------------------ Opaque --------------------------------------
 
-    /** Opaque version of {@link #getObjectVolatile(Object, long)} */
+    /** Opaque version of {@link #getReferenceVolatile(Object, long)} */
     @HotSpotIntrinsicCandidate
-    public final Object getObjectOpaque(Object o, long offset) {
-        return getObjectVolatile(o, offset);
+    public final Object getReferenceOpaque(Object o, long offset) {
+        return getReferenceVolatile(o, offset);
     }
 
     /** Opaque version of {@link #getBooleanVolatile(Object, long)} */
@@ -2210,10 +2210,10 @@
         return getDoubleVolatile(o, offset);
     }
 
-    /** Opaque version of {@link #putObjectVolatile(Object, long, Object)} */
+    /** Opaque version of {@link #putReferenceVolatile(Object, long, Object)} */
     @HotSpotIntrinsicCandidate
-    public final void putObjectOpaque(Object o, long offset, Object x) {
-        putObjectVolatile(o, offset, x);
+    public final void putReferenceOpaque(Object o, long offset, Object x) {
+        putReferenceVolatile(o, offset, x);
     }
 
     /** Opaque version of {@link #putBooleanVolatile(Object, long, boolean)} */
@@ -2642,29 +2642,29 @@
      * @since 1.8
      */
     @HotSpotIntrinsicCandidate
-    public final Object getAndSetObject(Object o, long offset, Object newValue) {
+    public final Object getAndSetReference(Object o, long offset, Object newValue) {
         Object v;
         do {
-            v = getObjectVolatile(o, offset);
-        } while (!weakCompareAndSetObject(o, offset, v, newValue));
+            v = getReferenceVolatile(o, offset);
+        } while (!weakCompareAndSetReference(o, offset, v, newValue));
         return v;
     }
 
     @ForceInline
-    public final Object getAndSetObjectRelease(Object o, long offset, Object newValue) {
+    public final Object getAndSetReferenceRelease(Object o, long offset, Object newValue) {
         Object v;
         do {
-            v = getObject(o, offset);
-        } while (!weakCompareAndSetObjectRelease(o, offset, v, newValue));
+            v = getReference(o, offset);
+        } while (!weakCompareAndSetReferenceRelease(o, offset, v, newValue));
         return v;
     }
 
     @ForceInline
-    public final Object getAndSetObjectAcquire(Object o, long offset, Object newValue) {
+    public final Object getAndSetReferenceAcquire(Object o, long offset, Object newValue) {
         Object v;
         do {
-            v = getObjectAcquire(o, offset);
-        } while (!weakCompareAndSetObjectAcquire(o, offset, v, newValue));
+            v = getReferenceAcquire(o, offset);
+        } while (!weakCompareAndSetReferenceAcquire(o, offset, v, newValue));
         return v;
     }
 
--- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeObjectFieldAccessorImpl.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeObjectFieldAccessorImpl.java	Tue Oct 23 15:29:10 2018 +0530
@@ -34,7 +34,7 @@
 
     public Object get(Object obj) throws IllegalArgumentException {
         ensureObj(obj);
-        return unsafe.getObject(obj, fieldOffset);
+        return unsafe.getReference(obj, fieldOffset);
     }
 
     public boolean getBoolean(Object obj) throws IllegalArgumentException {
@@ -81,7 +81,7 @@
                 throwSetIllegalArgumentException(value);
             }
         }
-        unsafe.putObject(obj, fieldOffset, value);
+        unsafe.putReference(obj, fieldOffset, value);
     }
 
     public void setBoolean(Object obj, boolean z)
--- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedObjectFieldAccessorImpl.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedObjectFieldAccessorImpl.java	Tue Oct 23 15:29:10 2018 +0530
@@ -36,7 +36,7 @@
 
     public Object get(Object obj) throws IllegalArgumentException {
         ensureObj(obj);
-        return unsafe.getObjectVolatile(obj, fieldOffset);
+        return unsafe.getReferenceVolatile(obj, fieldOffset);
     }
 
     public boolean getBoolean(Object obj) throws IllegalArgumentException {
@@ -83,7 +83,7 @@
                 throwSetIllegalArgumentException(value);
             }
         }
-        unsafe.putObjectVolatile(obj, fieldOffset, value);
+        unsafe.putReferenceVolatile(obj, fieldOffset, value);
     }
 
     public void setBoolean(Object obj, boolean z)
--- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl.java	Tue Oct 23 15:29:10 2018 +0530
@@ -35,7 +35,7 @@
     }
 
     public Object get(Object obj) throws IllegalArgumentException {
-        return unsafe.getObjectVolatile(base, fieldOffset);
+        return unsafe.getReferenceVolatile(base, fieldOffset);
     }
 
     public boolean getBoolean(Object obj) throws IllegalArgumentException {
@@ -81,7 +81,7 @@
                 throwSetIllegalArgumentException(value);
             }
         }
-        unsafe.putObjectVolatile(base, fieldOffset, value);
+        unsafe.putReferenceVolatile(base, fieldOffset, value);
     }
 
     public void setBoolean(Object obj, boolean z)
--- a/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticObjectFieldAccessorImpl.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticObjectFieldAccessorImpl.java	Tue Oct 23 15:29:10 2018 +0530
@@ -33,7 +33,7 @@
     }
 
     public Object get(Object obj) throws IllegalArgumentException {
-        return unsafe.getObject(base, fieldOffset);
+        return unsafe.getReference(base, fieldOffset);
     }
 
     public boolean getBoolean(Object obj) throws IllegalArgumentException {
@@ -79,7 +79,7 @@
                 throwSetIllegalArgumentException(value);
             }
         }
-        unsafe.putObject(base, fieldOffset, value);
+        unsafe.putReference(base, fieldOffset, value);
     }
 
     public void setBoolean(Object obj, boolean z)
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java	Tue Oct 23 15:29:10 2018 +0530
@@ -624,12 +624,12 @@
 
         static void setType(AnnotationInvocationHandler o,
                             Class<? extends Annotation> type) {
-            unsafe.putObject(o, typeOffset, type);
+            unsafe.putReference(o, typeOffset, type);
         }
 
         static void setMemberValues(AnnotationInvocationHandler o,
                                     Map<String, Object> memberValues) {
-            unsafe.putObject(o, memberValuesOffset, memberValues);
+            unsafe.putReference(o, memberValuesOffset, memberValues);
         }
     }
 }
--- a/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java	Tue Oct 23 15:29:10 2018 +0530
@@ -356,12 +356,12 @@
                 } else if (SSLLogger.isOn &&
                         SSLLogger.isOn("ssl,handshake,verbose")) {
                     SSLLogger.finest(
-                        "Ignore disabled signature sheme: " + ss.name);
+                        "Ignore disabled signature scheme: " + ss.name);
                 }
             } else if (SSLLogger.isOn &&
                     SSLLogger.isOn("ssl,handshake,verbose")) {
                 SSLLogger.finest(
-                    "Ignore inactive signature sheme: " + ss.name);
+                    "Ignore inactive signature scheme: " + ss.name);
             }
         }
 
--- a/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java	Tue Oct 23 15:29:10 2018 +0530
@@ -179,7 +179,7 @@
     public Object clone() {
         try {
             PrincipalName pName = (PrincipalName) super.clone();
-            UNSAFE.putObject(this, NAME_STRINGS_OFFSET, nameStrings.clone());
+            UNSAFE.putReference(this, NAME_STRINGS_OFFSET, nameStrings.clone());
             return pName;
         } catch (CloneNotSupportedException ex) {
             throw new AssertionError("Should never happen");
--- a/src/java.security.jgss/share/native/libj2gss/NativeUtil.c	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.security.jgss/share/native/libj2gss/NativeUtil.c	Tue Oct 23 15:29:10 2018 +0530
@@ -724,17 +724,14 @@
   if (jbytes == NULL) {
     return NULL;
   }
-  (*env)->SetByteArrayRegion(env, jbytes, 0, 2, (jbyte *) oidHdr);
-  if ((*env)->ExceptionCheck(env)) {
-    return NULL;
+  if (!(*env)->ExceptionCheck(env)) {
+    (*env)->SetByteArrayRegion(env, jbytes, 0, 2, (jbyte *) oidHdr);
   }
-  (*env)->SetByteArrayRegion(env, jbytes, 2, cLen, (jbyte *) cOid->elements);
-  if ((*env)->ExceptionCheck(env)) {
-    return NULL;
+  if (!(*env)->ExceptionCheck(env)) {
+    (*env)->SetByteArrayRegion(env, jbytes, 2, cLen, (jbyte *) cOid->elements);
   }
-  result = (*env)->NewObject(env, CLS_Oid, MID_Oid_ctor1, jbytes);
-  if ((*env)->ExceptionCheck(env)) {
-    return NULL;
+  if (!(*env)->ExceptionCheck(env)) {
+    result = (*env)->NewObject(env, CLS_Oid, MID_Oid_ctor1, jbytes);
   }
   (*env)->DeleteLocalRef(env, jbytes);
   return result;
--- a/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/SafeThread.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/SafeThread.java	Tue Oct 23 15:29:10 2018 +0530
@@ -74,8 +74,8 @@
      * Drops all thread locals (and inherited thread locals).
      */
     public final void eraseThreadLocals() {
-        UNSAFE.putObject(this, THREAD_LOCALS, null);
-        UNSAFE.putObject(this, INHERITABLE_THREAD_LOCALS, null);
+        UNSAFE.putReference(this, THREAD_LOCALS, null);
+        UNSAFE.putReference(this, INHERITABLE_THREAD_LOCALS, null);
     }
 
     static {
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java	Tue Oct 23 15:29:10 2018 +0530
@@ -203,7 +203,7 @@
             assert verifyReadRawObject(ret, baseConstant, initialDisplacement);
         } else {
             assert runtime.getConfig().useCompressedOops == compressed;
-            ret = UNSAFE.getObject(base, displacement);
+            ret = UNSAFE.getReference(base, displacement);
         }
         return ret;
     }
@@ -233,7 +233,7 @@
             case Double:
                 return JavaConstant.forDouble(isVolatile ? UNSAFE.getDoubleVolatile(obj, displacement) : UNSAFE.getDouble(obj, displacement));
             case Object:
-                return HotSpotObjectConstantImpl.forObject(isVolatile ? UNSAFE.getObjectVolatile(obj, displacement) : UNSAFE.getObject(obj, displacement));
+                return HotSpotObjectConstantImpl.forObject(isVolatile ? UNSAFE.getReferenceVolatile(obj, displacement) : UNSAFE.getReference(obj, displacement));
             default:
                 throw new IllegalArgumentException("Unsupported kind: " + kind);
         }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java	Tue Oct 23 15:29:10 2018 +0530
@@ -312,8 +312,8 @@
                             "jdk/internal/misc/Unsafe.compareAndExchangeIntRelease(Ljava/lang/Object;JII)I",
                             "jdk/internal/misc/Unsafe.compareAndExchangeLongAcquire(Ljava/lang/Object;JJJ)J",
                             "jdk/internal/misc/Unsafe.compareAndExchangeLongRelease(Ljava/lang/Object;JJJ)J",
-                            "jdk/internal/misc/Unsafe.compareAndExchangeObjectAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
-                            "jdk/internal/misc/Unsafe.compareAndExchangeObjectRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
+                            "jdk/internal/misc/Unsafe.compareAndExchangeReferenceAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
+                            "jdk/internal/misc/Unsafe.compareAndExchangeReferenceRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
                             "jdk/internal/misc/Unsafe.compareAndExchangeShortAcquire(Ljava/lang/Object;JSS)S",
                             "jdk/internal/misc/Unsafe.compareAndExchangeShortRelease(Ljava/lang/Object;JSS)S",
 
@@ -330,10 +330,10 @@
                             "jdk/internal/misc/Unsafe.weakCompareAndSetLongAcquire(Ljava/lang/Object;JJJ)Z",
                             "jdk/internal/misc/Unsafe.weakCompareAndSetLongPlain(Ljava/lang/Object;JJJ)Z",
                             "jdk/internal/misc/Unsafe.weakCompareAndSetLongRelease(Ljava/lang/Object;JJJ)Z",
-                            "jdk/internal/misc/Unsafe.weakCompareAndSetObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
-                            "jdk/internal/misc/Unsafe.weakCompareAndSetObjectAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
-                            "jdk/internal/misc/Unsafe.weakCompareAndSetObjectPlain(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
-                            "jdk/internal/misc/Unsafe.weakCompareAndSetObjectRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
+                            "jdk/internal/misc/Unsafe.weakCompareAndSetReference(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
+                            "jdk/internal/misc/Unsafe.weakCompareAndSetReferenceAcquire(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
+                            "jdk/internal/misc/Unsafe.weakCompareAndSetReferencePlain(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
+                            "jdk/internal/misc/Unsafe.weakCompareAndSetReferenceRelease(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z",
                             "jdk/internal/misc/Unsafe.weakCompareAndSetShort(Ljava/lang/Object;JSS)Z",
                             "jdk/internal/misc/Unsafe.weakCompareAndSetShortAcquire(Ljava/lang/Object;JSS)Z",
                             "jdk/internal/misc/Unsafe.weakCompareAndSetShortPlain(Ljava/lang/Object;JSS)Z",
@@ -399,7 +399,7 @@
                             "sun/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J",
                             "sun/misc/Unsafe.getAndSetInt(Ljava/lang/Object;JI)I",
                             "sun/misc/Unsafe.getAndSetLong(Ljava/lang/Object;JJ)J",
-                            "sun/misc/Unsafe.getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;");
+                            "sun/misc/Unsafe.getAndSetReference(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;");
 
             if (isJDK9OrHigher()) {
                 if (!(arch instanceof AArch64)) {
@@ -412,7 +412,7 @@
                                     "jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J",
                                     "jdk/internal/misc/Unsafe.getAndSetInt(Ljava/lang/Object;JI)I",
                                     "jdk/internal/misc/Unsafe.getAndSetLong(Ljava/lang/Object;JJ)J",
-                                    "jdk/internal/misc/Unsafe.getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;");
+                                    "jdk/internal/misc/Unsafe.getAndSetReference(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;");
                 }
                 add(toBeInvestigated,
                                 "jdk/internal/misc/Unsafe.getCharUnaligned(Ljava/lang/Object;J)C",
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java	Tue Oct 23 15:29:10 2018 +0530
@@ -32,6 +32,7 @@
 import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.SIN;
 import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.TAN;
 import static org.graalvm.compiler.serviceprovider.GraalServices.JAVA_SPECIFICATION_VERSION;
+import static org.graalvm.compiler.serviceprovider.GraalServices.Java11OrEarlier;
 import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier;
 
 import org.graalvm.compiler.bytecode.BytecodeProvider;
@@ -179,8 +180,8 @@
 
         for (JavaKind kind : unsafeJavaKinds) {
             Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass();
-
-            r.register4("getAndSet" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() {
+            String kindName = (kind == JavaKind.Object && !Java11OrEarlier) ? "Reference" : kind.name();
+            r.register4("getAndSet" + kindName, Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() {
                 @Override
                 public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode value) {
                     // Emits a null-check for the otherwise unused receiver
@@ -192,7 +193,7 @@
             });
 
             if (kind != JavaKind.Boolean && kind.isNumericInteger()) {
-                r.register4("getAndAdd" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() {
+                r.register4("getAndAdd" + kindName, Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode delta) {
                         // Emits a null-check for the otherwise unused receiver
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java	Tue Oct 23 15:29:10 2018 +0530
@@ -33,6 +33,7 @@
 import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.SIN;
 import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.TAN;
 import static org.graalvm.compiler.serviceprovider.GraalServices.JAVA_SPECIFICATION_VERSION;
+import static org.graalvm.compiler.serviceprovider.GraalServices.Java11OrEarlier;
 import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier;
 
 import java.util.Arrays;
@@ -230,18 +231,18 @@
     }
 
     private static void registerUnsafePlugins(InvocationPlugins plugins, BytecodeProvider replacementsBytecodeProvider, boolean explicitUnsafeNullChecks) {
-        registerUnsafePlugins(new Registration(plugins, Unsafe.class), explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object});
+        registerUnsafePlugins(new Registration(plugins, Unsafe.class), explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}, true);
         if (!Java8OrEarlier) {
             registerUnsafePlugins(new Registration(plugins, "jdk.internal.misc.Unsafe", replacementsBytecodeProvider), explicitUnsafeNullChecks,
-                            new JavaKind[]{JavaKind.Boolean, JavaKind.Byte, JavaKind.Char, JavaKind.Short, JavaKind.Int, JavaKind.Long, JavaKind.Object});
+                            new JavaKind[]{JavaKind.Boolean, JavaKind.Byte, JavaKind.Char, JavaKind.Short, JavaKind.Int, JavaKind.Long, JavaKind.Object}, Java11OrEarlier);
         }
     }
 
-    private static void registerUnsafePlugins(Registration r, boolean explicitUnsafeNullChecks, JavaKind[] unsafeJavaKinds) {
+    private static void registerUnsafePlugins(Registration r, boolean explicitUnsafeNullChecks, JavaKind[] unsafeJavaKinds, boolean java11OrEarlier) {
         for (JavaKind kind : unsafeJavaKinds) {
             Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass();
-
-            r.register4("getAndSet" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) {
+            String kindName = (kind == JavaKind.Object && !java11OrEarlier) ? "Reference" : kind.name();
+            r.register4("getAndSet" + kindName, Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) {
                 @Override
                 public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode value) {
                     // Emits a null-check for the otherwise unused receiver
@@ -251,7 +252,7 @@
                 }
             });
             if (kind != JavaKind.Boolean && kind.isNumericInteger()) {
-                r.register4("getAndAdd" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) {
+                r.register4("getAndAdd" + kindName, Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode delta) {
                         // Emits a null-check for the otherwise unused receiver
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java	Tue Oct 23 15:29:10 2018 +0530
@@ -121,9 +121,9 @@
         return unsafe.compareAndSetDouble(container, doubleOffset, 0.125, 0.25);
     }
 
-    public static boolean unsafeCompareAndSetObject() {
+    public static boolean unsafeCompareAndSetReference() {
         Container container = new Container();
-        return unsafe.compareAndSetObject(container, objectOffset, dummyValue, newDummyValue);
+        return unsafe.compareAndSetReference(container, objectOffset, dummyValue, newDummyValue);
     }
 
     public static boolean unsafeCompareAndExchangeBoolean() {
@@ -166,9 +166,9 @@
         return unsafe.compareAndExchangeDouble(container, doubleOffset, 0.125, 0.25);
     }
 
-    public static Object unsafeCompareAndExchangeObject() {
+    public static Object unsafeCompareAndExchangeReference() {
         Container container = new Container();
-        return unsafe.compareAndExchangeObject(container, objectOffset, dummyValue, newDummyValue);
+        return unsafe.compareAndExchangeReference(container, objectOffset, dummyValue, newDummyValue);
     }
 
     @Test
@@ -183,7 +183,7 @@
             testGraph("unsafeCompareAndSetLong");
             testGraph("unsafeCompareAndSetFloat");
             testGraph("unsafeCompareAndSetDouble");
-            testGraph("unsafeCompareAndSetObject");
+            testGraph("unsafeCompareAndSetReference");
             testGraph("unsafeCompareAndExchangeBoolean");
             testGraph("unsafeCompareAndExchangeByte");
             testGraph("unsafeCompareAndExchangeChar");
@@ -192,7 +192,7 @@
             testGraph("unsafeCompareAndExchangeLong");
             testGraph("unsafeCompareAndExchangeFloat");
             testGraph("unsafeCompareAndExchangeDouble");
-            testGraph("unsafeCompareAndExchangeObject");
+            testGraph("unsafeCompareAndExchangeReference");
         }
         test("unsafeCompareAndSetBoolean");
         test("unsafeCompareAndSetByte");
@@ -202,7 +202,7 @@
         test("unsafeCompareAndSetLong");
         test("unsafeCompareAndSetFloat");
         test("unsafeCompareAndSetDouble");
-        test("unsafeCompareAndSetObject");
+        test("unsafeCompareAndSetReference");
         test("unsafeCompareAndExchangeBoolean");
         test("unsafeCompareAndExchangeByte");
         test("unsafeCompareAndExchangeChar");
@@ -211,7 +211,7 @@
         test("unsafeCompareAndExchangeLong");
         test("unsafeCompareAndExchangeFloat");
         test("unsafeCompareAndExchangeDouble");
-        test("unsafeCompareAndExchangeObject");
+        test("unsafeCompareAndExchangeReference");
     }
 
     public static int unsafeGetAndAddByte() {
@@ -288,11 +288,11 @@
         return unsafe.getAndSetLong(container, longOffset, 0x12345678abL);
     }
 
-    public static Object unsafeGetAndSetObject() {
+    public static Object unsafeGetAndSetReference() {
         Container container = new Container();
         container.objectField = null;
         Container other = new Container();
-        return unsafe.getAndSetObject(container, objectOffset, other);
+        return unsafe.getAndSetReference(container, objectOffset, other);
     }
 
     @Test
@@ -307,7 +307,7 @@
         if (target.arch instanceof AMD64 || target.arch instanceof AArch64) {
             testGraph("unsafeGetAndSetInt");
             testGraph("unsafeGetAndSetLong");
-            testGraph("unsafeGetAndSetObject");
+            testGraph("unsafeGetAndSetReference");
         }
         test("unsafeGetAndSetBoolean");
         test("unsafeGetAndSetByte");
@@ -315,7 +315,7 @@
         test("unsafeGetAndSetShort");
         test("unsafeGetAndSetInt");
         test("unsafeGetAndSetLong");
-        test("unsafeGetAndSetObject");
+        test("unsafeGetAndSetReference");
     }
 
     public static void fieldInstance() {
@@ -562,10 +562,10 @@
         return unsafe.getDouble(container, doubleOffset);
     }
 
-    public static Object unsafeGetPutObject() {
+    public static Object unsafeGetPutReference() {
         Container container = new Container();
-        unsafe.putObject(container, objectOffset, "Hello there");
-        return unsafe.getObject(container, objectOffset);
+        unsafe.putReference(container, objectOffset, "Hello there");
+        return unsafe.getReference(container, objectOffset);
     }
 
     public static boolean unsafeGetPutBooleanOpaque() {
@@ -616,10 +616,10 @@
         return unsafe.getDoubleOpaque(container, doubleOffset);
     }
 
-    public static Object unsafeGetPutObjectOpaque() {
+    public static Object unsafeGetPutReferenceOpaque() {
         Container container = new Container();
-        unsafe.putObjectOpaque(container, objectOffset, "Hello there");
-        return unsafe.getObjectOpaque(container, objectOffset);
+        unsafe.putReferenceOpaque(container, objectOffset, "Hello there");
+        return unsafe.getReferenceOpaque(container, objectOffset);
     }
 
     public static boolean unsafeGetPutBooleanRA() {
@@ -670,10 +670,10 @@
         return unsafe.getDoubleAcquire(container, doubleOffset);
     }
 
-    public static Object unsafeGetPutObjectRA() {
+    public static Object unsafeGetPutReferenceRA() {
         Container container = new Container();
-        unsafe.putObjectRelease(container, objectOffset, "Hello there");
-        return unsafe.getObjectAcquire(container, objectOffset);
+        unsafe.putReferenceRelease(container, objectOffset, "Hello there");
+        return unsafe.getReferenceAcquire(container, objectOffset);
     }
 
     public static boolean unsafeGetPutBooleanVolatile() {
@@ -724,10 +724,10 @@
         return unsafe.getDoubleVolatile(container, doubleOffset);
     }
 
-    public static Object unsafeGetPutObjectVolatile() {
+    public static Object unsafeGetPutReferenceVolatile() {
         Container container = new Container();
-        unsafe.putObjectVolatile(container, objectOffset, "Hello there");
-        return unsafe.getObjectVolatile(container, objectOffset);
+        unsafe.putReferenceVolatile(container, objectOffset, "Hello there");
+        return unsafe.getReferenceVolatile(container, objectOffset);
     }
 
     @Test
@@ -786,7 +786,7 @@
         testGraph("unsafeGetPutLongRA");
         testGraph("unsafeGetPutFloatRA");
         testGraph("unsafeGetPutDoubleRA");
-        testGraph("unsafeGetPutObjectRA");
+        testGraph("unsafeGetPutReferenceRA");
 
         test("unsafeGetPutBooleanRA");
         test("unsafeGetPutByteRA");
@@ -796,7 +796,7 @@
         test("unsafeGetPutLongRA");
         test("unsafeGetPutFloatRA");
         test("unsafeGetPutDoubleRA");
-        test("unsafeGetPutObjectRA");
+        test("unsafeGetPutReferenceRA");
     }
 
     @Test
@@ -809,7 +809,7 @@
         testGraph("unsafeGetPutLongVolatile");
         testGraph("unsafeGetPutFloatVolatile");
         testGraph("unsafeGetPutDoubleVolatile");
-        testGraph("unsafeGetPutObjectVolatile");
+        testGraph("unsafeGetPutReferenceVolatile");
 
         test("unsafeGetPutBooleanVolatile");
         test("unsafeGetPutByteVolatile");
@@ -819,6 +819,6 @@
         test("unsafeGetPutLongVolatile");
         test("unsafeGetPutFloatVolatile");
         test("unsafeGetPutDoubleVolatile");
-        test("unsafeGetPutObjectVolatile");
+        test("unsafeGetPutReferenceVolatile");
     }
 }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java	Tue Oct 23 15:29:10 2018 +0530
@@ -33,6 +33,7 @@
 import static jdk.vm.ci.code.MemoryBarriers.STORE_LOAD;
 import static jdk.vm.ci.code.MemoryBarriers.STORE_STORE;
 import static org.graalvm.compiler.nodes.NamedLocationIdentity.OFF_HEAP_LOCATION;
+import static org.graalvm.compiler.serviceprovider.GraalServices.Java11OrEarlier;
 import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier;
 
 import java.lang.reflect.Array;
@@ -270,10 +271,11 @@
     }
 
     private abstract static class UnsafeCompareAndUpdatePluginsRegistrar {
-        public void register(Registration r, String casPrefix, boolean explicitUnsafeNullChecks, JavaKind[] compareAndSwapTypes) {
+        public void register(Registration r, String casPrefix, boolean explicitUnsafeNullChecks, JavaKind[] compareAndSwapTypes, boolean java11OrEarlier) {
             for (JavaKind kind : compareAndSwapTypes) {
                 Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass();
-                r.register5(casPrefix + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new UnsafeAccessPlugin(returnKind(kind), explicitUnsafeNullChecks) {
+                String kindName = (kind == JavaKind.Object && !java11OrEarlier) ? "Reference" : kind.name();
+                r.register5(casPrefix + kindName, Receiver.class, Object.class, long.class, javaClass, javaClass, new UnsafeAccessPlugin(returnKind(kind), explicitUnsafeNullChecks) {
                     @Override
                     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode expected, ValueNode x) {
                         // Emits a null-check for the otherwise unused receiver
@@ -332,10 +334,10 @@
 
     private static void registerPlatformSpecificUnsafePlugins(JavaKind[] supportedCasKinds, Registration r, boolean java8OrEarlier, boolean explicitUnsafeNullChecks) {
         if (java8OrEarlier) {
-            unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSwap", explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object});
+            unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSwap", explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}, true);
         } else {
-            unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSet", explicitUnsafeNullChecks, supportedCasKinds);
-            unsafeCompareAndExchangePluginsRegistrar.register(r, "compareAndExchange", explicitUnsafeNullChecks, supportedCasKinds);
+            unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSet", explicitUnsafeNullChecks, supportedCasKinds, Java11OrEarlier);
+            unsafeCompareAndExchangePluginsRegistrar.register(r, "compareAndExchange", explicitUnsafeNullChecks, supportedCasKinds, Java11OrEarlier);
         }
     }
 
@@ -346,11 +348,11 @@
         }
     }
 
-    private static void registerUnsafePlugins(Registration r, boolean java8OrEarlier, boolean explicitUnsafeNullChecks) {
+    private static void registerUnsafePlugins(Registration r, boolean sunMiscUnsafe, boolean explicitUnsafeNullChecks) {
         for (JavaKind kind : JavaKind.values()) {
             if ((kind.isPrimitive() && kind != JavaKind.Void) || kind == JavaKind.Object) {
                 Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass();
-                String kindName = kind.name();
+                String kindName = (kind == JavaKind.Object && !sunMiscUnsafe && !Java11OrEarlier) ? "Reference" : kind.name();
                 String getName = "get" + kindName;
                 String putName = "put" + kindName;
                 // Object-based accesses
@@ -360,7 +362,7 @@
                 r.register3(getName + "Volatile", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.VOLATILE, explicitUnsafeNullChecks));
                 r.register4(putName + "Volatile", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.VOLATILE, explicitUnsafeNullChecks));
                 // Ordered object-based accesses
-                if (java8OrEarlier) {
+                if (sunMiscUnsafe) {
                     if (kind == JavaKind.Int || kind == JavaKind.Long || kind == JavaKind.Object) {
                         r.register4("putOrdered" + kindName, Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.RELEASE_ACQUIRE, explicitUnsafeNullChecks));
                     }
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java	Tue Oct 23 15:29:10 2018 +0530
@@ -61,6 +61,11 @@
      */
     public static final boolean Java8OrEarlier = JAVA_SPECIFICATION_VERSION <= 8;
 
+    /**
+     * Determines if the Java runtime is version 11 or earlier.
+     */
+    public static final boolean Java11OrEarlier = JAVA_SPECIFICATION_VERSION <= 11;
+
     private GraalServices() {
     }
 
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java	Tue Oct 23 15:29:10 2018 +0530
@@ -864,7 +864,7 @@
      */
     @Override
     public void errormsg(String key, Object... args) {
-        error(messageFormat(key, args));
+        error("%s", messageFormat(key, args));
     }
 
     /**
--- a/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/CompletenessAnalyzer.java	Tue Oct 23 15:29:10 2018 +0530
@@ -228,15 +228,15 @@
         // Declarations and type parameters (thus expressions)
         EXTENDS(TokenKind.EXTENDS, XEXPR|XDECL),  //  extends
         COMMA(TokenKind.COMMA, XEXPR|XDECL),  //  ,
-        AMP(TokenKind.AMP, XEXPR|XDECL),  //  &
-        GT(TokenKind.GT, XEXPR|XDECL),  //  >
-        LT(TokenKind.LT, XEXPR|XDECL1),  //  <
-        LTLT(TokenKind.LTLT, XEXPR|XDECL1),  //  <<
-        GTGT(TokenKind.GTGT, XEXPR|XDECL),  //  >>
-        GTGTGT(TokenKind.GTGTGT, XEXPR|XDECL),  //  >>>
-        QUES(TokenKind.QUES, XEXPR|XDECL),  //  ?
+        AMP(TokenKind.AMP, XEXPR|XDECL, true),  //  &
+        GT(TokenKind.GT, XEXPR|XDECL, true),  //  >
+        LT(TokenKind.LT, XEXPR|XDECL1, true),  //  <
+        LTLT(TokenKind.LTLT, XEXPR|XDECL1, true),  //  <<
+        GTGT(TokenKind.GTGT, XEXPR|XDECL, true),  //  >>
+        GTGTGT(TokenKind.GTGTGT, XEXPR|XDECL, true),  //  >>>
+        QUES(TokenKind.QUES, XEXPR|XDECL, true),  //  ?
         DOT(TokenKind.DOT, XEXPR|XDECL),  //  .
-        STAR(TokenKind.STAR, XEXPR),  //  * (MAPPED: DOTSTAR)
+        STAR(TokenKind.STAR, XEXPR, true),  //  * (MAPPED: DOTSTAR)
 
         // Statement keywords
         ASSERT(TokenKind.ASSERT, XSTMT1|XSTART),  //  assert
@@ -249,7 +249,7 @@
         FOR(TokenKind.FOR, XSTMT1|XSTART),  //  for
         IF(TokenKind.IF, XSTMT1|XSTART),  //  if
         RETURN(TokenKind.RETURN, XSTMT1|XTERM|XSTART),  //  return
-        SWITCH(TokenKind.SWITCH, XSTMT1|XEXPR),  //  switch
+        SWITCH(TokenKind.SWITCH, XSTMT1|XEXPR1),  //  switch
         SYNCHRONIZED(TokenKind.SYNCHRONIZED, XSTMT1|XDECL),  //  synchronized
         THROW(TokenKind.THROW, XSTMT1|XSTART),  //  throw
         TRY(TokenKind.TRY, XSTMT1|XSTART),  //  try
@@ -276,7 +276,7 @@
         SUBSUB(TokenKind.SUBSUB, XEXPR1|XTERM),  //  --
 
         // Expressions cannot terminate
-        INSTANCEOF(TokenKind.INSTANCEOF, XEXPR),  //  instanceof
+        INSTANCEOF(TokenKind.INSTANCEOF, XEXPR, true),  //  instanceof
         NEW(TokenKind.NEW, XEXPR1),  //  new (MAPPED: COLCOLNEW)
         SUPER(TokenKind.SUPER, XEXPR1|XDECL),  //  super -- shouldn't see as rec. But in type parameters
         ARROW(TokenKind.ARROW, XEXPR),  //  ->
@@ -292,18 +292,18 @@
         BANG(TokenKind.BANG, XEXPR1),  //  !
         TILDE(TokenKind.TILDE, XEXPR1),  //  ~
         COLON(TokenKind.COLON, XEXPR|XTERM),  //  :
-        EQEQ(TokenKind.EQEQ, XEXPR),  //  ==
-        LTEQ(TokenKind.LTEQ, XEXPR),  //  <=
-        GTEQ(TokenKind.GTEQ, XEXPR),  //  >=
-        BANGEQ(TokenKind.BANGEQ, XEXPR),  //  !=
-        AMPAMP(TokenKind.AMPAMP, XEXPR),  //  &&
-        BARBAR(TokenKind.BARBAR, XEXPR),  //  ||
-        PLUS(TokenKind.PLUS, XEXPR1),  //  +
-        SUB(TokenKind.SUB, XEXPR1),  //  -
-        SLASH(TokenKind.SLASH, XEXPR),  //  /
-        BAR(TokenKind.BAR, XEXPR),  //  |
-        CARET(TokenKind.CARET, XEXPR),  //  ^
-        PERCENT(TokenKind.PERCENT, XEXPR),  //  %
+        EQEQ(TokenKind.EQEQ, XEXPR, true),  //  ==
+        LTEQ(TokenKind.LTEQ, XEXPR, true),  //  <=
+        GTEQ(TokenKind.GTEQ, XEXPR, true),  //  >=
+        BANGEQ(TokenKind.BANGEQ, XEXPR, true),  //  !=
+        AMPAMP(TokenKind.AMPAMP, XEXPR, true),  //  &&
+        BARBAR(TokenKind.BARBAR, XEXPR, true),  //  ||
+        PLUS(TokenKind.PLUS, XEXPR1, true),  //  +
+        SUB(TokenKind.SUB, XEXPR1, true),  //  -
+        SLASH(TokenKind.SLASH, XEXPR, true),  //  /
+        BAR(TokenKind.BAR, XEXPR, true),  //  |
+        CARET(TokenKind.CARET, XEXPR, true),  //  ^
+        PERCENT(TokenKind.PERCENT, XEXPR, true),  //  %
         PLUSEQ(TokenKind.PLUSEQ, XEXPR),  //  +=
         SUBEQ(TokenKind.SUBEQ, XEXPR),  //  -=
         STAREQ(TokenKind.STAREQ, XEXPR),  //  *=
@@ -330,6 +330,7 @@
 
         final TokenKind tokenKind;
         final int belongs;
+        final boolean valueOp;
         Function<TK,TK> mapping;
 
         TK(int b) {
@@ -337,8 +338,13 @@
         }
 
         TK(TokenKind tokenKind, int b) {
+            this(tokenKind, b, false);
+        }
+
+        TK(TokenKind tokenKind, int b, boolean valueOp) {
             this.tokenKind = tokenKind;
             this.belongs = b;
+            this.valueOp = valueOp;
             this.mapping = null;
         }
 
@@ -637,6 +643,8 @@
                         return parseExpressionStatement(); // Let this gen the status
                     }
                     return error();
+                case XSTMT1o | XEXPR1o:
+                    return disambiguateStatementVsExpression();
                 default:
                     throw new InternalError("Case not covered " + token.kind.belongs + " in " + token.kind);
             }
@@ -685,6 +693,44 @@
             }
         }
 
+        public Completeness disambiguateStatementVsExpression() {
+            if (token.kind == SWITCH) {
+                nextToken();
+                switch (token.kind) {
+                    case PARENS:
+                        nextToken();
+                        break;
+                    case UNMATCHED:
+                        nextToken();
+                        return Completeness.DEFINITELY_INCOMPLETE;
+                    case EOF:
+                        return Completeness.DEFINITELY_INCOMPLETE;
+                    default:
+                        return error();
+                }
+                switch (token.kind) {
+                    case BRACES:
+                        nextToken();
+                        break;
+                    case UNMATCHED:
+                        nextToken();
+                        return Completeness.DEFINITELY_INCOMPLETE;
+                    case EOF:
+                        return Completeness.DEFINITELY_INCOMPLETE;
+                    default:
+                        return error();
+                }
+                if (token.kind.valueOp) {
+                    return parseExpressionOptionalSemi();
+                } else {
+                    return Completeness.COMPLETE;
+                }
+            } else {
+                throw new InternalError("Unexpected statement/expression not covered " + token.kind.belongs + " in " + token.kind);
+            }
+        }
+
+
         public Completeness disambiguateDeclarationVsExpression() {
             // String folding messes up position information.
             return parseFactory.apply(pt -> {
@@ -699,7 +745,7 @@
                     case LABELED_STATEMENT:
                         if (shouldAbort(IDENTIFIER))  return checkResult;
                         if (shouldAbort(COLON))  return checkResult;
-                    return parseStatement();
+                        return parseStatement();
                     case VARIABLE:
                     case IMPORT:
                     case CLASS:
--- a/src/jdk.jshell/share/classes/jdk/jshell/ReplParser.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.jshell/share/classes/jdk/jshell/ReplParser.java	Tue Oct 23 15:29:10 2018 +0530
@@ -160,7 +160,6 @@
             case WHILE:
             case DO:
             case TRY:
-            case SWITCH:
             case RETURN:
             case THROW:
             case BREAK:
--- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Tue Oct 23 15:29:10 2018 +0530
@@ -196,7 +196,7 @@
      */
     @ForceInline
     public Object getObject(Object o, long offset) {
-        return theInternalUnsafe.getObject(o, offset);
+        return theInternalUnsafe.getReference(o, offset);
     }
 
     /**
@@ -211,7 +211,7 @@
      */
     @ForceInline
     public void putObject(Object o, long offset, Object x) {
-        theInternalUnsafe.putObject(o, offset, x);
+        theInternalUnsafe.putReference(o, offset, x);
     }
 
     /** @see #getInt(Object, long) */
@@ -860,7 +860,7 @@
     public final boolean compareAndSwapObject(Object o, long offset,
                                               Object expected,
                                               Object x) {
-        return theInternalUnsafe.compareAndSetObject(o, offset, expected, x);
+        return theInternalUnsafe.compareAndSetReference(o, offset, expected, x);
     }
 
     /**
@@ -901,7 +901,7 @@
      */
     @ForceInline
     public Object getObjectVolatile(Object o, long offset) {
-        return theInternalUnsafe.getObjectVolatile(o, offset);
+        return theInternalUnsafe.getReferenceVolatile(o, offset);
     }
 
     /**
@@ -910,7 +910,7 @@
      */
     @ForceInline
     public void putObjectVolatile(Object o, long offset, Object x) {
-        theInternalUnsafe.putObjectVolatile(o, offset, x);
+        theInternalUnsafe.putReferenceVolatile(o, offset, x);
     }
 
     /** Volatile version of {@link #getInt(Object, long)}  */
@@ -1020,7 +1020,7 @@
      */
     @ForceInline
     public void putOrderedObject(Object o, long offset, Object x) {
-        theInternalUnsafe.putObjectRelease(o, offset, x);
+        theInternalUnsafe.putReferenceRelease(o, offset, x);
     }
 
     /** Ordered/Lazy version of {@link #putIntVolatile(Object, long, int)}  */
@@ -1168,7 +1168,7 @@
      */
     @ForceInline
     public final Object getAndSetObject(Object o, long offset, Object newValue) {
-        return theInternalUnsafe.getAndSetObject(o, offset, newValue);
+        return theInternalUnsafe.getAndSetReference(o, offset, newValue);
     }
 
 
--- a/test/hotspot/jtreg/compiler/c2/Test7190310_unsafe.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/Test7190310_unsafe.java	Tue Oct 23 15:29:10 2018 +0530
@@ -95,12 +95,12 @@
 
         obj = getRef3(unsafe, t, referent_offset);
         if (obj != o) {
-            System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + o);
+            System.out.println("FAILED: unsafe.getReference(Object, " + referent_offset + ") " + obj + " != " + o);
             System.exit(97);
         }
         obj = getRef4(unsafe, t, referent_offset);
         if (obj != o) {
-            System.out.println("FAILED: unsafe.getObject(Test7190310, " + referent_offset + ") " + obj + " != " + o);
+            System.out.println("FAILED: unsafe.getReference(Test7190310, " + referent_offset + ") " + obj + " != " + o);
             System.exit(97);
         }
     }
@@ -115,17 +115,17 @@
         }
         obj = getRef1(unsafe, ref, referent_offset);
         if (obj != str) {
-            System.out.println("FAILED: unsafe.getObject(weakRef, " + referent_offset + ") " + obj + " != " + str);
+            System.out.println("FAILED: unsafe.getReference(weakRef, " + referent_offset + ") " + obj + " != " + str);
             return false;
         }
         obj = getRef2(unsafe, ref, referent_offset);
         if (obj != str) {
-            System.out.println("FAILED: unsafe.getObject(abstRef, " + referent_offset + ") " + obj + " != " + str);
+            System.out.println("FAILED: unsafe.getReference(abstRef, " + referent_offset + ") " + obj + " != " + str);
             return false;
         }
         obj = getRef3(unsafe, ref, referent_offset);
         if (obj != str) {
-            System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + str);
+            System.out.println("FAILED: unsafe.getReference(Object, " + referent_offset + ") " + obj + " != " + str);
             return false;
         }
         return true;
@@ -136,19 +136,19 @@
     }
 
     static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception {
-        return unsafe.getObject(ref, referent_offset);
+        return unsafe.getReference(ref, referent_offset);
     }
 
     static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception {
-        return unsafe.getObject(ref, referent_offset);
+        return unsafe.getReference(ref, referent_offset);
     }
 
     static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception {
-        return unsafe.getObject(ref, referent_offset);
+        return unsafe.getReference(ref, referent_offset);
     }
 
     static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception {
-        return unsafe.getObject(ref, referent_offset);
+        return unsafe.getReference(ref, referent_offset);
     }
 }
 
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java	Tue Oct 23 15:29:10 2018 +0530
@@ -75,6 +75,6 @@
 
     public void testObj(Object x, Object o)
     {
-        unsafe.compareAndSetObject(this, f_obj_off, x, o);
+        unsafe.compareAndSetReference(this, f_obj_off, x, o);
     }
 }
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java	Tue Oct 23 15:29:10 2018 +0530
@@ -51,6 +51,6 @@
 
     public int testObj()
     {
-        return ((Integer)unsafe.getObjectVolatile(this, f_obj_off));
+        return ((Integer)unsafe.getReferenceVolatile(this, f_obj_off));
     }
 }
--- a/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java	Tue Oct 23 15:29:10 2018 +0530
@@ -74,6 +74,6 @@
 
     public void testObj(Object o)
     {
-        unsafe.putObjectVolatile(this, f_obj_off, o);
+        unsafe.putReferenceVolatile(this, f_obj_off, o);
     }
 }
--- a/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/gcbarriers/UnsafeIntrinsicsTest.java	Tue Oct 23 15:29:10 2018 +0530
@@ -25,7 +25,7 @@
  * @test
  * @bug 8059022
  * @modules java.base/jdk.internal.misc:+open
- * @summary Validate barriers after Unsafe getObject, CAS and swap (GetAndSet)
+ * @summary Validate barriers after Unsafe getReference, CAS and swap (GetAndSet)
  * @requires vm.gc.Z & !vm.graal.enabled
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+UnlockDiagnosticVMOptions -XX:+ZUnmapBadViews -XX:ZCollectionInterval=1 -XX:-CreateCoredumpOnCrash -XX:CompileCommand=dontinline,*::mergeImpl* compiler.gcbarriers.UnsafeIntrinsicsTest
  */
@@ -263,19 +263,19 @@
 
     private Node mergeImplLoad(Node startNode, Node expectedNext, Node head) {
         // Atomic load version
-        Node temp = (Node) UNSAFE.getObject(startNode, offset);
+        Node temp = (Node) UNSAFE.getReference(startNode, offset);
         startNode.setNext(head);
         return temp;
     }
 
     private Node mergeImplSwap(Node startNode, Node expectedNext, Node head) {
         // Swap version
-        return (Node) UNSAFE.getAndSetObject(startNode, offset, head);
+        return (Node) UNSAFE.getAndSetReference(startNode, offset, head);
     }
 
     private Node mergeImplCAS(Node startNode, Node expectedNext, Node head) {
         // CAS - should always be true within a single thread - no other thread can have overwritten
-        if (!UNSAFE.compareAndSetObject(startNode, offset, expectedNext, head)) {
+        if (!UNSAFE.compareAndSetReference(startNode, offset, expectedNext, head)) {
             throw new Error("CAS should always succeed on thread local objects, check you barrier implementation");
         }
         return expectedNext; // continue on old circle
@@ -283,7 +283,7 @@
 
     private Node mergeImplCASFail(Node startNode, Node expectedNext, Node head) {
         // Force a fail
-        if (UNSAFE.compareAndSetObject(startNode, offset, "fail", head)) {
+        if (UNSAFE.compareAndSetReference(startNode, offset, "fail", head)) {
             throw new Error("This CAS should always fail, check you barrier implementation");
         }
         if (startNode.next() != expectedNext) {
@@ -294,7 +294,7 @@
 
     private Node mergeImplWeakCAS(Node startNode, Node expectedNext, Node head) {
         // Weak CAS - should always be true within a single thread - no other thread can have overwritten
-        if (!UNSAFE.weakCompareAndSetObject(startNode, offset, expectedNext, head)) {
+        if (!UNSAFE.weakCompareAndSetReference(startNode, offset, expectedNext, head)) {
             throw new Error("Weak CAS should always succeed on thread local objects, check you barrier implementation");
         }
         return expectedNext; // continue on old circle
@@ -302,7 +302,7 @@
 
     private Node mergeImplWeakCASFail(Node startNode, Node expectedNext, Node head) {
         // Force a fail
-        if (UNSAFE.weakCompareAndSetObject(startNode, offset, "fail", head)) {
+        if (UNSAFE.weakCompareAndSetReference(startNode, offset, "fail", head)) {
             throw new Error("This weak CAS should always fail, check you barrier implementation");
         }
         if (startNode.next() != expectedNext) {
@@ -313,7 +313,7 @@
 
     private Node mergeImplCMPX(Node startNode, Node expectedNext, Node head) {
         // CmpX - should always be true within a single thread - no other thread can have overwritten
-        Object res = UNSAFE.compareAndExchangeObject(startNode, offset, expectedNext, head);
+        Object res = UNSAFE.compareAndExchangeReference(startNode, offset, expectedNext, head);
         if (!res.equals(expectedNext)) {
             throw new Error("Fail CmpX should always succeed on thread local objects, check you barrier implementation");
         }
@@ -321,7 +321,7 @@
     }
 
     private Node mergeImplCMPXFail(Node startNode, Node expectedNext, Node head) {
-        Object res = UNSAFE.compareAndExchangeObject(startNode, offset, head, head);
+        Object res = UNSAFE.compareAndExchangeReference(startNode, offset, head, head);
         if (startNode.next() != expectedNext) {
             throw new Error("Shouldn't have changed");
         }
--- a/test/hotspot/jtreg/compiler/intrinsics/unsafe/TestCAEAntiDep.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/intrinsics/unsafe/TestCAEAntiDep.java	Tue Oct 23 15:29:10 2018 +0530
@@ -25,7 +25,7 @@
 /**
  * @test
  * @bug 8167298
- * @summary Unsafe.compareAndExchangeObject should keep track of returned type after matching
+ * @summary Unsafe.compareAndExchangeReference should keep track of returned type after matching
  * @modules java.base/jdk.internal.misc
  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-UseCompressedOops TestCAEAntiDep
  *
@@ -54,7 +54,7 @@
     }
 
     static int m(TestCAEAntiDep test, Object expected, Object x) {
-        C old = (C)UNSAFE.compareAndExchangeObject(test, O_OFFSET, expected, x);
+        C old = (C)UNSAFE.compareAndExchangeReference(test, O_OFFSET, expected, x);
         int res = old.f1;
         old.f1 = 0x42;
         return res;
--- a/test/hotspot/jtreg/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java	Tue Oct 23 15:29:10 2018 +0530
@@ -52,7 +52,7 @@
     static final long array_offset;
 
     void m() {
-        UNSAFE.getObject(this, array_offset);
+        UNSAFE.getReference(this, array_offset);
     }
 
     static public void main(String[] args) {
--- a/test/hotspot/jtreg/compiler/profiling/UnsafeAccess.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/profiling/UnsafeAccess.java	Tue Oct 23 15:29:10 2018 +0530
@@ -49,7 +49,7 @@
 
     static Object helperUnsafeAccess(Object o, boolean isObjArray) {
         if (isObjArray) {
-            U.putObject(o, off, new Object());
+            U.putReference(o, off, new Object());
         }
         return o;
     }
@@ -63,8 +63,8 @@
 
     static Object helperUnsafeLoadStore(Object o, boolean isObjArray) {
         if (isObjArray) {
-            Object o1 = U.getObject(o, off);
-            U.compareAndSetObject(o, off, o1, new Object());
+            Object o1 = U.getReference(o, off);
+            U.compareAndSetReference(o, off, o1, new Object());
         }
         return o;
     }
--- a/test/hotspot/jtreg/compiler/regalloc/C1ObjectSpillInLogicOp.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/regalloc/C1ObjectSpillInLogicOp.java	Tue Oct 23 15:29:10 2018 +0530
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8027751
- * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill
+ * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetReference() intrinsic because of the new value spill
  * @requires vm.gc.G1
  *
  * @run main/othervm -XX:+UseG1GC compiler.regalloc.C1ObjectSpillInLogicOp
--- a/test/hotspot/jtreg/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java	Tue Oct 23 15:29:10 2018 +0530
@@ -71,6 +71,6 @@
     }
 
     private void readField(Object o, long fieldOffset) {
-        unsafe.getObject(o, fieldOffset);
+        unsafe.getReference(o, fieldOffset);
     }
 }
--- a/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java	Tue Oct 23 15:29:10 2018 +0530
@@ -119,141 +119,141 @@
     static void testAccess(Object base, long offset) {
         // Plain
         {
-            UNSAFE.putObject(base, offset, "foo");
-            Object x = UNSAFE.getObject(base, offset);
+            UNSAFE.putReference(base, offset, "foo");
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "set Object value");
         }
 
         // Volatile
         {
-            UNSAFE.putObjectVolatile(base, offset, "bar");
-            Object x = UNSAFE.getObjectVolatile(base, offset);
+            UNSAFE.putReferenceVolatile(base, offset, "bar");
+            Object x = UNSAFE.getReferenceVolatile(base, offset);
             assertEquals(x, "bar", "putVolatile Object value");
         }
 
 
         // Lazy
         {
-            UNSAFE.putObjectRelease(base, offset, "foo");
-            Object x = UNSAFE.getObjectAcquire(base, offset);
+            UNSAFE.putReferenceRelease(base, offset, "foo");
+            Object x = UNSAFE.getReferenceAcquire(base, offset);
             assertEquals(x, "foo", "putRelease Object value");
         }
 
         // Opaque
         {
-            UNSAFE.putObjectOpaque(base, offset, "bar");
-            Object x = UNSAFE.getObjectOpaque(base, offset);
+            UNSAFE.putReferenceOpaque(base, offset, "bar");
+            Object x = UNSAFE.getReferenceOpaque(base, offset);
             assertEquals(x, "bar", "putOpaque Object value");
         }
 
 
-        UNSAFE.putObject(base, offset, "foo");
+        UNSAFE.putReference(base, offset, "foo");
 
         // Compare
         {
-            boolean r = UNSAFE.compareAndSetObject(base, offset, "foo", "bar");
+            boolean r = UNSAFE.compareAndSetReference(base, offset, "foo", "bar");
             assertEquals(r, true, "success compareAndSet Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "success compareAndSet Object value");
         }
 
         {
-            boolean r = UNSAFE.compareAndSetObject(base, offset, "foo", "baz");
+            boolean r = UNSAFE.compareAndSetReference(base, offset, "foo", "baz");
             assertEquals(r, false, "failing compareAndSet Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "failing compareAndSet Object value");
         }
 
         // Advanced compare
         {
-            Object r = UNSAFE.compareAndExchangeObject(base, offset, "bar", "foo");
+            Object r = UNSAFE.compareAndExchangeReference(base, offset, "bar", "foo");
             assertEquals(r, "bar", "success compareAndExchange Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "success compareAndExchange Object value");
         }
 
         {
-            Object r = UNSAFE.compareAndExchangeObject(base, offset, "bar", "baz");
+            Object r = UNSAFE.compareAndExchangeReference(base, offset, "bar", "baz");
             assertEquals(r, "foo", "failing compareAndExchange Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "failing compareAndExchange Object value");
         }
 
         {
-            Object r = UNSAFE.compareAndExchangeObjectAcquire(base, offset, "foo", "bar");
+            Object r = UNSAFE.compareAndExchangeReferenceAcquire(base, offset, "foo", "bar");
             assertEquals(r, "foo", "success compareAndExchangeAcquire Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "success compareAndExchangeAcquire Object value");
         }
 
         {
-            Object r = UNSAFE.compareAndExchangeObjectAcquire(base, offset, "foo", "baz");
+            Object r = UNSAFE.compareAndExchangeReferenceAcquire(base, offset, "foo", "baz");
             assertEquals(r, "bar", "failing compareAndExchangeAcquire Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "failing compareAndExchangeAcquire Object value");
         }
 
         {
-            Object r = UNSAFE.compareAndExchangeObjectRelease(base, offset, "bar", "foo");
+            Object r = UNSAFE.compareAndExchangeReferenceRelease(base, offset, "bar", "foo");
             assertEquals(r, "bar", "success compareAndExchangeRelease Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "success compareAndExchangeRelease Object value");
         }
 
         {
-            Object r = UNSAFE.compareAndExchangeObjectRelease(base, offset, "bar", "baz");
+            Object r = UNSAFE.compareAndExchangeReferenceRelease(base, offset, "bar", "baz");
             assertEquals(r, "foo", "failing compareAndExchangeRelease Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "failing compareAndExchangeRelease Object value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = UNSAFE.weakCompareAndSetObjectPlain(base, offset, "foo", "bar");
+                success = UNSAFE.weakCompareAndSetReferencePlain(base, offset, "foo", "bar");
             }
             assertEquals(success, true, "weakCompareAndSetPlain Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "weakCompareAndSetPlain Object value");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = UNSAFE.weakCompareAndSetObjectAcquire(base, offset, "bar", "foo");
+                success = UNSAFE.weakCompareAndSetReferenceAcquire(base, offset, "bar", "foo");
             }
             assertEquals(success, true, "weakCompareAndSetAcquire Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "weakCompareAndSetAcquire Object");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = UNSAFE.weakCompareAndSetObjectRelease(base, offset, "foo", "bar");
+                success = UNSAFE.weakCompareAndSetReferenceRelease(base, offset, "foo", "bar");
             }
             assertEquals(success, true, "weakCompareAndSetRelease Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "bar", "weakCompareAndSetRelease Object");
         }
 
         {
             boolean success = false;
             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
-                success = UNSAFE.weakCompareAndSetObject(base, offset, "bar", "foo");
+                success = UNSAFE.weakCompareAndSetReference(base, offset, "bar", "foo");
             }
             assertEquals(success, true, "weakCompareAndSet Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "weakCompareAndSet Object");
         }
 
-        UNSAFE.putObject(base, offset, "bar");
+        UNSAFE.putReference(base, offset, "bar");
 
         // Compare set and get
         {
-            Object o = UNSAFE.getAndSetObject(base, offset, "foo");
+            Object o = UNSAFE.getAndSetReference(base, offset, "foo");
             assertEquals(o, "bar", "getAndSet Object");
-            Object x = UNSAFE.getObject(base, offset);
+            Object x = UNSAFE.getReference(base, offset);
             assertEquals(x, "foo", "getAndSet Object value");
         }
 
--- a/test/hotspot/jtreg/compiler/unsafe/MixedUnsafeStoreObject.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/MixedUnsafeStoreObject.java	Tue Oct 23 15:29:10 2018 +0530
@@ -54,7 +54,7 @@
         for (int c = 0; c < 20000; c++) { // trigger OSR compilation
             // java/lang/Object+12 *
             // _base = InstPtr, _ptr = BotPTR, _field = NULL, mismatched = true
-            UNSAFE.putObject(t, F_OFFSET, "foo");
+            UNSAFE.putReference(t, F_OFFSET, "foo");
         }
     }
 
@@ -62,7 +62,7 @@
         for (int c = 0; c < 20000; c++) { // trigger OSR compilation
             // ...$T+12 *
             // _base = InstPtr, _ptr = BotPTR, _field = T.f, mismatched = false
-            UNSAFE.putObject(t, F_OFFSET, "foo");
+            UNSAFE.putReference(t, F_OFFSET, "foo");
         }
     }
     public static void main(String[] args) {
--- a/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java	Tue Oct 23 15:29:10 2018 +0530
@@ -78,7 +78,7 @@
     private long l1, l2;
 
     static Object testFixedOffsetField(Object o) {
-        return UNSAFE.getObject(o, F_OFFSET);
+        return UNSAFE.getReference(o, F_OFFSET);
     }
 
     static int testFixedOffsetHeader0(Object o) {
@@ -106,11 +106,11 @@
     }
 
     static Object testFixedBase(long off) {
-        return UNSAFE.getObject(INSTANCE, off);
+        return UNSAFE.getReference(INSTANCE, off);
     }
 
     static Object testOpaque(Object o, long off) {
-        return UNSAFE.getObject(o, off);
+        return UNSAFE.getReference(o, off);
     }
 
     static int testFixedOffsetHeaderArray0(Object[] arr) {
@@ -138,15 +138,15 @@
     }
 
     static Object testFixedOffsetArray(Object[] arr) {
-        return UNSAFE.getObject(arr, E_OFFSET);
+        return UNSAFE.getReference(arr, E_OFFSET);
     }
 
     static Object testFixedBaseArray(long off) {
-        return UNSAFE.getObject(ARRAY, off);
+        return UNSAFE.getReference(ARRAY, off);
     }
 
     static Object testOpaqueArray(Object[] o, long off) {
-        return UNSAFE.getObject(o, off);
+        return UNSAFE.getReference(o, off);
     }
 
     static final long ADDR = UNSAFE.allocateMemory(10);
--- a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java	Tue Oct 23 15:29:10 2018 +0530
@@ -222,6 +222,9 @@
                 return name();
             }
         }
+        String unsafeTypeName() {
+            return typeName.equals("Object") ? "Reference" : typeName;
+        }
     }
 
     static String internalName(Class cls) {
@@ -352,7 +355,7 @@
                 } else {
                     mv.visitInsn(ACONST_NULL);
                 }
-                String name = "put" + type.typeName + nameSuffix;
+                String name = "put" + type.unsafeTypeName() + nameSuffix;
                 mv.visitMethodInsn(INVOKEVIRTUAL, UNSAFE_NAME, name, "(Ljava/lang/Object;J" + type.desc()+ ")V", false);
                 mv.visitInsn(RETURN);
 
@@ -438,7 +441,7 @@
                 mv.visitFieldInsn(GETSTATIC, className, "t", classDesc);
             }
             mv.visitFieldInsn(GETSTATIC, className, "FIELD_OFFSET", "J");
-            String name = "get" + type.typeName + nameSuffix;
+            String name = "get" + type.unsafeTypeName() + nameSuffix;
             mv.visitMethodInsn(INVOKEVIRTUAL, UNSAFE_NAME, name, "(Ljava/lang/Object;J)" + type.desc(), false);
         }
         void wrapResult(MethodVisitor mv) {
--- a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java	Tue Oct 23 15:29:10 2018 +0530
@@ -173,15 +173,15 @@
         static float   testD_F() { return U.getFloat(  STABLE_DOUBLE_ARRAY, ARRAY_DOUBLE_BASE_OFFSET); }
         static double  testD_D() { return U.getDouble( STABLE_DOUBLE_ARRAY, ARRAY_DOUBLE_BASE_OFFSET); }
 
-        static Object  testL_L() { return U.getObject( STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static boolean testL_Z() { return U.getBoolean(STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static byte    testL_B() { return U.getByte(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static short   testL_S() { return U.getShort(  STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static char    testL_C() { return U.getChar(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static int     testL_I() { return U.getInt(    STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static long    testL_J() { return U.getLong(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static float   testL_F() { return U.getFloat(  STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
-        static double  testL_D() { return U.getDouble( STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
+        static Object  testL_L() { return U.getReference( STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET); }
+        static boolean testL_Z() { return U.getBoolean(STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static byte    testL_B() { return U.getByte(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static short   testL_S() { return U.getShort(  STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static char    testL_C() { return U.getChar(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static int     testL_I() { return U.getInt(    STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static long    testL_J() { return U.getLong(   STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static float   testL_F() { return U.getFloat(  STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
+        static double  testL_D() { return U.getDouble( STABLE_OBJECT_ARRAY, ARRAY_OBJECT_BASE_OFFSET);    }
 
         static short   testS_U() { return U.getShortUnaligned(STABLE_SHORT_ARRAY, ARRAY_SHORT_BASE_OFFSET + 1); }
         static char    testC_U() { return U.getCharUnaligned(  STABLE_CHAR_ARRAY,  ARRAY_CHAR_BASE_OFFSET + 1); }
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/NonBootLoaderClasses.java	Tue Oct 23 15:29:10 2018 +0530
@@ -34,7 +34,6 @@
 import jdk.test.lib.cds.CDSOptions;
 import jdk.test.lib.cds.CDSTestUtils;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.process.ProcessTools;
 
 public class NonBootLoaderClasses {
     public static void main(String[] args) throws Exception {
@@ -50,16 +49,16 @@
         CDSTestUtils.createArchiveAndCheck(opts);
 
         // Print the shared dictionary and inspect the output
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-                "-cp", "\"\"",
+        opts = (new CDSOptions())
+            .setUseVersion(false)
+            .addSuffix( "-cp", "\"\"",
                 "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
                 "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary");
-        OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "print-shared-archive");
-        CDSTestUtils.checkMappingFailure(out);
-
-        out.shouldContain("archive is valid")
-            .shouldHaveExitValue(0)               // Should report success in error code.
-            .shouldContain(PLATFORM_CLASS.replace('/', '.'))
-            .shouldContain(APP_CLASS.replace('/', '.'));
+        CDSTestUtils.run(opts)
+            .assertNormalExit(output -> {
+                output.shouldContain("archive is valid");
+                output.shouldContain(PLATFORM_CLASS.replace('/', '.'));
+                output.shouldContain(APP_CLASS.replace('/', '.'));
+            });
    }
 }
--- a/test/hotspot/jtreg/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java	Tue Oct 23 15:29:10 2018 +0530
@@ -33,7 +33,6 @@
 
 import jdk.test.lib.cds.CDSOptions;
 import jdk.test.lib.cds.CDSTestUtils;
-import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
 public class PrintSharedArchiveAndExit {
@@ -44,23 +43,24 @@
         CDSTestUtils.checkDump(out);
 
         // (1) With a valid archive
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-                "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
+        opts = (new CDSOptions())
+            .setUseVersion(false)
+            .addSuffix( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
                 "-XX:+PrintSharedArchiveAndExit", "-version");
-        out = CDSTestUtils.executeAndLog(pb, "print-shared-archive-and-version");
-        CDSTestUtils.checkMappingFailure(out);
+        CDSTestUtils.run(opts)
+            .assertNormalExit(output -> {
+                output.shouldContain("archive is valid");
+                output.shouldNotContain("java version"); // Should not print JVM version
+            });
 
-        out.shouldContain("archive is valid")
-            .shouldNotContain("java version")     // Should not print JVM version
-            .shouldHaveExitValue(0);              // Should report success in error code.
-
-        pb = ProcessTools.createJavaProcessBuilder(
-                "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
+        opts = (new CDSOptions())
+            .setUseVersion(false)
+            .addSuffix( "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./" + archiveName,
                 "-XX:+PrintSharedArchiveAndExit");
-        out = CDSTestUtils.executeAndLog(pb, "print-shared-archive");
-        CDSTestUtils.checkMappingFailure(out);
-        out.shouldContain("archive is valid")
-            .shouldNotContain("Usage:")           // Should not print JVM help message
-            .shouldHaveExitValue(0);              // Should report success in error code.
+        CDSTestUtils.run(opts)
+            .assertNormalExit(output -> {
+                output.shouldContain("archive is valid");
+                output.shouldNotContain("Usage:"); // Should not print JVM help message
+            });
     }
 }
--- a/test/hotspot/jtreg/runtime/Unsafe/GetPutObject.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/runtime/Unsafe/GetPutObject.java	Tue Oct 23 15:29:10 2018 +0530
@@ -42,16 +42,16 @@
         Field field = Test.class.getField("o");
 
         long offset = unsafe.objectFieldOffset(field);
-        assertEquals(t.o, unsafe.getObject(t, offset));
+        assertEquals(t.o, unsafe.getReference(t, offset));
 
-        unsafe.putObject(t, offset, o);
-        assertEquals(o, unsafe.getObject(t, offset));
+        unsafe.putReference(t, offset, o);
+        assertEquals(o, unsafe.getReference(t, offset));
 
         Object arrayObject[] = { unsafe, null, new Object() };
         int scale = unsafe.arrayIndexScale(arrayObject.getClass());
         offset = unsafe.arrayBaseOffset(arrayObject.getClass());
         for (int i = 0; i < arrayObject.length; i++) {
-            assertEquals(unsafe.getObject(arrayObject, offset), arrayObject[i]);
+            assertEquals(unsafe.getReference(arrayObject, offset), arrayObject[i]);
             offset += scale;
         }
     }
--- a/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java	Tue Oct 23 15:29:10 2018 +0530
@@ -59,7 +59,7 @@
     public static class DummyClassWithMainRangeCheck {
         public static void main(String args[]) throws Exception {
             Unsafe unsafe = Unsafe.getUnsafe();
-            unsafe.getObject(new DummyClassWithMainRangeCheck(), Short.MAX_VALUE);
+            unsafe.getReference(new DummyClassWithMainRangeCheck(), Short.MAX_VALUE);
         }
     }
 }
--- a/test/hotspot/jtreg/vmTestbase/gc/gctests/nativeGC01/libnativeGC01.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/gc/gctests/nativeGC01/libnativeGC01.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -27,7 +27,7 @@
 extern "C" {
 
 /*
- * A C function that takes a reference to java Object( a circular Linked list)
+ * A C function that takes a reference to java Object (a circular Linked list)
  * and utilizes this reference to do a java method callback to determine the
  * number of elements in the linked list
  */
@@ -55,8 +55,8 @@
            */
 
         clss = env->GetObjectClass(linked_list);
-        mid2 = env->GetMethodID(clss, "getLength", "()I" );
-        if (mid2  == 0) {
+        mid2 = env->GetMethodID(clss, "getLength", "()I");
+        if (mid2 == 0) {
                 printf("couldnt locate method getLength()");
                 return -1;
         }
--- a/test/hotspot/jtreg/vmTestbase/gc/gctests/nativeGC02/libnativeGC02.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/gc/gctests/nativeGC02/libnativeGC02.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -25,7 +25,7 @@
 
 extern "C" {
 
-/* A C function that takes a reference to java Object( a circular Linked list)
+/* A C function that takes a reference to java Object(a circular Linked list)
     and utilizes this reference to do a java method callback to determine the
     number of elements in the linked list */
 JNIEXPORT jint JNICALL
@@ -51,9 +51,9 @@
         /* force a GC by invoking a callback where System.gc() is called
         */
 
-        cls  = env->GetObjectClass(obj);
+        cls = env->GetObjectClass(obj);
         mid = env->GetMethodID(cls, "callbackGC", "()V");
-        if (mid  == 0){
+        if (mid == 0) {
                 printf("couldnt locate method callbackGC()\n");
                 return -1;
         }
@@ -65,12 +65,12 @@
            */
 
         clss = env->GetObjectClass(linked_list);
-        mid2 = env->GetMethodID(clss, "getLength", "(Lnsk/share/gc/CircularLinkedList;)I" );
-        if (mid2  == 0 ){
+        mid2 = env->GetMethodID(clss, "getLength", "(Lnsk/share/gc/CircularLinkedList;)I");
+        if (mid2 == 0) {
                 printf("couldnt locate method getLength(CircularLinkedList)\n");
                 return -1;
         }
-        elementCount  = env->CallIntMethod(linked_list, mid2, llist);
+        elementCount = env->CallIntMethod(linked_list, mid2, llist);
         return elementCount;
 }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -142,7 +142,7 @@
             break;
         }
 
-        if (printdump == JNI_TRUE && (memCount % 50 == 0) ) {
+        if (printdump == JNI_TRUE && (memCount % 50 == 0)) {
            printf(">>> ... done (%dMb)\n", memCount);
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach002/attach002Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach002/attach002Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -205,7 +205,7 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_all_class_hook_events = 1;
     caps.can_redefine_classes = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         /*
          * If VM is run with -Xshare:on agent can't get required capabilities (see 6718407)
          */
@@ -222,7 +222,7 @@
         eventCallbacks.ClassLoad = classLoadHandler;
         eventCallbacks.ClassPrepare = classPrepareHandler;
         eventCallbacks.ClassFileLoadHook = classFileLoadHoockHandler;
-        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
             return JNI_ERR;
         }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/attach002aAgent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/attach002aAgent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -106,13 +106,13 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_redefine_classes = 1;
     caps.can_generate_vm_object_alloc_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.VMObjectAlloc = vmObjectAllocHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach008/attach008Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach008/attach008Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -123,14 +123,14 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_monitor_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.MonitorContendedEntered = monitorContentedEnteredHandler;
     eventCallbacks.MonitorContendedEnter = monitorContentedEnterHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach009/attach009Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach009/attach009Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -82,7 +82,7 @@
             return;
         }
 
-        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, thread) ) ) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, thread))) {
             NSK_COMPLAIN1("Failed to enable events for thread '%s'\n", mainThreadName);
             nsk_aod_agentFinished(jni, agentName, 0);
             return;
@@ -141,7 +141,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassLoad = classLoadHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach012/attach012Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach012/attach012Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -65,7 +65,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps))) {
         return JNI_ERR;
     }
 
@@ -75,7 +75,7 @@
 
     NSK_DISPLAY1("%s: trying to get all potential capabilities:\n", agentName);
 
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach014/attach014Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach014/attach014Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -104,7 +104,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassLoad = classLoadHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach015/attach015Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach015/attach015Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -97,7 +97,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassPrepare = classPrepareHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach015/attach015Agent01.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach015/attach015Agent01.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -97,7 +97,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassLoad = classLoadHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach020/attach020Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach020/attach020Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -118,7 +118,7 @@
     if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThread(jni)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, auxiliaryThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, auxiliaryThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
         return NSK_FALSE;
     }
 
@@ -165,14 +165,14 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_garbage_collection_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.GarbageCollectionStart  = garbageCollectionStartHandler;
     eventCallbacks.GarbageCollectionFinish = garbageCollectionFinishHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach021/attach021Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach021/attach021Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -142,13 +142,13 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_tag_objects = 1;
     caps.can_generate_object_free_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ObjectFree = objectFreeHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach022/attach022Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach022/attach022Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -203,14 +203,14 @@
     caps.can_tag_objects = 1;
     caps.can_generate_object_free_events = 1;
     caps.can_generate_vm_object_alloc_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ObjectFree = objectFreeHandler;
     eventCallbacks.VMObjectAlloc = vmObjectAllocHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach037/attach037Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach037/attach037Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -122,14 +122,14 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_monitor_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.MonitorWaited = monitorWaitedHandler;
     eventCallbacks.MonitorWait = monitorWaitHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach038/attach038Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach038/attach038Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -119,7 +119,7 @@
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadEnd = threadEndHandler;
     eventCallbacks.ThreadStart = threadStartHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach039/attach039Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach039/attach039Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -68,7 +68,7 @@
     if (!NSK_VERIFY((thread = nsk_jvmti_aod_createThreadWithName(jni, STARTED_THREAD_NAME)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, startedThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RunAgentThread(thread, startedThreadFunction, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
         return NSK_FALSE;
     }
 
@@ -154,7 +154,7 @@
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadEnd = threadEndHandler;
     eventCallbacks.ThreadStart = threadStartHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach040/attach040Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach040/attach040Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -150,7 +150,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadStart = threadStartHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach041/attach041Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach041/attach041Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -172,7 +172,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadStart = threadStartHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach042/attach042Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach042/attach042Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -136,7 +136,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadStart = threadStartHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -114,7 +114,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassLoad = classLoadHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent01.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent01.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -125,7 +125,7 @@
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassPrepare = classPrepareHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent02.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent02.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -146,7 +146,7 @@
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ThreadStart = threadStartHandler;
     eventCallbacks.ThreadEnd = threadEndHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent03.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/attach045Agent03.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -135,13 +135,13 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_vm_object_alloc_events = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.VMObjectAlloc = VMObjectAllocHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach046/attach046Agent00.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach046/attach046Agent00.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -113,13 +113,13 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_redefine_classes = 1;
-    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&eventCallbacks,0, sizeof(eventCallbacks));
     eventCallbacks.ClassLoad = classLoadHandler;
-    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))) ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/fieldacc003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/fieldacc003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -165,7 +165,7 @@
             }
             if (watch.m_sig == NULL ||
                     strcmp(watch.m_sig, watches[i].m_sig) != 0) {
-                printf("(watch#%" PRIuPTR " ) wrong method sig: \"%s\"",
+                printf("(watch#%" PRIuPTR ") wrong method sig: \"%s\"",
                        i, watch.m_sig);
                 printf(", expected: \"%s\"\n", watches[i].m_sig);
                 result = STATUS_FAILED;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/ForceEarlyReturn001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/ForceEarlyReturn001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -44,10 +44,7 @@
         , jobject earlyReturnThread
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->SuspendThread                    (earlyReturnThread                )
-            )
-        )
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(earlyReturnThread)))
          return JNI_FALSE;
 
     return JNI_TRUE;
@@ -62,10 +59,7 @@
         , jobject earlyReturnThread
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ResumeThread                    (earlyReturnThread                )
-            )
-        )
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(earlyReturnThread)))
          return JNI_FALSE;
 
     return JNI_TRUE;
@@ -81,10 +75,7 @@
         , jobject valueToReturn
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnObject                    (earlyReturnThread                    , valueToReturn                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnObject(earlyReturnThread, valueToReturn)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -100,10 +91,7 @@
         , jint valueToReturn
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnInt                    (earlyReturnThread                    , valueToReturn                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnInt(earlyReturnThread, valueToReturn)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -119,10 +107,7 @@
         , jlong valueToReturn
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnLong                    (earlyReturnThread                    , valueToReturn                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnLong(earlyReturnThread, valueToReturn)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -138,10 +123,7 @@
         , jfloat valueToReturn
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnFloat                    (earlyReturnThread                    , valueToReturn                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnFloat(earlyReturnThread, valueToReturn)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -157,10 +139,7 @@
         , jdouble valueToReturn
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnDouble                    (earlyReturnThread                    , valueToReturn                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnDouble(earlyReturnThread, valueToReturn)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -175,10 +154,7 @@
         , jthread earlyReturnThread
         )
 {
-    if (!NSK_JVMTI_VERIFY(
-                jvmti                    ->ForceEarlyReturnVoid                    (earlyReturnThread                    )
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->ForceEarlyReturnVoid(earlyReturnThread)))
         return JNI_FALSE;
 
     return JNI_TRUE;
@@ -202,24 +178,17 @@
 {
     jvmtiCapabilities caps;
 
-    if (!NSK_VERIFY(
-                (jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL
-                )
-       )
+    if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(jvmti                    ->GetCapabilities                    (&caps)
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     // Register all necessary JVM capabilities
     caps.can_force_early_return = 1;
     caps.can_suspend = 1;
 
-    if (!NSK_JVMTI_VERIFY(jvmti                    ->AddCapabilities                    (&caps)
-                )
-       )
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat002/thrstat002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -245,8 +245,8 @@
         return;
     }
 
-    printf( "START checkStatus for \"thr1\" (0x%p%s), check state: %s\n",
-            thr_ptr, suspStr, TranslateState(state[statInd]) );
+    printf("START checkStatus for \"thr1\" (0x%p%s), check state: %s\n",
+           thr_ptr, suspStr, TranslateState(state[statInd]));
 
     timeout_is_reached = JNI_TRUE;
     for (millis = WAIT_START, waited_millis=0; millis < wait_time; millis <<= 1) {
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat005/thrstat005.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetThreadState/thrstat005/thrstat005.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -101,13 +101,13 @@
     jint res;
 
     res = jvm->GetEnv((void **) &g_ppJvmtiEnv, JVMTI_VERSION_1_1);
-    if ( res != JNI_OK || ! g_ppJvmtiEnv ) {
+    if (res != JNI_OK || !g_ppJvmtiEnv) {
         printf("Agent_OnLoad: Error: GetEnv returned error or NULL\n");
         return JNI_ERR;
     }
 
     error = g_ppJvmtiEnv->CreateRawMonitor("beast", &g_waitMon);
-    if ( error != JVMTI_ERROR_NONE ) {
+    if (error != JVMTI_ERROR_NONE) {
         reportError("Agent_OnLoad: error creating raw monitor", error);
         return JNI_ERR;
     }
@@ -139,21 +139,21 @@
         printf("GetThreadState = %x. Masked: %x. Must be: %x\n", thrState, maskedThrState, g_ThreadState[stateIdx]);
         fflush(stdout);
 
-        if ( maskedThrState == g_ThreadState[stateIdx] )
+        if (maskedThrState == g_ThreadState[stateIdx])
             return JNI_TRUE;
 
         printf("checkThreadState: wait %d ms\n", waitTime);
         fflush(stdout);
-        if ( (res = g_ppJvmtiEnv->RawMonitorEnter(g_waitMon)) != JVMTI_ERROR_NONE
+        if ((res = g_ppJvmtiEnv->RawMonitorEnter(g_waitMon)) != JVMTI_ERROR_NONE
                 || (res = g_ppJvmtiEnv->RawMonitorWait(g_waitMon, waitTime)) != JVMTI_ERROR_NONE
-                || (res = g_ppJvmtiEnv->RawMonitorExit(g_waitMon)) != JVMTI_ERROR_NONE ) {
+                || (res = g_ppJvmtiEnv->RawMonitorExit(g_waitMon)) != JVMTI_ERROR_NONE) {
             reportError("GetThreadState: unexpected error", res);
             return JNI_FALSE;
         }
 
         waitTime <<= 1;
 
-    } while ( waitTime < g_waitTime );
+    } while (waitTime < g_waitTime);
 
     return JNI_FALSE;
 }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap004/iterheap004.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap004/iterheap004.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -86,7 +86,7 @@
 
     long ind = (long)((*tag_ptr) - 1);
 
-    if (ind < 0 || ind > objectDescCount ) {
+    if (ind < 0 || ind > objectDescCount) {
         NSK_COMPLAIN1("heapObjectCallbackForSecondIteration: invalid object tag value: %d\n", (long)*tag_ptr);
         nsk_jvmti_setFailStatus();
         callbackAborted = 1;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap006/iterheap006.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap006/iterheap006.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -46,7 +46,7 @@
                    void* storage_data) {
 
     if (!NSK_JVMTI_VERIFY(
-            st_jvmti->SetEnvironmentLocalStorage(storage_data ))) {
+            st_jvmti->SetEnvironmentLocalStorage(storage_data))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -86,7 +86,7 @@
 
         if (strcmp(storage_data, (char *)storage_ptr) != 0) {
             NSK_COMPLAIN2("Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                             (char *)storage_ptr, storage_data );
+                             (char *)storage_ptr, storage_data);
             nsk_jvmti_setFailStatus();
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap007/iterheap007.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverHeap/iterheap007/iterheap007.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -45,8 +45,7 @@
                    jlong* tag_ptr,
                    void* user_data) {
 
-    if (!NSK_JVMTI_VERIFY(
-            st_jvmti->GetCurrentThreadCpuTimerInfo(&timer_info1 ))) {
+    if (!NSK_JVMTI_VERIFY(st_jvmti->GetCurrentThreadCpuTimerInfo(&timer_info1))) {
         nsk_jvmti_setFailStatus();
     }
     /* Check the returned jvmtiTimerInfo structure */
@@ -64,14 +63,12 @@
     }
     /* ---------------------------------------------------------------------- */
 
-    if (!NSK_JVMTI_VERIFY(
-            st_jvmti->GetCurrentThreadCpuTime(&nanos ))) {
+    if (!NSK_JVMTI_VERIFY(st_jvmti->GetCurrentThreadCpuTime(&nanos))) {
         nsk_jvmti_setFailStatus();
     }
     /* ---------------------------------------------------------------------- */
 
-    if (!NSK_JVMTI_VERIFY(
-            st_jvmti->GetTimerInfo(&timer_info2 ))) {
+    if (!NSK_JVMTI_VERIFY(st_jvmti->GetTimerInfo(&timer_info2))) {
         nsk_jvmti_setFailStatus();
     }
     /* Check the returned jvmtiTimerInfo structure */
@@ -90,8 +87,7 @@
     /* ---------------------------------------------------------------------- */
 
     nanos = 0;
-    if (!NSK_JVMTI_VERIFY(
-            st_jvmti->GetTime(&nanos ))) {
+    if (!NSK_JVMTI_VERIFY(st_jvmti->GetTime(&nanos))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -112,8 +108,8 @@
     {
         NSK_DISPLAY0("Calling IterateOverHeap with filter JVMTI_HEAP_OBJECT_EITHER\n");
         {
-            if (!NSK_JVMTI_VERIFY(
-                    jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_EITHER, heapObjectCallback, (void *)user_data))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->IterateOverHeap(
+                    JVMTI_HEAP_OBJECT_EITHER, heapObjectCallback, (void *)user_data))) {
                 nsk_jvmti_setFailStatus();
             }
         }
@@ -159,8 +155,7 @@
         caps.can_tag_objects = 1;
         caps.can_get_current_thread_cpu_time = 1;
 
-        if (!NSK_JVMTI_VERIFY(
-                jvmti->AddCapabilities(&caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls006/iterinstcls006.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls006/iterinstcls006.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -90,13 +90,13 @@
 
         if (storage_data != storage_ptr) {
             NSK_COMPLAIN2("Local storage address was corrupted: %p ,\n\texpected value: %p\n",
-                             storage_ptr, storage_data);
+                          storage_ptr, storage_data);
             nsk_jvmti_setFailStatus();
         }
 
         if (strcmp(storage_data, (char *)storage_ptr) != 0) {
             NSK_COMPLAIN2("Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                             (char *)storage_ptr, storage_data );
+                          (char *)storage_ptr, storage_data);
             nsk_jvmti_setFailStatus();
         }
     } while (0);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj002/iterobjreachobj002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj002/iterobjreachobj002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -54,13 +54,13 @@
 
 /** jvmtiObjectReferenceCallback for first iteration. */
 jvmtiIterationControl JNICALL
-objectReferenceCallback1( jvmtiObjectReferenceKind reference_kind,
-                          jlong  class_tag,
-                          jlong  size,
-                          jlong* tag_ptr,
-                          jlong  referrer_tag,
-                          jint   referrer_index,
-                          void*  user_data) {
+objectReferenceCallback1(jvmtiObjectReferenceKind reference_kind,
+                         jlong  class_tag,
+                         jlong  size,
+                         jlong* tag_ptr,
+                         jlong  referrer_tag,
+                         jint   referrer_index,
+                         void*  user_data) {
 
     objectCount++;
     /* Set tag */
@@ -80,13 +80,13 @@
 
 /** jvmtiObjectReferenceCallback for second iteration. */
 jvmtiIterationControl JNICALL
-objectReferenceCallback2( jvmtiObjectReferenceKind reference_kind,
-                          jlong  class_tag,
-                          jlong  size,
-                          jlong* tag_ptr,
-                          jlong  referrer_tag,
-                          jint   referrer_index,
-                          void*  user_data) {
+objectReferenceCallback2(jvmtiObjectReferenceKind reference_kind,
+                         jlong  class_tag,
+                         jlong  size,
+                         jlong* tag_ptr,
+                         jlong  referrer_tag,
+                         jint   referrer_index,
+                         void*  user_data) {
 
     objectCount--;
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj003/iterobjreachobj003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj003/iterobjreachobj003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -40,13 +40,13 @@
 /* ============================================================================= */
 
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     const char* name = "monitorName";
     jrawMonitorID monitor_ptr = NULL;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj004/iterobjreachobj004.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj004/iterobjreachobj004.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -42,13 +42,13 @@
 /* ============================================================================= */
 
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     objCounter++;
 
@@ -115,13 +115,13 @@
 
         if (storage_data != storage_ptr) {
             NSK_COMPLAIN2("Local storage address was corrupted: %p ,\n\texpected value: %p\n",
-                             storage_ptr, storage_data);
+                          storage_ptr, storage_data);
             nsk_jvmti_setFailStatus();
         }
 
         if (strcmp(storage_data, (char *)storage_ptr) != 0) {
             NSK_COMPLAIN2("Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                             (char *)storage_ptr, storage_data );
+                          (char *)storage_ptr, storage_data);
             nsk_jvmti_setFailStatus();
         }
     } while (0);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj005/iterobjreachobj005.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj005/iterobjreachobj005.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -42,13 +42,13 @@
 /* ============================================================================= */
 
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     objCounter++;
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj002/iterreachobj002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj002/iterreachobj002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -64,11 +64,11 @@
 
 /** jvmtiHeapRootCallback for first iteration. */
 jvmtiIterationControl JNICALL
-heapRootCallbackForFirstObjectsIteration( jvmtiHeapRootKind root_kind,
-                   jlong class_tag,
-                   jlong size,
-                   jlong* tag_ptr,
-                   void* user_data) {
+heapRootCallbackForFirstObjectsIteration(jvmtiHeapRootKind root_kind,
+                                         jlong class_tag,
+                                         jlong size,
+                                         jlong* tag_ptr,
+                                         void* user_data) {
 
     if (*tag_ptr != 0) return JVMTI_ITERATION_CONTINUE;
 
@@ -94,11 +94,11 @@
 
 /** jvmtiHeapRootCallback for second iteration. */
 jvmtiIterationControl JNICALL
-heapRootCallbackForSecondObjectsIteration( jvmtiHeapRootKind root_kind,
-                   jlong class_tag,
-                   jlong size,
-                   jlong* tag_ptr,
-                   void* user_data) {
+heapRootCallbackForSecondObjectsIteration(jvmtiHeapRootKind root_kind,
+                                          jlong class_tag,
+                                          jlong size,
+                                          jlong* tag_ptr,
+                                          void* user_data) {
 
     long ind = (long)((*tag_ptr) - 1);
 
@@ -108,7 +108,7 @@
     ObjectDesc *objectDesc = objectDescArr[ind];
     jlong tag = (*objectDesc).tag;
 */
-    if (ind < 0 || ind > objectCountMax ) {
+    if (ind < 0 || ind > objectCountMax) {
         NSK_COMPLAIN1("heapRootCallbackForSecondObjectsIteration: invalid object tag value: %d\n", (long)*tag_ptr);
         nsk_jvmti_setFailStatus();
         callbackAborted = 1;
@@ -138,15 +138,15 @@
 
 /** jvmtiStackReferenceCallback for first iteration. */
 jvmtiIterationControl JNICALL
-stackReferenceCallbackForFirstObjectsIteration( jvmtiHeapRootKind root_kind,
-                         jlong     class_tag,
-                         jlong     size,
-                         jlong*    tag_ptr,
-                         jlong     thread_tag,
-                         jint      depth,
-                         jmethodID method,
-                         jint      slot,
-                         void*     user_data) {
+stackReferenceCallbackForFirstObjectsIteration(jvmtiHeapRootKind root_kind,
+                                               jlong     class_tag,
+                                               jlong     size,
+                                               jlong*    tag_ptr,
+                                               jlong     thread_tag,
+                                               jint      depth,
+                                               jmethodID method,
+                                               jint      slot,
+                                               void*     user_data) {
 
     if (*tag_ptr != 0) return JVMTI_ITERATION_CONTINUE;
 
@@ -172,15 +172,15 @@
 
 /** jvmtiStackReferenceCallback for second iteration. */
 jvmtiIterationControl JNICALL
-stackReferenceCallbackForSecondObjectsIteration( jvmtiHeapRootKind root_kind,
-                         jlong     class_tag,
-                         jlong     size,
-                         jlong*    tag_ptr,
-                         jlong     thread_tag,
-                         jint      depth,
-                         jmethodID method,
-                         jint      slot,
-                         void*     user_data) {
+stackReferenceCallbackForSecondObjectsIteration(jvmtiHeapRootKind root_kind,
+                                                jlong     class_tag,
+                                                jlong     size,
+                                                jlong*    tag_ptr,
+                                                jlong     thread_tag,
+                                                jint      depth,
+                                                jmethodID method,
+                                                jint      slot,
+                                                void*     user_data) {
 
     long ind = (long)((*tag_ptr) - 1);
 
@@ -190,7 +190,7 @@
     ObjectDesc *objectDesc = objectDescArr[ind];
     jlong tag = (*objectDesc).tag;
 */
-    if (ind < 0 || ind > objectCountMax ) {
+    if (ind < 0 || ind > objectCountMax) {
         NSK_COMPLAIN1("stackReferenceCallbackForSecondObjectsIteration: invalid object tag value: %d\n", (long)*tag_ptr);
         nsk_jvmti_setFailStatus();
         callbackAborted = 1;
@@ -220,13 +220,13 @@
 
 /** jvmtiObjectReferenceCallback for first iteration. */
 jvmtiIterationControl JNICALL
-objectReferenceCallbackForFirstObjectsIteration( jvmtiObjectReferenceKind reference_kind,
-                          jlong  class_tag,
-                          jlong  size,
-                          jlong* tag_ptr,
-                          jlong  referrer_tag,
-                          jint   referrer_index,
-                          void*  user_data) {
+objectReferenceCallbackForFirstObjectsIteration(jvmtiObjectReferenceKind reference_kind,
+                                                jlong  class_tag,
+                                                jlong  size,
+                                                jlong* tag_ptr,
+                                                jlong  referrer_tag,
+                                                jint   referrer_index,
+                                                void*  user_data) {
 
     if (*tag_ptr != 0) return JVMTI_ITERATION_CONTINUE;
 
@@ -252,13 +252,13 @@
 
 /** jvmtiObjectReferenceCallback for second iteration. */
 jvmtiIterationControl JNICALL
-objectReferenceCallbackForSecondObjectsIteration( jvmtiObjectReferenceKind reference_kind,
-                          jlong  class_tag,
-                          jlong  size,
-                          jlong* tag_ptr,
-                          jlong  referrer_tag,
-                          jint   referrer_index,
-                          void*  user_data) {
+objectReferenceCallbackForSecondObjectsIteration(jvmtiObjectReferenceKind reference_kind,
+                                                 jlong  class_tag,
+                                                 jlong  size,
+                                                 jlong* tag_ptr,
+                                                 jlong  referrer_tag,
+                                                 jint   referrer_index,
+                                                 void*  user_data) {
 
     long ind = (long)((*tag_ptr) - 1);
 
@@ -268,7 +268,7 @@
     ObjectDesc *objectDesc = objectDescArr[ind];
     jlong tag = (*objectDesc).tag;
 */
-    if (ind < 0 || ind > objectCountMax ) {
+    if (ind < 0 || ind > objectCountMax) {
         NSK_COMPLAIN1("objectReferenceCallbackForSecondObjectsIteration: invalid object tag value: %d\n", (long)*tag_ptr);
         nsk_jvmti_setFailStatus();
         callbackAborted = 1;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj003/iterreachobj003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj003/iterreachobj003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -44,11 +44,11 @@
 
 /* jvmtiHeapRootCallback */
 jvmtiIterationControl JNICALL
-heapRootCallback( jvmtiHeapRootKind root_kind,
-                  jlong class_tag,
-                  jlong size,
-                  jlong* tag_ptr,
-                  void* user_data) {
+heapRootCallback(jvmtiHeapRootKind root_kind,
+                 jlong class_tag,
+                 jlong size,
+                 jlong* tag_ptr,
+                 void* user_data) {
 
     jrawMonitorID monitor_ptr = NULL;
 
@@ -104,15 +104,15 @@
 
 /* jvmtiStackReferenceCallback */
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     jrawMonitorID monitor_ptr = NULL;
 
@@ -169,13 +169,13 @@
 
 /* jvmtiObjectReferenceCallback */
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     jrawMonitorID monitor_ptr = NULL;
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj004/iterreachobj004.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj004/iterreachobj004.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -46,11 +46,11 @@
 
 /* jvmtiHeapRootCallback */
 jvmtiIterationControl JNICALL
-heapRootCallback( jvmtiHeapRootKind root_kind,
-                  jlong class_tag,
-                  jlong size,
-                  jlong* tag_ptr,
-                  void* user_data) {
+heapRootCallback(jvmtiHeapRootKind root_kind,
+                 jlong class_tag,
+                 jlong size,
+                 jlong* tag_ptr,
+                 void* user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
@@ -66,14 +66,14 @@
 
     if (storage_data != storage_ptr) {
         NSK_COMPLAIN2("heapRootCallback: Local storage address was corrupted: %p ,\n\texpected value: %p\n",
-                         storage_ptr, storage_data);
+                      storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
 
     if (strcmp(storage_data, (char *)storage_ptr) != 0) {
         NSK_COMPLAIN2("heapRootCallback: Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                         (char *)storage_ptr, storage_data );
+                      (char *)storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
@@ -86,15 +86,15 @@
 
 /* jvmtiStackReferenceCallback */
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
@@ -110,14 +110,14 @@
 
     if (storage_data != storage_ptr) {
         NSK_COMPLAIN2("stackReferenceCallback: Local storage address was corrupted: %p ,\n\texpected value: %p\n",
-                         storage_ptr, storage_data);
+                      storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
 
     if (strcmp(storage_data, (char *)storage_ptr) != 0) {
         NSK_COMPLAIN2("stackReferenceCallback: Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                         (char *)storage_ptr, storage_data );
+                      (char *)storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
@@ -131,13 +131,13 @@
 
 /* jvmtiObjectReferenceCallback */
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
@@ -153,14 +153,14 @@
 
     if (storage_data != storage_ptr) {
         NSK_COMPLAIN2("objectReferenceCallback: Local storage address was corrupted: %p ,\n\texpected value: %p\n",
-                         storage_ptr, storage_data);
+                      storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
 
     if (strcmp(storage_data, (char *)storage_ptr) != 0) {
         NSK_COMPLAIN2("objectReferenceCallback: Local storage was corrupted: %s ,\n\texpected value: %s\n",
-                         (char *)storage_ptr, storage_data );
+                      (char *)storage_ptr, storage_data);
         nsk_jvmti_setFailStatus();
         return JVMTI_ITERATION_ABORT;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj005/iterreachobj005.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj005/iterreachobj005.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -43,11 +43,11 @@
 
 /* jvmtiHeapRootCallback */
 jvmtiIterationControl JNICALL
-heapRootCallback( jvmtiHeapRootKind root_kind,
-                  jlong class_tag,
-                  jlong size,
-                  jlong* tag_ptr,
-                  void* user_data) {
+heapRootCallback(jvmtiHeapRootKind root_kind,
+                 jlong class_tag,
+                 jlong size,
+                 jlong* tag_ptr,
+                 void* user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
@@ -108,15 +108,15 @@
 
 /* jvmtiStackReferenceCallback */
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
@@ -178,13 +178,13 @@
 
 /* jvmtiObjectReferenceCallback */
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     *tag_ptr = (jlong)++objCounter;
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -77,26 +77,26 @@
     jvmtiEventCallbacks callbacks;
     jvmtiCapabilities capabilities;
 
-    if ( ! NSK_VERIFY(nsk_jvmti_parseOptions(options)))
+    if (!NSK_VERIFY(nsk_jvmti_parseOptions(options)))
         return JNI_ERR;
 
-    if ( ! NSK_VERIFY((gJvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL) )
+    if (!NSK_VERIFY((gJvmti = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
         return JNI_ERR;
 
     memset(&capabilities, 0, sizeof(jvmtiCapabilities));
     capabilities.can_generate_resource_exhaustion_heap_events = 1;
     capabilities.can_generate_resource_exhaustion_threads_events = 1;
-    if ( ! NSK_JVMTI_VERIFY(gJvmti->AddCapabilities(&capabilities)) )
+    if (!NSK_JVMTI_VERIFY(gJvmti->AddCapabilities(&capabilities)))
         return JNI_ERR;
 
     memset((void *)&callbacks, 0, sizeof(jvmtiEventCallbacks));
     callbacks.ResourceExhausted = resourceExhausted;
-    if ( ! NSK_JVMTI_VERIFY(gJvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))) )
+    if (!NSK_JVMTI_VERIFY(gJvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
-    if ( ! NSK_JVMTI_VERIFY(gJvmti->SetEventNotificationMode(JVMTI_ENABLE,
-                                                             JVMTI_EVENT_RESOURCE_EXHAUSTED,
-                                                             NULL) ) )
+    if (!NSK_JVMTI_VERIFY(gJvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                           JVMTI_EVENT_RESOURCE_EXHAUSTED,
+                                                           NULL)))
         return JNI_ERR;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst002/resumethrdlst002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst002/resumethrdlst002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -250,7 +250,7 @@
     int i = 0;
 
     jvmtiError e = jvmti->RawMonitorEnter(eventsReceivedMtx);
-    if ( !NSK_JVMTI_VERIFY(e) ) {
+    if (!NSK_JVMTI_VERIFY(e)) {
         NSK_DISPLAY1("  ... ERROR entering raw monitor for thread %p\n", (void *) thread);
         return;
     }
@@ -323,7 +323,7 @@
 
     /* create a mutex for the eventsReceived variable */
     {
-        if ( ! NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("eventsReceived", &eventsReceivedMtx))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("eventsReceived", &eventsReceivedMtx))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/setextevent001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/setextevent001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -36,7 +36,7 @@
 /* ============================================================================= */
 
 static void JNICALL
-callbackExtensionEvent(jvmtiEnv* jvmti, ... ) {
+callbackExtensionEvent(jvmtiEnv* jvmti, ...) {
     NSK_DISPLAY0("    event: callbackExtensionEvent\n");
 }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetLocalVariable/setlocal001/setlocal001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetLocalVariable/setlocal001/setlocal001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -258,7 +258,7 @@
     jvmtiError err;
 
     res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
-    if ( res != JNI_OK || jvmti == NULL ) {
+    if (res != JNI_OK || jvmti == NULL) {
         printf("Wrong result of a valid call to GetEnv !\n");
         return JNI_ERR;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag001/setvrbflag001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag001/setvrbflag001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -43,36 +43,28 @@
 /* Check SetVerboseFlag function
  */
 static int checkSetVerboseFlag(jvmtiEnv *jvmti) {
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_OTHER, JNI_TRUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_OTHER, JNI_TRUE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_OTHER, JNI_FALSE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_OTHER, JNI_FALSE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_GC, JNI_TRUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_GC, JNI_TRUE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_GC, JNI_FALSE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_GC, JNI_FALSE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_CLASS, JNI_TRUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_CLASS, JNI_TRUE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_CLASS, JNI_FALSE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_CLASS, JNI_FALSE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_JNI, JNI_TRUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_JNI, JNI_TRUE)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti, JVMTI_VERBOSE_JNI, JNI_FALSE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetVerboseFlag(JVMTI_VERBOSE_JNI, JNI_FALSE)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -83,7 +75,7 @@
 void JNICALL
 VMInit(jvmtiEnv *jvmti, JNIEnv* jni, jthread thread) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti, &phase)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&phase)))
         nsk_jvmti_setFailStatus();
 
     NSK_DISPLAY1("Phase: %s\n", TranslatePhase(phase));
@@ -105,10 +97,10 @@
                   unsigned char** new_class_data) {
     jvmtiPhase curr_phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, access_lock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(access_lock)))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti, &curr_phase)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&curr_phase)))
         nsk_jvmti_setFailStatus();
 
     if (phase != curr_phase) {
@@ -121,7 +113,7 @@
             nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, access_lock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(access_lock)))
         nsk_jvmti_setFailStatus();
 }
 
@@ -135,7 +127,7 @@
     if (!nsk_jvmti_waitForSync(timeout))
         return;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti, &phase)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&phase)))
         nsk_jvmti_setFailStatus();
 
     NSK_DISPLAY1("Phase: %s\n", TranslatePhase(phase));
@@ -181,12 +173,10 @@
         return JNI_ERR;
 
     /* Create data access lock */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti,
-                "_access_lock", &access_lock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_access_lock", &access_lock)))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti, &phase)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&phase)))
         return JNI_ERR;
 
     NSK_DISPLAY1("Phase: %s\n", TranslatePhase(phase));
@@ -199,21 +189,17 @@
     memset(&callbacks, 0, sizeof(callbacks));
     callbacks.VMInit = &VMInit;
     callbacks.ClassFileLoadHook = &ClassFileLoadHook;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-                &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     /* enable VMInit event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_VM_INIT, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL)))
         return JNI_ERR;
 
     /* enable ClassFileLoadHook event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag002/setvrbflag002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag002/setvrbflag002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -47,8 +47,7 @@
 
     NSK_DISPLAY0("Check on JVMTI_ERROR_ILLEGAL_ARGUMENT\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_ILLEGAL_ARGUMENT,
-            NSK_CPP_STUB3(SetVerboseFlag, jvmti,
-                (jvmtiVerboseFlag)(-1), JNI_TRUE)))
+            jvmti->SetVerboseFlag((jvmtiVerboseFlag)(-1), JNI_TRUE)))
         nsk_jvmti_setFailStatus();
 
     /* resume debugee after last sync */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep001/singlestep001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep001/singlestep001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -63,15 +63,11 @@
 static void setBP(jvmtiEnv *jvmti_env, JNIEnv *env, jclass klass) {
     jmethodID mid;
 
-    if (!NSK_JNI_VERIFY(env, (mid = NSK_CPP_STUB4(GetMethodID,
-            env, klass, METHODS[0], METHOD_SIGS[0])) != NULL))
-        NSK_CPP_STUB2(FatalError, env,
-            "failed to get ID for the java method\n");
+    if (!NSK_JNI_VERIFY(env, (mid = env->GetMethodID(klass, METHODS[0], METHOD_SIGS[0])) != NULL))
+        env->FatalError("failed to get ID for the java method\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetBreakpoint,
-            jvmti_env, mid, 0)))
-        NSK_CPP_STUB2(FatalError, env,
-            "failed to set breakpoint\n");
+    if (!NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(mid, 0)))
+        env->FatalError("failed to set breakpoint\n");
 }
 
 /** callback functions **/
@@ -82,10 +78,8 @@
     jvmti->RawMonitorEnter(agent_lock);
 
     if (vm_started) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-                                            jvmti_env, klass, &sig, &generic)))
-            NSK_CPP_STUB2(FatalError, env,
-                          "failed to obtain a class signature\n");
+        if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic)))
+            env->FatalError("failed to obtain a class signature\n");
 
         if (sig != NULL && (strcmp(sig, CLASS_SIG) == 0)) {
             NSK_DISPLAY1(
@@ -106,20 +100,16 @@
     char *sig, *generic;
 
     NSK_DISPLAY0("Breakpoint event received\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetMethodDeclaringClass,
-            jvmti_env, method, &klass)))
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &klass)))
         NSK_COMPLAIN0("TEST FAILURE: unable to get method declaring class\n\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-            jvmti_env, klass, &sig, &generic)))
-        NSK_CPP_STUB2(FatalError, env,
-            "Breakpoint: failed to obtain a class signature\n");
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic)))
+        env->FatalError("Breakpoint: failed to obtain a class signature\n");
 
     if (sig != NULL && (strcmp(sig, CLASS_SIG) == 0)) {
         NSK_DISPLAY1("method declaring class \"%s\"\n\tenabling SingleStep events ...\n",
             sig);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-                jvmti_env, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thr))) {
             result = STATUS_FAILED;
             NSK_COMPLAIN0("TEST FAILURE: cannot enable SingleStep events\n\n");
         }
@@ -142,20 +132,17 @@
 
     NSK_DISPLAY0(">>>> SingleStep event received\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &methNam, &methSig, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &methNam, &methSig, NULL))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to get method name during SingleStep callback\n\n");
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetMethodDeclaringClass,
-            jvmti_env, method, &klass))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &klass))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to get method declaring class during SingleStep callback\n\n");
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-            jvmti_env, klass, &sig, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to obtain a class signature during SingleStep callback\n\n");
         return;
@@ -187,21 +174,18 @@
                 "CHECK PASSED: SingleStep event received for the method \"%s\" as expected\n"
                 "\tdisabling the event generation\n",
                 methNam);
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-                    jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, thread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, thread))) {
                 result = STATUS_FAILED;
                 NSK_COMPLAIN0("TEST FAILED: cannot disable SingleStep events\n\n");
             }
         }
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*) methNam))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) methNam))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n");
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*) methSig))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) methSig))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method signature\n\n");
     }
@@ -261,12 +245,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     caps.can_generate_breakpoint_events = 1;
     caps.can_generate_single_step_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_generate_single_step_events)
@@ -279,24 +261,19 @@
     callbacks.Breakpoint = &Breakpoint;
     callbacks.SingleStep = &SingleStep;
     callbacks.VMStart = &VMStart;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks,
-            jvmti, &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     NSK_DISPLAY0("setting event callbacks done\nenabling JVMTI events ...\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_START, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_START, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)))
         return JNI_ERR;
     NSK_DISPLAY0("enabling the events done\n\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor,
-            jvmti, "agent lock", &agent_lock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("agent lock", &agent_lock)))
         return JNI_ERR;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep002/singlestep002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep002/singlestep002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -50,8 +50,7 @@
         jmethodID method, jlocation location) {
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase,
-            jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to obtain phase of the VM execution during SingleStep callback\n\n");
     }
@@ -105,12 +104,10 @@
     /* add capability to generate compiled method events */
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     caps.can_generate_single_step_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_generate_single_step_events)
@@ -121,16 +118,13 @@
     (void) memset(&callbacks, 0, sizeof(callbacks));
     callbacks.SingleStep = &SingleStep;
     callbacks.VMDeath = &VMDeath;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks,
-            jvmti, &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     NSK_DISPLAY0("setting event callbacks done\nenabling JVMTI events ...\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
         return JNI_ERR;
     NSK_DISPLAY0("enabling the events done\n\n");
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep003/singlestep003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep003/singlestep003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -64,15 +64,11 @@
 static void setBP(jvmtiEnv *jvmti_env, JNIEnv *env, jclass klass) {
     jmethodID mid;
 
-    if (!NSK_JNI_VERIFY(env, (mid = NSK_CPP_STUB4(GetMethodID,
-            env, klass, METHODS[0][0], METHODS[0][1])) != NULL))
-        NSK_CPP_STUB2(FatalError, env,
-            "failed to get ID for the java method\n");
+    if (!NSK_JNI_VERIFY(env, (mid = env->GetMethodID(klass, METHODS[0][0], METHODS[0][1])) != NULL))
+        env->FatalError("failed to get ID for the java method\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetBreakpoint,
-            jvmti_env, mid, 0)))
-        NSK_CPP_STUB2(FatalError, env,
-            "failed to set breakpoint\n");
+    if (!NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(mid, 0)))
+        env->FatalError("failed to set breakpoint\n");
 }
 
 /** callback functions **/
@@ -80,10 +76,8 @@
 ClassLoad(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread, jclass klass) {
     char *sig, *generic;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-            jvmti_env, klass, &sig, &generic)))
-        NSK_CPP_STUB2(FatalError, env,
-            "failed to obtain a class signature\n");
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic)))
+        env->FatalError("failed to obtain a class signature\n");
 
     if (sig != NULL && (strcmp(sig, CLASS_SIG) == 0)) {
         NSK_DISPLAY1(
@@ -101,20 +95,16 @@
     char *sig, *generic;
 
     NSK_DISPLAY0("Breakpoint event received\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetMethodDeclaringClass,
-            jvmti_env, method, &klass)))
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &klass)))
         NSK_COMPLAIN0("TEST FAILURE: unable to get method declaring class\n\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-            jvmti_env, klass, &sig, &generic)))
-        NSK_CPP_STUB2(FatalError, env,
-            "Breakpoint: failed to obtain a class signature\n");
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic)))
+        env->FatalError("Breakpoint: failed to obtain a class signature\n");
 
     if (sig != NULL && (strcmp(sig, CLASS_SIG) == 0)) {
         NSK_DISPLAY1("method declaring class \"%s\"\n\tenabling SingleStep events ...\n",
             sig);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-                jvmti_env, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, thr))) {
             result = STATUS_FAILED;
             NSK_COMPLAIN0("TEST FAILURE: cannot enable SingleStep events\n\n");
         }
@@ -138,20 +128,17 @@
 
     NSK_DISPLAY0(">>>> SingleStep event received\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &methNam, &methSig, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &methNam, &methSig, NULL))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to get method name during SingleStep callback\n\n");
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetMethodDeclaringClass,
-            jvmti_env, method, &klass))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &klass))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to get method declaring class during SingleStep callback\n\n");
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature,
-            jvmti_env, klass, &sig, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &sig, &generic))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to obtain a class signature during SingleStep callback\n\n");
         return;
@@ -186,8 +173,7 @@
 
                 if (i == (METH_NUM-1)) {
                     NSK_DISPLAY0("Disabling the single step event generation\n");
-                    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-                            jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, thread))) {
+                    if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, thread))) {
                         result = STATUS_FAILED;
                         NSK_COMPLAIN0("TEST FAILED: cannot disable SingleStep events\n\n");
                     }
@@ -196,13 +182,11 @@
         }
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*) methNam))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) methNam))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n");
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*) methSig))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) methSig))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method signature\n\n");
     }
@@ -278,12 +262,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     caps.can_generate_breakpoint_events = 1;
     caps.can_generate_single_step_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.can_generate_single_step_events)
         NSK_DISPLAY0("Warning: generation of single step events is not implemented\n");
@@ -294,16 +276,13 @@
     callbacks.ClassLoad = &ClassLoad;
     callbacks.Breakpoint = &Breakpoint;
     callbacks.SingleStep = &SingleStep;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks,
-            jvmti, &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     NSK_DISPLAY0("setting event callbacks done\nenabling JVMTI events ...\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_LOAD, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)))
         return JNI_ERR;
     NSK_DISPLAY0("enabling the events done\n\n");
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/StopThread/stopthrd007/stopthrd007.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/StopThread/stopthrd007/stopthrd007.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -62,8 +62,7 @@
     NSK_DISPLAY0("Prepare: find tested threads\n");
 
     /* get all live threads */
-    if (!NSK_JVMTI_VERIFY(
-           NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
         return NSK_FALSE;
 
     if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
@@ -75,8 +74,7 @@
             return NSK_FALSE;
 
         /* get thread information */
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
             return NSK_FALSE;
 
         NSK_DISPLAY3("    thread #%d (%s): %p\n", i, info.name, threads[i]);
@@ -93,23 +91,19 @@
         }
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Prepare: create new instance of ThreadDeath exception\n");
 
-    if (!NSK_JNI_VERIFY(jni, (cls =
-            NSK_CPP_STUB2(FindClass, jni, THREAD_DEATH_CLASS_NAME)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (cls = jni->FindClass(THREAD_DEATH_CLASS_NAME)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (ctor =
-            NSK_CPP_STUB4(GetMethodID, jni, cls,
-                THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
+            jni->GetMethodID(cls, THREAD_DEATH_CTOR_NAME, THREAD_DEATH_CTOR_SIGNATURE)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (threadDeath =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (threadDeath = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -133,8 +127,7 @@
     if (!NSK_VERIFY(runningThread != NULL)) {
         nsk_jvmti_setFailStatus();
     } else {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
-                jvmti, runningThread, threadDeath)))
+        if (!NSK_JVMTI_VERIFY(jvmti->StopThread(runningThread, threadDeath)))
             nsk_jvmti_setFailStatus();
     }
 
@@ -142,8 +135,7 @@
     if (!NSK_VERIFY(waitingThread != NULL)) {
         nsk_jvmti_setFailStatus();
     } else {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
-                jvmti, waitingThread, threadDeath)))
+        if (!NSK_JVMTI_VERIFY(jvmti->StopThread(waitingThread, threadDeath)))
             nsk_jvmti_setFailStatus();
     }
 
@@ -151,8 +143,7 @@
     if (!NSK_VERIFY(sleepingThread != NULL)) {
         nsk_jvmti_setFailStatus();
     } else {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread,
-                jvmti, sleepingThread, threadDeath)))
+        if (!NSK_JVMTI_VERIFY(jvmti->StopThread(sleepingThread, threadDeath)))
             nsk_jvmti_setFailStatus();
     }
 
@@ -194,7 +185,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_signal_thread = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd001/suspendthrd001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd001/suspendthrd001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -58,8 +58,7 @@
         NSK_DISPLAY1("  ... found thread: %p\n", (void*)testedThread);
 
         NSK_DISPLAY1("Suspend thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(SuspendThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(testedThread))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -72,8 +71,7 @@
         {
             jint state = 0;
 
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB3(GetThreadState, jvmti, testedThread, &state))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(testedThread, &state))) {
                 nsk_jvmti_setFailStatus();
             }
             NSK_DISPLAY2("  ... got state vector: %s (%d)\n",
@@ -88,8 +86,7 @@
         }
 
         NSK_DISPLAY1("Resume thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(ResumeThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(testedThread))) {
             nsk_jvmti_setFailStatus();
         }
 
@@ -98,7 +95,7 @@
             return;
 
         NSK_DISPLAY0("Delete thread reference\n");
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread));
+        NSK_TRACE(jni->DeleteGlobalRef(testedThread));
     }
 
     NSK_DISPLAY0("Let debugee to finish\n");
@@ -139,8 +136,7 @@
         jvmtiCapabilities suspendCaps;
         memset(&suspendCaps, 0, sizeof(suspendCaps));
         suspendCaps.can_suspend = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
             return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd002/suspendthrd002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd002/suspendthrd002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -75,8 +75,7 @@
             return;
 
         NSK_DISPLAY1("Suspend thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(SuspendThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(testedThread))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -104,8 +103,7 @@
             return;
 
         NSK_DISPLAY1("Resume thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(ResumeThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(testedThread))) {
             nsk_jvmti_setFailStatus();
         }
 
@@ -114,7 +112,7 @@
             return;
 
         NSK_DISPLAY0("Delete thread reference\n");
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread));
+        NSK_TRACE(jni->DeleteGlobalRef(testedThread));
     }
 
     NSK_DISPLAY0("Let debugee to finish\n");
@@ -129,7 +127,7 @@
 callbackThreadEnd(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
     /* check if event is for tested thread */
     if (thread != NULL &&
-                NSK_CPP_STUB3(IsSameObject, jni, testedThread, thread)) {
+                jni->IsSameObject(testedThread, thread)) {
         NSK_DISPLAY1("  ... received THREAD_END event for tested thread: %p\n", (void*)thread);
         eventsReceived++;
     } else {
@@ -170,8 +168,7 @@
         jvmtiCapabilities suspendCaps;
         memset(&suspendCaps, 0, sizeof(suspendCaps));
         suspendCaps.can_suspend = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
             return JNI_ERR;
     }
 
@@ -180,8 +177,7 @@
         jvmtiEventCallbacks callbacks;
         memset(&callbacks, 0, sizeof(callbacks));
         callbacks.ThreadEnd = callbackThreadEnd;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, sizeof(callbacks))))
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/suspendthrd003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/suspendthrd003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -63,8 +63,7 @@
         NSK_DISPLAY1("  ... found thread: %p\n", (void*)testedThread);
 
         NSK_DISPLAY1("Suspend thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(SuspendThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(testedThread))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -78,8 +77,7 @@
         {
             jint state = 0;
 
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB3(GetThreadState, jvmti, testedThread, &state))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(testedThread, &state))) {
                 nsk_jvmti_setFailStatus();
             }
             NSK_DISPLAY2("  ... got state vector: %s (%d)\n",
@@ -94,8 +92,7 @@
         }
 
         NSK_DISPLAY1("Resume thread: %p\n", (void*)testedThread);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(ResumeThread, jvmti, testedThread))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(testedThread))) {
             nsk_jvmti_setFailStatus();
         }
         /* Original agentProc test block ends here. */
@@ -107,7 +104,7 @@
         for (late_count = 0; late_count < N_LATE_CALLS; late_count++) {
             jvmtiError l_err;
             printf("INFO: Late suspend thread: %p\n", (void*)testedThread);
-            l_err = NSK_CPP_STUB2(SuspendThread, jvmti, testedThread);
+            l_err = jvmti->SuspendThread(testedThread);
             if (l_err != JVMTI_ERROR_NONE) {
                 printf("INFO: Late suspend thread err: %d\n", l_err);
                 // testedThread has exited so we're done with late calls
@@ -117,8 +114,7 @@
             // Only resume a thread if suspend worked. Using NSK_DISPLAY1()
             // here because we want ResumeThread() to be faster.
             NSK_DISPLAY1("INFO: Late resume thread: %p\n", (void*)testedThread);
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB2(ResumeThread, jvmti, testedThread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(testedThread))) {
                 nsk_jvmti_setFailStatus();
             }
         }
@@ -137,7 +133,7 @@
             return;
 
         NSK_DISPLAY0("Delete thread reference\n");
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread));
+        NSK_TRACE(jni->DeleteGlobalRef(testedThread));
     }
 
     NSK_DISPLAY0("Let debugee to finish\n");
@@ -180,8 +176,7 @@
         jvmtiCapabilities suspendCaps;
         memset(&suspendCaps, 0, sizeof(suspendCaps));
         suspendCaps.can_suspend = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
             return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst001/suspendthrdlst001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst001/suspendthrdlst001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -62,18 +62,16 @@
         int i;
 
         NSK_DISPLAY1("Allocate threads array: %d threads\n", threadsCount);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
-                                                (unsigned char**)&threads))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jthread)),
+                                              (unsigned char**)&threads))) {
             nsk_jvmti_setFailStatus();
             return;
         }
         NSK_DISPLAY1("  ... allocated array: %p\n", (void*)threads);
 
         NSK_DISPLAY1("Allocate results array: %d threads\n", threadsCount);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jvmtiError)),
-                                                (unsigned char**)&results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jvmtiError)),
+                                              (unsigned char**)&results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -84,8 +82,7 @@
             return;
 
         NSK_DISPLAY0("Suspend threads list\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount, threads, results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threads, results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -107,8 +104,7 @@
             jint state = 0;
 
             NSK_DISPLAY2("  thread #%d (%p):\n", i, (void*)threads[i]);
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB3(GetThreadState, jvmti, threads[i], &state))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threads[i], &state))) {
                 nsk_jvmti_setFailStatus();
             }
             NSK_DISPLAY2("  ... got state vector: %s (%d)\n",
@@ -123,8 +119,7 @@
         }
 
         NSK_DISPLAY0("Resume threads list\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount, threads, results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threads, results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -136,18 +131,16 @@
         NSK_DISPLAY0("Delete threads references\n");
         for (i = 0; i < threadsCount; i++) {
             if (threads[i] != NULL)
-                NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threads[i]));
+                NSK_TRACE(jni->DeleteGlobalRef(threads[i]));
         }
 
         NSK_DISPLAY1("Deallocate threads array: %p\n", (void*)threads);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
             nsk_jvmti_setFailStatus();
         }
 
         NSK_DISPLAY1("Deallocate results array: %p\n", (void*)results);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -173,8 +166,7 @@
         foundThreads[i] = NULL;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetAllThreads, jvmti, &count, &threads))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&count, &threads))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -183,8 +175,7 @@
     for (i = 0; i < count; i++) {
         jvmtiThreadInfo info;
 
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -199,8 +190,7 @@
 
     }
 
-    if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -218,7 +208,7 @@
     NSK_DISPLAY1("Make global references for threads: %d threads\n", foundCount);
     for (i = 0; i < foundCount; i++) {
         if (!NSK_JNI_VERIFY(jni, (foundThreads[i] = (jthread)
-                    NSK_CPP_STUB2(NewGlobalRef, jni, foundThreads[i])) != NULL)) {
+                    jni->NewGlobalRef(foundThreads[i])) != NULL)) {
             nsk_jvmti_setFailStatus();
             return NSK_FALSE;
         }
@@ -266,8 +256,7 @@
         jvmtiCapabilities suspendCaps;
         memset(&suspendCaps, 0, sizeof(suspendCaps));
         suspendCaps.can_suspend = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
             return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst002/suspendthrdlst002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst002/suspendthrdlst002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -73,18 +73,16 @@
         int i;
 
         NSK_DISPLAY1("Allocate threads array: %d threads\n", threadsCount);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
-                                                (unsigned char**)&threads))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jthread)),
+                                              (unsigned char**)&threads))) {
             nsk_jvmti_setFailStatus();
             return;
         }
         NSK_DISPLAY1("  ... allocated array: %p\n", (void*)threads);
 
         NSK_DISPLAY1("Allocate results array: %d threads\n", threadsCount);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jvmtiError)),
-                                                (unsigned char**)&results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jvmtiError)),
+                                              (unsigned char**)&results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -95,8 +93,7 @@
             return;
 
         NSK_DISPLAY0("Suspend threads list\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount, threads, results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threads, results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -138,8 +135,7 @@
             return;
 
         NSK_DISPLAY0("Resume threads list\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount, threads, results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threads, results))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -151,18 +147,16 @@
         NSK_DISPLAY0("Delete threads references\n");
         for (i = 0; i < threadsCount; i++) {
             if (threads[i] != NULL)
-                NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threads[i]));
+                NSK_TRACE(jni->DeleteGlobalRef(threads[i]));
         }
 
         NSK_DISPLAY1("Deallocate threads array: %p\n", (void*)threads);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
             nsk_jvmti_setFailStatus();
         }
 
         NSK_DISPLAY1("Deallocate results array: %p\n", (void*)results);
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -188,8 +182,7 @@
         foundThreads[i] = NULL;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetAllThreads, jvmti, &count, &threads))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&count, &threads))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -198,8 +191,7 @@
     for (i = 0; i < count; i++) {
         jvmtiThreadInfo info;
 
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -214,8 +206,7 @@
 
     }
 
-    if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -233,7 +224,7 @@
     NSK_DISPLAY1("Make global references for threads: %d threads\n", foundCount);
     for (i = 0; i < foundCount; i++) {
         if (!NSK_JNI_VERIFY(jni, (foundThreads[i] = (jthread)
-                    NSK_CPP_STUB2(NewGlobalRef, jni, foundThreads[i])) != NULL)) {
+                    jni->NewGlobalRef(foundThreads[i])) != NULL)) {
             nsk_jvmti_setFailStatus();
             return NSK_FALSE;
         }
@@ -253,7 +244,7 @@
     /* check if event is for tested thread */
     for (i = 0; i < threadsCount; i++) {
         if (thread != NULL &&
-                NSK_CPP_STUB3(IsSameObject, jni, threads[i], thread)) {
+                jni->IsSameObject(threads[i], thread)) {
             NSK_DISPLAY2("  ... received THREAD_END event for thread #%d: %p\n",
                                                                     i, (void*)thread);
             eventsReceived++;
@@ -301,8 +292,7 @@
         jvmtiCapabilities suspendCaps;
         memset(&suspendCaps, 0, sizeof(suspendCaps));
         suspendCaps.can_suspend = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
             return JNI_ERR;
     }
 
@@ -311,8 +301,7 @@
         jvmtiEventCallbacks callbacks;
         memset(&callbacks, 0, sizeof(callbacks));
         callbacks.ThreadEnd = callbackThreadEnd;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, sizeof(callbacks))))
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ThreadEnd/threadend002/threadend002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ThreadEnd/threadend002/threadend002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -57,9 +57,7 @@
         NSK_DISPLAY1("disabling %s\n", TranslateEvent(event));
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, enable,
-                                            event, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(enable, event, NULL))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -92,10 +90,7 @@
 
     eventCallbacks.ThreadEnd = cbThreadEnd;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-                                &eventCallbacks,
-                                sizeof(eventCallbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ThreadStart/threadstart002/threadstart002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ThreadStart/threadstart002/threadstart002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -119,17 +119,17 @@
     /* Notify VMInit callback as well as ThreadStart callback (if any)
      * that agent thread has been started
      */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(agent_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("[agent] failed to acquire agent_start_lock\n");
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorNotifyAll, jvmti, agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorNotifyAll(agent_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("[agent] failed to notify about agent_start_lock\n");
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(agent_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("[agent] failed to release agent_start_lock\n");
     }
@@ -138,16 +138,16 @@
 
     debug_agent_started = JNI_TRUE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, thr_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(thr_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("[agent] failed to enter thr_start_lock\n");
     }
 
     while (terminate_debug_agent != JNI_TRUE) {
 
-        if (next_thread == NULL ) {
+        if (next_thread == NULL) {
             /* wait till new thread will be created and started */
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RawMonitorWait, jvmti, thr_start_lock, (jlong)0))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(thr_start_lock, (jlong)0))) {
                 result = STATUS_FAILED;
                 NSK_COMPLAIN0("[agent] Failed while waiting thr_start_lock\n");
             }
@@ -155,9 +155,9 @@
 
         if (next_thread != NULL) {
             /* hmm, why NewGlobalRef is called one more time???
-             * next_thread = NSK_CPP_STUB2(NewGlobalRef, env, next_thread);
+             * next_thread = env->NewGlobalRef(next_thread);
              */
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, next_thread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(next_thread))) {
                 result = STATUS_FAILED;
                 NSK_COMPLAIN1("[agent] Failed to suspend thread#%d\n", eventsCount);
             }
@@ -165,17 +165,17 @@
             NSK_DISPLAY2(">>> [agent] thread#%d %s suspended ...\n", eventsCount, inf.name);
 
             /* these dummy calls provoke VM to hang */
-            temp = NSK_CPP_STUB2(NewGlobalRef, env, next_thread);
-            NSK_CPP_STUB2(DeleteGlobalRef, env, temp);
+            temp = env->NewGlobalRef(next_thread);
+            env->DeleteGlobalRef(temp);
 
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, next_thread))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(next_thread))) {
                 result = STATUS_FAILED;
                 NSK_COMPLAIN1("[agent] Failed to resume thread#%d\n", eventsCount);
             }
 
             NSK_DISPLAY2(">>> [agent] thread#%d %s resumed ...\n", eventsCount, inf.name);
 
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadState, jvmti, next_thread, &thrStat))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(next_thread, &thrStat))) {
                 result = STATUS_FAILED;
                 NSK_COMPLAIN1("[agent] Failed to get thread state for thread#%d\n", eventsCount);
             }
@@ -185,26 +185,26 @@
 
             if (thrStat & JVMTI_THREAD_STATE_SUSPENDED) {
                 NSK_COMPLAIN1("[agent] \"%s\" was not resumed\n", inf.name);
-                NSK_CPP_STUB2(FatalError, env, "[agent] could not recover");
+                env->FatalError("[agent] could not recover");
             }
 
-            NSK_CPP_STUB2(DeleteGlobalRef, env, next_thread);
+            env->DeleteGlobalRef(next_thread);
             next_thread = NULL;
 
             /* Notify ThreadStart callback that thread has been resumed */
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, thr_resume_lock))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(thr_resume_lock))) {
                 NSK_COMPLAIN0("[agent] Failed to acquire thr_resume_lock\n");
                 result = STATUS_FAILED;
             }
 
             debug_agent_timed_out = JNI_FALSE;
 
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorNotify, jvmti, thr_resume_lock))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorNotify(thr_resume_lock))) {
                 NSK_COMPLAIN0("[agent] Failed to notifing about thr_resume_lock\n");
                 result = STATUS_FAILED;
             }
 
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, thr_resume_lock))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(thr_resume_lock))) {
                 NSK_COMPLAIN0("[agent] Failed to release thr_resume_lock\n");
                 result = STATUS_FAILED;
             }
@@ -215,7 +215,7 @@
      * We don't call RawMonitorExit(thr_start_lock) in the loop so we don't
      * lose any notify calls.
      */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, thr_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(thr_start_lock))) {
         NSK_COMPLAIN0("[agent] Failed to release thr_start_lock\n");
         result = STATUS_FAILED;
     }
@@ -230,7 +230,7 @@
     NSK_DISPLAY0(">>> [ThreadStart hook] start\n");
 
     /* skip if thread is 'agent thread' */
-    if (NSK_CPP_STUB3(IsSameObject, env, agent_thread, thread) == JNI_TRUE) {
+    if (env->IsSameObject(agent_thread, thread) == JNI_TRUE) {
         NSK_DISPLAY0(">>> [ThreadStart hook] skip agent thread\n");
         NSK_DISPLAY0(">>> [ThreadStart hook] end\n");
         return;
@@ -240,7 +240,7 @@
      * (otherwise can fail while waiting on thr_resume_thread due to timeout)
      */
     if (debug_agent_started != JNI_TRUE) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti_env, agent_start_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorEnter(agent_start_lock))) {
             NSK_COMPLAIN0("[ThreadStart hook] Failed to acquire agent_start_lock\n");
             result = STATUS_FAILED;
         }
@@ -248,14 +248,13 @@
         while (debug_agent_started != JNI_TRUE) {
             NSK_DISPLAY1(">>> [ThreadStart hook] waiting %dms for agent thread to start\n", WAIT_TIME);
 
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RawMonitorWait,
-                    jvmti_env, agent_start_lock, (jlong)WAIT_TIME))) {
+            if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorWait(agent_start_lock, (jlong)WAIT_TIME))) {
                 NSK_COMPLAIN0("[ThreadStart hook] Failed to wait for agent_start_lock\n");
                 result = STATUS_FAILED;
             }
         }
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti_env, agent_start_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorExit(agent_start_lock))) {
             NSK_COMPLAIN0("[ThreadStart hook] Failed to release agent_start_lock\n");
             result = STATUS_FAILED;
         }
@@ -263,7 +262,7 @@
 
 
     /* get JVMTI phase */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         NSK_COMPLAIN0("[ThreadStart hook] Failed to get JVMTI phase\n");
         result = STATUS_FAILED;
     }
@@ -271,7 +270,7 @@
     /* Acquire event lock,
      * so only one StartThread callback could be proceeded at the time
      */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti_env, thr_event_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorEnter(thr_event_lock))) {
         NSK_COMPLAIN0("[ThreadStart hook] Failed to acquire thr_event_lock\n");
         result = STATUS_FAILED;
     }
@@ -281,8 +280,7 @@
         inf.name = (char*) "UNKNOWN";
         if (phase == JVMTI_PHASE_LIVE) {
             /* GetThreadInfo may only be called during the live phase */
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB3(GetThreadInfo, jvmti_env, thread, &inf))) {
+            if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &inf))) {
                 NSK_COMPLAIN1("[ThreadStart hook] Failed to get thread infor for thread#%d\n", eventsCount);
                 result = STATUS_FAILED;
             }
@@ -291,7 +289,7 @@
         NSK_DISPLAY2(">>> [ThreadStart hook] thread#%d: %s\n", eventsCount, inf.name);
 
         /* Acquire thr_start_lock */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti_env, thr_start_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorEnter(thr_start_lock))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed to acquire thr_start_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
@@ -299,46 +297,45 @@
             /* Acquire thr_resume_lock before we release thr_start_lock to prevent
              * debug agent from notifying us before we are ready.
          */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti_env, thr_resume_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorEnter(thr_resume_lock))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed to acquire thr_resume_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
 
         /* Store thread */
-        next_thread = NSK_CPP_STUB2(NewGlobalRef, env, thread);
+        next_thread = env->NewGlobalRef(thread);
         debug_agent_timed_out = JNI_TRUE;
 
         /* Notify agent thread about new started thread and let agent thread to work with it */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorNotify, jvmti_env, thr_start_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorNotify(thr_start_lock))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed to notify about thr_start_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti_env, thr_start_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorExit(thr_start_lock))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed to release thr_start_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
 
         /* Wait till this started thread will be resumed by agent thread */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RawMonitorWait,
-                jvmti_env, thr_resume_lock, (jlong)WAIT_TIME ))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorWait(thr_resume_lock, (jlong)WAIT_TIME))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed while waiting for thr_resume_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
 
         if (debug_agent_timed_out == JNI_TRUE) {
             NSK_COMPLAIN1("[ThreadStart hook] \"%s\": debug agent timed out\n", inf.name);
-            NSK_CPP_STUB2(FatalError, env, "[ThreadStart hook] could not recover");
+            env->FatalError("[ThreadStart hook] could not recover");
         }
 
         /* Release thr_resume_lock lock */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti_env, thr_resume_lock))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorExit(thr_resume_lock))) {
             NSK_COMPLAIN1("[ThreadStart hook] thread#%d failed to release thr_resume_lock\n", eventsCount);
             result = STATUS_FAILED;
         }
 
         /* check that thread is not in SUSPENDED state */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadState, jvmti_env, thread, &thrStat))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadState(thread, &thrStat))) {
             NSK_COMPLAIN1("[ThreadStart hook] Failed to get thread state for thread#%d\n", eventsCount);
             result = STATUS_FAILED;
         }
@@ -348,13 +345,13 @@
 
         if (thrStat & JVMTI_THREAD_STATE_SUSPENDED) {
             NSK_COMPLAIN1("[ThreadStart hook] \"%s\" was self-suspended\n", inf.name);
-            NSK_CPP_STUB2(FatalError, env, "[ThreadStart hook] could not recover");
+            env->FatalError("[ThreadStart hook] could not recover");
         }
 
         eventsCount++;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti_env, thr_event_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorExit(thr_event_lock))) {
         NSK_COMPLAIN0("[ThreadStart hook] Failed to release thr_event_lock\n");
         result = STATUS_FAILED;
     }
@@ -368,37 +365,33 @@
 
     NSK_DISPLAY0(">>> VMInit event: start\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti_env, JVMTI_ENABLE, JVMTI_EVENT_THREAD_START, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_THREAD_START, NULL))) {
         NSK_COMPLAIN0("TEST FAILED: failed to enable JVMTI_EVENT_THREAD_START\n");
         return;
     }
 
     /* Start agent thread */
-    if (!NSK_VERIFY((cls =
-            NSK_CPP_STUB2(FindClass, env, "java/lang/Thread")) != NULL)) {
+    if (!NSK_VERIFY((cls = env->FindClass("java/lang/Thread")) != NULL)) {
         result = STATUS_FAILED;
             NSK_COMPLAIN0("TEST FAILED: Cannot start agent thread: FindClass() failed\n");
         return;
     }
 
 
-    if (!NSK_VERIFY((mid =
-            NSK_CPP_STUB4(GetMethodID, env, cls, "<init>", "()V")) != NULL)) {
+    if (!NSK_VERIFY((mid = env->GetMethodID(cls, "<init>", "()V")) != NULL)) {
         result = STATUS_FAILED;
             NSK_COMPLAIN0("TEST FAILED: Cannot start agent thread: GetMethodID() failed\n");
         return;
     }
 
 
-    if (!NSK_VERIFY((agent_thread =
-            NSK_CPP_STUB3(NewObject, env, cls, mid)) != NULL)) {
+    if (!NSK_VERIFY((agent_thread = env->NewObject(cls, mid)) != NULL)) {
         result = STATUS_FAILED;
             NSK_COMPLAIN0("Cannot start agent thread: NewObject() failed\n");
         return;
     }
 
-    agent_thread = (jthread) NSK_CPP_STUB2(NewGlobalRef, env, agent_thread);
+    agent_thread = (jthread) env->NewGlobalRef(agent_thread);
     if (agent_thread == NULL) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("Cannot create global reference for agent_thread\n");
@@ -410,23 +403,22 @@
      * debug_agent from notifying us before we are ready.
      */
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti_env, agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorEnter(agent_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: failed to enter agent_start_lock\n");
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(RunAgentThread,
-            jvmti_env, agent_thread, debug_agent, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RunAgentThread(agent_thread, debug_agent, NULL, JVMTI_THREAD_NORM_PRIORITY))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: failed to create agent thread\n");
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RawMonitorWait, jvmti_env, agent_start_lock, (jlong)0))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorWait(agent_start_lock, (jlong)0))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: failed to wait agent_start_lock\n");
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti_env, agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->RawMonitorExit(agent_start_lock))) {
         result = STATUS_FAILED;
         NSK_COMPLAIN0("TEST FAILED: failed to exit agent_start_lock\n");
     }
@@ -464,17 +456,17 @@
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps))) {
         NSK_COMPLAIN0("TEST FAILED: failed to get potential capabilities\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         NSK_COMPLAIN0("TEST FAILED: failed to add capabilities during agent load\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) {
         NSK_COMPLAIN0("TEST FAILED: failed to get capabilities\n");
         return JNI_ERR;
     }
@@ -484,22 +476,22 @@
     }
 
     /* create raw monitors */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_agent_start_lock", &agent_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_agent_start_lock", &agent_start_lock))) {
         NSK_COMPLAIN0("TEST FAILED: failed to create agent_start_lock\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_thr_event_lock", &thr_event_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_thr_event_lock", &thr_event_lock))) {
         NSK_COMPLAIN0("TEST FAILED: failed to create thr_event_lock\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_thr_start_lock", &thr_start_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_thr_start_lock", &thr_start_lock))) {
         NSK_COMPLAIN0("TEST FAILED: failed to create thr_start_lock\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_thr_resume_lock", &thr_resume_lock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_thr_resume_lock", &thr_resume_lock))) {
         NSK_COMPLAIN0("TEST FAILED: failed to create thr_resume_lock\n");
         return JNI_ERR;
     }
@@ -508,19 +500,17 @@
     callbacks.VMDeath = &VMDeath;
     callbacks.ThreadStart = &ThreadStart;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, sizeof(callbacks)))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks)))) {
         NSK_COMPLAIN0("TEST FAILED: failed to set event callbacks\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL))) {
         NSK_COMPLAIN0("TEST FAILED: failed to enable JVMTI_EVENT_VM_INIT\n");
         return JNI_ERR;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL))) {
         NSK_COMPLAIN0("TEST FAILED: failed to enable JVMTI_EVENT_VM_DEATH\n");
         return JNI_ERR;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/VMDeath/vmdeath001/vmdeath001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/VMDeath/vmdeath001/vmdeath001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -48,8 +48,7 @@
 
     NSK_DISPLAY0("CHECK PASSED: VMDeath event received\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase,
-            jvmti, &phase)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&phase)))
         exit(95 + STATUS_FAILED);
 
     if (phase != JVMTI_PHASE_LIVE) {
@@ -88,13 +87,11 @@
     NSK_DISPLAY0("setting event callbacks ...\n");
     (void) memset(&callbacks, 0, sizeof(callbacks));
     callbacks.VMDeath = &VMDeath;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks,
-            jvmti, &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     NSK_DISPLAY0("setting event callbacks done\nenabling VMDeath event ...\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
         return JNI_ERR;
     NSK_DISPLAY0("enabling VMDeath event done\n");
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/VMObjectAlloc/vmobjalloc001/vmobjalloc001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/VMObjectAlloc/vmobjalloc001/vmobjalloc001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -61,8 +61,7 @@
 
     eventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti,
-            object_klass, &signature, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(object_klass, &signature, &generic))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -70,10 +69,10 @@
     NSK_DISPLAY2("VMObjectAlloc: \"%s\", size=%d\n", signature, size);
 
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)signature);
+        jvmti->Deallocate((unsigned char*)signature);
 
     if (generic != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)generic);
+        jvmti->Deallocate((unsigned char*)generic);
 
 }
 
@@ -130,21 +129,18 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_vm_object_alloc_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
         return JNI_ERR;
     }
 
     memset(&callbacks, 0, sizeof(callbacks));
     callbacks.VMObjectAlloc= &VMObjectAlloc;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-                &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     /* enable VMObjectAlloc event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP01/ap01t001/ap01t001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP01/ap01t001/ap01t001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -63,7 +63,7 @@
 
     NSK_DISPLAY0("VMDeath event received\n");
 
-    if (obj_free != (EXP_OBJ_NUMBER - 1) ) {
+    if (obj_free != (EXP_OBJ_NUMBER - 1)) {
         NSK_COMPLAIN2(
             "Received unexpected number of ObjectFree events: %d\n"
             "\texpected number: %d\n",
@@ -88,15 +88,15 @@
 }
 
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     if (class_tag == DEBUGEE_CLASS_TAG && *tag_ptr == 0) {
         obj_count++;
@@ -107,11 +107,11 @@
 }
 
 jvmtiIterationControl JNICALL
-heapRootCallback( jvmtiHeapRootKind root_kind,
-                  jlong class_tag,
-                  jlong size,
-                  jlong* tag_ptr,
-                  void* user_data) {
+heapRootCallback(jvmtiHeapRootKind root_kind,
+                 jlong class_tag,
+                 jlong size,
+                 jlong* tag_ptr,
+                 void* user_data) {
 
     if (class_tag == DEBUGEE_CLASS_TAG && *tag_ptr == 0) {
         obj_count++;
@@ -122,13 +122,13 @@
 }
 
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     if (class_tag == DEBUGEE_CLASS_TAG && *tag_ptr == 0) {
         obj_count++;
@@ -142,17 +142,17 @@
 /************************/
 
 JNIEXPORT jobject JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP01_ap01t001_newObject( JNIEnv* jni, jclass cls ) {
+Java_nsk_jvmti_scenarios_allocation_AP01_ap01t001_newObject(JNIEnv* jni, jclass cls) {
     jmethodID cid;
     jobject result;
 
-    if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(cls, "<init>", "()V" )) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(cls, "<init>", "()V")) != NULL)) {
          NSK_COMPLAIN0("newObject: GetMethodID returned NULL\n\n");
          nsk_jvmti_setFailStatus();
          return NULL;
     }
 
-    if (!NSK_JNI_VERIFY(jni, ( result = jni->NewObject(cls, cid)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(cls, cid)) != NULL)) {
 
          NSK_COMPLAIN0("newObject: NewObject returned NULL\n\n");
          nsk_jvmti_setFailStatus();
@@ -163,18 +163,18 @@
 }
 
 JNIEXPORT jobject JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP01_ap01t001_allocObject( JNIEnv* jni, jclass cls ) {
+Java_nsk_jvmti_scenarios_allocation_AP01_ap01t001_allocObject(JNIEnv* jni, jclass cls) {
     jmethodID cid;
     jobject result;
 
-    if (!NSK_JNI_VERIFY(jni, ( cid = jni->GetMethodID(cls, "<init>", "()V" )) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(cls, "<init>", "()V")) != NULL)) {
 
          NSK_COMPLAIN0("allocObject: GetMethodID returned NULL\n\n");
          nsk_jvmti_setFailStatus();
          return NULL;
     }
 
-    if (!NSK_JNI_VERIFY(jni, ( result = jni->AllocObject(cls)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (result = jni->AllocObject(cls)) != NULL)) {
 
          NSK_COMPLAIN0("allocObject: AllocObject returned NULL\n\n");
          nsk_jvmti_setFailStatus();
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP02/ap02t001/ap02t001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP02/ap02t001/ap02t001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -66,15 +66,15 @@
 }
 
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     if (class_tag == TESTED_CLASS_TAG) {
         obj_count++;
@@ -86,14 +86,14 @@
 /************************/
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP02_ap02t001_throwException( JNIEnv* jni,
-                                                                  jclass cls,
-                                                                  jclass exception_cls ) {
+Java_nsk_jvmti_scenarios_allocation_AP02_ap02t001_throwException(JNIEnv* jni,
+                                                                 jclass cls,
+                                                                 jclass exception_cls) {
     jint result;
 
-    result = jni->ThrowNew(exception_cls, "Got expected exception thrown from native code" );
+    result = jni->ThrowNew(exception_cls, "Got expected exception thrown from native code");
     if (result != 0) {
-        NSK_COMPLAIN1("throwException: Unable to throw exception in native code: %d\n\n", result );
+        NSK_COMPLAIN1("throwException: Unable to throw exception in native code: %d\n\n", result);
         nsk_jvmti_setFailStatus();
     } else {
         NSK_DISPLAY0("throwException: ThrowNew returned success code: 0\n\n");
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001/ap03t001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001/ap03t001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -69,13 +69,13 @@
 }
 
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     if (class_tag == DEBUGEE_CLASS_TAG && *tag_ptr != 0) {
         obj_count++;
@@ -88,7 +88,7 @@
 /************************/
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP03_ap03t001_setTag( JNIEnv* jni, jobject obj, jlong tag) {
+Java_nsk_jvmti_scenarios_allocation_AP03_ap03t001_setTag(JNIEnv* jni, jobject obj, jlong tag) {
 
     if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, tag))) {
          nsk_jvmti_setFailStatus();
@@ -160,13 +160,13 @@
         }
 
         if (!NSK_JNI_VERIFY(jni, (fid =
-                jni->GetStaticFieldID(debugeeClass, "catcher", DEBUGEE_SIGNATURE)) != NULL )) {
+                jni->GetStaticFieldID(debugeeClass, "catcher", DEBUGEE_SIGNATURE)) != NULL)) {
             nsk_jvmti_setFailStatus();
             break;
         }
 
         if (!NSK_JNI_VERIFY(jni, (catcher =
-                jni->GetStaticObjectField(debugeeClass, fid)) != NULL )) {
+                jni->GetStaticObjectField(debugeeClass, fid)) != NULL)) {
             NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'catcher' field value\n\n");
             nsk_jvmti_setFailStatus();
             break;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP04/ap04t001/ap04t001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP04/ap04t001/ap04t001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -109,10 +109,10 @@
 /***********************************************************************/
 
 jvmtiIterationControl JNICALL
-heapObjectCallback( jlong  class_tag,
-                    jlong  size,
-                    jlong* tag_ptr,
-                    void*  user_data) {
+heapObjectCallback(jlong  class_tag,
+                   jlong  size,
+                   jlong* tag_ptr,
+                   void*  user_data) {
 
     int count = 0;
 
@@ -133,11 +133,11 @@
 
 /* jvmtiHeapRootCallback */
 jvmtiIterationControl JNICALL
-heapRootCallback( jvmtiHeapRootKind root_kind,
-                  jlong class_tag,
-                  jlong size,
-                  jlong* tag_ptr,
-                  void* user_data) {
+heapRootCallback(jvmtiHeapRootKind root_kind,
+                 jlong class_tag,
+                 jlong size,
+                 jlong* tag_ptr,
+                 void* user_data) {
 
     int count = 0;
 
@@ -158,15 +158,15 @@
 
 /* jvmtiStackReferenceCallback */
 jvmtiIterationControl JNICALL
-stackReferenceCallback( jvmtiHeapRootKind root_kind,
-                        jlong     class_tag,
-                        jlong     size,
-                        jlong*    tag_ptr,
-                        jlong     thread_tag,
-                        jint      depth,
-                        jmethodID method,
-                        jint      slot,
-                        void*     user_data) {
+stackReferenceCallback(jvmtiHeapRootKind root_kind,
+                       jlong     class_tag,
+                       jlong     size,
+                       jlong*    tag_ptr,
+                       jlong     thread_tag,
+                       jint      depth,
+                       jmethodID method,
+                       jint      slot,
+                       void*     user_data) {
 
     int count = 0;
 
@@ -188,13 +188,13 @@
 
 /* jvmtiObjectReferenceCallback */
 jvmtiIterationControl JNICALL
-objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
-                         jlong  class_tag,
-                         jlong  size,
-                         jlong* tag_ptr,
-                         jlong  referrer_tag,
-                         jint   referrer_index,
-                         void*  user_data) {
+objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
+                        jlong  class_tag,
+                        jlong  size,
+                        jlong* tag_ptr,
+                        jlong  referrer_tag,
+                        jint   referrer_index,
+                        void*  user_data) {
 
     int count = 0;
 
@@ -237,10 +237,10 @@
 /***********************************************************************/
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_setTag( JNIEnv* jni,
-                                                          jclass  klass,
-                                                          jobject target, /* object to be tagged */
-                                                          jlong   tag ) {
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_setTag(JNIEnv* jni,
+                                                         jclass  klass,
+                                                         jobject target, /* object to be tagged */
+                                                         jlong   tag) {
 
     if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
         nsk_jvmti_setFailStatus();
@@ -248,7 +248,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_forceGC( JNIEnv* jni,
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_forceGC(JNIEnv* jni,
                                                           jclass  klass) {
 
 NSK_DISPLAY0("  run: ForceGarbageCollection\n");
@@ -258,8 +258,8 @@
 }
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverHeap( JNIEnv* jni,
-                                                                      jclass  klass ) {
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverHeap(JNIEnv* jni,
+                                                                     jclass  klass) {
     int count = 0;
 
     setCounter(&errorCount, 0);
@@ -286,8 +286,8 @@
 }
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverReachableObjects( JNIEnv* jni,
-                                                                                  jclass  klass ) {
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverReachableObjects(JNIEnv* jni,
+                                                                                 jclass  klass) {
     int count = 0;
 
     setCounter(&errorCount, 0);
@@ -315,8 +315,8 @@
 }
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverInstancesOfClass( JNIEnv* jni,
-                                                                                  jclass  klass ) {
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverInstancesOfClass(JNIEnv* jni,
+                                                                                 jclass  klass) {
     int count = 0;
 
     setCounter(&errorCount, 0);
@@ -344,14 +344,14 @@
 }
 
 JNIEXPORT void JNICALL
-Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverObjectsReachableFromObject( JNIEnv* jni,
-                                                                                            jclass  klass ) {
+Java_nsk_jvmti_scenarios_allocation_AP04_ap04t001_runIterateOverObjectsReachableFromObject(JNIEnv* jni,
+                                                                                           jclass  klass) {
 
     jobject root = NULL;
     int count = 0;
 
     if (!NSK_JNI_VERIFY(jni, (root =
-            jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL )) {
+            jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL)) {
         NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n");
         nsk_jvmti_setFailStatus();
         return;
@@ -402,14 +402,14 @@
 
     NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE);
     if (!NSK_JNI_VERIFY(jni, (rootFieldID =
-            jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL )) {
+            jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     NSK_DISPLAY1("Find ID of 'unlockSecondary' method: %s\n", ROOT_SIGNATURE);
     if (!NSK_JNI_VERIFY(jni, (unlockSecondaryID =
-            jni->GetStaticMethodID(debugeeClass, "unlockSecondary", "()V")) != NULL )) {
+            jni->GetStaticMethodID(debugeeClass, "unlockSecondary", "()V")) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref001/followref001.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref001/followref001.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -142,10 +142,8 @@
 
     printf("Allocate memory for objects list: %d objects\n", *objectsCount);
     fflush(0);
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(Allocate, jvmti,
-                                    (*objectsCount * sizeof(ObjectDesc)),
-                                    (unsigned char**) objectDescList))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate((*objectsCount * sizeof(ObjectDesc)),
+                                          (unsigned char**) objectDescList))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -180,8 +178,7 @@
                             jclass*      chainObjectClass)
 {
 
-    if (!NSK_JNI_VERIFY(jni, (*debugeeClass =
-            NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (*debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -190,14 +187,12 @@
     fflush(0);
 
     if (!NSK_JNI_VERIFY(jni, (*rootObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, ROOT_OBJECT_CLASS_NAME)) != NULL)) {
+            jni->FindClass(ROOT_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti,
-                                                *rootObjectClass,
-                                                ROOT_CLASS_TAG))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(*rootObjectClass, ROOT_CLASS_TAG))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -208,14 +203,12 @@
 
 
     if (!NSK_JNI_VERIFY(jni, (*chainObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
+            jni->FindClass(CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti,
-                                                *chainObjectClass,
-                                                CHAIN_CLASS_TAG))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(*chainObjectClass, CHAIN_CLASS_TAG))) {
         nsk_jvmti_setFailStatus();
     }
     printf("\nFound chain object class: 0x%p, tag=%ld\n  %s\n",
@@ -241,10 +234,7 @@
     jfieldID rootObjectField = NULL;
 
     if (!NSK_JNI_VERIFY(jni, (rootObjectField =
-            NSK_CPP_STUB4(GetStaticFieldID, jni,
-                                            debugeeClass,
-                                            OBJECT_FIELD_NAME,
-                                            ROOT_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetStaticFieldID(debugeeClass, OBJECT_FIELD_NAME, ROOT_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -253,9 +243,7 @@
     fflush(0);
 
     if (!NSK_JNI_VERIFY(jni, (*reachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                          REACHABLE_CHAIN_FIELD_NAME,
-                          CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, REACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -264,9 +252,7 @@
     fflush(0);
 
     if (!NSK_JNI_VERIFY(jni, (*unreachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                          UNREACHABLE_CHAIN_FIELD_NAME,
-                          CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, UNREACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -276,8 +262,7 @@
     fflush(0);
 
     if (!NSK_JNI_VERIFY(jni, (*nextField =
-            NSK_CPP_STUB4(GetFieldID, jni, chainObjectClass,
-                          NEXT_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(chainObjectClass, NEXT_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -286,16 +271,14 @@
     fflush(0);
 
     if (!NSK_JNI_VERIFY(jni, (*rootObjectPtr =
-            NSK_CPP_STUB3(GetStaticObjectField, jni,
-                          debugeeClass, rootObjectField)) != NULL)) {
+            jni->GetStaticObjectField(debugeeClass, rootObjectField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("\nFound root object: 0x%p\n", (void*) *rootObjectPtr);
     fflush(0);
 
-    if (!NSK_JNI_VERIFY(jni, (*rootObjectPtr =
-            NSK_CPP_STUB2(NewGlobalRef, jni, *rootObjectPtr)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (*rootObjectPtr = jni->NewGlobalRef(*rootObjectPtr)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -328,8 +311,7 @@
     count--;
     tag++;
 
-    if (!NSK_JNI_VERIFY(jni, (nextObj =
-         NSK_CPP_STUB3(GetObjectField, jni, currObj, refField)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (nextObj = jni->GetObjectField(currObj, refField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -339,7 +321,7 @@
         objectDescList[count].exp_found++;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, nextObj, objTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(nextObj, objTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld object=0x%p\n", (long)objTag, (void*)nextObj);
@@ -359,7 +341,7 @@
         return NSK_FALSE;
     }
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteLocalRef, jni, nextObj));
+    NSK_TRACE(jni->DeleteLocalRef(nextObj));
 
     return NSK_TRUE;
 } /* getAndTagChainObjects */
@@ -411,9 +393,7 @@
     printf("\nObtain and tag chain objects:\n");
     printf("    root tested object:\n");
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti,
-                                                *rootObjectPtr,
-                                                ROOT_OBJECT_TAG))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(*rootObjectPtr, ROOT_OBJECT_TAG))
     ) {
         nsk_jvmti_setFailStatus();
     }
@@ -531,13 +511,12 @@
 {
     if (rootObject != NULL) {
         printf("Release object reference to root tested object: 0x%p\n", rootObject);
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, rootObject));
+        NSK_TRACE(jni->DeleteGlobalRef(rootObject));
     }
 
     if (objectDescList != NULL) {
         printf("Deallocate objects list: 0x%p\n", (void*)objectDescList);
-        if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)objectDescList))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)objectDescList))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -786,14 +765,11 @@
     printf(">>> Start iteration from root tested object: 0x%p\n\n", rootObject);
     fflush(0);
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB6(FollowReferences, jvmti,
-                                            (jint)   0,    /* heap_filter    */
-                                            (jclass) NULL, /* class          */
-                                            rootObject,    /* initial_object */
-                                            &heapCallbacks,
-                                            (const void *) &fakeUserData))
-    ) {
+    if (!NSK_JVMTI_VERIFY(jvmti->FollowReferences((jint)   0,    /* heap_filter    */
+                                                  (jclass) NULL, /* class          */
+                                                  rootObject,    /* initial_object */
+                                                  &heapCallbacks,
+                                                  (const void *) &fakeUserData))) {
          nsk_jvmti_setFailStatus();
          return;
     }
@@ -856,7 +832,7 @@
 
         memset(&caps, 0, sizeof(caps));
         caps.can_tag_objects = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref002/followref002.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref002/followref002.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -119,8 +119,7 @@
     count--;
     tag++;
 
-    if (!NSK_JNI_VERIFY(jni, (obj =
-            NSK_CPP_STUB3(GetObjectField, jni, firstObject, firstField)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (obj = jni->GetObjectField(firstObject, firstField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -130,7 +129,7 @@
         objectDescList[count].exp_found++;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, obj, objTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, objTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld object=0x%p\n", (long)objTag, (void*)obj);
@@ -147,7 +146,7 @@
         return NSK_FALSE;
     }
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteLocalRef, jni, obj));
+    NSK_TRACE(jni->DeleteLocalRef(obj));
     return NSK_TRUE;
 } /* getAndTagChainObjects */
 
@@ -174,9 +173,8 @@
 
     printf("Allocate memory for objects list: %d objects\n", *objectsCount);
     fflush(0);
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(Allocate, jvmti, (*objectsCount * sizeof(ObjectDesc)),
-                                             (unsigned char**)objectDescList))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate((*objectsCount * sizeof(ObjectDesc)),
+                                          (unsigned char**)objectDescList))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -196,8 +194,7 @@
 
     printf("Find debugee class: %s\n", DEBUGEE_CLASS_NAME);
     fflush(0);
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass =
-            NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -205,14 +202,13 @@
 
     printf("Find root object class: %s\n", ROOT_OBJECT_CLASS_NAME);
     fflush(0);
-    if (!NSK_JNI_VERIFY(jni, (rootObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, ROOT_OBJECT_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (rootObjectClass = jni->FindClass(ROOT_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... found class: 0x%p\n", (void*)rootObjectClass);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, rootObjectClass, rootClassTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(rootObjectClass, rootClassTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld rootClass=0x%p\n", (long)rootClassTag, (void*)rootObjectClass);
@@ -220,13 +216,13 @@
     printf("Find chain object class: %s\n", CHAIN_OBJECT_CLASS_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (chainObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
+            jni->FindClass(CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... found class: 0x%p\n", (void*)chainObjectClass);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, chainObjectClass, chainClassTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(chainObjectClass, chainClassTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld chainClass=0x%p\n", (long)chainClassTag, (void*)chainObjectClass);
@@ -234,8 +230,7 @@
     printf("Find static field in debugee class: %s\n", OBJECT_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (objectField =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                            OBJECT_FIELD_NAME, ROOT_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetStaticFieldID(debugeeClass, OBJECT_FIELD_NAME, ROOT_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -244,8 +239,7 @@
     printf("Find instance field in root object class: %s\n", REACHABLE_CHAIN_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (reachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                        REACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, REACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -254,8 +248,7 @@
     printf("Find instance field in root object class: %s\n", UNREACHABLE_CHAIN_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (unreachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                          UNREACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, UNREACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -264,8 +257,7 @@
     printf("Find instance field in chain object class: %s\n", TAIL_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (tailField =
-            NSK_CPP_STUB4(GetFieldID, jni, chainObjectClass,
-                          TAIL_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(chainObjectClass, TAIL_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -274,16 +266,14 @@
     printf("Get root object from static field: %s\n", OBJECT_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (*rootObject =
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass,
-                                                    objectField)) != NULL)) {
+            jni->GetStaticObjectField(debugeeClass, objectField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... got object: 0x%p\n", (void*)*rootObject);
     fflush(0);
 
-    if (!NSK_JNI_VERIFY(jni, (*rootObject =
-            NSK_CPP_STUB2(NewGlobalRef, jni, *rootObject)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (*rootObject = jni->NewGlobalRef(*rootObject)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -293,7 +283,7 @@
 
     printf("    root tested object:\n");
     fflush(0);
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, *rootObject, rootObjectTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(*rootObject, rootObjectTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld object=0x%p\n", (long)rootObjectTag, (void*)*rootObject);
@@ -406,13 +396,12 @@
                                 ObjectDesc* objectDescList, jobject rootObject) {
     if (rootObject != NULL) {
         printf("Release object reference to root tested object: 0x%p\n", rootObject);
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, rootObject));
+        NSK_TRACE(jni->DeleteGlobalRef(rootObject));
     }
 
     if (objectDescList != NULL) {
         printf("Deallocate objects list: 0x%p\n", (void*)objectDescList);
-        if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)objectDescList))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)objectDescList))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -645,14 +634,11 @@
     fflush(0);
     {
         jint heap_filter = JVMTI_HEAP_FILTER_UNTAGGED | JVMTI_HEAP_FILTER_CLASS_UNTAGGED;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB6(FollowReferences, jvmti,
-                    heap_filter,
-                    (jclass) NULL, /* class          */
-                    rootObject,    /* initial_object */
-                    &heapCallbacks,
-                    (const void *) &fakeUserData)))
-        {
+        if (!NSK_JVMTI_VERIFY(jvmti->FollowReferences(heap_filter,
+                                                      (jclass) NULL, /* class          */
+                                                      rootObject,    /* initial_object */
+                                                      &heapCallbacks,
+                                                      (const void *) &fakeUserData))) {
              nsk_jvmti_setFailStatus();
              return;
         }
@@ -681,14 +667,11 @@
         /* This time everythig is filtered out */
         jint heap_filter = JVMTI_HEAP_FILTER_UNTAGGED | JVMTI_HEAP_FILTER_CLASS_UNTAGGED |
                            JVMTI_HEAP_FILTER_TAGGED   | JVMTI_HEAP_FILTER_CLASS_TAGGED;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB6(FollowReferences, jvmti,
-                    heap_filter,
-                    (jclass) NULL, /* class          */
-                    rootObject,    /* initial_object */
-                    &heapCallbacks,
-                    (const void *) &fakeUserData)))
-        {
+        if (!NSK_JVMTI_VERIFY(jvmti->FollowReferences(heap_filter,
+                                                      (jclass) NULL, /* class          */
+                                                      rootObject,    /* initial_object */
+                                                      &heapCallbacks,
+                                                      (const void *) &fakeUserData))) {
              nsk_jvmti_setFailStatus();
              return;
         }
@@ -751,7 +734,7 @@
 
         memset(&caps, 0, sizeof(caps));
         caps.can_tag_objects = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/followref003.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -138,15 +138,14 @@
     count--;
     tag++;
 
-    if (!NSK_JNI_VERIFY(jni, (obj =
-            NSK_CPP_STUB3(GetObjectField, jni, firstObject, firstField)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (obj = jni->GetObjectField(firstObject, firstField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
     objectDescList[count].tag = objTag;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, obj, objTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, objTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld object=0x%p\n", (long)objTag, (void*)obj);
@@ -157,7 +156,7 @@
         return NSK_FALSE;
     }
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteLocalRef, jni, obj));
+    NSK_TRACE(jni->DeleteLocalRef(obj));
     return NSK_TRUE;
 }
 
@@ -178,9 +177,8 @@
 
     printf("Allocate memory for objects list: %d objects\n", *objectsCount);
     fflush(0);
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(Allocate, jvmti, (*objectsCount * sizeof(ObjectDesc)),
-                                             (unsigned char**)objectDescList))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate((*objectsCount * sizeof(ObjectDesc)),
+                                          (unsigned char**)objectDescList))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -200,8 +198,7 @@
 
     printf("Find debugee class: %s\n", DEBUGEE_CLASS_NAME);
     fflush(0);
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass =
-            NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -209,14 +206,13 @@
 
     printf("Find root object class: %s\n", ROOT_OBJECT_CLASS_NAME);
     fflush(0);
-    if (!NSK_JNI_VERIFY(jni, (rootObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, ROOT_OBJECT_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (rootObjectClass = jni->FindClass(ROOT_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... found class: 0x%p\n", (void*)rootObjectClass);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, rootObjectClass, rootClassTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(rootObjectClass, rootClassTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld rootClass=0x%p\n",
@@ -225,14 +221,14 @@
     printf("Find chain object class: %s\n", CHAIN_OBJECT_CLASS_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (chainObjectClass =
-            NSK_CPP_STUB2(FindClass, jni, CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
+            jni->FindClass(CHAIN_OBJECT_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... found class: 0x%p\n",
            (void*)chainObjectClass);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, chainObjectClass, chainClassTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(chainObjectClass, chainClassTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld chainClass=0x%p\n",
@@ -241,8 +237,7 @@
     printf("Find static field in debugee class: %s\n", OBJECT_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (objectField =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                            OBJECT_FIELD_NAME, ROOT_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetStaticFieldID(debugeeClass, OBJECT_FIELD_NAME, ROOT_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -251,8 +246,7 @@
     printf("Find instance field in root object class: %s\n", REACHABLE_CHAIN_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (reachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                        REACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, REACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -261,8 +255,7 @@
     printf("Find instance field in root object class: %s\n", UNREACHABLE_CHAIN_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (unreachableChainField =
-            NSK_CPP_STUB4(GetFieldID, jni, rootObjectClass,
-                          UNREACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(rootObjectClass, UNREACHABLE_CHAIN_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -271,8 +264,7 @@
     printf("Find instance field in chain object class: %s\n", TAIL_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (tailField =
-            NSK_CPP_STUB4(GetFieldID, jni, chainObjectClass,
-                          TAIL_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
+            jni->GetFieldID(chainObjectClass, TAIL_FIELD_NAME, CHAIN_OBJECT_CLASS_SIG)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -281,16 +273,14 @@
     printf("Get root object from static field: %s\n", OBJECT_FIELD_NAME);
     fflush(0);
     if (!NSK_JNI_VERIFY(jni, (*rootObject =
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass,
-                                                    objectField)) != NULL)) {
+            jni->GetStaticObjectField(debugeeClass, objectField)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     printf("  ... got object: 0x%p\n", (void*)*rootObject);
     fflush(0);
 
-    if (!NSK_JNI_VERIFY(jni, (*rootObject =
-            NSK_CPP_STUB2(NewGlobalRef, jni, *rootObject)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (*rootObject = jni->NewGlobalRef(*rootObject)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -300,7 +290,7 @@
 
     printf("    root tested object\n");
     fflush(0);
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, *rootObject, rootObjectTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(*rootObject, rootObjectTag))) {
         nsk_jvmti_setFailStatus();
     }
     printf("        tag=%-5ld object=0x%p\n",
@@ -406,13 +396,12 @@
                                 ObjectDesc* objectDescList, jobject rootObject) {
     if (rootObject != NULL) {
         printf("Release object reference to root tested object: 0x%p\n", rootObject);
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, rootObject));
+        NSK_TRACE(jni->DeleteGlobalRef(rootObject));
     }
 
     if (objectDescList != NULL) {
         printf("Deallocate objects list: 0x%p\n", (void*)objectDescList);
-        if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)objectDescList))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)objectDescList))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -949,14 +938,11 @@
     printf("\n\n>>> Start 1-st iteration starting from the heap root\n");
     fflush(0);
     {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB6(FollowReferences, jvmti,
-                    (jint)   0,     /* heap_filter    */
-                    (jclass)  NULL, /* class          */
-                    (jobject) NULL, /* initial_object */
-                    &heapCallbacks,
-                    (const void *) &fakeUserData)))
-        {
+        if (!NSK_JVMTI_VERIFY(jvmti->FollowReferences((jint)   0,     /* heap_filter    */
+                                                      (jclass)  NULL, /* class          */
+                                                      (jobject) NULL, /* initial_object */
+                                                      &heapCallbacks,
+                                                      (const void *) &fakeUserData))) {
              nsk_jvmti_setFailStatus();
              return;
         }
@@ -990,14 +976,11 @@
     {
         jint heap_filter = JVMTI_HEAP_FILTER_UNTAGGED
                          | JVMTI_HEAP_FILTER_CLASS_UNTAGGED;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB6(FollowReferences, jvmti,
-                    heap_filter,
-                    (jclass)  NULL, /* class          */
-                    (jobject) NULL, /* initial_object */
-                    &heapCallbacks,
-                    (const void *) &fakeUserData)))
-        {
+        if (!NSK_JVMTI_VERIFY(jvmti->FollowReferences(heap_filter,
+                                                      (jclass)  NULL, /* class          */
+                                                      (jobject) NULL, /* initial_object */
+                                                      &heapCallbacks,
+                                                      (const void *) &fakeUserData))) {
              nsk_jvmti_setFailStatus();
              return;
         }
@@ -1086,7 +1069,7 @@
 
         memset(&caps, 0, sizeof(caps));
         caps.can_tag_objects = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref004/followref004.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref004/followref004.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -146,16 +146,16 @@
 {
     jclass klass;
 
-    if  ( ! NSK_JNI_VERIFY(jni, (klass = NSK_CPP_STUB2(FindClass, jni, JAVA_LANG_STRING_CLASS_NAME)) != NULL) ) {
+    if  ( ! NSK_JNI_VERIFY(jni, (klass = jni->FindClass(JAVA_LANG_STRING_CLASS_NAME)) != NULL) ) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    if ( ! NSK_JNI_VERIFY(jni, (g_jniGlobalRef = NSK_CPP_STUB2(NewGlobalRef, jni, klass)) != NULL) ) {
+    if ( ! NSK_JNI_VERIFY(jni, (g_jniGlobalRef = jni->NewGlobalRef(klass)) != NULL) ) {
         nsk_jvmti_setFailStatus();
     }
 
-    if ( ! NSK_JNI_VERIFY(jni, (g_jniWeakGlobalRef = NSK_CPP_STUB2(NewWeakGlobalRef, jni, klass)) != NULL) ) {
+    if ( ! NSK_JNI_VERIFY(jni, (g_jniWeakGlobalRef = jni->NewWeakGlobalRef(klass)) != NULL) ) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -179,13 +179,11 @@
 
     createGlobalRefs(jni);
 
-    retCode = NSK_CPP_STUB6(FollowReferences,
-                              jvmti,
-                              (jint) 0,                 /* heap filter */
-                              NULL,                     /* class */
-                              NULL,                     /* inital object */
-                              &g_heapCallbacks,
-                              (const void *) &g_fakeUserData);
+    retCode = jvmti->FollowReferences((jint) 0,                 /* heap filter */
+                                      NULL,                     /* class */
+                                      NULL,                     /* inital object */
+                                      &g_heapCallbacks,
+                                      (const void *) &g_fakeUserData);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NONE) ) {
         nsk_jvmti_setFailStatus();
@@ -247,7 +245,7 @@
 
         memset(&caps, 0, sizeof(caps));
         caps.can_tag_objects = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref005/followref005.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref005/followref005.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -45,58 +45,42 @@
     printf(">>> Check that FollowReferences(), IterateThroughHeap(), GetTag(), SetTag() and GetObjectsWithTags() \n"
            "    return an error if env. doesn't possess can_tag_objects capability\n");
 
-    retCode = NSK_CPP_STUB6(FollowReferences,
-                              jvmti,
-                              (jint) 0,                 /* heap filter */
-                              NULL,                     /* class */
-                              NULL,                     /* inital object */
-                              &g_wrongHeapCallbacks,
-                              (const void *) &g_fakeUserData);
+    retCode = jvmti->FollowReferences((jint) 0,                 /* heap filter */
+                                      NULL,                     /* class */
+                                      NULL,                     /* inital object */
+                                      &g_wrongHeapCallbacks,
+                                      (const void *) &g_fakeUserData);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
         NSK_COMPLAIN1("FollowReferences() returned %i", retCode);
         nsk_jvmti_setFailStatus();
     }
 
-    retCode = NSK_CPP_STUB5(IterateThroughHeap,
-                              jvmti,
-                              (jint) 0,                 /* heap filter */
-                              NULL,                     /* class */
-                              &g_wrongHeapCallbacks,
-                              (const void *) &g_fakeUserData);
+    retCode = jvmti->IterateThroughHeap((jint) 0,                 /* heap filter */
+                                        NULL,                     /* class */
+                                        &g_wrongHeapCallbacks,
+                                        (const void *) &g_fakeUserData);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
         NSK_COMPLAIN1("IterateThroughHeap() returned %i", retCode);
         nsk_jvmti_setFailStatus();
     }
 
-    retCode = NSK_CPP_STUB3(GetTag,
-                              jvmti,
-                              (jobject) &g_wrongHeapCallbacks,
-                              &tag);
+    retCode = jvmti->GetTag((jobject) &g_wrongHeapCallbacks, &tag);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
         NSK_COMPLAIN1("GetTag() returned %i", retCode);
         nsk_jvmti_setFailStatus();
     }
 
-    retCode = NSK_CPP_STUB3(SetTag,
-                              jvmti,
-                              (jobject) &g_wrongHeapCallbacks,
-                              tag);
+    retCode = jvmti->SetTag((jobject) &g_wrongHeapCallbacks, tag);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
         NSK_COMPLAIN1("SetTag() returned %i", retCode);
         nsk_jvmti_setFailStatus();
     }
 
-    retCode = NSK_CPP_STUB6(GetObjectsWithTags,
-                              jvmti,
-                              1,
-                              &tag,
-                              &cnt,
-                              &pObjs,
-                              &pObjTags);
+    retCode = jvmti->GetObjectsWithTags(1, &tag, &cnt, &pObjs, &pObjTags);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
         NSK_COMPLAIN1("GetObjectsWithTags() returned %i", retCode);
@@ -148,7 +132,7 @@
 
         memset(&caps, 0, sizeof(caps));
         /* Don't add can_tag_objects capability */
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref006/followref006.cpp	Tue Oct 16 23:21:05 2018 +0530
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/FollowReferences/followref006/followref006.cpp	Tue Oct 23 15:29:10 2018 +0530
@@ -49,13 +49,11 @@
 
     NSK_DISPLAY0("FollowReferences: Invalid class:");
 
-    retCode = NSK_CPP_STUB6(FollowReferences,
-                              jvmti,
-                              (jint) 0,                 /* heap filter */
-                              (jclass) &g_wrongHeapCallbacks ,   /* invalid class, but valid memory address */
-                              NULL,                     /* inital object */
-                              &g_wrongHeapCallbacks,
-                              (const void *) &g_fakeUserData);
+    retCode = jvmti->FollowReferences((jint) 0,                 /* heap filter */
+                                      (jclass) &g_wrongHeapCallbacks ,   /* invalid class, but valid memory address */
+                                      NULL,                     /* inital object */
+                                      &g_wrongHeapCallbacks,
+                                      (const void *) &g_fakeUserData);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_CLASS ) ) {
         nsk_jvmti_setFailStatus();
@@ -75,13 +73,11 @@
     emptyHeapCallbacks.primitive_field_callback = NULL;
     emptyHeapCallbacks.array_primitive_value_callback = NULL;
     emptyHeapCallbacks.string_primitive_value_callback = NULL;
-    retCode = NSK_CPP_STUB6(FollowReferences,
-                            jvmti,
-                            (jint) 0,               // heap filter
-                            NULL,                   // class
-                            (jobject) &g_wrongHeapCallbacks,  // invalid inital object
-                            &emptyHeapCallbacks,    // No callbacks
-                            (const void *) &g_fakeUserData);
+    retCode = jvmti->FollowReferences((jint) 0,               // heap filter
+                                      NULL,                   // class
+                                      (jobject) &g_wrongHeapCallbacks,  // invalid inital object
+                                      &emptyHeapCallbacks,    // No callbacks
+                                      (const void *) &g_fakeUserData);
 
     // Accept both JVMTI_ERROR_INVALID_OBJECT and JVMTI_ERROR_NONE
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT || retCode == JVMTI_ERROR_NONE ) ) {
@@ -90,13 +86,11 @@
 
     NSK_DISPLAY0("FollowReferences: Invalid callbacks:");
 
-    retCode = NSK_CPP_STUB6(FollowReferences,
-                              jvmti,
-                              (jint) 0,     /* heap filter */
-                              NULL,         /* class */
-                              NULL,         /* inital object */
-                              NULL,
-                              (const void *) &g_fakeUserData);
+    retCode = jvmti->FollowReferences((jint) 0,     /* heap filter */
+                                      NULL,         /* class */
+                                      NULL,         /* inital object */
+                                      NULL,
+                                      (const void *) &g_fakeUserData);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NULL_POINTER ) ) {
         nsk_jvmti_setFailStatus();
@@ -104,10 +98,8 @@
 
     NSK_DISPLAY0("GetTag: Invalid object:");
 
-    retCode = NSK_CPP_STUB3(GetTag,
-                              jvmti,
-                              (jobject) &g_wrongHeapCallbacks,  /* invalid inital object */
-                              &tag);
+    retCode = jvmti->GetTag((jobject) &g_wrongHeapCallbacks,  /* invalid inital object */
+                            &tag);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
         nsk_jvmti_setFailStatus();
@@ -115,10 +107,7 @@
 
     NSK_DISPLAY0("GetTag: NULL object pointer:");
 
-    retCode = NSK_CPP_STUB3(GetTag,
-                              jvmti,
-                              NULL,
-                              &tag);
+    retCode = jvmti->GetTag(NULL, &tag);
 
     if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
         nsk_jvmti_setFailStatus();
@@ -126,10 +115,7 @@
 
     NSK_DISPLAY0("GetTag: NULL tag pointer:");
 
-    retCode = NSK_CPP_STUB3(GetTag,
-                              jvmti,
-                              (jobject) &g_wrongHeapCallbacks,
-