Merge JDK-8200758-branch
authorherrick
Thu, 11 Oct 2018 20:58:37 -0400
branchJDK-8200758-branch
changeset 56959 973e113ced9a
parent 56958 8880b21d458d (current diff)
parent 52101 5fcf63f0d86c (diff)
child 56962 a769ad2d40d6
Merge
--- a/.hgtags	Thu Oct 11 20:53:02 2018 -0400
+++ b/.hgtags	Thu Oct 11 20:58:37 2018 -0400
@@ -517,3 +517,4 @@
 8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14
 8897e41b327c0a5601c6ba2bba5d07f15a3ffc91 jdk-12+14
 6f04692c7d5137ee34a6bd94c0c8a6c9219cb127 jdk-12+14
+f8626bcc169813a4b2a15880386b952719d1d6d1 jdk-12+15
--- a/src/hotspot/cpu/ppc/c2_globals_ppc.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/cpu/ppc/c2_globals_ppc.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -62,7 +62,7 @@
 define_pd_global(bool, UseCISCSpill,                 false);
 define_pd_global(bool, OptoBundling,                 false);
 define_pd_global(bool, OptoRegScheduling,            false);
-define_pd_global(bool, SuperWordLoopUnrollAnalysis,  false);
+define_pd_global(bool, SuperWordLoopUnrollAnalysis,  true);
 // GL:
 // Detected a problem with unscaled compressed oops and
 // narrow_oop_use_complex_address() == false.
--- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -33,7 +33,7 @@
 
 enum platform_dependent_constants {
   code_size1 = 20000 LP64_ONLY(+10000),         // simply increase if too small (assembler will crash if too small)
-  code_size2 = 33800 LP64_ONLY(+10000)           // simply increase if too small (assembler will crash if too small)
+  code_size2 = 35300 LP64_ONLY(+10000)          // simply increase if too small (assembler will crash if too small)
 };
 
 class x86 {
--- a/src/hotspot/share/classfile/classLoader.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/classfile/classLoader.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -135,7 +135,6 @@
 PerfCounter*    ClassLoader::_sync_JVMDefineClassLockFreeCounter = NULL;
 PerfCounter*    ClassLoader::_sync_JNIDefineClassLockFreeCounter = NULL;
 PerfCounter*    ClassLoader::_unsafe_defineClassCallCounter = NULL;
-PerfCounter*    ClassLoader::_load_instance_class_failCounter = NULL;
 
 GrowableArray<ModuleClassPathList*>* ClassLoader::_patch_mod_entries = NULL;
 GrowableArray<ModuleClassPathList*>* ClassLoader::_exploded_entries = NULL;
@@ -1604,9 +1603,6 @@
 
     NEWPERFEVENTCOUNTER(_unsafe_defineClassCallCounter, SUN_CLS,
                         "unsafeDefineClassCalls");
-
-    NEWPERFEVENTCOUNTER(_load_instance_class_failCounter, SUN_CLS,
-                        "loadInstanceClassFailRate");
   }
 
   // lookup zip library entry points
--- a/src/hotspot/share/classfile/classLoader.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/classfile/classLoader.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -192,7 +192,6 @@
   static PerfCounter* _sync_JNIDefineClassLockFreeCounter;
 
   static PerfCounter* _unsafe_defineClassCallCounter;
-  static PerfCounter* _load_instance_class_failCounter;
 
   // The boot class path consists of 3 ordered pieces:
   //  1. the module/path pairs specified to --patch-module
@@ -340,12 +339,6 @@
     return _unsafe_defineClassCallCounter;
   }
 
-  // Record how many times SystemDictionary::load_instance_class call
-  // fails with linkageError when Unsyncloadclass flag is set.
-  static PerfCounter* load_instance_class_failCounter() {
-    return _load_instance_class_failCounter;
-  }
-
   // Modular java runtime image is present vs. a build with exploded modules
   static bool has_jrt_entry() { return (_jrt_entry != NULL); }
   static ClassPathEntry* get_jrt_entry() { return _jrt_entry; }
--- a/src/hotspot/share/classfile/verificationType.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/classfile/verificationType.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -111,7 +111,7 @@
     VerificationType comp_from = from.get_component(context, CHECK_false);
     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
       return comp_this.is_component_assignable_from(comp_from, context,
-                                          from_field_is_protected, CHECK_false);
+                                                    from_field_is_protected, THREAD);
     }
   }
   return false;
--- a/src/hotspot/share/classfile/verificationType.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/classfile/verificationType.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -312,7 +312,7 @@
         case Short:
           return false;
         default:
-          return is_assignable_from(from, context, from_field_is_protected, CHECK_false);
+          return is_assignable_from(from, context, from_field_is_protected, THREAD);
       }
     }
   }
--- a/src/hotspot/share/code/nmethod.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/code/nmethod.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -2340,7 +2340,7 @@
   for (int i = 0; i < oops_count(); i++) {
     oop o = oop_at(i);
     tty->print("#%3d: " INTPTR_FORMAT " ", i, p2i(o));
-    if (o == (oop)Universe::non_oop_word()) {
+    if (o == Universe::non_oop_word()) {
       tty->print("non-oop word");
     } else {
       if (o != NULL) {
--- a/src/hotspot/share/code/relocInfo.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/code/relocInfo.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -574,7 +574,7 @@
 oop oop_Relocation::oop_value() {
   oop v = *oop_addr();
   // clean inline caches store a special pseudo-null
-  if (v == (oop)Universe::non_oop_word())  v = NULL;
+  if (v == Universe::non_oop_word())  v = NULL;
   return v;
 }
 
--- a/src/hotspot/share/compiler/oopMap.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/compiler/oopMap.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -350,7 +350,7 @@
         // implicit null check is used in compiled code.
         // The narrow_oop_base could be NULL or be the address
         // of the page below heap depending on compressed oops mode.
-        if (base_loc != NULL && *base_loc != (oop)NULL && !Universe::is_narrow_oop_base(*base_loc)) {
+        if (base_loc != NULL && *base_loc != NULL && !Universe::is_narrow_oop_base(*base_loc)) {
           derived_oop_fn(base_loc, derived_loc);
         }
         oms.next();
@@ -371,7 +371,7 @@
       guarantee(loc != NULL, "missing saved register");
       if ( omv.type() == OopMapValue::oop_value ) {
         oop val = *loc;
-        if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) {
+        if (val == NULL || Universe::is_narrow_oop_base(val)) {
           // Ignore NULL oops and decoded NULL narrow oops which
           // equal to Universe::narrow_oop_base when a narrow oop
           // implicit null check is used in compiled code.
@@ -769,7 +769,7 @@
   assert(Universe::heap()->is_in_or_null(*base_loc), "not an oop");
   assert(derived_loc != base_loc, "Base and derived in same location");
   if (_active) {
-    assert(*derived_loc != (oop)base_loc, "location already added");
+    assert(*derived_loc != (void*)base_loc, "location already added");
     assert(_list != NULL, "list must exist");
     intptr_t offset = value_of_loc(derived_loc) - value_of_loc(base_loc);
     // This assert is invalid because derived pointers can be
--- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -118,6 +118,8 @@
 }
 
 HeapWord* EpsilonHeap::allocate_work(size_t size) {
+  assert(is_object_aligned(size), "Allocation size should be aligned: " SIZE_FORMAT, size);
+
   HeapWord* res = _space->par_allocate(size);
 
   while (res == NULL) {
@@ -168,6 +170,7 @@
     }
   }
 
+  assert(is_object_aligned(res), "Object should be aligned: " PTR_FORMAT, p2i(res));
   return res;
 }
 
@@ -211,6 +214,9 @@
   // Always honor boundaries
   size = MAX2(min_size, MIN2(_max_tlab_size, size));
 
+  // Always honor alignment
+  size = align_up(size, MinObjAlignment);
+
   if (log_is_enabled(Trace, gc)) {
     ResourceMark rm;
     log_trace(gc)("TLAB size for \"%s\" (Requested: " SIZE_FORMAT "K, Min: " SIZE_FORMAT
--- a/src/hotspot/share/gc/shared/barrierSet.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/barrierSet.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -130,6 +130,10 @@
   virtual void on_thread_detach(JavaThread* thread) {}
   virtual void make_parsable(JavaThread* thread) {}
 
+#ifdef CHECK_UNHANDLED_OOPS
+  virtual bool oop_equals_operator_allowed() { return true; }
+#endif
+
 public:
   // Print a description of the memory for the barrier set
   virtual void print_on(outputStream* st) const = 0;
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -586,3 +586,7 @@
 void CollectedHeap::deduplicate_string(oop str) {
   // Do nothing, unless overridden in subclass.
 }
+
+size_t CollectedHeap::obj_size(oop obj) const {
+  return obj->size();
+}
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -576,6 +576,8 @@
 
   virtual bool is_oop(oop object) const;
 
+  virtual size_t obj_size(oop obj) const;
+
   // Non product verification and debugging.
 #ifndef PRODUCT
   // Support for PromotionFailureALot.  Return true if it's time to cause a
--- a/src/hotspot/share/gc/shared/memAllocator.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -198,15 +198,6 @@
     return;
   }
 
-  assert(JavaThread::current()->heap_sampler().add_sampling_collector(),
-         "Should never return false.");
-
-  // Only check if the sampler could actually sample something in this path.
-  assert(!JvmtiExport::should_post_sampled_object_alloc() ||
-         !JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() ||
-         _thread->heap_sampler().sampling_collector_present(),
-         "Sampling collector not present.");
-
   if (JvmtiExport::should_post_sampled_object_alloc()) {
     // If we want to be sampling, protect the allocated object with a Handle
     // before doing the callback. The callback is done in the destructor of
@@ -219,8 +210,6 @@
     _thread->heap_sampler().check_for_sampling(obj_h(), size_in_bytes, bytes_since_last);
   }
 
-  assert(JavaThread::current()->heap_sampler().remove_sampling_collector(), "Should never return false.");
-
   if (_tlab_end_reset_for_sample || _allocated_tlab_size != 0) {
     _thread->tlab().set_sample_end();
   }
--- a/src/hotspot/share/gc/shared/referenceProcessor.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -284,7 +284,7 @@
 
   // First _prev_next ref actually points into DiscoveredList (gross).
   oop new_next;
-  if (_next_discovered == _current_discovered) {
+  if (oopDesc::equals_raw(_next_discovered, _current_discovered)) {
     // At the end of the list, we should make _prev point to itself.
     // If _ref is the first ref, then _prev_next will be in the DiscoveredList,
     // and _prev will be NULL.
@@ -474,7 +474,7 @@
 ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) {
   oop obj = NULL;
   oop next = refs_list.head();
-  while (next != obj) {
+  while (!oopDesc::equals_raw(next, obj)) {
     obj = next;
     next = java_lang_ref_Reference::discovered(obj);
     java_lang_ref_Reference::set_discovered_raw(obj, NULL);
@@ -746,7 +746,7 @@
         ref_lists[to_idx].inc_length(refs_to_move);
 
         // Remove the chain from the from list.
-        if (move_tail == new_head) {
+        if (oopDesc::equals_raw(move_tail, new_head)) {
           // We found the end of the from list.
           ref_lists[from_idx].set_head(NULL);
         } else {
--- a/src/hotspot/share/gc/shared/referenceProcessor.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/referenceProcessor.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -143,13 +143,13 @@
   inline size_t removed() const { return _removed; }
 
   inline void move_to_next() {
-    if (_current_discovered == _next_discovered) {
+    if (oopDesc::equals_raw(_current_discovered, _next_discovered)) {
       // End of the list.
       _current_discovered = NULL;
     } else {
       _current_discovered = _next_discovered;
     }
-    assert(_current_discovered != _first_seen, "cyclic ref_list found");
+    assert(!oopDesc::equals_raw(_current_discovered, _first_seen), "cyclic ref_list found");
     _processed++;
   }
 };
--- a/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -375,7 +375,7 @@
   }
 
   typeArrayOop existing_value = lookup_or_add(value, latin1, hash);
-  if (existing_value == value) {
+  if (oopDesc::equals_raw(existing_value, value)) {
     // Same value, already known
     stat->inc_known();
     return;
--- a/src/hotspot/share/interpreter/linkResolver.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/interpreter/linkResolver.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -793,24 +793,6 @@
     check_method_loader_constraints(link_info, resolved_method, "method", CHECK_NULL);
   }
 
-  // For private method invocation we should only find the method in the resolved class.
-  // If that is not the case then we have a found a supertype method that we have nestmate
-  // access to.
-  if (resolved_method->is_private() && resolved_method->method_holder() != resolved_klass) {
-    ResourceMark rm(THREAD);
-    DEBUG_ONLY(bool is_nestmate = InstanceKlass::cast(link_info.current_klass())->has_nestmate_access_to(InstanceKlass::cast(resolved_klass), THREAD);)
-    assert(is_nestmate, "was only expecting nestmates to get here!");
-    Exceptions::fthrow(
-      THREAD_AND_LOCATION,
-      vmSymbols::java_lang_NoSuchMethodError(),
-      "%s: method %s%s not found",
-      resolved_klass->external_name(),
-      resolved_method->name()->as_C_string(),
-      resolved_method->signature()->as_C_string()
-    );
-    return NULL;
-  }
-
   return resolved_method;
 }
 
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -148,7 +148,7 @@
                              require_local);
     if (elem_klass != NULL) {
       // Now make an array for it
-      return elem_klass->array_klass(CHECK_NULL);
+      return elem_klass->array_klass(THREAD);
     }
   }
 
--- a/src/hotspot/share/oops/access.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/access.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -277,7 +277,7 @@
   }
 
   static bool equals(oop o1, oop o2) {
-    verify_decorators<INTERNAL_EMPTY>();
+    verify_decorators<AS_RAW>();
     return AccessInternal::equals<decorators>(o1, o2);
   }
 };
--- a/src/hotspot/share/oops/accessBackend.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/accessBackend.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -410,7 +410,7 @@
 
   static oop resolve(oop obj) { return obj; }
 
-  static bool equals(oop o1, oop o2) { return o1 == o2; }
+  static bool equals(oop o1, oop o2) { return (void*)o1 == (void*)o2; }
 };
 
 // Below is the implementation of the first 4 steps of the template pipeline:
@@ -998,7 +998,7 @@
 
     template <DecoratorSet decorators>
     inline static typename EnableIf<
-      HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
+      HasDecorator<decorators, AS_RAW>::value || HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
     equals(oop o1, oop o2) {
       typedef RawAccessBarrier<decorators & RAW_DECORATOR_MASK> Raw;
       return Raw::equals(o1, o2);
@@ -1006,7 +1006,7 @@
 
     template <DecoratorSet decorators>
     inline static typename EnableIf<
-      !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
+      !HasDecorator<decorators, AS_RAW>::value && !HasDecorator<decorators, INTERNAL_BT_TO_SPACE_INVARIANT>::value, bool>::type
     equals(oop o1, oop o2) {
       return RuntimeDispatch<decorators, oop, BARRIER_EQUALS>::equals(o1, o2);
     }
--- a/src/hotspot/share/oops/constantPool.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/constantPool.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -472,7 +472,7 @@
     // or any internal exception fields such as cause or stacktrace.  But since the
     // detail message is often a class name or other literal string, we will repeat it
     // if we can find it in the symbol table.
-    throw_resolution_error(this_cp, which, CHECK_0);
+    throw_resolution_error(this_cp, which, CHECK_NULL);
     ShouldNotReachHere();
   }
 
--- a/src/hotspot/share/oops/instanceKlass.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -2738,48 +2738,6 @@
   return;
 }
 
-// tell if two classes have the same enclosing class (at package level)
-bool InstanceKlass::is_same_package_member(const Klass* class2, TRAPS) const {
-  if (class2 == this) return true;
-  if (!class2->is_instance_klass())  return false;
-
-  // must be in same package before we try anything else
-  if (!is_same_class_package(class2))
-    return false;
-
-  // As long as there is an outer_this.getEnclosingClass,
-  // shift the search outward.
-  const InstanceKlass* outer_this = this;
-  for (;;) {
-    // As we walk along, look for equalities between outer_this and class2.
-    // Eventually, the walks will terminate as outer_this stops
-    // at the top-level class around the original class.
-    bool ignore_inner_is_member;
-    const Klass* next = outer_this->compute_enclosing_class(&ignore_inner_is_member,
-                                                            CHECK_false);
-    if (next == NULL)  break;
-    if (next == class2)  return true;
-    outer_this = InstanceKlass::cast(next);
-  }
-
-  // Now do the same for class2.
-  const InstanceKlass* outer2 = InstanceKlass::cast(class2);
-  for (;;) {
-    bool ignore_inner_is_member;
-    Klass* next = outer2->compute_enclosing_class(&ignore_inner_is_member,
-                                                    CHECK_false);
-    if (next == NULL)  break;
-    // Might as well check the new outer against all available values.
-    if (next == this)  return true;
-    if (next == outer_this)  return true;
-    outer2 = InstanceKlass::cast(next);
-  }
-
-  // If by this point we have not found an equality between the
-  // two classes, we know they are in separate package members.
-  return false;
-}
-
 bool InstanceKlass::find_inner_classes_attr(int* ooff, int* noff, TRAPS) const {
   constantPoolHandle i_cp(THREAD, constants());
   for (InnerClassesIterator iter(this); !iter.done(); iter.next()) {
--- a/src/hotspot/share/oops/instanceKlass.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -507,9 +507,6 @@
                                        ClassLoaderData* loader_data,
                                        TRAPS);
  public:
-  // tell if two classes have the same enclosing class (at package level)
-  bool is_same_package_member(const Klass* class2, TRAPS) const;
-
   // initialization state
   bool is_loaded() const                   { return _init_state >= loaded; }
   bool is_linked() const                   { return _init_state >= linked; }
--- a/src/hotspot/share/oops/instanceMirrorKlass.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/instanceMirrorKlass.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -52,7 +52,7 @@
 
   // Since mirrors can be variable sized because of the static fields, store
   // the size in the mirror itself.
-  return (instanceOop)Universe::heap()->class_allocate(this, size, CHECK_NULL);
+  return (instanceOop)Universe::heap()->class_allocate(this, size, THREAD);
 }
 
 int InstanceMirrorKlass::oop_size(oop obj) const {
--- a/src/hotspot/share/oops/oop.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/oop.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -153,6 +153,8 @@
 
   inline static bool equals(oop o1, oop o2) { return Access<>::equals(o1, o2); }
 
+  inline static bool equals_raw(oop o1, oop o2) { return RawAccess<>::equals(o1, o2); }
+
   // Access to fields in a instanceOop through these methods.
   template <DecoratorSet decorator>
   oop obj_field_access(int offset) const;
--- a/src/hotspot/share/oops/oopsHierarchy.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/oopsHierarchy.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/barrierSet.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "oops/oopsHierarchy.hpp"
@@ -53,4 +54,15 @@
     t->unhandled_oops()->unregister_unhandled_oop(this);
   }
 }
+
+bool oop::operator==(const oop o) const {
+  assert(BarrierSet::barrier_set()->oop_equals_operator_allowed(), "Not allowed");
+  return obj() == o.obj();
+}
+
+bool oop::operator!=(const volatile oop o) const {
+  assert(BarrierSet::barrier_set()->oop_equals_operator_allowed(), "Not allowed");
+  return obj() != o.obj();
+}
+
 #endif // CHECK_UNHANDLED_OOPS
--- a/src/hotspot/share/oops/oopsHierarchy.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/oops/oopsHierarchy.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -101,9 +101,9 @@
 
   // General access
   oopDesc*  operator->() const        { return obj(); }
-  bool operator==(const oop o) const  { return obj() == o.obj(); }
+  bool operator==(const oop o) const;
   bool operator==(void *p) const      { return obj() == p; }
-  bool operator!=(const volatile oop o) const  { return obj() != o.obj(); }
+  bool operator!=(const volatile oop o) const;
   bool operator!=(void *p) const      { return obj() != p; }
 
   // Assignment
--- a/src/hotspot/share/opto/compile.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/opto/compile.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -3379,6 +3379,32 @@
       n->set_req(MemBarNode::Precedent, top());
     }
     break;
+  case Op_MemBarAcquire: {
+    if (n->as_MemBar()->trailing_load() && n->req() > MemBarNode::Precedent) {
+      // At parse time, the trailing MemBarAcquire for a volatile load
+      // is created with an edge to the load. After optimizations,
+      // that input may be a chain of Phis. If those phis have no
+      // other use, then the MemBarAcquire keeps them alive and
+      // register allocation can be confused.
+      ResourceMark rm;
+      Unique_Node_List wq;
+      wq.push(n->in(MemBarNode::Precedent));
+      n->set_req(MemBarNode::Precedent, top());
+      while (wq.size() > 0) {
+        Node* m = wq.pop();
+        if (m->outcnt() == 0) {
+          for (uint j = 0; j < m->req(); j++) {
+            Node* in = m->in(j);
+            if (in != NULL) {
+              wq.push(in);
+            }
+          }
+          m->disconnect_inputs(NULL, this);
+        }
+      }
+    }
+    break;
+  }
   case Op_RangeCheck: {
     RangeCheckNode* rc = n->as_RangeCheck();
     Node* iff = new IfNode(rc->in(0), rc->in(1), rc->_prob, rc->_fcnt);
--- a/src/hotspot/share/opto/graphKit.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/opto/graphKit.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -1804,12 +1804,13 @@
 // A better answer would be to separate out card marks from other memory.
 // For now, return the input memory state, so that it can be reused
 // after the call, if this call has restricted memory effects.
-Node* GraphKit::set_predefined_input_for_runtime_call(SafePointNode* call) {
+Node* GraphKit::set_predefined_input_for_runtime_call(SafePointNode* call, Node* narrow_mem) {
   // Set fixed predefined input arguments
   Node* memory = reset_memory();
+  Node* m = narrow_mem == NULL ? memory : narrow_mem;
   call->init_req( TypeFunc::Control,   control()  );
   call->init_req( TypeFunc::I_O,       top()      ); // does no i/o
-  call->init_req( TypeFunc::Memory,    memory     ); // may gc ptrs
+  call->init_req( TypeFunc::Memory,    m          ); // may gc ptrs
   call->init_req( TypeFunc::FramePtr,  frameptr() );
   call->init_req( TypeFunc::ReturnAdr, top()      );
   return memory;
@@ -2465,9 +2466,7 @@
   } else {
     assert(!wide_out, "narrow in => narrow out");
     Node* narrow_mem = memory(adr_type);
-    prev_mem = reset_memory();
-    map()->set_memory(narrow_mem);
-    set_predefined_input_for_runtime_call(call);
+    prev_mem = set_predefined_input_for_runtime_call(call, narrow_mem);
   }
 
   // Hook each parm in order.  Stop looking at the first NULL.
--- a/src/hotspot/share/opto/graphKit.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/opto/graphKit.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -699,7 +699,7 @@
   void  set_predefined_output_for_runtime_call(Node* call,
                                                Node* keep_mem,
                                                const TypePtr* hook_mem);
-  Node* set_predefined_input_for_runtime_call(SafePointNode* call);
+  Node* set_predefined_input_for_runtime_call(SafePointNode* call, Node* narrow_mem = NULL);
 
   // Replace the call with the current state of the kit.  Requires
   // that the call was generated with separate io_projs so that
--- a/src/hotspot/share/opto/memnode.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/opto/memnode.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -3174,21 +3174,43 @@
 }
 
 MemBarNode* MemBarNode::trailing_membar() const {
+  ResourceMark rm;
   Node* trailing = (Node*)this;
   VectorSet seen(Thread::current()->resource_area());
-  while (!trailing->is_MemBar() || !trailing->as_MemBar()->trailing()) {
-    if (seen.test_set(trailing->_idx)) {
-      // Dying subgraph?
-      return NULL;
-    }
-    for (DUIterator_Fast jmax, j = trailing->fast_outs(jmax); j < jmax; j++) {
-      Node* next = trailing->fast_out(j);
-      if (next != trailing && next->is_CFG()) {
-        trailing = next;
+  Node_Stack multis(0);
+  do {
+    Node* c = trailing;
+    uint i = 0;
+    do {
+      trailing = NULL;
+      for (; i < c->outcnt(); i++) {
+        Node* next = c->raw_out(i);
+        if (next != c && next->is_CFG()) {
+          if (c->is_MultiBranch()) {
+            if (multis.node() == c) {
+              multis.set_index(i+1);
+            } else {
+              multis.push(c, i+1);
+            }
+          }
+          trailing = next;
+          break;
+        }
+      }
+      if (trailing != NULL && !seen.test_set(trailing->_idx)) {
         break;
       }
-    }
-  }
+      while (multis.size() > 0) {
+        c = multis.node();
+        i = multis.index();
+        if (i < c->req()) {
+          break;
+        }
+        multis.pop();
+      }
+    } while (multis.size() > 0);
+  } while (!trailing->is_MemBar() || !trailing->as_MemBar()->trailing());
+
   MemBarNode* mb = trailing->as_MemBar();
   assert((mb->_kind == TrailingStore && _kind == LeadingStore) ||
          (mb->_kind == TrailingLoadStore && _kind == LeadingLoadStore), "bad trailing membar");
@@ -3197,14 +3219,30 @@
 }
 
 MemBarNode* MemBarNode::leading_membar() const {
+  ResourceMark rm;
   VectorSet seen(Thread::current()->resource_area());
+  Node_Stack regions(0);
   Node* leading = in(0);
   while (leading != NULL && (!leading->is_MemBar() || !leading->as_MemBar()->leading())) {
-    if (seen.test_set(leading->_idx)) {
-      // Dying subgraph?
-      return NULL;
+    while (leading == NULL || leading->is_top() || seen.test_set(leading->_idx)) {
+      leading = NULL;
+      while (regions.size() > 0) {
+        Node* r = regions.node();
+        uint i = regions.index();
+        if (i < r->req()) {
+          leading = r->in(i);
+          regions.set_index(i+1);
+        } else {
+          regions.pop();
+        }
+      }
+      if (leading == NULL) {
+        assert(regions.size() == 0, "all paths should have been tried");
+        return NULL;
+      }
     }
     if (leading->is_Region()) {
+      regions.push(leading, 2);
       leading = leading->in(1);
     } else {
       leading = leading->in(0);
--- a/src/hotspot/share/opto/parse2.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/opto/parse2.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -1346,7 +1346,7 @@
     if (prob <= PROB_MIN)  prob_str = (prob == PROB_MIN) ? "min" : "never";
     char prob_str_buf[30];
     if (prob_str == NULL) {
-      sprintf(prob_str_buf, "%g", prob);
+      jio_snprintf(prob_str_buf, sizeof(prob_str_buf), "%20.2f", prob);
       prob_str = prob_str_buf;
     }
     C->log()->elem("branch target_bci='%d' taken='%d' not_taken='%d' cnt='%f' prob='%s'",
@@ -2854,7 +2854,7 @@
   IdealGraphPrinter *printer = C->printer();
   if (printer && printer->should_print(1)) {
     char buffer[256];
-    sprintf(buffer, "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
+    jio_snprintf(buffer, sizeof(buffer), "Bytecode %d: %s", bci(), Bytecodes::name(bc()));
     bool old = printer->traverse_outs();
     printer->set_traverse_outs(true);
     printer->print_method(buffer, 4);
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -470,7 +470,7 @@
 JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) {
   oop mirror = JNIHandles::resolve_external_guard(object);
   NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT);
-  *size_ptr = (jlong)mirror->size() * wordSize;
+  *size_ptr = (jlong)Universe::heap()->obj_size(mirror) * wordSize;
   return JVMTI_ERROR_NONE;
 } /* end GetObjectSize */
 
--- a/src/hotspot/share/prims/whitebox.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/prims/whitebox.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -372,7 +372,7 @@
 
 WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))
   oop p = JNIHandles::resolve(obj);
-  return p->size() * HeapWordSize;
+  return Universe::heap()->obj_size(p) * HeapWordSize;
 WB_END
 
 WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
--- a/src/hotspot/share/runtime/java.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/java.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -575,9 +575,6 @@
 }
 
 void vm_perform_shutdown_actions() {
-  // Warning: do not call 'exit_globals()' here. All threads are still running.
-  // Calling 'exit_globals()' will disable thread-local-storage and cause all
-  // kinds of assertions to trigger in debug mode.
   if (is_init_completed()) {
     Thread* thread = Thread::current_or_null();
     if (thread != NULL && thread->is_Java_thread()) {
--- a/src/hotspot/share/runtime/javaCalls.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/javaCalls.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -307,25 +307,26 @@
   JavaCalls::call_special(&void_result, klass,
                           vmSymbols::object_initializer_name(),
                           constructor_signature, args, CHECK_NH);
+  // Already returned a Null Handle if any exception is pending.
   return obj;
 }
 
 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, TRAPS) {
   JavaCallArguments args;
-  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, CHECK_NH);
+  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 }
 
 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, Handle arg1, TRAPS) {
   JavaCallArguments args;
   args.push_oop(arg1);
-  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, CHECK_NH);
+  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 }
 
 Handle JavaCalls::construct_new_instance(InstanceKlass* klass, Symbol* constructor_signature, Handle arg1, Handle arg2, TRAPS) {
   JavaCallArguments args;
   args.push_oop(arg1);
   args.push_oop(arg2);
-  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, CHECK_NH);
+  return JavaCalls::construct_new_instance(klass, constructor_signature, &args, THREAD);
 }
 
 // -------------------------------------------------
--- a/src/hotspot/share/runtime/reflection.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/reflection.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -750,10 +750,12 @@
   InnerClassesIterator iter(outer);
   constantPoolHandle cp   (THREAD, outer->constants());
   for (; !iter.done(); iter.next()) {
-     int ioff = iter.inner_class_info_index();
-     int ooff = iter.outer_class_info_index();
+    int ioff = iter.inner_class_info_index();
+    int ooff = iter.outer_class_info_index();
 
-     if (inner_is_member && ioff != 0 && ooff != 0) {
+    if (inner_is_member && ioff != 0 && ooff != 0) {
+      if (cp->klass_name_at_matches(outer, ooff) &&
+          cp->klass_name_at_matches(inner, ioff)) {
         Klass* o = cp->klass_at(ooff, CHECK);
         if (o == outer) {
           Klass* i = cp->klass_at(ioff, CHECK);
@@ -761,14 +763,16 @@
             return;
           }
         }
-     }
-     if (!inner_is_member && ioff != 0 && ooff == 0 &&
-         cp->klass_name_at_matches(inner, ioff)) {
-        Klass* i = cp->klass_at(ioff, CHECK);
-        if (i == inner) {
-          return;
-        }
-     }
+      }
+    }
+
+    if (!inner_is_member && ioff != 0 && ooff == 0 &&
+        cp->klass_name_at_matches(inner, ioff)) {
+      Klass* i = cp->klass_at(ioff, CHECK);
+      if (i == inner) {
+        return;
+      }
+    }
   }
 
   // 'inner' not declared as an inner klass in outer
--- a/src/hotspot/share/runtime/thread.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/thread.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -4212,10 +4212,10 @@
 //     <-- do not use anything that could get blocked by Safepoint -->
 //   + Disable tracing at JNI/JVM barriers
 //   + Set _vm_exited flag for threads that are still running native code
-//   + Delete this thread
 //   + Call exit_globals()
 //      > deletes tty
 //      > deletes PerfMemory resources
+//   + Delete this thread
 //   + Return to caller
 
 bool Threads::destroy_vm() {
@@ -4291,6 +4291,9 @@
 
   notify_vm_shutdown();
 
+  // exit_globals() will delete tty
+  exit_globals();
+
   // We are after VM_Exit::set_vm_exited() so we can't call
   // thread->smr_delete() or we will block on the Threads_lock.
   // Deleting the shutdown thread here is safe because another
@@ -4304,9 +4307,6 @@
   }
 #endif
 
-  // exit_globals() will delete tty
-  exit_globals();
-
   LogConfiguration::finalize();
 
   return true;
--- a/src/hotspot/share/runtime/threadHeapSampler.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -171,20 +171,3 @@
 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
   OrderAccess::release_store(&_sampling_interval, sampling_interval);
 }
-
-// Methods used in assertion mode to check if a collector is present or not at
-// the moment of TLAB sampling, ie a slow allocation path.
-bool ThreadHeapSampler::sampling_collector_present() const {
-  return _collectors_present > 0;
-}
-
-bool ThreadHeapSampler::remove_sampling_collector() {
-  assert(_collectors_present > 0, "Problem with collector counter.");
-  _collectors_present--;
-  return true;
-}
-
-bool ThreadHeapSampler::add_sampling_collector() {
-  _collectors_present++;
-  return true;
-}
--- a/src/hotspot/share/runtime/threadHeapSampler.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -39,10 +39,6 @@
   static int _enabled;
   static int _sampling_interval;
 
-  // Used for assertion mode to determine if there is a path to a TLAB slow path
-  // without a collector present.
-  size_t _collectors_present;
-
   static void init_log_table();
 
  public:
@@ -51,8 +47,6 @@
     if (_rnd == 0) {
       _rnd = 1;
     }
-
-    _collectors_present = 0;
   }
 
   size_t bytes_until_sample()                    { return _bytes_until_sample;   }
@@ -66,10 +60,6 @@
 
   static void set_sampling_interval(int sampling_interval);
   static int get_sampling_interval();
-
-  bool sampling_collector_present() const;
-  bool remove_sampling_collector();
-  bool add_sampling_collector();
 };
 
 #endif // SHARE_RUNTIME_THREADHEAPSAMPLER_HPP
--- a/src/hotspot/share/runtime/vm_version.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/runtime/vm_version.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -218,10 +218,16 @@
         #define HOTSPOT_BUILD_COMPILER "MS VC++ 12.0 (VS2013)"
       #elif _MSC_VER == 1900
         #define HOTSPOT_BUILD_COMPILER "MS VC++ 14.0 (VS2015)"
+      #elif _MSC_VER == 1911
+        #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.3 (VS2017)"
       #elif _MSC_VER == 1912
         #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.5 (VS2017)"
       #elif _MSC_VER == 1913
         #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.6 (VS2017)"
+      #elif _MSC_VER == 1914
+        #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.7 (VS2017)"
+      #elif _MSC_VER == 1915
+        #define HOTSPOT_BUILD_COMPILER "MS VC++ 15.8 (VS2017)"
       #else
         #define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER)
       #endif
--- a/src/hotspot/share/services/management.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/services/management.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -178,7 +178,7 @@
 
 InstanceKlass* Management::load_and_initialize_klass(Symbol* sh, TRAPS) {
   Klass* k = SystemDictionary::resolve_or_fail(sh, true, CHECK_NULL);
-  return initialize_klass(k, CHECK_NULL);
+  return initialize_klass(k, THREAD);
 }
 
 InstanceKlass* Management::load_and_initialize_klass_or_null(Symbol* sh, TRAPS) {
@@ -186,7 +186,7 @@
   if (k == NULL) {
      return NULL;
   }
-  return initialize_klass(k, CHECK_NULL);
+  return initialize_klass(k, THREAD);
 }
 
 InstanceKlass* Management::initialize_klass(Klass* k, TRAPS) {
--- a/src/hotspot/share/utilities/exceptions.hpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/hotspot/share/utilities/exceptions.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -211,7 +211,7 @@
 //
 // CAUTION: make sure that the function call using a CHECK macro is not the only statement of a
 // conditional branch w/o enclosing {} braces, since the CHECK macros expand into several state-
-// ments!
+// ments! Also make sure it is not used on a function call that is part of a return statement!
 
 #define PENDING_EXCEPTION                        (((ThreadShadow*)THREAD)->pending_exception())
 #define HAS_PENDING_EXCEPTION                    (((ThreadShadow*)THREAD)->has_pending_exception())
--- a/src/java.base/share/classes/java/lang/SecurityManager.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/lang/SecurityManager.java	Thu Oct 11 20:58:37 2018 -0400
@@ -28,7 +28,6 @@
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.module.ModuleReference;
 import java.lang.reflect.Member;
 import java.io.FileDescriptor;
 import java.io.File;
@@ -47,9 +46,7 @@
 import java.util.PropertyPermission;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 
-import jdk.internal.module.ModuleBootstrap;
 import jdk.internal.module.ModuleLoaderMap;
 import jdk.internal.reflect.CallerSensitive;
 import sun.security.util.SecurityConstants;
@@ -81,10 +78,100 @@
  * throws a <code>SecurityException</code> if the operation is not
  * permitted.
  * <p>
- * The current security manager is set by the
- * <code>setSecurityManager</code> method in class
- * <code>System</code>. The current security manager is obtained
- * by the <code>getSecurityManager</code> method.
+ * Environments using a security manager will typically set the security
+ * manager at startup. In the JDK implementation, this is done by setting
+ * the system property {@code java.security.manager} on the command line to
+ * the class name of the security manager. It can also be set to the empty
+ * String ("") or the special token "{@code default}" to use the
+ * default {@code java.lang.SecurityManager}. If a class name is specified,
+ * it must be {@code java.lang.SecurityManager} or a public subclass and have
+ * a public no-arg constructor. The class is loaded by the
+ * {@linkplain ClassLoader#getSystemClassLoader() built-in system class loader}
+ * if it is not {@code java.lang.SecurityManager}. If the
+ * {@code java.security.manager} system property is not set, the default value
+ * is {@code null}, which means a security manager will not be set at startup.
+ * <p>
+ * The Java run-time may also allow, but is not required to allow, the security
+ * manager to be set dynamically by invoking the
+ * {@link System#setSecurityManager(SecurityManager) setSecurityManager} method.
+ * In the JDK implementation, if the Java virtual machine is started with
+ * the {@code java.security.manager} system property set to the special token
+ * "{@code disallow}" then a security manager will not be set at startup and
+ * cannot be set dynamically (the
+ * {@link System#setSecurityManager(SecurityManager) setSecurityManager}
+ * method will throw an {@code UnsupportedOperationException}). If the
+ * {@code java.security.manager} system property is not set or is set to the
+ * special token "{@code allow}", then a security manager will not be set at
+ * startup but can be set dynamically. Finally, if the
+ * {@code java.security.manager} system property is set to the class name of
+ * the security manager, or to the empty String ("") or the special token
+ * "{@code default}", then a security manager is set at startup (as described
+ * previously) and can also be subsequently replaced (or disabled) dynamically
+ * (subject to the policy of the currently installed security manager). The
+ * following table illustrates the behavior of the JDK implementation for the
+ * different settings of the {@code java.security.manager} system property:
+ * <table class="striped">
+ * <caption style="display:none">property value,
+ *  the SecurityManager set at startup,
+ *  can dynamically set a SecurityManager
+ * </caption>
+ * <thead>
+ * <tr>
+ * <th scope="col">Property Value</th>
+ * <th scope="col">The SecurityManager set at startup</th>
+ * <th scope="col">System.setSecurityManager run-time behavior</th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ *
+ * <tr>
+ *   <th scope="row">null</th>
+ *   <td>None</td>
+ *   <td>Success or throws {@code SecurityException} if not permitted by
+ * the currently installed security manager</td>
+ * </tr>
+ *
+ * <tr>
+ *   <th scope="row">empty String ("")</th>
+ *   <td>{@code java.lang.SecurityManager}</td>
+ *   <td>Success or throws {@code SecurityException} if not permitted by
+ * the currently installed security manager</td>
+ * </tr>
+ *
+ * <tr>
+ *   <th scope="row">"default"</th>
+ *   <td>{@code java.lang.SecurityManager}</td>
+ *   <td>Success or throws {@code SecurityException} if not permitted by
+ * the currently installed security manager</td>
+ * </tr>
+ *
+ * <tr>
+ *   <th scope="row">"disallow"</th>
+ *   <td>None</td>
+ *   <td>Always throws {@code UnsupportedOperationException}</td>
+ * </tr>
+ *
+ * <tr>
+ *   <th scope="row">"allow"</th>
+ *   <td>None</td>
+ *   <td>Success or throws {@code SecurityException} if not permitted by
+ * the currently installed security manager</td>
+ * </tr>
+ *
+ * <tr>
+ *   <th scope="row">a class name</th>
+ *   <td>the named class</td>
+ *   <td>Success or throws {@code SecurityException} if not permitted by
+ * the currently installed security manager</td>
+ * </tr>
+ *
+ * </tbody>
+ * </table>
+ * <p> A future release of the JDK may change the default value of the
+ * {@code java.security.manager} system property to "{@code disallow}".
+ * <p>
+ * The current security manager is returned by the
+ * {@link System#getSecurityManager() getSecurityManager} method.
  * <p>
  * The special method
  * {@link SecurityManager#checkPermission(java.security.Permission)}
@@ -221,7 +308,6 @@
  * @see     java.net.SocketPermission
  * @see     java.util.PropertyPermission
  * @see     java.lang.RuntimePermission
- * @see     java.awt.AWTPermission
  * @see     java.security.Policy Policy
  * @see     java.security.SecurityPermission SecurityPermission
  * @see     java.security.ProtectionDomain
--- a/src/java.base/share/classes/java/lang/System.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/lang/System.java	Thu Oct 11 20:58:37 2018 -0400
@@ -72,6 +72,7 @@
 import jdk.internal.logger.LoggerFinderLoader;
 import jdk.internal.logger.LazyLoggers;
 import jdk.internal.logger.LocalizedLoggerWrapper;
+import jdk.internal.vm.annotation.Stable;
 import sun.reflect.annotation.AnnotationType;
 import sun.nio.ch.Interruptible;
 import sun.security.util.SecurityConstants;
@@ -154,9 +155,18 @@
      */
     public static final PrintStream err = null;
 
-    /* The security manager for the system.
-     */
-    private static volatile SecurityManager security;
+    // indicates if a security manager is possible
+    private static final int NEVER = 1;
+    private static final int MAYBE = 2;
+    private static @Stable int allowSecurityManager;
+
+    // current security manager
+    private static volatile SecurityManager security;   // read by VM
+
+    // return true if a security manager is allowed
+    private static boolean allowSecurityManager() {
+        return (allowSecurityManager != NEVER);
+    }
 
     /**
      * Reassigns the "standard" input stream.
@@ -231,6 +241,7 @@
     }
 
     private static volatile Console cons;
+
     /**
      * Returns the unique {@link java.io.Console Console} object associated
      * with the current Java virtual machine, if any.
@@ -292,7 +303,7 @@
     private static native void setErr0(PrintStream err);
 
     /**
-     * Sets the System security.
+     * Sets the system-wide security manager.
      *
      * If there is a security manager already installed, this method first
      * calls the security manager's {@code checkPermission} method
@@ -306,27 +317,46 @@
      * security manager has been established, then no action is taken and
      * the method simply returns.
      *
-     * @param      s   the security manager.
-     * @throws     SecurityException  if the security manager has already
-     *             been set and its {@code checkPermission} method
-     *             doesn't allow it to be replaced.
+     * @implNote In the JDK implementation, if the Java virtual machine is
+     * started with the system property {@code java.security.manager} set to
+     * the special token "{@code disallow}" then the {@code setSecurityManager}
+     * method cannot be used to set a security manager.
+     *
+     * @param  sm the security manager or {@code null}
+     * @throws SecurityException
+     *         if the security manager has already been set and its {@code
+     *         checkPermission} method doesn't allow it to be replaced
+     * @throws UnsupportedOperationException
+     *         if {@code sm} is non-null and a security manager is not allowed
+     *         to be set dynamically
      * @see #getSecurityManager
      * @see SecurityManager#checkPermission
      * @see java.lang.RuntimePermission
      */
-    public static void setSecurityManager(final SecurityManager s) {
-        if (security == null) {
-            // ensure image reader is initialized
-            Object.class.getResource("java/lang/ANY");
-        }
-        if (s != null) {
-            try {
-                s.checkPackageAccess("java.lang");
-            } catch (Exception e) {
-                // no-op
+    public static void setSecurityManager(SecurityManager sm) {
+        if (allowSecurityManager()) {
+            if (security == null) {
+                // ensure image reader is initialized
+                Object.class.getResource("java/lang/ANY");
+            }
+            if (sm != null) {
+                try {
+                    // pre-populates the SecurityManager.packageAccess cache
+                    // to avoid recursive permission checking issues with custom
+                    // SecurityManager implementations
+                    sm.checkPackageAccess("java.lang");
+                } catch (Exception e) {
+                    // no-op
+                }
+            }
+            setSecurityManager0(sm);
+        } else {
+            // security manager not allowed
+            if (sm != null) {
+                throw new UnsupportedOperationException(
+                    "Runtime configured to disallow security manager");
             }
         }
-        setSecurityManager0(s);
     }
 
     private static synchronized
@@ -335,13 +365,12 @@
         if (sm != null) {
             // ask the currently installed security manager if we
             // can replace it.
-            sm.checkPermission(new RuntimePermission
-                                     ("setSecurityManager"));
+            sm.checkPermission(new RuntimePermission("setSecurityManager"));
         }
 
         if ((s != null) && (s.getClass().getClassLoader() != null)) {
             // New security manager class is not on bootstrap classpath.
-            // Cause policy to get initialized before we install the new
+            // Force policy to get initialized before we install the new
             // security manager, in order to prevent infinite loops when
             // trying to initialize the policy (which usually involves
             // accessing some security and/or system properties, which in turn
@@ -361,7 +390,7 @@
     }
 
     /**
-     * Gets the system security interface.
+     * Gets the system-wide security manager.
      *
      * @return  if a security manager has already been established for the
      *          current application, then that security manager is returned;
@@ -369,7 +398,11 @@
      * @see     #setSecurityManager
      */
     public static SecurityManager getSecurityManager() {
-        return security;
+        if (allowSecurityManager()) {
+            return security;
+        } else {
+            return null;
+        }
     }
 
     /**
@@ -2028,35 +2061,48 @@
      * 3. set TCCL
      *
      * This method must be called after the module system initialization.
-     * The security manager and system class loader may be custom class from
+     * The security manager and system class loader may be a custom class from
      * the application classpath or modulepath.
      */
     private static void initPhase3() {
-        // set security manager
-        String cn = System.getProperty("java.security.manager");
-        if (cn != null) {
-            if (cn.isEmpty() || "default".equals(cn)) {
-                System.setSecurityManager(new SecurityManager());
-            } else {
-                try {
-                    Class<?> c = Class.forName(cn, false, ClassLoader.getBuiltinAppClassLoader());
-                    Constructor<?> ctor = c.getConstructor();
-                    // Must be a public subclass of SecurityManager with
-                    // a public no-arg constructor
-                    if (!SecurityManager.class.isAssignableFrom(c) ||
+        String smProp = System.getProperty("java.security.manager");
+        if (smProp != null) {
+            switch (smProp) {
+                case "disallow":
+                    allowSecurityManager = NEVER;
+                    break;
+                case "allow":
+                    allowSecurityManager = MAYBE;
+                    break;
+                case "":
+                case "default":
+                    setSecurityManager(new SecurityManager());
+                    allowSecurityManager = MAYBE;
+                    break;
+                default:
+                    try {
+                        ClassLoader cl = ClassLoader.getBuiltinAppClassLoader();
+                        Class<?> c = Class.forName(smProp, false, cl);
+                        Constructor<?> ctor = c.getConstructor();
+                        // Must be a public subclass of SecurityManager with
+                        // a public no-arg constructor
+                        if (!SecurityManager.class.isAssignableFrom(c) ||
                             !Modifier.isPublic(c.getModifiers()) ||
                             !Modifier.isPublic(ctor.getModifiers())) {
-                        throw new Error("Could not create SecurityManager: " + ctor.toString());
+                            throw new Error("Could not create SecurityManager: "
+                                             + ctor.toString());
+                        }
+                        // custom security manager may be in non-exported package
+                        ctor.setAccessible(true);
+                        SecurityManager sm = (SecurityManager) ctor.newInstance();
+                        setSecurityManager(sm);
+                    } catch (Exception e) {
+                        throw new InternalError("Could not create SecurityManager", e);
                     }
-                    // custom security manager implementation may be in unnamed module
-                    // or a named module but non-exported package
-                    ctor.setAccessible(true);
-                    SecurityManager sm = (SecurityManager) ctor.newInstance();
-                    System.setSecurityManager(sm);
-                } catch (Exception e) {
-                    throw new Error("Could not create SecurityManager", e);
-                }
+                    allowSecurityManager = MAYBE;
             }
+        } else {
+            allowSecurityManager = MAYBE;
         }
 
         // initializing the system class loader
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Thu Oct 11 20:58:37 2018 -0400
@@ -969,9 +969,6 @@
             ProtectionDomain pd = (loader != null) ? lookupClassProtectionDomain() : null;
             String source = "__Lookup_defineClass__";
             Class<?> clazz = SharedSecrets.getJavaLangAccess().defineClass(loader, cn, bytes, pd, source);
-            assert clazz.getClassLoader() == lookupClass.getClassLoader()
-                    && clazz.getPackageName().equals(lookupClass.getPackageName())
-                    && protectionDomain(clazz) == lookupClassProtectionDomain();
             return clazz;
         }
 
--- a/src/java.base/share/classes/java/math/BigInteger.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/math/BigInteger.java	Thu Oct 11 20:58:37 2018 -0400
@@ -41,6 +41,7 @@
 import jdk.internal.math.DoubleConsts;
 import jdk.internal.math.FloatConsts;
 import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.vm.annotation.Stable;
 
 /**
  * Immutable arbitrary-precision integers.  All operations behave as if
@@ -1219,8 +1220,10 @@
      * Initialize static constant array when class is loaded.
      */
     private static final int MAX_CONSTANT = 16;
-    private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1];
-    private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1];
+    @Stable
+    private static final BigInteger[] posConst = new BigInteger[MAX_CONSTANT+1];
+    @Stable
+    private static final BigInteger[] negConst = new BigInteger[MAX_CONSTANT+1];
 
     /**
      * The cache of powers of each radix.  This allows us to not have to
--- a/src/java.base/share/classes/java/time/Duration.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/Duration.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1519,7 +1519,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);  // identifies a Duration
--- a/src/java.base/share/classes/java/time/Instant.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/Instant.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1332,7 +1332,7 @@
     // -----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(2);  // identifies an Instant
--- a/src/java.base/share/classes/java/time/LocalDate.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/LocalDate.java	Thu Oct 11 20:58:37 2018 -0400
@@ -2189,7 +2189,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(3);  // identifies a LocalDate
--- a/src/java.base/share/classes/java/time/LocalDateTime.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/LocalDateTime.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1975,12 +1975,12 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(5);  // identifies a LocalDateTime
-     *  // the <a href="../../serialized-form.html#java.time.LocalDate">date</a> excluding the one byte header
-     *  // the <a href="../../serialized-form.html#java.time.LocalTime">time</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.LocalDate">date</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.LocalTime">time</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
--- a/src/java.base/share/classes/java/time/LocalTime.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/LocalTime.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1645,7 +1645,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * A twos-complement value indicates the remaining values are not in the stream
      * and should be set to zero.
--- a/src/java.base/share/classes/java/time/MonthDay.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/MonthDay.java	Thu Oct 11 20:58:37 2018 -0400
@@ -754,7 +754,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(13);  // identifies a MonthDay
--- a/src/java.base/share/classes/java/time/OffsetDateTime.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/OffsetDateTime.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1915,12 +1915,12 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(10);  // identifies an OffsetDateTime
-     *  // the <a href="../../serialized-form.html#java.time.LocalDateTime">datetime</a> excluding the one byte header
-     *  // the <a href="../../serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.LocalDateTime">datetime</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
--- a/src/java.base/share/classes/java/time/OffsetTime.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/OffsetTime.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1400,12 +1400,12 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(9);  // identifies an OffsetTime
-     *  // the <a href="../../serialized-form.html#java.time.LocalTime">time</a> excluding the one byte header
-     *  // the <a href="../../serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.LocalTime">time</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
--- a/src/java.base/share/classes/java/time/Period.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/Period.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1041,7 +1041,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(14);  // identifies a Period
--- a/src/java.base/share/classes/java/time/Ser.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/Ser.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -139,20 +139,20 @@
      * in the stream.  Refer to each class {@code writeReplace}
      * serialized form for the value of the type and sequence of values for the type.
      * <ul>
-     * <li><a href="../../serialized-form.html#java.time.Duration">Duration.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.Instant">Instant.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.LocalDate">LocalDate.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.LocalDateTime">LocalDateTime.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.LocalTime">LocalTime.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.MonthDay">MonthDay.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.OffsetTime">OffsetTime.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.OffsetDateTime">OffsetDateTime.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.Period">Period.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.Year">Year.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.YearMonth">YearMonth.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.ZoneId">ZoneId.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.ZoneOffset">ZoneOffset.writeReplace</a>
-     * <li><a href="../../serialized-form.html#java.time.ZonedDateTime">ZonedDateTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Duration">Duration.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Instant">Instant.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalDate">LocalDate.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalDateTime">LocalDateTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalTime">LocalTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.MonthDay">MonthDay.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.OffsetTime">OffsetTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.OffsetDateTime">OffsetDateTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Period">Period.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Year">Year.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.YearMonth">YearMonth.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZoneId">ZoneId.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZoneOffset">ZoneOffset.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZonedDateTime">ZonedDateTime.writeReplace</a>
      * </ul>
      *
      * @param out  the data stream to write to, not null
@@ -223,20 +223,20 @@
      * {@code Ser} object.
      *
      * <ul>
-     * <li><a href="../../serialized-form.html#java.time.Duration">Duration</a> - {@code Duration.ofSeconds(seconds, nanos);}
-     * <li><a href="../../serialized-form.html#java.time.Instant">Instant</a> - {@code Instant.ofEpochSecond(seconds, nanos);}
-     * <li><a href="../../serialized-form.html#java.time.LocalDate">LocalDate</a> - {@code LocalDate.of(year, month, day);}
-     * <li><a href="../../serialized-form.html#java.time.LocalDateTime">LocalDateTime</a> - {@code LocalDateTime.of(date, time);}
-     * <li><a href="../../serialized-form.html#java.time.LocalTime">LocalTime</a> - {@code LocalTime.of(hour, minute, second, nano);}
-     * <li><a href="../../serialized-form.html#java.time.MonthDay">MonthDay</a> - {@code MonthDay.of(month, day);}
-     * <li><a href="../../serialized-form.html#java.time.OffsetTime">OffsetTime</a> - {@code OffsetTime.of(time, offset);}
-     * <li><a href="../../serialized-form.html#java.time.OffsetDateTime">OffsetDateTime</a> - {@code OffsetDateTime.of(dateTime, offset);}
-     * <li><a href="../../serialized-form.html#java.time.Period">Period</a> - {@code Period.of(years, months, days);}
-     * <li><a href="../../serialized-form.html#java.time.Year">Year</a> - {@code Year.of(year);}
-     * <li><a href="../../serialized-form.html#java.time.YearMonth">YearMonth</a> - {@code YearMonth.of(year, month);}
-     * <li><a href="../../serialized-form.html#java.time.ZonedDateTime">ZonedDateTime</a> - {@code ZonedDateTime.ofLenient(dateTime, offset, zone);}
-     * <li><a href="../../serialized-form.html#java.time.ZoneId">ZoneId</a> - {@code ZoneId.of(id);}
-     * <li><a href="../../serialized-form.html#java.time.ZoneOffset">ZoneOffset</a> - {@code (offsetByte == 127 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(offsetByte * 900));}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Duration">Duration</a> - {@code Duration.ofSeconds(seconds, nanos);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Instant">Instant</a> - {@code Instant.ofEpochSecond(seconds, nanos);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalDate">LocalDate</a> - {@code LocalDate.of(year, month, day);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalDateTime">LocalDateTime</a> - {@code LocalDateTime.of(date, time);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.LocalTime">LocalTime</a> - {@code LocalTime.of(hour, minute, second, nano);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.MonthDay">MonthDay</a> - {@code MonthDay.of(month, day);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.OffsetTime">OffsetTime</a> - {@code OffsetTime.of(time, offset);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.OffsetDateTime">OffsetDateTime</a> - {@code OffsetDateTime.of(dateTime, offset);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Period">Period</a> - {@code Period.of(years, months, days);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.Year">Year</a> - {@code Year.of(year);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.YearMonth">YearMonth</a> - {@code YearMonth.of(year, month);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZonedDateTime">ZonedDateTime</a> - {@code ZonedDateTime.ofLenient(dateTime, offset, zone);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZoneId">ZoneId</a> - {@code ZoneId.of(id);}
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.ZoneOffset">ZoneOffset</a> - {@code (offsetByte == 127 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(offsetByte * 900));}
      * </ul>
      *
      * @param in  the data to read, not null
--- a/src/java.base/share/classes/java/time/Year.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/Year.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1088,7 +1088,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(11);  // identifies a Year
--- a/src/java.base/share/classes/java/time/YearMonth.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/YearMonth.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1212,7 +1212,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(12);  // identifies a YearMonth
--- a/src/java.base/share/classes/java/time/ZoneId.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/ZoneId.java	Thu Oct 11 20:58:37 2018 -0400
@@ -641,7 +641,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(7);  // identifies a ZoneId (not ZoneOffset)
--- a/src/java.base/share/classes/java/time/ZoneOffset.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/ZoneOffset.java	Thu Oct 11 20:58:37 2018 -0400
@@ -750,7 +750,7 @@
     // -----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(8);                  // identifies a ZoneOffset
--- a/src/java.base/share/classes/java/time/ZoneRegion.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/ZoneRegion.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -180,7 +180,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(7);  // identifies a ZoneId (not ZoneOffset)
--- a/src/java.base/share/classes/java/time/ZonedDateTime.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/ZonedDateTime.java	Thu Oct 11 20:58:37 2018 -0400
@@ -2224,13 +2224,13 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(6);  // identifies a ZonedDateTime
-     *  // the <a href="../../serialized-form.html#java.time.LocalDateTime">dateTime</a> excluding the one byte header
-     *  // the <a href="../../serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
-     *  // the <a href="../../serialized-form.html#java.time.ZoneId">zone ID</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.LocalDateTime">dateTime</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.ZoneOffset">offset</a> excluding the one byte header
+     *  // the <a href="{@docRoot}/serialized-form.html#java.time.ZoneId">zone ID</a> excluding the one byte header
      * </pre>
      *
      * @return the instance of {@code Ser}, not null
--- a/src/java.base/share/classes/java/time/chrono/AbstractChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/AbstractChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -721,7 +721,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * <pre>
      *  out.writeByte(1);  // identifies this as a Chronology
      *  out.writeUTF(getId());
--- a/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -399,7 +399,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the ChronoLocalDateTime using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(2);              // identifies a ChronoLocalDateTime
--- a/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -355,7 +355,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * <pre>
      *  out.writeByte(12);  // identifies this as a ChronoPeriodImpl
      *  out.writeUTF(getId());  // the chronology
--- a/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -322,7 +322,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the ChronoZonedDateTime using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(3);                  // identifies a ChronoZonedDateTime
--- a/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/HijrahChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -1011,7 +1011,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);     // identifies a Chronology
--- a/src/java.base/share/classes/java/time/chrono/HijrahDate.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/HijrahDate.java	Thu Oct 11 20:58:37 2018 -0400
@@ -663,7 +663,7 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(6);                 // identifies a HijrahDate
--- a/src/java.base/share/classes/java/time/chrono/IsoChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/IsoChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -680,7 +680,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);     // identifies a Chronology
--- a/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -507,7 +507,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);     // identifies a Chronology
--- a/src/java.base/share/classes/java/time/chrono/JapaneseDate.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseDate.java	Thu Oct 11 20:58:37 2018 -0400
@@ -725,7 +725,7 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(4);                 // identifies a JapaneseDate
--- a/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/JapaneseEra.java	Thu Oct 11 20:58:37 2018 -0400
@@ -395,7 +395,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(5);        // identifies a JapaneseEra
--- a/src/java.base/share/classes/java/time/chrono/MinguoChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/MinguoChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -337,7 +337,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);     // identifies a Chronology
--- a/src/java.base/share/classes/java/time/chrono/MinguoDate.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/MinguoDate.java	Thu Oct 11 20:58:37 2018 -0400
@@ -487,7 +487,7 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(8);                 // identifies a MinguoDate
--- a/src/java.base/share/classes/java/time/chrono/Ser.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/Ser.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -136,18 +136,18 @@
      * in the stream.  Refer to each class {@code writeReplace}
      * serialized form for the value of the type and sequence of values for the type.
      * <ul>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.IsoChronology">IsoChronology.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahDate">HijrahDate.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoDate">MinguoDate.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.IsoChronology">IsoChronology.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahDate">HijrahDate.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoDate">MinguoDate.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate.writeReplace</a>
      * </ul>
      *
      * @param out  the data stream to write to, not null
@@ -202,18 +202,18 @@
      * {@code Ser} object.
      *
      * <ul>
-     * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology</a> - Chronology.of(id)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.IsoChronology">IsoChronology</a> - Chronology.of(id)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology</a> - Chronology.of(id)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology</a> - Chronology.of(id)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology</a> - Chronology.of(id)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime</a> - date.atTime(time)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime</a> - dateTime.atZone(offset).withZoneSameLocal(zone)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate</a> - JapaneseChronology.INSTANCE.date(year, month, dayOfMonth)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra</a> - JapaneseEra.of(eraValue)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahDate">HijrahDate</a> - HijrahChronology chrono.date(year, month, dayOfMonth)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoDate">MinguoDate</a> - MinguoChronology.INSTANCE.date(year, month, dayOfMonth)
-     * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate</a> - ThaiBuddhistChronology.INSTANCE.date(year, month, dayOfMonth)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology</a> - Chronology.of(id)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.IsoChronology">IsoChronology</a> - Chronology.of(id)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology</a> - Chronology.of(id)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology</a> - Chronology.of(id)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology</a> - Chronology.of(id)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime</a> - date.atTime(time)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime</a> - dateTime.atZone(offset).withZoneSameLocal(zone)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate</a> - JapaneseChronology.INSTANCE.date(year, month, dayOfMonth)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra</a> - JapaneseEra.of(eraValue)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahDate">HijrahDate</a> - HijrahChronology chrono.date(year, month, dayOfMonth)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoDate">MinguoDate</a> - MinguoChronology.INSTANCE.date(year, month, dayOfMonth)
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate</a> - ThaiBuddhistChronology.INSTANCE.date(year, month, dayOfMonth)
      * </ul>
      *
      * @param in  the data stream to read from, not null
--- a/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -374,7 +374,7 @@
     //-----------------------------------------------------------------------
     /**
      * Writes the Chronology using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(1);     // identifies a Chronology
--- a/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java	Thu Oct 11 20:58:37 2018 -0400
@@ -487,7 +487,7 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre>
      *  out.writeByte(10);                // identifies a ThaiBuddhistDate
--- a/src/java.base/share/classes/java/time/zone/Ser.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/zone/Ser.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -125,9 +125,9 @@
      * serialized form for the value of the type and sequence of values for the type.
      *
      * <ul>
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition.writeReplace</a>
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition.writeReplace</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule.writeReplace</a>
      * </ul>
      *
      * @param out  the data stream to write to, not null
@@ -168,11 +168,11 @@
      * {@code Ser} object.
      *
      * <ul>
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneRules">ZoneRules</a>
      * - {@code ZoneRules.of(standardTransitions, standardOffsets, savingsInstantTransitions, wallOffsets, lastRules);}
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition</a>
      * - {@code ZoneOffsetTransition of(LocalDateTime.ofEpochSecond(epochSecond), offsetBefore, offsetAfter);}
-     * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule</a>
+     * <li><a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule</a>
      * - {@code ZoneOffsetTransitionRule.of(month, dom, dow, time, timeEndOfDay, timeDefinition, standardOffset, offsetBefore, offsetAfter);}
      * </ul>
      * @param in  the data to read, not null
--- a/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -190,10 +190,10 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
      * @serialData
      * Refer to the serialized form of
-     * <a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
+     * <a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
      * for the encoding of epoch seconds and offsets.
      * <pre style="font-size:1.0em">{@code
      *
--- a/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -249,10 +249,10 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
      * @serialData
      * Refer to the serialized form of
-     * <a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
+     * <a href="{@docRoot}/serialized-form.html#java.time.zone.ZoneRules">ZoneRules.writeReplace</a>
      * for the encoding of epoch seconds and offsets.
      * <pre style="font-size:1.0em">{@code
      *
--- a/src/java.base/share/classes/java/time/zone/ZoneRules.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/time/zone/ZoneRules.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -327,7 +327,7 @@
 
     /**
      * Writes the object using a
-     * <a href="../../../serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
+     * <a href="{@docRoot}/serialized-form.html#java.time.zone.Ser">dedicated serialized form</a>.
      * @serialData
      * <pre style="font-size:1.0em">{@code
      *
--- a/src/java.base/share/classes/java/util/regex/Pattern.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/java/util/regex/Pattern.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1433,10 +1433,10 @@
 
     /**
      * The pattern is converted to normalized form ({@link
-     * java.text.Normalizer.Form.NFC NFC}, canonical decomposition,
+     * java.text.Normalizer.Form#NFC NFC}, canonical decomposition,
      * followed by canonical composition for the character class
-     * part, and {@link java.text.Normalizer.Form.NFD NFD},
-     * canonical decomposition) for the rest), and then a pure
+     * part, and {@link java.text.Normalizer.Form#NFD NFD},
+     * canonical decomposition for the rest), and then a pure
      * group is constructed to match canonical equivalences of the
      * characters.
      */
--- a/src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/classes/sun/reflect/annotation/AnnotatedTypeFactory.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -31,6 +31,8 @@
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
+import java.util.StringJoiner;
 
 import static sun.reflect.annotation.TypeAnnotation.*;
 
@@ -202,6 +204,68 @@
 
         }
 
+        @Override // java.lang.Object
+        public String toString() {
+            // Reusable toString implementation, but needs to be
+            // specialized for quirks of arrays.
+            return annotationsToString(getAnnotations(), false) + type.toString();
+        }
+
+        protected String annotationsToString(Annotation[] annotations, boolean leadingSpace) {
+            if (annotations != null && annotations.length > 0) {
+                StringJoiner sj = new StringJoiner(" ");
+                if (leadingSpace) {
+                    sj.add(""); // Add a space
+                }
+
+                for (Annotation annotation : annotations) {
+                    sj.add(annotation.toString());
+                }
+
+                if (!leadingSpace) {
+                    sj.add("");
+                }
+                return sj.toString();
+            } else {
+                return "";
+            }
+        }
+
+        protected boolean equalsTypeAndAnnotations(AnnotatedType that) {
+            return getType().equals(that.getType()) &&
+                // Treat ordering of annotations as significant
+                Arrays.equals(getAnnotations(), that.getAnnotations()) &&
+                Objects.equals(getAnnotatedOwnerType(), that.getAnnotatedOwnerType());
+        }
+
+        int baseHashCode() {
+            return type.hashCode() ^
+                // Acceptable to use Objects.hash rather than
+                // Arrays.deepHashCode since the elements of the array
+                // are not themselves arrays.
+                Objects.hash((Object[])getAnnotations()) ^
+                Objects.hash(getAnnotatedOwnerType());
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof AnnotatedType &&
+                !(o instanceof AnnotatedArrayType) &&
+                !(o instanceof AnnotatedTypeVariable) &&
+                !(o instanceof AnnotatedParameterizedType) &&
+                !(o instanceof AnnotatedWildcardType)) {
+                AnnotatedType that = (AnnotatedType) o;
+                return equalsTypeAndAnnotations(that);
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return baseHashCode();
+        }
+
         // Implementation details
         final LocationInfo getLocation() {
             return location;
@@ -244,6 +308,52 @@
             }
             return ((GenericArrayType)t).getGenericComponentType();
         }
+
+        @Override
+        public String toString() {
+            // To annotate the full type of an array, the annotations
+            // are placed between the type and the brackets. For
+            // example, to annotate an array of Strings, the syntax used is
+            //
+            // String @TypeAnnotation []
+            //
+            // and *not*
+            //
+            // @TypeAnnotation String[].
+            //
+            // The toString output should strive to be reusable in
+            // source code. Therefore, the general logic of putting
+            // the annotations before a textual representation of the
+            // type need to be overridden for arrays.
+            StringBuilder sb = new StringBuilder();
+
+            AnnotatedType componentType = this;
+            while (componentType instanceof AnnotatedArrayType) {
+                AnnotatedArrayType annotatedArrayType = (AnnotatedArrayType) componentType;
+                sb.append(annotationsToString(annotatedArrayType.getAnnotations(), true) + "[]");
+                componentType = annotatedArrayType.getAnnotatedGenericComponentType();
+            }
+
+            sb.insert(0, componentType.toString());
+            return sb.toString();
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof AnnotatedArrayType) {
+                AnnotatedArrayType that = (AnnotatedArrayType) o;
+                return equalsTypeAndAnnotations(that) &&
+                    Objects.equals(getAnnotatedGenericComponentType(),
+                                   that.getAnnotatedGenericComponentType());
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return baseHashCode() ^ getAnnotatedGenericComponentType().hashCode();
+        }
     }
 
     private static final class AnnotatedTypeVariableImpl extends AnnotatedTypeBaseImpl implements AnnotatedTypeVariable {
@@ -266,6 +376,23 @@
         private TypeVariable<?> getTypeVariable() {
             return (TypeVariable)getType();
         }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof AnnotatedTypeVariable) {
+                AnnotatedTypeVariable that = (AnnotatedTypeVariable) o;
+                return equalsTypeAndAnnotations(that) &&
+                    Arrays.equals(getAnnotatedBounds(), that.getAnnotatedBounds());
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return baseHashCode() ^
+                Objects.hash((Object[])getAnnotatedBounds());
+        }
     }
 
     private static final class AnnotatedParameterizedTypeImpl extends AnnotatedTypeBaseImpl
@@ -316,6 +443,23 @@
         private ParameterizedType getParameterizedType() {
             return (ParameterizedType)getType();
         }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof AnnotatedParameterizedType) {
+                AnnotatedParameterizedType that = (AnnotatedParameterizedType) o;
+                return equalsTypeAndAnnotations(that) &&
+                    Arrays.equals(getAnnotatedActualTypeArguments(), that.getAnnotatedActualTypeArguments());
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return baseHashCode() ^
+                Objects.hash((Object[])getAnnotatedActualTypeArguments());
+        }
     }
 
     private static final class AnnotatedWildcardTypeImpl extends AnnotatedTypeBaseImpl implements AnnotatedWildcardType {
@@ -378,5 +522,26 @@
         private boolean hasUpperBounds() {
             return hasUpperBounds;
         }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof AnnotatedWildcardType) {
+                AnnotatedWildcardType that = (AnnotatedWildcardType) o;
+                return equalsTypeAndAnnotations(that) &&
+                    // Treats ordering as significant
+                    Arrays.equals(getAnnotatedLowerBounds(), that.getAnnotatedLowerBounds()) &&
+                    // Treats ordering as significant
+                    Arrays.equals(getAnnotatedUpperBounds(), that.getAnnotatedUpperBounds());
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return baseHashCode() ^
+                Objects.hash((Object[])getAnnotatedLowerBounds()) ^
+                Objects.hash((Object[])getAnnotatedUpperBounds());
+        }
     }
 }
--- a/src/java.base/share/native/libjava/io_util.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/native/libjava/io_util.c	Thu Oct 11 20:58:37 2018 -0400
@@ -201,7 +201,7 @@
     }
 }
 
-JNIEXPORT void JNICALL
+void
 throwFileNotFoundException(JNIEnv *env, jstring path)
 {
     char buf[256];
--- a/src/java.base/share/native/libjava/io_util.h	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/native/libjava/io_util.h	Thu Oct 11 20:58:37 2018 -0400
@@ -54,8 +54,7 @@
 void writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, jint off,
                 jint len, jboolean append, jfieldID fid);
 void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags);
-JNIEXPORT void JNICALL
-throwFileNotFoundException(JNIEnv *env, jstring path);
+void throwFileNotFoundException(JNIEnv *env, jstring path);
 
 /*
  * Macros for managing platform strings.  The typical usage pattern is:
--- a/src/java.base/share/native/libnet/net_util.h	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/share/native/libnet/net_util.h	Thu Oct 11 20:58:37 2018 -0400
@@ -122,8 +122,6 @@
 
 JNIEXPORT void JNICALL NET_ThrowNew(JNIEnv *env, int errorNum, char *msg);
 
-int NET_GetError();
-
 void NET_ThrowCurrent(JNIEnv *env, char *msg);
 
 jfieldID NET_GetFileDescriptorID(JNIEnv *env);
@@ -202,7 +200,6 @@
 
 unsigned short in_cksum(unsigned short *addr, int len);
 
-JNIEXPORT jint JNICALL
-NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
+jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
 
 #endif /* NET_UTILS_H */
--- a/src/java.base/unix/native/libnet/net_util_md.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/unix/native/libnet/net_util_md.c	Thu Oct 11 20:58:37 2018 -0400
@@ -1546,7 +1546,7 @@
  * It returns the time left from the timeout (possibly 0), or -1 if it expired.
  */
 
-JNIEXPORT jint JNICALL
+jint
 NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout)
 {
     jlong prevNanoTime = JVM_NanoTime(env, 0);
--- a/src/java.base/unix/native/libnio/ch/Net.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/unix/native/libnio/ch/Net.c	Thu Oct 11 20:58:37 2018 -0400
@@ -747,8 +747,7 @@
 
 /* Declared in nio_util.h */
 
-JNIEXPORT jint JNICALL
-handleSocketError(JNIEnv *env, jint errorValue)
+jint handleSocketError(JNIEnv *env, jint errorValue)
 {
     char *xn;
     switch (errorValue) {
--- a/src/java.base/unix/native/libnio/ch/nio_util.h	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/unix/native/libnio/ch/nio_util.h	Thu Oct 11 20:58:37 2018 -0400
@@ -62,5 +62,4 @@
 
 /* Defined in Net.c */
 
-JNIEXPORT jint JNICALL
-handleSocketError(JNIEnv *env, jint errorValue);
+jint handleSocketError(JNIEnv *env, jint errorValue);
--- a/src/java.base/windows/native/libjava/io_util_md.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/windows/native/libjava/io_util_md.c	Thu Oct 11 20:58:37 2018 -0400
@@ -213,8 +213,7 @@
     return pathbuf;
 }
 
-JNIEXPORT FD JNICALL
-winFileHandleOpen(JNIEnv *env, jstring path, int flags)
+FD winFileHandleOpen(JNIEnv *env, jstring path, int flags)
 {
     const DWORD access =
         (flags & O_WRONLY) ?  GENERIC_WRITE :
--- a/src/java.base/windows/native/libjava/io_util_md.h	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/windows/native/libjava/io_util_md.h	Thu Oct 11 20:58:37 2018 -0400
@@ -56,8 +56,7 @@
  * Returns an opaque handle to file named by "path".  If an error occurs,
  * returns -1 and an exception is pending.
  */
-JNIEXPORT FD JNICALL
-winFileHandleOpen(JNIEnv *env, jstring path, int flags);
+FD winFileHandleOpen(JNIEnv *env, jstring path, int flags);
 
 /*
  * Macros to set/get fd from the java.io.FileDescriptor.
--- a/src/java.base/windows/native/libnet/net_util_md.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.base/windows/native/libnet/net_util_md.c	Thu Oct 11 20:58:37 2018 -0400
@@ -903,7 +903,7 @@
  * It returns the time left from the timeout, or -1 if it expired.
  */
 
-JNIEXPORT jint JNICALL
+jint
 NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout)
 {
     jlong prevTime = JVM_CurrentTimeMillis(env, 0);
--- a/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -609,7 +609,7 @@
                 // get the channel name
                 char *channelName;
                 CFStringRef cfname = NULL;
-                const AudioObjectPropertyAddress address = {kAudioObjectPropertyElementName, port->scope, ch};
+                const AudioObjectPropertyAddress address = {kAudioObjectPropertyElementName, port->scope, (unsigned)ch};
                 UInt32 size = sizeof(cfname);
                 OSStatus err = AudioObjectGetPropertyData(mixer->deviceID, &address, 0, NULL, &size, &cfname);
                 if (err == noErr) {
--- a/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Reference.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/java.xml.crypto/share/classes/javax/xml/crypto/dsig/Reference.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -144,7 +144,7 @@
 
     /**
      * Returns the dereferenced data, if
-     * <a href="XMLSignContext.html#Supported%20Properties">reference caching</a>
+     * <a href="XMLSignContext.html#SupportedProperties">reference caching</a>
      * is enabled. This is the result of dereferencing the URI of this
      * reference during a validation or generation operation.
      *
@@ -156,7 +156,7 @@
 
     /**
      * Returns the pre-digested input stream, if
-     * <a href="XMLSignContext.html#Supported%20Properties">reference caching</a>
+     * <a href="XMLSignContext.html#SupportedProperties">reference caching</a>
      * is enabled. This is the input to the digest operation during a
      * validation or signing operation.
      *
--- a/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c	Thu Oct 11 20:58:37 2018 -0400
@@ -26,7 +26,7 @@
 
 /*
  *  This file implements a binding between Java and the hsdis
- *  dissasembler.  It should compile on Linux/Solaris and Windows.
+ *  disassembler.  It should compile on Linux/Solaris and Windows.
  *  The only platform dependent pieces of the code for doing
  *  dlopen/dlsym to find the entry point in hsdis.  All the rest is
  *  standard JNI code.
--- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java	Thu Oct 11 20:58:37 2018 -0400
@@ -236,15 +236,7 @@
                                            final MethodImpl method,
                                            final ValueImpl[] args,
                                            final int options) {
-        /*
-         * Cache the values of args when TRACE_SENDS is enabled, for later printing.
-         * If not cached, printing causes a remote call while synchronized, and deadlock.
-         */
-        if ((vm.traceFlags & VirtualMachine.TRACE_SENDS) != 0) {
-           for (ValueImpl arg: args) {
-              arg.toString();
-           }
-        }
+
         CommandSender sender = getInvokeMethodSender(thread, method, args, options);
         PacketStream stream;
         if ((options & ClassType.INVOKE_SINGLE_THREADED) != 0) {
--- a/src/jdk.jdi/share/classes/com/sun/tools/jdi/VMState.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/src/jdk.jdi/share/classes/com/sun/tools/jdi/VMState.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -26,10 +26,7 @@
 package com.sun.tools.jdi;
 
 import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 import com.sun.jdi.ThreadGroupReference;
 import com.sun.jdi.ThreadReference;
@@ -44,12 +41,10 @@
 
     /*
      * Certain information can be cached only when the entire VM is
-     * suspended and there are no pending resumes. The fields below
-     * are used to track whether there are pending resumes. (There
-     * is an assumption that JDWP command ids are increasing over time.)
+     * suspended and there are no pending resumes. The field below
+     * is used to track whether there are pending resumes.
      */
-    private int lastCompletedCommandId = 0;   // synchronized (this)
-    private int lastResumeCommandId = 0;      // synchronized (this)
+    private final Set<Integer> pendingResumeCommands = Collections.synchronizedSet(new HashSet<>());
 
     // This is cached only while the VM is suspended
     private static class Cache {
@@ -97,12 +92,12 @@
      * A JDWP command has been completed (reply has been received).
      * Update data that tracks pending resume commands.
      */
-    synchronized void notifyCommandComplete(int id) {
-        lastCompletedCommandId = id;
+    void notifyCommandComplete(int id) {
+        pendingResumeCommands.remove(id);
     }
 
     synchronized void freeze() {
-        if (cache == null && (lastCompletedCommandId >= lastResumeCommandId)) {
+        if (cache == null && (pendingResumeCommands.isEmpty())) {
             /*
              * No pending resumes to worry about. The VM is suspended
              * and additional state can be cached. Notify all
@@ -115,7 +110,7 @@
 
     synchronized PacketStream thawCommand(CommandSender sender) {
         PacketStream stream = sender.send();
-        lastResumeCommandId = stream.id();
+        pendingResumeCommands.add(stream.id());
         thaw();
         return stream;
     }
--- a/test/hotspot/jtreg/Makefile	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/Makefile	Thu Oct 11 20:58:37 2018 -0400
@@ -24,8 +24,6 @@
 
 NATIVE_TEST_PATH := hotspot/jtreg/native
 
-TREAT_EXIT_CODE_1_AS_0 := true
-
 CLEAN_BEFORE_PREP := true
 
 USE_JTREG_VERSION := 4.1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/compiler/regalloc/VolatileLoadMemBarsOnlyUses.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8210389
+ * @summary C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
+ *
+ * @run main/othervm -Xcomp -XX:CompileOnly=VolatileLoadMemBarsOnlyUses VolatileLoadMemBarsOnlyUses
+ *
+ */
+
+public class VolatileLoadMemBarsOnlyUses {
+
+    public static final int N = 400;
+    public static long instanceCount=-94L;
+    public static volatile byte byFld=-108;
+
+    public int mainTest(String[] strArr1) {
+
+        int i17=9, i19=1, i20=63, i21=-32916, i22=0, iArr[]=new int[N];
+        boolean b1=false;
+        double d3=76.18241;
+
+        for (int i : iArr) {
+            for (i17 = 2; i17 < 63; i17++) {
+                if (b1) break;
+                byFld += (byte)(0.131F + (i17 * i17));
+            }
+            for (i19 = 1; 63 > i19; ++i19) {
+                for (i21 = 1; i21 < 2; i21++) {
+                    d3 = i22;
+                    if (b1) continue;
+                    i20 = i21;
+                }
+                d3 -= byFld;
+                instanceCount = 46725L;
+            }
+            switch ((((i22 >>> 1) % 4) * 5) + 91) {
+            case 98:
+                break;
+            case 110:
+                break;
+            case 105:
+                break;
+            case 103:
+                break;
+            default:
+            }
+        }
+
+        return i20;
+    }
+    public static void main(String[] strArr) {
+        VolatileLoadMemBarsOnlyUses _instance = new VolatileLoadMemBarsOnlyUses();
+        for (int i = 0; i < 10; i++ ) {
+            _instance.mainTest(strArr);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/gc/epsilon/TestAlignment.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018, Red Hat, Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test TestAlignment
+ * @key gc
+ * @requires vm.gc.Epsilon & !vm.graal.enabled
+ * @summary Check Epsilon runs fine with (un)usual alignments
+ * @bug 8212005
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:+UseTLAB TestAlignment
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:-UseTLAB TestAlignment
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:+UseTLAB -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestAlignment
+ * @run main/othervm -XX:+UnlockExperimentalVMOptions -Xmx128m -XX:+UseEpsilonGC -XX:-UseTLAB -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=16 TestAlignment
+ */
+
+public class TestAlignment {
+    static Object sink;
+
+    public static void main(String[] args) throws Exception {
+        for (int c = 0; c < 1000; c++) {
+            sink = new byte[c];
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/InnerClassesAttr/Base.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package com.g;
+class Base {
+    static class Builder { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/InnerClassesAttr/Child.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package com.g;
+public final class Child extends Base {
+    public Builder setJobName() {
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/InnerClassesAttr/InnerClassesTest.jasm	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8079784
+ * @compile InnerClassesTest.jasm Base.java Child.java
+ * @run main com.n.InnerClassesTest
+ */
+
+// Test that if a class's InnerClasses attribute contains a class that is not
+// accessible to the class with the attribute then an IllegalAccessError
+// exception should not get thrown as a result of the class accessing other
+// classes in the InnerClasses attribute.
+//
+// In this test, class InnerClassesTest has an InnerClasses attribute with two
+// entries.  One for inaccessable (non-public) class com/g/Base and class
+// con/g/Base$Builder.  And, one entry for classes com/n/InnerClassTest and
+// com/n/InnerClasses/Test$Foo.  The test accesses com/n/InnerClsses/Test$Foo
+// by calling getSimpleName().  This should not cause an IllegalAccessError
+// exception to get thrown.
+//
+//
+// This jasm code was generated from the following Java code.  The only
+// difference is that, in the jasm code, the order of the entries in the
+// InnerClasses attributes for class InnerClassesTest were switched.
+//
+// package com.n;
+// import com.g.Child;
+//
+// public final class InnerClassesTest {
+//
+//     public static final class Foo { }
+//     void unused() {
+//         new Child().setJobName();
+//     }
+//
+//     public static void main(String[] args) {
+//         Class<?> clazz = InnerClassesTest.Foo.class;
+//         clazz.getSimpleName();
+//     }
+// }
+
+package com/n;
+
+super public final class InnerClassesTest$Foo version 53:0 {
+
+    public Method "<init>":"()V" stack 1 locals 1 {
+        aload_0;
+        invokespecial Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+public static final InnerClass Foo=class InnerClassesTest$Foo of class InnerClassesTest;
+
+} // end Class InnerClassesTest$Foo
+
+
+super public final class InnerClassesTest version 53:0 {
+
+
+    public Method "<init>":"()V" stack 1 locals 1 {
+        aload_0;
+        invokespecial    Method java/lang/Object."<init>":"()V";
+        return;
+    }
+
+    Method unused:"()V" stack 2 locals 1 {
+        new    class com/g/Child;
+        dup;
+        invokespecial    Method com/g/Child."<init>":"()V";
+        invokevirtual    Method com/g/Child.setJobName:"()Lcom/g/Base$Builder;";
+        pop;
+        return;
+    }
+
+    public static Method main:"([Ljava/lang/String;)V" stack 1 locals 2 {
+        ldc    class InnerClassesTest$Foo;
+        astore_1;
+        aload_1;
+        invokevirtual    Method java/lang/Class.getSimpleName:"()Ljava/lang/String;";
+        pop;
+        return;
+    }
+
+static InnerClass Builder=class com/g/Base$Builder of class com/g/Base;
+public static final InnerClass Foo=class InnerClassesTest$Foo of class InnerClassesTest;
+
+} // end Class InnerClassesTest
--- a/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8046171
+ * @bug 8046171 8211065
  * @summary Setup nestmate calls to private methods then use
  *          modified jcod classes to introduce errors. Test with
  *          and without verification enabled
@@ -96,14 +96,10 @@
             System.out.println("Got expected exception:" + nsme);
         }
 
-        try {
-            MissingMethodWithSuper m = new MissingMethodWithSuper();
-            m.priv_invoke();
-            throw new Error("Unexpected success invoking MissingMethodWithSuper.priv_invoke");
-        }
-        catch (NoSuchMethodError nsme) {
-            System.out.println("Got expected exception:" + nsme);
-        }
+        // This test was revised to expect successful invocation of the
+        // super class method - see JDK-8211065
+        MissingMethodWithSuper m = new MissingMethodWithSuper();
+        m.priv_invoke();
 
         // Verification of Helper will trigger the nestmate access check failure
         try {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.process.OutputAnalyzer;
+
+/*
+ * @test PrintStringTableStatsTest
+ * @bug 8211821
+ * @library /test/lib
+ * @run main PrintStringTableStatsTest
+ */
+
+public class PrintStringTableStatsTest {
+    public static void main(String... args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+            "-XX:+PrintStringTableStatistics",
+            "--version");
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        output.shouldContain("Number of buckets");
+        output.shouldHaveExitValue(0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/linkResolver/TestDeletedMethod.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8211065
+ * @summary Test that deleting a subclass method implementation results in
+ * execution of a superclass implementation - if it is accessible.
+ * @compile TestDeletedMethod.java
+ * @compile TestDeletedMethod_Sub.jcod TestDeletedMethod_Super.jcod
+ * @run main/othervm -XX:+RelaxAccessControlCheck TestDeletedMethod
+ */
+
+// The access control relaxation was originally done to ensure an assertion
+// in the nestmate logic would not trigger unintentionally because it
+// assumed only nestmates could be involved. The assertion no longer exists
+// but we keep the test as a non-nestmate version of the situation.
+
+/* package */ class TestDeletedMethod_Super {
+    public static final int ID = 2;
+    private static int m() {
+        System.out.println("Super.m");
+        return ID;
+    }
+}
+
+/* package */ class TestDeletedMethod_Sub extends TestDeletedMethod_Super {
+    public static final int ID = 1;
+    // At runtime this implementation is not present
+    private static int m() {
+        System.out.println("Sub.m");
+        return ID;
+    }
+    public static int test() {
+        return TestDeletedMethod_Sub.m();
+    }
+}
+
+public class TestDeletedMethod {
+    public static void main(String[] args) {
+        int x = TestDeletedMethod_Sub.test();
+        if (x != TestDeletedMethod_Super.ID)
+            throw new RuntimeException("Wrong method invoked: " + x);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/linkResolver/TestDeletedMethod_Sub.jcod	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// We have deleted the local method m() by renaming it
+// We have set the class file version to 49 to allow relaxed access checks
+
+class TestDeletedMethod_Sub {
+  0xCAFEBABE;
+  0; // minor version
+  49; // version
+  [] { // Constant Pool
+    ; // first element is empty
+    Method #7 #21; // #1
+    Field #22 #23; // #2
+    String #24; // #3
+    Method #25 #26; // #4
+    class #27; // #5
+    Method #5 #28; // #6
+    class #29; // #7
+    Utf8 "ID"; // #8
+    Utf8 "I"; // #9
+    Utf8 "ConstantValue"; // #10
+    int 0x00000001; // #11
+    Utf8 "<init>"; // #12
+    Utf8 "()V"; // #13
+    Utf8 "Code"; // #14
+    Utf8 "LineNumberTable"; // #15
+    Utf8 "m"; // #16
+    Utf8 "()I"; // #17
+    Utf8 "test"; // #18
+    Utf8 "SourceFile"; // #19
+    Utf8 "TestDeletedMethod.java"; // #20
+    NameAndType #12 #13; // #21
+    class #30; // #22
+    NameAndType #31 #32; // #23
+    Utf8 "Sub.m"; // #24
+    class #33; // #25
+    NameAndType #34 #35; // #26
+    Utf8 "TestDeletedMethod_Sub"; // #27
+    NameAndType #16 #17; // #28
+    Utf8 "TestDeletedMethod_Super"; // #29
+    Utf8 "java/lang/System"; // #30
+    Utf8 "out"; // #31
+    Utf8 "Ljava/io/PrintStream;"; // #32
+    Utf8 "java/io/PrintStream"; // #33
+    Utf8 "println"; // #34
+    Utf8 "(Ljava/lang/String;)V"; // #35
+    Utf8 "m_renamed"; // #36 added
+  } // Constant Pool
+
+  0x0020; // access
+  #5;// this_cpx
+  #7;// super_cpx
+
+  [] { // Interfaces
+  } // Interfaces
+
+  [] { // fields
+    { // Member
+      0x0019; // access
+      #8; // name_cpx
+      #9; // sig_cpx
+      [] { // Attributes
+        Attr(#10) { // ConstantValue
+          #11;
+        } // end ConstantValue
+      } // Attributes
+    } // Member
+  } // fields
+
+  [] { // methods
+    { // Member
+      0x0000; // access
+      #12; // name_cpx
+      #13; // sig_cpx
+      [] { // Attributes
+        Attr(#14) { // Code
+          1; // max_stack
+          1; // max_locals
+          Bytes[]{
+            0x2AB70001B1;
+          };
+          [] { // Traps
+          } // end Traps
+          [] { // Attributes
+            Attr(#15) { // LineNumberTable
+              [] { // LineNumberTable
+                0  43;
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member
+      0x000A; // access
+      #36; // name_cpx UPDATED to rename method
+      #17; // sig_cpx
+      [] { // Attributes
+        Attr(#14) { // Code
+          2; // max_stack
+          0; // max_locals
+          Bytes[]{
+            0xB200021203B60004;
+            0x04AC;
+          };
+          [] { // Traps
+          } // end Traps
+          [] { // Attributes
+            Attr(#15) { // LineNumberTable
+              [] { // LineNumberTable
+                0  47;
+                8  48;
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member
+      0x0009; // access
+      #18; // name_cpx
+      #17; // sig_cpx
+      [] { // Attributes
+        Attr(#14) { // Code
+          1; // max_stack
+          0; // max_locals
+          Bytes[]{
+            0xB80006AC;
+          };
+          [] { // Traps
+          } // end Traps
+          [] { // Attributes
+            Attr(#15) { // LineNumberTable
+              [] { // LineNumberTable
+                0  51;
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [] { // Attributes
+    Attr(#19) { // SourceFile
+      #20;
+    } // end SourceFile
+  } // Attributes
+} // end class TestDeletedMethod_Sub
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/runtime/linkResolver/TestDeletedMethod_Super.jcod	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// We have set the class file version to 49 to allow relaxed access checks
+
+class TestDeletedMethod_Super {
+  0xCAFEBABE;
+  0; // minor version
+  49; // version
+  [] { // Constant Pool
+    ; // first element is empty
+    Method #6 #19; // #1
+    Field #20 #21; // #2
+    String #22; // #3
+    Method #23 #24; // #4
+    class #25; // #5
+    class #26; // #6
+    Utf8 "ID"; // #7
+    Utf8 "I"; // #8
+    Utf8 "ConstantValue"; // #9
+    int 0x00000002; // #10
+    Utf8 "<init>"; // #11
+    Utf8 "()V"; // #12
+    Utf8 "Code"; // #13
+    Utf8 "LineNumberTable"; // #14
+    Utf8 "m"; // #15
+    Utf8 "()I"; // #16
+    Utf8 "SourceFile"; // #17
+    Utf8 "TestDeletedMethod.java"; // #18
+    NameAndType #11 #12; // #19
+    class #27; // #20
+    NameAndType #28 #29; // #21
+    Utf8 "Super.m"; // #22
+    class #30; // #23
+    NameAndType #31 #32; // #24
+    Utf8 "TestDeletedMethod_Super"; // #25
+    Utf8 "java/lang/Object"; // #26
+    Utf8 "java/lang/System"; // #27
+    Utf8 "out"; // #28
+    Utf8 "Ljava/io/PrintStream;"; // #29
+    Utf8 "java/io/PrintStream"; // #30
+    Utf8 "println"; // #31
+    Utf8 "(Ljava/lang/String;)V"; // #32
+  } // Constant Pool
+
+  0x0020; // access
+  #5;// this_cpx
+  #6;// super_cpx
+
+  [] { // Interfaces
+  } // Interfaces
+
+  [] { // fields
+    { // Member
+      0x0019; // access
+      #7; // name_cpx
+      #8; // sig_cpx
+      [] { // Attributes
+        Attr(#9) { // ConstantValue
+          #10;
+        } // end ConstantValue
+      } // Attributes
+    } // Member
+  } // fields
+
+  [] { // methods
+    { // Member
+      0x0000; // access
+      #11; // name_cpx
+      #12; // sig_cpx
+      [] { // Attributes
+        Attr(#13) { // Code
+          1; // max_stack
+          1; // max_locals
+          Bytes[]{
+            0x2AB70001B1;
+          };
+          [] { // Traps
+          } // end Traps
+          [] { // Attributes
+            Attr(#14) { // LineNumberTable
+              [] { // LineNumberTable
+                0  35;
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+    ;
+    { // Member
+      0x000A; // access
+      #15; // name_cpx
+      #16; // sig_cpx
+      [] { // Attributes
+        Attr(#13) { // Code
+          2; // max_stack
+          0; // max_locals
+          Bytes[]{
+            0xB200021203B60004;
+            0x05AC;
+          };
+          [] { // Traps
+          } // end Traps
+          [] { // Attributes
+            Attr(#14) { // LineNumberTable
+              [] { // LineNumberTable
+                0  38;
+                8  39;
+              }
+            } // end LineNumberTable
+          } // Attributes
+        } // end Code
+      } // Attributes
+    } // Member
+  } // methods
+
+  [] { // Attributes
+    Attr(#17) { // SourceFile
+      #18;
+    } // end SourceFile
+  } // Attributes
+} // end class TestDeletedMethod_Super
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP06/ap06t001/ap06t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP06/ap06t001/ap06t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -124,7 +124,7 @@
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_scenarios_allocation_AP06_ap06t001Thread_setTag( JNIEnv* jni, jobject obj) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, obj, threadTag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, threadTag))) {
         nsk_jvmti_setFailStatus();
     } else {
         NSK_DISPLAY0("setTag: the tag was set for checked thread.");
@@ -153,34 +153,26 @@
         }
 
         if (!NSK_JNI_VERIFY(jni, (fid =
-                NSK_CPP_STUB4(GetStaticFieldID, jni,
-                                                debugeeClass,
-                                                "thread",
-                                                THREAD_CLS_SIGNATURE)) != NULL )) {
+                jni->GetStaticFieldID(debugeeClass, "thread", THREAD_CLS_SIGNATURE)) != NULL)) {
             nsk_jvmti_setFailStatus();
             break;
         }
 
         if (!NSK_JNI_VERIFY(jni, (localRefThread =
-                NSK_CPP_STUB3(GetStaticObjectField, jni,
-                                                    debugeeClass,
-                                                    fid )) != NULL )) {
+                jni->GetStaticObjectField(debugeeClass, fid)) != NULL)) {
             NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'thread' field value\n\n");
             nsk_jvmti_setFailStatus();
             break;
         }
 
-        if (!NSK_JNI_VERIFY(jni, (globalRefThread =
-                 NSK_CPP_STUB2(NewGlobalRef, jni, localRefThread)) != NULL))
+        if (!NSK_JNI_VERIFY(jni, (globalRefThread = jni->NewGlobalRef(localRefThread)) != NULL))
             return;
 
         NSK_DISPLAY0("Calling IterateOverReachableObjects\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                                                           heapRootCallback,
-                                                           stackReferenceCallback,
-                                                           objectReferenceCallback,
-                                                           NULL /*user_data*/))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->IterateOverReachableObjects(heapRootCallback,
+                                                                 stackReferenceCallback,
+                                                                 objectReferenceCallback,
+                                                                 NULL /*user_data*/))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -234,12 +226,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     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;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_tag_objects)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t001/ap07t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t001/ap07t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -111,15 +111,14 @@
                                                           jobject target,
                                                           jlong   tag ) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, target, tag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setRoot( JNIEnv* jni, jobject obj) {
-    if (!NSK_JNI_VERIFY(jni, (root =
-            NSK_CPP_STUB2(NewGlobalRef, jni, obj)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (root = jni->NewGlobalRef(obj)) != NULL))
         nsk_jvmti_setFailStatus();
 }
 
@@ -135,30 +134,24 @@
     do {
 
         NSK_DISPLAY0("Calling IterateOverReachableObjects\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                                                           heapRootCallback,
-                                                           stackReferenceCallback,
-                                                           objectReferenceCallback,
-                                                           NULL /*user_data*/))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->IterateOverReachableObjects(heapRootCallback,
+                                                                 stackReferenceCallback,
+                                                                 objectReferenceCallback,
+                                                                 NULL /*user_data*/))) {
             nsk_jvmti_setFailStatus();
             break;
         }
 
         NSK_DISPLAY0("Calling IterateOverObjectsReachableFromObject\n");
         {
-            if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB4(IterateOverObjectsReachableFromObject,
-                        jvmti,
-                        root,
-                        objectReferenceCallback,
-                        NULL /*user_data*/))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->IterateOverObjectsReachableFromObject(
+                    root, objectReferenceCallback, NULL /*user_data*/))) {
                 nsk_jvmti_setFailStatus();
                 break;
             }
         }
 
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, root));
+        NSK_TRACE(jni->DeleteGlobalRef(root));
 
     } while (0);
 
@@ -191,12 +184,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     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;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_tag_objects)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t002/ap07t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t002/ap07t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -111,7 +111,7 @@
                                                           jobject target,
                                                           jlong   tag ) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, target, tag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
         nsk_jvmti_setFailStatus();
     }
 }
@@ -128,12 +128,10 @@
     do {
 
         NSK_DISPLAY0("Calling IterateOverReachableObjects\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                                                           heapRootCallback,
-                                                           stackReferenceCallback,
-                                                           objectReferenceCallback,
-                                                           NULL /*user_data*/))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->IterateOverReachableObjects(heapRootCallback,
+                                                                 stackReferenceCallback,
+                                                                 objectReferenceCallback,
+                                                                 NULL /*user_data*/))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -169,12 +167,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     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;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_tag_objects)
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP09/ap09t001/ap09t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP09/ap09t001/ap09t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -132,15 +132,14 @@
                                                           jobject target,
                                                           jlong   tag ) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, target, tag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setReferrer( JNIEnv* jni, jclass klass, jobject ref) {
-    if (!NSK_JNI_VERIFY(jni, (referrer =
-            NSK_CPP_STUB2(NewGlobalRef, jni, ref)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (referrer = jni->NewGlobalRef(ref)) != NULL))
         nsk_jvmti_setFailStatus();
 }
 
@@ -155,12 +154,9 @@
 
     do {
         NSK_DISPLAY0("\nCalling IterateOverObjectsReachableFromObject\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(IterateOverObjectsReachableFromObject,
-                    jvmti,
-                    referrer,
-                    objectReferenceCallback,
-                    NULL /*user_data*/))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->IterateOverObjectsReachableFromObject(referrer,
+                                                                           objectReferenceCallback,
+                                                                           NULL /*user_data*/))) {
             nsk_jvmti_setFailStatus();
         }
         if (!classFound) {
@@ -192,7 +188,7 @@
             nsk_jvmti_setFailStatus();
         }
 
-        NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, referrer));
+        NSK_TRACE(jni->DeleteGlobalRef(referrer));
     } while (0);
 
     NSK_DISPLAY0("Let debugee to finish\n");
@@ -224,12 +220,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     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;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_tag_objects) {
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP10/ap10t001/ap10t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP10/ap10t001/ap10t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -61,8 +61,7 @@
 
     NSK_DISPLAY2("%s: setting an environment local storage 0x%p ...\n",
         msg, (void*) &stor);
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SetEnvironmentLocalStorage,
-            jvmti_env, (const void*) &stor))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->SetEnvironmentLocalStorage((const void*) &stor))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: unable to set an environment local storage\n\n",
             msg);
@@ -71,8 +70,7 @@
 
     NSK_DISPLAY1("%s: getting an environment local storage ...\n",
         msg);
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetEnvironmentLocalStorage,
-            jvmti_env, (void**) &obtainedData))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetEnvironmentLocalStorage((void**) &obtainedData))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: unable to get an environment local storage\n\n",
             msg);
@@ -90,8 +88,7 @@
 }
 
 static void timerFunc(jvmtiEnv *jvmti_env, const char *msg) {
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti_env, &timer_info1 ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetCurrentThreadCpuTimerInfo(&timer_info1))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: GetCurrentThreadCpuTimerInfo returned unexpected error code\n\n",
             msg);
@@ -114,8 +111,7 @@
     }
     /* ---------------------------------------------------------------------- */
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti_env, &nanos ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetCurrentThreadCpuTime(&nanos))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: GetCurrentThreadCpuTime returned unexpected error code\n\n",
             msg);
@@ -123,8 +119,7 @@
     /* ---------------------------------------------------------------------- */
 
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetTimerInfo, jvmti_env, &timer_info2 ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetTimerInfo(&timer_info2))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: GetTimerInfo returned unexpected error code\n\n",
             msg);
@@ -148,8 +143,7 @@
     /* ---------------------------------------------------------------------- */
 
     nanos = 0;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetTime, jvmti_env, &nanos ))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetTime(&nanos))) {
         nsk_jvmti_setFailStatus();
         NSK_COMPLAIN1("%s: GetTime returned unexpected error code\n\n",
             msg);
@@ -223,10 +217,9 @@
 
     NSK_DISPLAY0("Call IterateOverHeap to tag random objects for ObjectFree evnts\n\n");
     {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(IterateOverHeap, jvmti,
-                    JVMTI_HEAP_OBJECT_UNTAGGED, heapObjectCallback,
-                    &user_data))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_UNTAGGED,
+                                                     heapObjectCallback,
+                                                     &user_data))) {
             nsk_jvmti_setFailStatus();
         }
     }
@@ -276,12 +269,10 @@
     caps.can_get_thread_cpu_time = 1;
     caps.can_generate_object_free_events = 1;
     caps.can_generate_garbage_collection_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_garbage_collection_events)
@@ -299,19 +290,21 @@
     callbacks.GarbageCollectionFinish = &GarbageCollectionFinish;
     callbacks.ObjectFree = &ObjectFree;
 
-    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_GARBAGE_COLLECTION_START, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_GARBAGE_COLLECTION_START,
+                                                          NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_GARBAGE_COLLECTION_FINISH,
+                                                          NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_OBJECT_FREE, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_OBJECT_FREE,
+                                                          NULL)))
         return JNI_ERR;
     NSK_DISPLAY0("enabling the events done\n\n");
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP11/ap11t001/ap11t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP11/ap11t001/ap11t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -43,8 +43,7 @@
     jint i;
 
     for (i = 0; i < classCount && !found; i++) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti,
-                classes[i], &signature, &generic)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(classes[i], &signature, &generic)))
             break;
 
         if (signature != NULL && strcmp(signature, exp_sig) == 0) {
@@ -52,10 +51,10 @@
         }
 
         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);
     }
 
     return found;
@@ -74,7 +73,7 @@
     */
     {
         jvmtiPhase phase;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti, &phase ))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetPhase(&phase))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -85,14 +84,12 @@
     }
 
     do {
-        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();
             break;
         }
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti,
-                thread, &threadInfo))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &threadInfo))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -108,14 +105,13 @@
         jint i;
         jboolean found = JNI_FALSE;
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetAllThreads, jvmti,
-                 &threadCount, &threads))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threadCount, &threads))) {
             nsk_jvmti_setFailStatus();
             break;
         }
 
         for (i = 0; i < threadCount && !found; i++) {
-            found = NSK_CPP_STUB3(IsSameObject, jni, threads[i], thread);
+            found = jni->IsSameObject(threads[i], thread);
             if (found == JNI_TRUE) {
                 break;
             }
@@ -134,8 +130,7 @@
         jint classCount;
         jclass *classes;
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetLoadedClasses, jvmti,
-                 &classCount, &classes))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetLoadedClasses(&classCount, &classes))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -147,7 +142,7 @@
         }
 
         if (classes != NULL)
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)classes);
+            jvmti->Deallocate((unsigned char*)classes);
     } while(0);
 
 
@@ -155,8 +150,8 @@
     */
     {
         jclass klass;
-        klass = NSK_CPP_STUB2(GetObjectClass, jni, object);
-        if (!(NSK_CPP_STUB3(IsSameObject, jni, object_klass, klass))) {
+        klass = jni->GetObjectClass(object);
+        if (!(jni->IsSameObject(object_klass, klass))) {
             nsk_jvmti_setFailStatus();
             NSK_COMPLAIN1("VMObjectAlloc: unexpected object_klass : \"%s\"\n\n", signature);
         }
@@ -167,8 +162,7 @@
 
     do {
         jlong objSize;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectSize, jvmti,
-                 object, &objSize))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetObjectSize(object, &objSize))) {
             nsk_jvmti_setFailStatus();
             break;
         }
@@ -181,10 +175,10 @@
     } while(0);
 
     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);
 }
 
 /* ========================================================================== */
@@ -234,21 +228,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/AP12/ap12t001/ap12t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP12/ap12t001/ap12t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -79,8 +79,7 @@
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_scenarios_allocation_AP12_ap12t001_setTag( JNIEnv* jni, jobject obj, jlong tag) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag,
-         jvmti, obj, tag))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, tag))) {
          nsk_jvmti_setFailStatus();
     }
 }
@@ -129,12 +128,10 @@
     memset(&caps, 0, sizeof(jvmtiCapabilities));
     caps.can_generate_object_free_events = 1;
     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;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities,
-            jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
 
     if (!caps.can_generate_object_free_events)
@@ -149,16 +146,17 @@
     callbacks.ObjectFree = &ObjectFree;
     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_OBJECT_FREE, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_OBJECT_FREE,
+                                                          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/scenarios/bcinstr/BI01/bi01t001/bi01t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t001/bi01t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -52,23 +52,20 @@
     jbyte* elements;
     jboolean isCopy;
 
-    if (!NSK_JNI_VERIFY(jni_env, (newClassSize =
-            NSK_CPP_STUB2(GetArrayLength, jni_env, byteCode)) > 0)) {
+    if (!NSK_JNI_VERIFY(jni_env, (newClassSize = jni_env->GetArrayLength(byteCode)) > 0)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     NSK_DISPLAY1("\t... got array size: %d\n", newClassSize);
 
     if (!NSK_JNI_VERIFY(jni_env, (elements =
-            NSK_CPP_STUB3(GetByteArrayElements, jni_env, byteCode,
-                                                        &isCopy)) != NULL)) {
+            jni_env->GetByteArrayElements(byteCode, &isCopy)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     NSK_DISPLAY1("\t... got elements list: 0x%p\n", (void*)elements);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti,
-                                newClassSize, &newClassBytes))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate(newClassSize, &newClassBytes))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -82,7 +79,7 @@
     NSK_DISPLAY1("\t... copied bytecode: %d bytes\n", (int)newClassSize);
 
     NSK_DISPLAY1("\t... release elements list: 0x%p\n", (void*)elements);
-    NSK_TRACE(NSK_CPP_STUB4(ReleaseByteArrayElements, jni_env, byteCode, elements, JNI_ABORT));
+    NSK_TRACE(jni_env->ReleaseByteArrayElements(byteCode, elements, JNI_ABORT));
     NSK_DISPLAY0("\t... released\n");
     return NSK_TRUE;
 }
@@ -98,7 +95,7 @@
                         jobject o, jclass cls) {
 
     if (!NSK_JNI_VERIFY(jni_env, (oldClassDef.klass = (jclass)
-             NSK_CPP_STUB2(NewGlobalRef, jni_env, cls)) != NULL)) {
+             jni_env->NewGlobalRef(cls)) != NULL)) {
         nsk_jvmti_setFailStatus();
     }
 }
@@ -129,9 +126,7 @@
         unsigned char *arr;
 
         oldClassDef.class_byte_count = class_data_len;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti_env, class_data_len,
-                                &arr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Allocate(class_data_len, &arr))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -181,9 +176,9 @@
         return;
 
     NSK_DISPLAY0("Notification disabled for CLASS_FILE_LOAD_HOOK event\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                                JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -205,8 +200,7 @@
         nsk_printHexBytes("   ", 16, oldClassDef.class_byte_count,
                                 oldClassDef.class_bytes);
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &oldClassDef))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &oldClassDef))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -219,7 +213,7 @@
     if (!nsk_jvmti_waitForSync(timeout))
         return;
 
-    NSK_CPP_STUB2(DeleteGlobalRef, agentJNI, oldClassDef.klass);
+    agentJNI->DeleteGlobalRef(oldClassDef.klass);
 
     NSK_DISPLAY0("Let debuggee to finish\n");
     if (!nsk_jvmti_resumeSync())
@@ -256,7 +250,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_redefine_classes = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
             return JNI_ERR;
     }
 
@@ -267,16 +261,15 @@
 
         memset(&callbacks, 0, size);
         callbacks.ClassFileLoadHook = cbClassFileLoadHook;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, size))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, size))) {
             return JNI_ERR;
         }
     }
 
     NSK_DISPLAY0("Set notification enabled for CLASS_FILE_LOAD_HOOK event\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                                JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t002/bi01t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t002/bi01t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -54,23 +54,20 @@
     jbyte* elements;
     jboolean isCopy;
 
-    if (!NSK_JNI_VERIFY(jni_env, (newClassSize[ind] =
-            NSK_CPP_STUB2(GetArrayLength, jni_env, byteCode)) > 0)) {
+    if (!NSK_JNI_VERIFY(jni_env, (newClassSize[ind] = jni_env->GetArrayLength(byteCode)) > 0)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     NSK_DISPLAY1("\t... got array size: %d\n", newClassSize[ind]);
 
     if (!NSK_JNI_VERIFY(jni_env, (elements =
-            NSK_CPP_STUB3(GetByteArrayElements, jni_env, byteCode,
-                                                        &isCopy)) != NULL)) {
+            jni_env->GetByteArrayElements(byteCode, &isCopy)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     NSK_DISPLAY1("\t... got elements list: 0x%p\n", (void*)elements);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti,
-                                newClassSize[ind], &newClassBytes[ind]))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate(newClassSize[ind], &newClassBytes[ind]))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -84,7 +81,7 @@
     NSK_DISPLAY1("\t... copied bytecode: %d bytes\n", (int)newClassSize[ind]);
 
     NSK_DISPLAY1("\t... release elements list: 0x%p\n", (void*)elements);
-    NSK_TRACE(NSK_CPP_STUB4(ReleaseByteArrayElements, jni_env, byteCode, elements, JNI_ABORT));
+    NSK_TRACE(jni_env->ReleaseByteArrayElements(byteCode, elements, JNI_ABORT));
     NSK_DISPLAY0("\t... released\n");
     return NSK_TRUE;
 }
@@ -100,7 +97,7 @@
                         jobject o, jint ind, jclass cls) {
 
     if (!NSK_JNI_VERIFY(jni_env, (oldClassDef[ind].klass = (jclass)
-             NSK_CPP_STUB2(NewGlobalRef, jni_env, cls)) != NULL)) {
+             jni_env->NewGlobalRef(cls)) != NULL)) {
         nsk_jvmti_setFailStatus();
     }
 }
@@ -131,9 +128,7 @@
         unsigned char *arr;
 
         oldClassDef[clsLoadedIdx].class_byte_count = class_data_len;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(Allocate, jvmti_env, class_data_len,
-                                &arr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Allocate(class_data_len, &arr))) {
             nsk_jvmti_setFailStatus();
             return;
         }
@@ -189,9 +184,9 @@
         return;
 
     NSK_DISPLAY0("Notification disabled for CLASS_FILE_LOAD_HOOK event\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                                JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -216,9 +211,7 @@
                                     oldClassDef[i].class_bytes);
         }
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(RedefineClasses, jvmti, TOTAL_INSTRUMENTED_CLASSES,
-                            oldClassDef))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(TOTAL_INSTRUMENTED_CLASSES, oldClassDef))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -232,7 +225,7 @@
         return;
 
     for (i = 0; i < TOTAL_INSTRUMENTED_CLASSES; i++) {
-        NSK_CPP_STUB2(DeleteGlobalRef, agentJNI, oldClassDef[i].klass);
+        agentJNI->DeleteGlobalRef(oldClassDef[i].klass);
     }
 
     NSK_DISPLAY0("Let debuggee to finish\n");
@@ -270,7 +263,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_redefine_classes = 1;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
             return JNI_ERR;
     }
 
@@ -281,16 +274,15 @@
 
         memset(&callbacks, 0, size);
         callbacks.ClassFileLoadHook = cbClassFileLoadHook;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, size))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, size))) {
             return JNI_ERR;
         }
     }
 
     NSK_DISPLAY0("Set notification enabled for CLASS_FILE_LOAD_HOOK event\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                                JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/bi02t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -63,13 +63,13 @@
             /* sent by class load */
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data_len =
-                    NSK_CPP_STUB2(GetArrayLength, jni_env, classBytes)) > 0)) {
+                    jni_env->GetArrayLength(classBytes)) > 0)) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
-                    NSK_CPP_STUB3(GetByteArrayElements, jni_env, classBytes, NULL))
+                    jni_env->GetByteArrayElements(classBytes, NULL))
                         != NULL)) {
                 nsk_jvmti_setFailStatus();
                 return;
@@ -86,30 +86,27 @@
     jfieldID field = NULL;
 
     NSK_DISPLAY1("Find class: %s\n", DEBUGEE_CLASS_NAME);
-    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))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, debugeeClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                "newClassBytes", "[B")) != NULL))
+            jni->GetStaticFieldID(debugeeClass, "newClassBytes", "[B")) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, field))
+            jni->GetStaticObjectField(debugeeClass, field))
                 != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB2(NewGlobalRef, jni, classBytes)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL)))
         return JNI_ERR;
 
     return NSK_TRUE;
@@ -140,12 +137,13 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL)))
         nsk_jvmti_setFailStatus();
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, debugeeClass));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, classBytes));
+    NSK_TRACE(jni->DeleteGlobalRef(debugeeClass));
+    NSK_TRACE(jni->DeleteGlobalRef(classBytes));
 
     if (!nsk_jvmti_resumeSync())
         return;
@@ -183,7 +181,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_all_class_hook_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
@@ -191,8 +189,7 @@
 
     memset(&callbacks, 0, sizeof(callbacks));
     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;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/bi02t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -52,35 +52,29 @@
     jfieldID field = NULL;
 
     NSK_DISPLAY1("Find class: %s\n", DEBUGEE_CLASS_NAME);
-    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))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, debugeeClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                "newClassBytes", "[B")) != NULL))
+            jni->GetStaticFieldID(debugeeClass, "newClassBytes", "[B")) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, field))
+            jni->GetStaticObjectField(debugeeClass, field))
                 != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB2(NewGlobalRef, jni, classBytes)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY1("Find class: %s\n", CLASS_NAME);
-    if (!NSK_JNI_VERIFY(jni, (testedClass =
-            NSK_CPP_STUB2(FindClass, jni, CLASS_NAME)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (testedClass = jni->FindClass(CLASS_NAME)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (testedClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, testedClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (testedClass = (jclass)jni->NewGlobalRef(testedClass)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -93,17 +87,16 @@
 
     NSK_DISPLAY0("Redefining ...\n");
 
-    if (!NSK_JNI_VERIFY(jni, (class_def.class_byte_count =
-            NSK_CPP_STUB2(GetArrayLength, jni, classBytes)) > 0))
+    if (!NSK_JNI_VERIFY(jni, (class_def.class_byte_count = jni->GetArrayLength(classBytes)) > 0))
         return NSK_TRUE;
 
     if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
-            NSK_CPP_STUB3(GetByteArrayElements, jni, classBytes, NULL))
+            jni->GetByteArrayElements(classBytes, NULL))
                 != NULL))
         return NSK_TRUE;
 
     class_def.klass = testedClass;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -132,9 +125,9 @@
     if (!nsk_jvmti_waitForSync(timeout))
         return;
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, debugeeClass));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, classBytes));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedClass));
+    NSK_TRACE(jni->DeleteGlobalRef(debugeeClass));
+    NSK_TRACE(jni->DeleteGlobalRef(classBytes));
+    NSK_TRACE(jni->DeleteGlobalRef(testedClass));
 
     if (!nsk_jvmti_resumeSync())
         return;
@@ -171,7 +164,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_redefine_classes = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/bi03t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -63,13 +63,13 @@
             /* sent by class load */
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data_len =
-                    NSK_CPP_STUB2(GetArrayLength, jni_env, classBytes)) > 0)) {
+                    jni_env->GetArrayLength(classBytes)) > 0)) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
 
             if (!NSK_JNI_VERIFY(jni_env, (*new_class_data = (unsigned char*)
-                    NSK_CPP_STUB3(GetByteArrayElements, jni_env, classBytes, NULL))
+                    jni_env->GetByteArrayElements(classBytes, NULL))
                         != NULL)) {
                 nsk_jvmti_setFailStatus();
                 return;
@@ -86,30 +86,27 @@
     jfieldID field = NULL;
 
     NSK_DISPLAY1("Find class: %s\n", DEBUGEE_CLASS_NAME);
-    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))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, debugeeClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                "newClassBytes", "[B")) != NULL))
+            jni->GetStaticFieldID(debugeeClass, "newClassBytes", "[B")) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, field))
+            jni->GetStaticObjectField(debugeeClass, field))
                 != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB2(NewGlobalRef, jni, classBytes)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL)))
         return JNI_ERR;
 
     return NSK_TRUE;
@@ -140,12 +137,13 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE,
+                                                          JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
+                                                          NULL)))
         nsk_jvmti_setFailStatus();
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, debugeeClass));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, classBytes));
+    NSK_TRACE(jni->DeleteGlobalRef(debugeeClass));
+    NSK_TRACE(jni->DeleteGlobalRef(classBytes));
 
     if (!nsk_jvmti_resumeSync())
         return;
@@ -183,7 +181,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_all_class_hook_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
@@ -191,8 +189,7 @@
 
     memset(&callbacks, 0, sizeof(callbacks));
     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;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/bi03t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -52,35 +52,29 @@
     jfieldID field = NULL;
 
     NSK_DISPLAY1("Find class: %s\n", DEBUGEE_CLASS_NAME);
-    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))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, debugeeClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (debugeeClass = (jclass)jni->NewGlobalRef(debugeeClass)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, debugeeClass,
-                "newClassBytes", "[B")) != NULL))
+            jni->GetStaticFieldID(debugeeClass, "newClassBytes", "[B")) != NULL))
         return NSK_FALSE;
 
     if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB3(GetStaticObjectField, jni, debugeeClass, field))
+            jni->GetStaticObjectField(debugeeClass, field))
                 != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)
-            NSK_CPP_STUB2(NewGlobalRef, jni, classBytes)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (classBytes = (jbyteArray)jni->NewGlobalRef(classBytes)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY1("Find class: %s\n", CLASS_NAME);
-    if (!NSK_JNI_VERIFY(jni, (testedClass =
-            NSK_CPP_STUB2(FindClass, jni, CLASS_NAME)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (testedClass = jni->FindClass(CLASS_NAME)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (testedClass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, testedClass)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (testedClass = (jclass)jni->NewGlobalRef(testedClass)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -93,17 +87,16 @@
 
     NSK_DISPLAY0("Redefining ...\n");
 
-    if (!NSK_JNI_VERIFY(jni, (class_def.class_byte_count =
-            NSK_CPP_STUB2(GetArrayLength, jni, classBytes)) > 0))
+    if (!NSK_JNI_VERIFY(jni, (class_def.class_byte_count = jni->GetArrayLength(classBytes)) > 0))
         return NSK_TRUE;
 
     if (!NSK_JNI_VERIFY(jni, (class_def.class_bytes = (unsigned char*)
-            NSK_CPP_STUB3(GetByteArrayElements, jni, classBytes, NULL))
+            jni->GetByteArrayElements(classBytes, NULL))
                 != NULL))
         return NSK_TRUE;
 
     class_def.klass = testedClass;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -132,9 +125,9 @@
     if (!nsk_jvmti_waitForSync(timeout))
         return;
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, debugeeClass));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, classBytes));
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedClass));
+    NSK_TRACE(jni->DeleteGlobalRef(debugeeClass));
+    NSK_TRACE(jni->DeleteGlobalRef(classBytes));
+    NSK_TRACE(jni->DeleteGlobalRef(testedClass));
 
     if (!nsk_jvmti_resumeSync())
         return;
@@ -171,7 +164,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_redefine_classes = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/bi04t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/bi04t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -69,9 +69,7 @@
     classDef.class_byte_count = ftell(bytecode);
     rewind(bytecode);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti,
-                                classDef.class_byte_count,
-                                &newClassBytes))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate(classDef.class_byte_count, &newClassBytes))) {
         NSK_COMPLAIN0("buffer couldn't be allocated\n");
         return NSK_FALSE;
     }
@@ -99,14 +97,13 @@
         return;
 
     NSK_DISPLAY1("Find class: %s\n", TESTED_CLASS_NAME);
-    if (!NSK_JNI_VERIFY(jni, (classDef.klass =
-            NSK_CPP_STUB2(FindClass, jni, TESTED_CLASS_NAME)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (classDef.klass = jni->FindClass(TESTED_CLASS_NAME)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!NSK_JNI_VERIFY(jni, (classDef.klass = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, classDef.klass)) != NULL)) {
+            jni->NewGlobalRef(classDef.klass)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -120,13 +117,12 @@
         nsk_printHexBytes("   ", 16, classDef.class_byte_count,
                                 classDef.class_bytes);
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &classDef))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &classDef))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    NSK_CPP_STUB2(DeleteGlobalRef, jni, classDef.klass);
+    jni->DeleteGlobalRef(classDef.klass);
 
     if (!nsk_jvmti_resumeSync())
         return;
@@ -163,7 +159,7 @@
 
         caps.can_redefine_classes = 1;
         caps.can_redefine_any_class = 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/scenarios/capability/CM01/cm01t001/cm01t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t001/cm01t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -79,8 +79,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -92,8 +91,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]);
@@ -105,24 +103,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -136,23 +130,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -168,27 +160,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -202,7 +190,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -215,7 +203,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -225,8 +213,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -269,44 +256,36 @@
     jint dummy_user_data = 0;
 
     NSK_DISPLAY0("Checking positive: SetTag\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetTag\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetObjectsWithTags\n");
     tag = TAG_VALUE;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverInstancesOfClass\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IterateOverInstancesOfClass(
+            klass, JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverObjectsReachableFromObject\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IterateOverObjectsReachableFromObject(
+            thread, ObjectReference, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverReachableObjects\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IterateOverReachableObjects(
+            HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -325,58 +304,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -391,18 +369,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -418,7 +395,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -431,7 +408,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -444,12 +421,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -463,7 +440,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -477,12 +454,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -496,12 +473,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -597,7 +574,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -609,13 +586,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -627,13 +604,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -645,10 +622,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t002/cm01t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t002/cm01t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,8 +72,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -85,8 +84,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]);
@@ -98,24 +96,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -129,23 +123,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -161,27 +153,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -195,7 +183,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -208,7 +196,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -218,8 +206,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -263,43 +250,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -318,58 +307,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,18 +372,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -411,7 +398,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -424,7 +411,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -437,12 +424,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -455,10 +442,9 @@
     unsigned char *bytecodes;
 
     NSK_DISPLAY0("Checking positive: GetBytecodes\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti, bytecodes)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate(bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -472,12 +458,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,12 +477,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -592,7 +578,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -604,13 +590,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -622,13 +608,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -640,10 +626,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t003/cm01t003.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t003/cm01t003.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -131,23 +125,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -163,27 +155,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -197,7 +185,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -210,7 +198,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -220,8 +208,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -265,43 +252,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -320,58 +309,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -386,18 +374,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -413,7 +400,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -426,7 +413,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -438,13 +425,11 @@
     jboolean is_synthetic;
 
     NSK_DISPLAY0("Checking positive: IsFieldSynthetic\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IsMethodSynthetic\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -458,7 +443,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -472,12 +457,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,12 +476,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -592,7 +577,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -604,13 +589,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -622,13 +607,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -640,10 +625,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t004/cm01t004.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t004/cm01t004.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,8 +72,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -85,8 +84,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]);
@@ -98,24 +96,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -129,23 +123,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -161,27 +153,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -194,8 +182,7 @@
     jobject *monitors = NULL;
 
     NSK_DISPLAY0("Checking positive: GetOwnedMonitorInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -208,7 +195,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -218,8 +205,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -263,43 +249,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -318,58 +306,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,18 +371,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -411,7 +397,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -424,7 +410,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -437,12 +423,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -456,7 +442,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -470,12 +456,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -489,12 +475,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: checkGetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -590,7 +576,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -602,13 +588,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -620,13 +606,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -638,10 +624,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t005/cm01t005.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t005/cm01t005.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,8 +72,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -85,8 +84,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]);
@@ -98,24 +96,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -129,23 +123,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -161,27 +153,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -195,7 +183,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -207,8 +195,7 @@
     jobject monitor = NULL;
 
     NSK_DISPLAY0("Checking positive: GetCurrentContendedMonitor\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -218,8 +205,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -263,43 +249,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -318,58 +306,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,18 +371,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -411,7 +397,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -424,7 +410,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -437,12 +423,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -456,7 +442,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -470,12 +456,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -489,12 +475,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -590,7 +576,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -602,13 +588,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -620,13 +606,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -638,10 +624,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t006/cm01t006.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t006/cm01t006.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,8 +72,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -85,8 +84,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]);
@@ -98,24 +96,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -129,23 +123,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -161,27 +153,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -195,7 +183,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -208,7 +196,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -218,8 +206,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -263,43 +250,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -318,58 +307,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,18 +372,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -411,7 +398,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -423,8 +410,7 @@
     jvmtiMonitorUsage monitor_info;
 
     NSK_DISPLAY0("Checking positive: GetObjectMonitorUsage\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -437,12 +423,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -456,7 +442,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -470,12 +456,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -489,12 +475,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -590,7 +576,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -602,13 +588,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -620,13 +606,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -638,10 +624,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t007/cm01t007.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t007/cm01t007.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,8 +72,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -85,8 +84,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]);
@@ -98,23 +96,19 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingFlag' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "waitingFlag", "Z")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "waitingFlag", "Z")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -128,23 +122,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -160,27 +152,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -194,7 +182,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -207,7 +195,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -223,23 +211,23 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.can_suspend = 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(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     // PopFrame is allowed to fail with JVMTI_ERROR_OPAQUE_FRAME.
     // That will happen if we are in a native function, for example while waiting for a Condition.
     // See JCK-5020108.
-    err = NSK_CPP_STUB2(PopFrame, jvmti, thread);
+    err = jvmti->PopFrame(thread);
     if (err != JVMTI_ERROR_NONE && err != JVMTI_ERROR_OPAQUE_FRAME) {
       NSK_DISPLAY1("jvmti error from PopFrame: %d\n", err);
       return NSK_FALSE;
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         return NSK_FALSE;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     return NSK_TRUE;
@@ -283,43 +271,47 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED,
+                                   HeapObject,
+                                   &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -338,58 +330,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -404,18 +395,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -431,7 +421,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -444,7 +434,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -457,12 +447,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -476,7 +466,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -490,12 +480,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -509,12 +499,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -610,7 +600,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -622,13 +612,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -640,13 +630,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -658,10 +648,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t008/cm01t008.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t008/cm01t008.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -76,8 +76,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -89,8 +88,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]);
@@ -102,24 +100,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -133,23 +127,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -165,27 +157,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -199,7 +187,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -212,7 +200,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -222,8 +210,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -267,43 +254,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -322,58 +311,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -388,18 +376,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -415,12 +402,11 @@
     class_def.klass = klass;
     class_def.class_byte_count = klass_byte_count;
     class_def.class_bytes = klass_bytes;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IsMethodObsolete\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(IsMethodObsolete, jvmti, method, &is_obsolete)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsMethodObsolete(method, &is_obsolete)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -433,7 +419,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -446,12 +432,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -465,7 +451,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -479,12 +465,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -498,12 +484,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -521,15 +507,14 @@
 
     if (name != NULL && (strcmp(name, CLASS_NAME) == 0)) {
         NSK_DISPLAY1("ClassFileLoadHook: %s\n", name);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate,
-            jvmti, class_data_len, &klass_bytes)))
+        if (!NSK_JVMTI_VERIFY(jvmti->Allocate(class_data_len, &klass_bytes)))
             nsk_jvmti_setFailStatus();
         else {
             memcpy(klass_bytes, class_data, class_data_len);
             klass_byte_count = class_data_len;
         }
-        NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL));
+        NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL));
     }
 }
 
@@ -624,7 +609,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -636,13 +621,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -654,13 +639,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -672,10 +657,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -686,11 +671,10 @@
     /* activate ClassFileLoadHook to get class file data */
     memset(&callbacks, 0, sizeof(callbacks));
     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;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+        jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
         return JNI_ERR;
 
     return JNI_OK;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t009/cm01t009.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t009/cm01t009.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -131,23 +125,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -163,25 +155,22 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: StopThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+    if (!NSK_JVMTI_VERIFY(jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -195,7 +184,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -208,7 +197,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -218,8 +207,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -263,43 +251,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -318,58 +308,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,18 +373,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -411,7 +399,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -424,7 +412,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -437,12 +425,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -456,7 +444,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -470,12 +458,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -489,12 +477,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -590,7 +578,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -602,13 +590,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -620,13 +608,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -638,10 +626,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t010/cm01t010.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t010/cm01t010.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -73,8 +73,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -86,8 +85,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]);
@@ -99,24 +97,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -130,23 +124,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -162,27 +154,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -196,7 +184,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -209,7 +197,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -219,8 +207,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -264,43 +251,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -319,58 +308,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -384,19 +372,17 @@
     jvmtiLineNumberEntry *line_number_table = NULL;
 
     NSK_DISPLAY0("Checking positive: GetSourceFileName\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -412,7 +398,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -425,7 +411,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -438,12 +424,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -457,7 +443,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -471,12 +457,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -490,12 +476,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -591,7 +577,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -603,13 +589,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -621,13 +607,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -639,10 +625,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t011/cm01t011.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t011/cm01t011.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -83,8 +83,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -96,8 +95,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]);
@@ -109,24 +107,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -140,23 +134,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -172,27 +164,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -206,7 +194,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -219,7 +207,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -229,8 +217,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -274,43 +261,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -333,83 +322,80 @@
 */
 
     NSK_DISPLAY0("Checking positive: GetLocalVariableTable\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
 /* DEBUG -- while thread should be suspended
     memset(&caps, 0, sizeof(caps));
     caps.can_suspend = 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(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 */
 
     for (i = 0; i < count; i++) {
         if (strcmp(local_variable_table[i].name, "o") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalObject\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalObject, jvmti,
-                    thread, 1, local_variable_table[i].slot, &object_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalObject(thread, 1, local_variable_table[i].slot, &object_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalObject\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalObject, jvmti,
-                    thread, 1, local_variable_table[i].slot, object_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalObject(thread, 1, local_variable_table[i].slot, object_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "i") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalInt\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalInt, jvmti,
-                    thread, 1, local_variable_table[i].slot, &int_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalInt(thread, 1, local_variable_table[i].slot, &int_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalInt\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalInt, jvmti,
-                    thread, 1, local_variable_table[i].slot, int_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalInt(thread, 1, local_variable_table[i].slot, int_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "l") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalLong\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalLong, jvmti,
-                    thread, 1, local_variable_table[i].slot, &long_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalLong(thread, 1, local_variable_table[i].slot, &long_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalLong\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalLong, jvmti,
-                    thread, 1, local_variable_table[i].slot, long_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalLong(thread, 1, local_variable_table[i].slot, long_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "f") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalFloat\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalFloat, jvmti,
-                    thread, 1, local_variable_table[i].slot, &float_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalFloat(thread, 1, local_variable_table[i].slot, &float_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalFloat\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalFloat, jvmti,
-                    thread, 1, local_variable_table[i].slot, float_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalFloat(thread, 1, local_variable_table[i].slot, float_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "d") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalDouble\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalDouble, jvmti,
-                    thread, 1, local_variable_table[i].slot, &double_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalDouble(thread, 1, local_variable_table[i].slot, &double_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalDouble\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalDouble, jvmti,
-                    thread, 1, local_variable_table[i].slot, double_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalDouble(thread, 1, local_variable_table[i].slot, double_value)))
                 return NSK_FALSE;
         }
     }
 
 /* DEBUG -- while thread should be suspended
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         return NSK_FALSE;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 */
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti,
-            (unsigned char*)local_variable_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)local_variable_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -424,18 +410,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -451,7 +436,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -464,7 +449,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -477,12 +462,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -496,7 +481,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -510,12 +495,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -529,12 +514,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -630,7 +615,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -642,13 +627,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -660,13 +645,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -678,10 +663,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t012/cm01t012.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t012/cm01t012.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -76,8 +76,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -89,8 +88,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]);
@@ -102,24 +100,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -133,21 +127,19 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking positive: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: SuspendThreadList\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: ResumeThreadList\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -163,27 +155,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -197,7 +185,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -210,7 +198,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -220,8 +208,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -265,43 +252,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -320,58 +309,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -386,18 +374,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -413,7 +400,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -426,7 +413,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -439,12 +426,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -458,7 +445,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -472,12 +459,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,12 +478,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -592,7 +579,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -604,13 +591,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -622,13 +609,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -640,10 +627,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t013/cm01t013.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t013/cm01t013.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -73,8 +73,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -86,8 +85,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]);
@@ -99,24 +97,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -130,23 +124,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -162,27 +154,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -196,7 +184,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -209,7 +197,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -219,8 +207,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -264,43 +251,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -319,58 +308,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -385,18 +373,16 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetLineNumberTable\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -412,7 +398,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -425,7 +411,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -438,12 +424,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -457,7 +443,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -471,12 +457,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -490,12 +476,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -591,7 +577,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -603,13 +589,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -621,13 +607,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -639,10 +625,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t014/cm01t014.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t014/cm01t014.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -130,7 +124,7 @@
 static int checkGetPotentialCapabilities() {
     jvmtiCapabilities caps;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return NSK_FALSE;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -148,7 +142,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -160,7 +154,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (owe && !caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -182,7 +176,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -196,23 +190,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -228,27 +220,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -262,7 +250,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -275,7 +263,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -285,8 +273,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -330,43 +317,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -385,58 +374,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -451,18 +439,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -478,7 +465,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,7 +478,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -504,12 +491,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -523,15 +510,14 @@
 
     if (positive) {
         NSK_DISPLAY0("Checking positive: GetBytecodes\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetBytecodes(method, &count, &bytecodes)))
             return NSK_FALSE;
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti, bytecodes)))
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate(bytecodes)))
             return NSK_FALSE;
     } else {
         NSK_DISPLAY0("Checking negative: GetBytecodes\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+                jvmti->GetBytecodes(method, &count, &bytecodes)))
             return NSK_FALSE;
     }
 
@@ -546,12 +532,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -565,12 +551,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t015/cm01t015.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t015/cm01t015.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -76,8 +76,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -89,8 +88,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]);
@@ -102,24 +100,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -132,7 +126,7 @@
 static int checkGetPotentialCapabilities() {
     jvmtiCapabilities caps;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return NSK_FALSE;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -150,7 +144,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -162,7 +156,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (owe && !caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -184,7 +178,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -198,23 +192,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -230,27 +222,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -264,7 +252,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -277,7 +265,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -287,8 +275,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -332,43 +319,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -387,58 +376,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -453,18 +441,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -480,7 +467,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -493,7 +480,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -506,23 +493,21 @@
 
     if (positive) {
         NSK_DISPLAY0("Checking positive: IsFieldSynthetic\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+        if (!NSK_JVMTI_VERIFY(jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking positive: IsMethodSynthetic\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+        if (!NSK_JVMTI_VERIFY(jvmti->IsMethodSynthetic(method, &is_synthetic)))
             return NSK_FALSE;
     } else {
         NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+                jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+                jvmti->IsMethodSynthetic(method, &is_synthetic)))
             return NSK_FALSE;
     }
 
@@ -537,7 +522,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -551,12 +536,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -570,12 +555,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t016/cm01t016.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t016/cm01t016.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -130,7 +124,7 @@
 static int checkGetPotentialCapabilities() {
     jvmtiCapabilities caps;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return NSK_FALSE;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -148,7 +142,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -160,7 +154,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (owe && !caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -182,7 +176,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -196,23 +190,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -228,27 +220,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -262,7 +250,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -275,7 +263,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -285,8 +273,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -330,43 +317,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -385,58 +374,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -451,18 +439,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -478,7 +465,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,14 +478,12 @@
 
     if (positive) {
         NSK_DISPLAY0("Checking positive: GetObjectMonitorUsage\n");
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti,
-                thread, &monitor_info)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
             return NSK_FALSE;
     } else {
         NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti,
-                    thread, &monitor_info)))
+                jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
             return NSK_FALSE;
     }
 
@@ -512,12 +497,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -531,7 +516,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -545,12 +530,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -564,12 +549,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t017/cm01t017.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t017/cm01t017.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -76,8 +76,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -89,8 +88,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]);
@@ -102,24 +100,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -132,7 +126,7 @@
 static int checkGetPotentialCapabilities() {
     jvmtiCapabilities caps;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return NSK_FALSE;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -150,7 +144,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -162,7 +156,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (owe && !caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -184,7 +178,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -198,23 +192,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -230,37 +222,33 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     if (positive) {
         NSK_DISPLAY0("Checking positive: InterruptThread\n");
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+        if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(thread)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking positive: StopThread\n");
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread, jvmti,
-                thread, exception)))
+        if (!NSK_JVMTI_VERIFY(jvmti->StopThread(thread, exception)))
             return NSK_FALSE;
     } else {
         NSK_DISPLAY0("Checking negative: StopThread\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+                jvmti->StopThread(thread, exception)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking negative: InterruptThread\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+                jvmti->InterruptThread(thread)))
             return NSK_FALSE;
     }
 
@@ -275,7 +263,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -288,7 +276,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -298,8 +286,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -343,43 +330,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -398,58 +387,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -464,18 +452,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,7 +478,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -504,7 +491,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -517,12 +504,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -536,7 +523,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -550,12 +537,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -569,12 +556,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t018/cm01t018.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t018/cm01t018.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -78,8 +78,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -91,8 +90,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]);
@@ -104,24 +102,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -134,7 +128,7 @@
 static int checkGetPotentialCapabilities() {
     jvmtiCapabilities caps;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return NSK_FALSE;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -152,7 +146,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -164,7 +158,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (owe && !caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -186,7 +180,7 @@
 
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -201,41 +195,39 @@
 
     if (positive) {
         NSK_DISPLAY0("Checking positive: SuspendThread\n");
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking positive: ResumeThread\n");
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking positive: SuspendThreadList\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+        if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(1, &thread, &err)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking positive: ResumeThreadList\n");
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+        if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(1, &thread, &err)))
             return NSK_FALSE;
     } else {
         NSK_DISPLAY0("Checking negative: SuspendThread\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+                jvmti->SuspendThread(thread)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking negative: ResumeThread\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+                jvmti->ResumeThread(thread)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+                jvmti->SuspendThreadList(1, &thread, &err)))
             return NSK_FALSE;
 
         NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+                jvmti->ResumeThreadList(1, &thread, &err)))
             return NSK_FALSE;
     }
 
@@ -252,27 +244,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -286,7 +274,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -299,7 +287,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -309,8 +297,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -354,43 +341,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -409,58 +398,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -475,18 +463,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -502,7 +489,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -515,7 +502,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -528,12 +515,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -547,7 +534,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -561,12 +548,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -580,12 +567,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t019/cm01t019.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t019/cm01t019.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -73,8 +73,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -86,8 +85,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]);
@@ -99,24 +97,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -130,23 +124,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -162,27 +154,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -196,7 +184,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -209,7 +197,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -219,8 +207,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -264,43 +251,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -319,58 +308,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -385,18 +373,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_ABSENT_INFORMATION,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -412,7 +399,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -425,7 +412,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -438,12 +425,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -457,7 +444,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -471,12 +458,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -490,12 +477,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -591,7 +578,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -603,13 +590,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -621,13 +608,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -639,10 +626,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t020/cm01t020.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t020/cm01t020.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -131,23 +125,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -163,27 +155,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -197,7 +185,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -210,7 +198,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -220,8 +208,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -265,43 +252,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -320,58 +309,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -386,18 +374,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -413,7 +400,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -426,7 +413,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -439,12 +426,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -458,7 +445,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -471,13 +458,11 @@
     jlong nanos;
 
     NSK_DISPLAY0("Checking positive: GetCurrentThreadCpuTimerInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetCurrentThreadCpuTime\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -491,12 +476,12 @@
 
     NSK_DISPLAY0("Checking negative: GetThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: checkGetThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+            jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -592,7 +577,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -604,13 +589,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -622,13 +607,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -640,10 +625,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t021/cm01t021.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t021/cm01t021.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -74,8 +74,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -87,8 +86,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]);
@@ -100,24 +98,20 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'run' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "run", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "run", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingMonitor' */
     if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass,
-                "waitingMonitor", "Ljava/lang/Object;")) != NULL))
+            jni->GetFieldID(klass, "waitingMonitor", "Ljava/lang/Object;")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -131,23 +125,21 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking negative: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SuspendThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+            jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: ResumeThreadList\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+            jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -163,27 +155,23 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: StopThread\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+            jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -197,7 +185,7 @@
 
     NSK_DISPLAY0("Checking negative: GetOwnedMonitorInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+            jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -210,7 +198,7 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentContendedMonitor\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+            jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -220,8 +208,7 @@
  */
 static int checkPopFrame() {
     NSK_DISPLAY0("Checking negative: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(PopFrame, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->PopFrame(thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -265,43 +252,45 @@
 
     NSK_DISPLAY0("Checking negative: SetTag\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+            jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetTag\n");
-    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY, jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetObjectsWithTags\n");
     tag = TAG_VALUE;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+            jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -320,58 +309,57 @@
 
     NSK_DISPLAY0("Checking negative: GetLocalVariableTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+            jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalObject, jvmti, thread, 0, 0, &object_value)))
+            jvmti->GetLocalObject(thread, 0, 0, &object_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalInt, jvmti, thread, 0, 0, &int_value)))
+            jvmti->GetLocalInt(thread, 0, 0, &int_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalLong, jvmti, thread, 0, 0, &long_value)))
+            jvmti->GetLocalLong(thread, 0, 0, &long_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalFloat, jvmti, thread, 0, 0, &float_value)))
+            jvmti->GetLocalFloat(thread, 0, 0, &float_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(GetLocalDouble, jvmti, thread, 0, 0, &double_value)))
+            jvmti->GetLocalDouble(thread, 0, 0, &double_value)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalObject\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalObject, jvmti, thread, 0, 0, thread)))
+            jvmti->SetLocalObject(thread, 0, 0, thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalInt\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalInt, jvmti, thread, 0, 0, (jint)0)))
+            jvmti->SetLocalInt(thread, 0, 0, (jint)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalLong\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalLong, jvmti, thread, 0, 0, (jlong)0)))
+            jvmti->SetLocalLong(thread, 0, 0, (jlong)0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalFloat\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalFloat, jvmti, thread, 0, 0, (jfloat)0.0)))
+            jvmti->SetLocalFloat(thread, 0, 0, (jfloat)0.0)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: SetLocalDouble\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB5(SetLocalDouble, jvmti, thread, 0, 0, (jdouble)0.0)))
+            jvmti->SetLocalDouble(thread, 0, 0, (jdouble)0.0)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -386,18 +374,17 @@
 
     NSK_DISPLAY0("Checking negative: GetSourceFileName\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+            jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetLineNumberTable\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+            jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -413,7 +400,7 @@
     class_def.class_byte_count = 0;
     class_def.class_bytes = NULL;
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+            jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -426,7 +413,7 @@
 
     NSK_DISPLAY0("Checking negative: GetObjectMonitorUsage\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+            jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -439,12 +426,12 @@
 
     NSK_DISPLAY0("Checking negative: IsFieldSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+            jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: IsMethodSynthetic\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+            jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -458,7 +445,7 @@
 
     NSK_DISPLAY0("Checking negative: GetBytecodes\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+            jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -472,12 +459,12 @@
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTimerInfo\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+            jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking negative: GetCurrentThreadCpuTime\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+            jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -490,13 +477,11 @@
     jlong nanos;
 
     NSK_DISPLAY0("Checking positive: GetThreadCpuTimerInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: checkGetThreadCpuTime\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -592,7 +577,7 @@
 
     /* testcase #1: check GetPotentialCapabilities */
     NSK_DISPLAY0("Testcase #1: check if GetPotentialCapabilities returns the capability\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPotentialCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetPotentialCapabilities does not return \"%s\" capability\n",
@@ -604,13 +589,13 @@
     NSK_DISPLAY0("Testcase #2: add the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #3: check if GetCapabilities returns the capability */
     NSK_DISPLAY0("Testcase #3: check if GetCapabilities returns the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
@@ -622,13 +607,13 @@
     NSK_DISPLAY0("Testcase #4: relinquish the capability during Onload phase\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RelinquishCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(&caps)))
         return JNI_ERR;
 
     /* testcase #5: check if GetCapabilities does not return the capability */
     NSK_DISPLAY0("Testcase #5: check if GetCapabilities does not return the capability\n");
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities returns relinquished \"%s\" capability\n",
@@ -640,10 +625,10 @@
     NSK_DISPLAY0("Testcase #6: add back the capability and check with GetCapabilities\n");
     memset(&caps, 0, sizeof(caps));
     caps.CAPABILITY = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return JNI_ERR;
     if (!caps.CAPABILITY) {
         NSK_COMPLAIN1("GetCapabilities does not return \"%s\" capability\n",
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM02/cm02t001/cm02t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM02/cm02t001/cm02t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -99,17 +99,16 @@
 
     CompiledMethodLoadEventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY3("CompiledMethodLoad event: %s%s (0x%p)\n",
         name, signature, code_addr);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -126,8 +125,8 @@
     if (err == JVMTI_ERROR_NONE) {
         NSK_DISPLAY3("for: \tmethod: name=\"%s\" signature=\"%s\"\n\tnative address=0x%p\n",
           name, sig, code_addr);
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)sig);
+        jvmti_env->Deallocate((unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)sig);
     }
 }
 
@@ -139,8 +138,7 @@
     MonitorContendedEnterEventsCount++;
 
     /* get thread information */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
-            thread, &info))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -156,8 +154,7 @@
     MonitorContendedEnteredEventsCount++;
 
     /* get thread information */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
-            thread, &info))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -173,8 +170,7 @@
     MonitorWaitEventsCount++;
 
     /* get thread information */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
-            thread, &info))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -190,8 +186,7 @@
     MonitorWaitedEventsCount++;
 
     /* get thread information */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetThreadInfo, jvmti_env,
-            thread, &info))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -207,14 +202,13 @@
 
     VMObjectAllocEventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
-            object_klass, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(object_klass, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("VMObjectAlloc: \"%s\", size=%d\n", signature, size);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -226,7 +220,7 @@
 
     NativeMethodBindEventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -234,8 +228,7 @@
     if (phase != JVMTI_PHASE_START && phase != JVMTI_PHASE_LIVE)
         return;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -243,9 +236,9 @@
     NSK_DISPLAY2("NativeMethodBind event: %s%s\n", name, signature);
 
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -280,8 +273,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -293,8 +285,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]);
@@ -305,18 +296,15 @@
         }
     }
 
-    if (!NSK_JNI_VERIFY(jni, (thread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
         return NSK_FALSE;
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -330,7 +318,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (!NSK_VERIFY(caps.can_tag_objects))
         return NSK_FALSE;
@@ -373,8 +361,7 @@
     jobject *monitors = NULL;
 
     NSK_DISPLAY0("Checking positive: GetOwnedMonitorInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetOwnedMonitorInfo, jvmti, thread, &count, &monitors)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetOwnedMonitorInfo(thread, &count, &monitors)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -386,8 +373,7 @@
     jobject monitor = NULL;
 
     NSK_DISPLAY0("Checking positive: GetCurrentContendedMonitor\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetCurrentContendedMonitor, jvmti, thread, &monitor)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentContendedMonitor(thread, &monitor)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -439,44 +425,44 @@
     jint dummy_user_data = 0;
 
     NSK_DISPLAY0("Checking positive: SetTag\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetTag, jvmti, thread, TAG_VALUE)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetTag(thread, TAG_VALUE)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetTag\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetTag, jvmti, thread, &tag)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetTag(thread, &tag)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetObjectsWithTags\n");
     tag = TAG_VALUE;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB6(GetObjectsWithTags, jvmti, 1, &tag,
-                &count, &res_objects, &res_tags)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetObjectsWithTags(1, &tag, &count, &res_objects, &res_tags)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverHeap\n");
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IterateOverHeap, jvmti, JVMTI_HEAP_OBJECT_TAGGED,
-                HeapObject, &dummy_user_data)))
+            jvmti->IterateOverHeap(JVMTI_HEAP_OBJECT_TAGGED, HeapObject, &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverInstancesOfClass\n");
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(IterateOverInstancesOfClass, jvmti, klass,
-                JVMTI_HEAP_OBJECT_UNTAGGED, HeapObject, &dummy_user_data)))
+            jvmti->IterateOverInstancesOfClass(klass,
+                                               JVMTI_HEAP_OBJECT_UNTAGGED,
+                                               HeapObject,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverObjectsReachableFromObject\n");
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IterateOverObjectsReachableFromObject, jvmti, thread,
-                ThreadObjectReference, &dummy_user_data)))
+            jvmti->IterateOverObjectsReachableFromObject(thread,
+                                                         ThreadObjectReference,
+                                                         &dummy_user_data)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IterateOverReachableObjects\n");
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(IterateOverReachableObjects, jvmti,
-                HeapRoot, StackReference, ObjectReference, &dummy_user_data)))
+            jvmti->IterateOverReachableObjects(HeapRoot,
+                                               StackReference,
+                                               ObjectReference,
+                                               &dummy_user_data)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -488,8 +474,7 @@
     jvmtiMonitorUsage monitor_info;
 
     NSK_DISPLAY0("Checking positive: GetObjectMonitorUsage\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetObjectMonitorUsage, jvmti, thread, &monitor_info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(thread, &monitor_info)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -502,13 +487,11 @@
     jlong nanos;
 
     NSK_DISPLAY0("Checking positive: GetCurrentThreadCpuTimerInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTimerInfo, jvmti, &info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: GetCurrentThreadCpuTime\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetCurrentThreadCpuTime, jvmti, &nanos)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCurrentThreadCpuTime(&nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -521,13 +504,11 @@
     jlong nanos;
 
     NSK_DISPLAY0("Checking positive: GetThreadCpuTimerInfo\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(GetThreadCpuTimerInfo, jvmti, &info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTimerInfo(&info)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: checkGetThreadCpuTime\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetThreadCpuTime, jvmti, thread, &nanos)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTime(thread, &nanos)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -641,7 +622,7 @@
     if (!checkGetThreadCpuTime(jvmti))
         nsk_jvmti_setFailStatus();
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
+    NSK_TRACE(jni->DeleteGlobalRef(thread));
 
     /* resume debugee and wait for sync */
     if (!nsk_jvmti_resumeSync())
@@ -706,7 +687,7 @@
     caps.can_generate_native_method_bind_events = 1;
     caps.can_generate_garbage_collection_events = 1;
     caps.can_generate_object_free_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* set event callbacks */
@@ -723,46 +704,45 @@
     callbacks.GarbageCollectionStart = &GarbageCollectionStart;
     callbacks.GarbageCollectionFinish = &GarbageCollectionFinish;
     callbacks.ObjectFree = &ObjectFree;
-    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 events */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_UNLOAD, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_COMPILED_METHOD_UNLOAD, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_VM_OBJECT_ALLOC, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_NATIVE_METHOD_BIND, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_NATIVE_METHOD_BIND, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_START, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_START, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_OBJECT_FREE, NULL)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(
+            JVMTI_ENABLE, JVMTI_EVENT_OBJECT_FREE, NULL)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/cm03t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/cm03t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -95,15 +95,15 @@
 
     if (name != NULL && (strcmp(name, CLASS_NAME) == 0)) {
         NSK_DISPLAY1("ClassFileLoadHook: %s\n", name);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate,
-                jvmti_env, class_data_len, &klass_bytes)))
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Allocate(class_data_len, &klass_bytes)))
             nsk_jvmti_setFailStatus();
         else {
             memcpy(klass_bytes, class_data, class_data_len);
             klass_byte_count = class_data_len;
         }
-        NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL));
+        NSK_JVMTI_VERIFY(
+            jvmti_env->SetEventNotificationMode(
+                JVMTI_DISABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL));
     }
 }
 
@@ -116,20 +116,18 @@
 
     FieldAccessEventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(
-           NSK_CPP_STUB3(ClearFieldAccessWatch, jvmti_env, klass, field)))
+    if (!NSK_JVMTI_VERIFY(jvmti_env->ClearFieldAccessWatch(klass, field)))
         return;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB6(GetFieldName,
-            jvmti_env, field_klass, field, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetFieldName(field_klass, field, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("FieldAccess event: %s:%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -142,16 +140,15 @@
 
     FieldModificationEventsCount++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB6(GetFieldName,
-            jvmti_env, field_klass, field, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetFieldName(field_klass, field, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("FieldModification event: %s:%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -162,19 +159,19 @@
 
     SingleStepEventsCount++;
 
-    NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-        jvmti_env, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
+    NSK_JVMTI_VERIFY(
+        jvmti_env->SetEventNotificationMode(
+            JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("SingleStep event: %s%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -186,19 +183,17 @@
 
     ExceptionEventsCount++;
 
-    if (!NSK_JNI_VERIFY(jni_env, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
-            klass, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY1("Exception event: %s\n", signature);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 void JNICALL
@@ -209,19 +204,17 @@
 
     ExceptionCatchEventsCount++;
 
-    if (!NSK_JNI_VERIFY(jni_env, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
-            klass, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY1("ExceptionCatch event: %s\n", signature);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -231,18 +224,17 @@
     char *signature = NULL;
 
     BreakpointEventsCount++;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("Breakpoint event: %s%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 
-    NSK_CPP_STUB3(NotifyFramePop, jvmti_env, thread, 0);
+    jvmti_env->NotifyFramePop(thread, 0);
 }
 
 static void JNICALL
@@ -253,16 +245,15 @@
     char *signature = NULL;
 
     FramePopEventsCount++;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("FramePop event: %s%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -272,16 +263,15 @@
     char *signature = NULL;
 
     MethodEntryEventsCount++;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("MethodEntry event: %s%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 static void JNICALL
@@ -292,16 +282,15 @@
     char *signature = NULL;
 
     MethodExitEventsCount++;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
-            jvmti_env, method, &name, &signature, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
         nsk_jvmti_setFailStatus();
         return;
     }
     NSK_DISPLAY2("MethodExit event: %s%s\n", name, signature);
     if (name != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name);
+        jvmti_env->Deallocate((unsigned char*)name);
     if (signature != NULL)
-        NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+        jvmti_env->Deallocate((unsigned char*)signature);
 }
 
 /* ========================================================================== */
@@ -316,8 +305,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -329,8 +317,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]);
@@ -341,28 +328,23 @@
         }
     }
 
-    if (!NSK_JNI_VERIFY(jni, (thread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
         return NSK_FALSE;
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread method 'delay' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "delay", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "delay", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingFlag' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "waitingFlag", "Z")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "waitingFlag", "Z")) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -372,41 +354,37 @@
     NSK_DISPLAY0("Prepare events ...\n");
 
     /* get tested thread method 'letItGo' */
-    if (!NSK_JNI_VERIFY(jni, (method =
-            NSK_CPP_STUB4(GetMethodID, jni, klass, "letItGo", "()V")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (method = jni->GetMethodID(klass, "letItGo", "()V")) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'waitingFlag' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "waitingFlag", "Z")) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "waitingFlag", "Z")) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-           NSK_CPP_STUB3(SetFieldAccessWatch, jvmti, klass, field)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetFieldAccessWatch(klass, field)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-           NSK_CPP_STUB3(SetFieldModificationWatch, jvmti, klass, field)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetFieldModificationWatch(klass, field)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetBreakpoint, jvmti, method, 0)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetBreakpoint(method, 0)))
         return NSK_FALSE;
 
     /* enable events */
-    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_EXCEPTION, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION_CATCH, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread)))
         return NSK_FALSE;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -420,7 +398,7 @@
     jvmtiCapabilities caps;
 
     memset(&caps, 0, sizeof(caps));
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
         return NSK_FALSE;
     if (!NSK_VERIFY(caps.can_get_bytecodes))
         return NSK_FALSE;
@@ -471,10 +449,9 @@
     unsigned char *bytecodes;
 
     NSK_DISPLAY0("Checking positive: GetBytecodes\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetBytecodes, jvmti, method, &count, &bytecodes)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetBytecodes(method, &count, &bytecodes)))
         return NSK_FALSE;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti, bytecodes)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate(bytecodes)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -486,13 +463,11 @@
     jboolean is_synthetic;
 
     NSK_DISPLAY0("Checking positive: IsFieldSynthetic\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(IsFieldSynthetic, jvmti, klass, field, &is_synthetic)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsFieldSynthetic(klass, field, &is_synthetic)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IsMethodSynthetic\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(IsMethodSynthetic, jvmti, method, &is_synthetic)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsMethodSynthetic(method, &is_synthetic)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -511,12 +486,11 @@
     class_def.klass = klass;
     class_def.class_byte_count = klass_byte_count;
     class_def.class_bytes = klass_bytes;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(RedefineClasses, jvmti, 1, &class_def)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RedefineClasses(1, &class_def)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: IsMethodObsolete\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(IsMethodObsolete, jvmti, method, &is_obsolete)))
+    if (!NSK_JVMTI_VERIFY(jvmti->IsMethodObsolete(method, &is_obsolete)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -528,8 +502,7 @@
     char *name;
 
     NSK_DISPLAY0("Checking positive: GetSourceFileName\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetSourceFileName, jvmti, klass, &name)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetSourceFileName(klass, &name)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -542,9 +515,7 @@
     jvmtiLineNumberEntry *line_number_table = NULL;
 
     NSK_DISPLAY0("Checking positive: GetLineNumberTable\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetLineNumberTable, jvmti, method, &count,
-                &line_number_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetLineNumberTable(method, &count, &line_number_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -557,7 +528,7 @@
 
     NSK_DISPLAY0("Checking positive: GetSourceDebugExtension\n");
     if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_ABSENT_INFORMATION,
-            NSK_CPP_STUB3(GetSourceDebugExtension, jvmti, klass, &name)))
+            jvmti->GetSourceDebugExtension(klass, &name)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -576,77 +547,74 @@
     int i;
 
     NSK_DISPLAY0("Checking positive: GetLocalVariableTable\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetLocalVariableTable, jvmti, method, &count,
-                &local_variable_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetLocalVariableTable(method, &count, &local_variable_table)))
         return NSK_FALSE;
 
 /* DEBUG -- while 4913796 bug not fixed thread should be suspended
  */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     for (i = 0; i < count; i++) {
         if (strcmp(local_variable_table[i].name, "o") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalObject\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalObject, jvmti,
-                    thread, 1, local_variable_table[i].slot, &object_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalObject(thread, 1, local_variable_table[i].slot, &object_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalObject\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalObject, jvmti,
-                    thread, 1, local_variable_table[i].slot, object_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalObject(thread, 1, local_variable_table[i].slot, object_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "i") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalInt\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalInt, jvmti,
-                    thread, 1, local_variable_table[i].slot, &int_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalInt(thread, 1, local_variable_table[i].slot, &int_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalInt\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalInt, jvmti,
-                    thread, 1, local_variable_table[i].slot, int_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalInt(thread, 1, local_variable_table[i].slot, int_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "l") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalLong\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalLong, jvmti,
-                    thread, 1, local_variable_table[i].slot, &long_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalLong(thread, 1, local_variable_table[i].slot, &long_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalLong\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalLong, jvmti,
-                    thread, 1, local_variable_table[i].slot, long_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalLong(thread, 1, local_variable_table[i].slot, long_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "f") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalFloat\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalFloat, jvmti,
-                    thread, 1, local_variable_table[i].slot, &float_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalFloat(thread, 1, local_variable_table[i].slot, &float_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalFloat\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalFloat, jvmti,
-                    thread, 1, local_variable_table[i].slot, float_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalFloat(thread, 1, local_variable_table[i].slot, float_value)))
                 return NSK_FALSE;
         } else if (strcmp(local_variable_table[i].name, "d") ==0) {
             NSK_DISPLAY0("Checking positive: GetLocalDouble\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetLocalDouble, jvmti,
-                    thread, 1, local_variable_table[i].slot, &double_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->GetLocalDouble(thread, 1, local_variable_table[i].slot, &double_value)))
                 return NSK_FALSE;
 
             NSK_DISPLAY0("Checking positive: SetLocalDouble\n");
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(SetLocalDouble, jvmti,
-                    thread, 1, local_variable_table[i].slot, double_value)))
+            if (!NSK_JVMTI_VERIFY(
+                    jvmti->SetLocalDouble(thread, 1, local_variable_table[i].slot, double_value)))
                 return NSK_FALSE;
         }
     }
 
 /* DEBUG -- while 4913796 bug not fixed thread should be suspended
  */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, jvmti,
-            (unsigned char*)local_variable_table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)local_variable_table)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -658,21 +626,19 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking positive: SuspendThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: ResumeThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: SuspendThreadList\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SuspendThreadList, jvmti, 1, &thread, &err)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: ResumeThreadList\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(ResumeThreadList, jvmti, 1, &thread, &err)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(1, &thread, &err)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -685,20 +651,20 @@
     jvmtiError err;
 
     NSK_DISPLAY0("Checking positive: PopFrame\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(SuspendThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread)))
         return NSK_FALSE;
 
     // PopFrame is allowed to fail with JVMTI_ERROR_OPAQUE_FRAME.
     // That will happen if we are in a native function,
     // for example while waiting for a Condition.
     // See JCK-5020108.
-    err = NSK_CPP_STUB2(PopFrame, jvmti, thread);
+    err = jvmti->PopFrame(thread);
     if (err != JVMTI_ERROR_NONE && err != JVMTI_ERROR_OPAQUE_FRAME) {
       result = NSK_FALSE;
       NSK_DISPLAY1("jvmti error from PopFrame: %d\n", err);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(ResumeThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread)))
         result = NSK_FALSE;
 
     return result;
@@ -714,25 +680,22 @@
     jmethodID ctor = NULL;
     jobject exception = NULL;
 
-    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, (exception =
-            NSK_CPP_STUB3(NewObject, jni, cls, ctor)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (exception = jni->NewObject(cls, ctor)) != NULL))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: InterruptThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(InterruptThread, jvmti, thread)))
+    if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(thread)))
         return NSK_FALSE;
 
     NSK_DISPLAY0("Checking positive: StopThread\n");
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(StopThread, jvmti, thread, exception)))
+    if (!NSK_JVMTI_VERIFY(jvmti->StopThread(thread, exception)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -847,7 +810,7 @@
     if (!checkSignalThread(jvmti, jni))
         nsk_jvmti_setFailStatus();
 
-    NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
+    NSK_TRACE(jni->DeleteGlobalRef(thread));
 
     /* resume debugee and wait for sync */
     if (!nsk_jvmti_resumeSync())
@@ -916,7 +879,7 @@
     caps.can_generate_breakpoint_events = 1;
     caps.can_generate_method_entry_events = 1;
     caps.can_generate_method_exit_events = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* set event callbacks */
@@ -931,25 +894,24 @@
     callbacks.FramePop = &FramePop;
     callbacks.MethodEntry = &MethodEntry;
     callbacks.MethodExit = &MethodExit;
-    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 events */
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_FIELD_ACCESS, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_FIELD_ACCESS, NULL)))
         return JNI_ERR;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_FIELD_MODIFICATION, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_FIELD_MODIFICATION, 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;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
-            jvmti, JVMTI_ENABLE, JVMTI_EVENT_FRAME_POP, NULL)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_FRAME_POP, NULL)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC01/tc01t001/tc01t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC01/tc01t001/tc01t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -54,8 +54,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -67,8 +66,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]);
@@ -79,38 +77,31 @@
         }
 
         if (info.name != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    Deallocate, jvmti, (unsigned char*)info.name)))
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)info.name)))
                 return NSK_FALSE;
         }
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'M1' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "M1", FIELD_SIG)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "M1", FIELD_SIG)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (object_M1 =
-            NSK_CPP_STUB3(GetObjectField, jni, thread, field)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M1 = jni->GetObjectField(thread, field)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'M2' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "M2", FIELD_SIG)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "M2", FIELD_SIG)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (object_M2 =
-            NSK_CPP_STUB3(GetObjectField, jni, thread, field)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M2 = jni->GetObjectField(thread, field)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -126,22 +117,19 @@
     int i;
 
     NSK_DISPLAY1("Checking GetObjectMonitorUsage for 0x%p\n", object);
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-            GetObjectMonitorUsage, jvmti, object, &inf)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(object, &inf)))
         return NSK_FALSE;
 
     if (nsk_getVerboseMode()) {
         if (inf.owner == NULL) {
             NSK_DISPLAY0("\towner: none (0x0)\n");
         } else {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-                    GetThreadInfo, jvmti, inf.owner, &tinf))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(inf.owner, &tinf))) {
                 result = NSK_FALSE;
             } else {
                 NSK_DISPLAY2("\towner: %s (0x%p)\n", tinf.name, inf.owner);
                 if (tinf.name != NULL) {
-                    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                            Deallocate, jvmti, (unsigned char*)tinf.name)))
+                    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)tinf.name)))
                         result = NSK_FALSE;
                 }
             }
@@ -152,15 +140,13 @@
         if (inf.waiter_count > 0) {
             NSK_DISPLAY0("\twaiters:\n");
             for (i = 0; i < inf.waiter_count; i++) {
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-                        GetThreadInfo, jvmti, inf.waiters[i], &tinf))) {
+                if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(inf.waiters[i], &tinf))) {
                     result = NSK_FALSE;
                 } else {
                     NSK_DISPLAY3("\t\t%2d: %s (0x%p)\n",
                         i, tinf.name, inf.waiters[i]);
                     if (tinf.name != NULL) {
-                        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                                Deallocate, jvmti, (unsigned char*)tinf.name)))
+                        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)tinf.name)))
                             result = NSK_FALSE;
                     }
                 }
@@ -171,15 +157,13 @@
         if (inf.notify_waiter_count > 0) {
             NSK_DISPLAY0("\tnotify_waiters:\n");
             for (i = 0; i < inf.notify_waiter_count; i++) {
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-                        GetThreadInfo, jvmti, inf.notify_waiters[i], &tinf))) {
+                if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(inf.notify_waiters[i], &tinf))) {
                     result = NSK_FALSE;
                 } else {
                     NSK_DISPLAY3("\t\t%2d: %s (0x%p)\n",
                         i, tinf.name, inf.notify_waiters[i]);
                     if (tinf.name != NULL) {
-                        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                                Deallocate, jvmti, (unsigned char*)tinf.name)))
+                        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)tinf.name)))
                             result = NSK_FALSE;
                     }
                 }
@@ -188,8 +172,7 @@
     }
 
     /* check owner to be debugee thread */
-    if (!NSK_JNI_VERIFY(jni, (NSK_CPP_STUB3(
-            IsSameObject, jni, inf.owner, thread)) == JNI_TRUE))
+    if (!NSK_JNI_VERIFY(jni, (jni->IsSameObject(inf.owner, thread)) == JNI_TRUE))
         result = NSK_FALSE;
 
     if (!NSK_VERIFY(inf.entry_count == 2))
@@ -203,13 +186,11 @@
 
     /* deallocate monitor waiters arrays */
     if (inf.waiters != NULL) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                Deallocate, jvmti, (unsigned char*)inf.waiters)))
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)inf.waiters)))
             result = NSK_FALSE;
     }
     if (inf.notify_waiters != NULL) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                Deallocate, jvmti, (unsigned char*)inf.notify_waiters)))
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)inf.notify_waiters)))
             result = NSK_FALSE;
     }
 
@@ -279,7 +260,7 @@
     /* add capabilities */
     memset(&caps, 0, sizeof(caps));
     caps.can_get_monitor_info = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001/tc02t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001/tc02t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -52,8 +52,7 @@
     jint line = 0;
     int i;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(
-            GetFrameLocation, jvmti, thread, 0, &method, &location)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetFrameLocation(thread, 0, &method, &location)))
         return 0;
 
     if (!NSK_VERIFY(method != NULL))
@@ -62,8 +61,7 @@
     if (!NSK_VERIFY(location != -1))
         return 0;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(
-            GetLineNumberTable, jvmti, method, &count, &table)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetLineNumberTable(method, &count, &table)))
         return 0;
 
     if (!NSK_VERIFY(table != NULL))
@@ -81,8 +79,7 @@
     line = table[i-1].line_number;
 
     if (table != NULL) {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)table)))
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)table)))
             return 0;
     }
 
@@ -108,8 +105,8 @@
     }
 
     /* check if event is for tested thread and object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, thread, thr) &&
-            NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
+    if (jni->IsSameObject(thread, thr) &&
+            jni->IsSameObject(object_M, obj)) {
 
         if (!(line = findLineNumber(jvmti, thread))) {
             nsk_jvmti_setFailStatus();
@@ -152,8 +149,8 @@
     }
 
     /* check if event is for tested thread and object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, thread, thr) &&
-            NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
+    if (jni->IsSameObject(thread, thr) &&
+            jni->IsSameObject(object_M, obj)) {
 
         if (!(line = findLineNumber(jvmti, thread))) {
             nsk_jvmti_setFailStatus();
@@ -194,8 +191,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -207,8 +203,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]);
@@ -219,15 +214,13 @@
         }
 
         if (info.name != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    Deallocate, jvmti, (unsigned char*)info.name)))
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)info.name)))
                 return NSK_FALSE;
         }
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     if (thread == NULL) {
@@ -236,39 +229,34 @@
     }
 
     /* make thread accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (thread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'M' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "M", FIELD_SIG)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "M", FIELD_SIG)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (object_M =
-            NSK_CPP_STUB3(GetObjectField, jni, thread, field)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = jni->GetObjectField(thread, field)) != NULL))
         return NSK_FALSE;
 
     /* make object accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (object_M =
-            NSK_CPP_STUB2(NewGlobalRef, jni, object_M)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = jni->NewGlobalRef(object_M)) != NULL))
         return NSK_FALSE;
 
     /* enable MonitorContendedEntered event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
         return NSK_FALSE;
 
     /* enable MonitorContendedEntered event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -278,8 +266,8 @@
 
     /* disable MonitorContendedEntered event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_DISABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
         nsk_jvmti_setFailStatus();
 
     return NSK_TRUE;
@@ -364,15 +352,13 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_monitor_events = 1;
     caps.can_get_line_numbers = 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.MonitorContendedEnter = &MonitorContendedEnter;
     callbacks.MonitorContendedEntered = &MonitorContendedEntered;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-                &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t001/tc03t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t001/tc03t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -57,38 +57,32 @@
     NSK_DISPLAY1("Found deadlock #%d:\n", numberOfDeadlocks);
     for (pThread = dThread;;pThread = cThread) {
         NSK_DISPLAY1(" \"%s\":\n", threadList[pThread].name);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetCurrentContendedMonitor,
-                jvmti, threadList[pThread].thread, &monitor)))
+        if (!NSK_JVMTI_VERIFY(
+                jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)))
             return NSK_FALSE;
         if (monitor != NULL) {
-            if (!NSK_JNI_VERIFY(jni, (klass =
-                    NSK_CPP_STUB2(GetObjectClass, jni, monitor)) != NULL))
+            if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(monitor)) != NULL))
                 return NSK_FALSE;
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(
-                    GetClassSignature, jvmti, klass, &name, NULL)))
+            if (!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &name, NULL)))
                 return NSK_FALSE;
             NSK_DISPLAY2("    waiting to lock %p (%s),\n", monitor, name);
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+            jvmti->Deallocate((unsigned char*)name);
         } else {
             NSK_DISPLAY0(" (JVMTI raw monitor),\n");
         }
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage,
-                jvmti, monitor, &usageInfo)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(monitor, &usageInfo)))
             return NSK_FALSE;
         if (usageInfo.owner == NULL)
             break;
         for (cThread = 0; cThread < threads_count; cThread++) {
-            if (NSK_CPP_STUB3(IsSameObject, jni,
-                    threadList[cThread].thread, usageInfo.owner))
+            if (jni->IsSameObject(threadList[cThread].thread, usageInfo.owner))
                 break;
         }
         if (usageInfo.waiters != NULL) {
-            NSK_CPP_STUB2(Deallocate, jvmti,
-                    (unsigned char*)usageInfo.waiters);
+            jvmti->Deallocate((unsigned char*)usageInfo.waiters);
         }
         if (usageInfo.notify_waiters != NULL) {
-            NSK_CPP_STUB2(Deallocate, jvmti,
-                    (unsigned char*)usageInfo.notify_waiters);
+            jvmti->Deallocate((unsigned char*)usageInfo.notify_waiters);
         }
         if (!NSK_VERIFY(cThread != threads_count))
             return NSK_FALSE;
@@ -113,15 +107,14 @@
     NSK_DISPLAY0("Create threadList\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))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti,
-            threads_count*sizeof(threadDesc), (unsigned char**)&threadList)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->Allocate(threads_count*sizeof(threadDesc), (unsigned char**)&threadList)))
         return NSK_FALSE;
 
     for (i = 0; i < threads_count; i++) {
@@ -129,8 +122,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]);
@@ -141,8 +133,7 @@
     }
 
     /* deallocate thread list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     for (i = 0; i < threads_count; i++) {
@@ -150,28 +141,24 @@
             tDfn = gDfn;
             threadList[i].dfn = gDfn++;
             for (pThread = i;;pThread = cThread) {
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetCurrentContendedMonitor,
-                        jvmti, threadList[pThread].thread, &monitor)))
+                if (!NSK_JVMTI_VERIFY(
+                        jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)))
                     return NSK_FALSE;
                 if (monitor == NULL)
                     break;
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage,
-                        jvmti, monitor, &usageInfo)))
+                if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(monitor, &usageInfo)))
                     return NSK_FALSE;
                 if (usageInfo.owner == NULL)
                     break;
                 for (cThread = 0; cThread < threads_count; cThread++) {
-                    if (NSK_CPP_STUB3(IsSameObject, jni,
-                            threadList[cThread].thread, usageInfo.owner))
+                    if (jni->IsSameObject(threadList[cThread].thread, usageInfo.owner))
                         break;
                 }
                 if (usageInfo.waiters != NULL) {
-                    NSK_CPP_STUB2(Deallocate, jvmti,
-                            (unsigned char*)usageInfo.waiters);
+                    jvmti->Deallocate((unsigned char*)usageInfo.waiters);
                 }
                 if (usageInfo.notify_waiters != NULL) {
-                    NSK_CPP_STUB2(Deallocate, jvmti,
-                            (unsigned char*)usageInfo.notify_waiters);
+                    jvmti->Deallocate((unsigned char*)usageInfo.notify_waiters);
                 }
                 if (!NSK_VERIFY(cThread != threads_count))
                     return NSK_FALSE;
@@ -194,8 +181,7 @@
     /* deallocate thread names */
     for (i = 0; i < threads_count; i++) {
         if (threadList[i].name != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    Deallocate, jvmti, (unsigned char*)threadList[i].name)))
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadList[i].name)))
                 return NSK_FALSE;
         }
     }
@@ -261,7 +247,7 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_get_current_contended_monitor = 1;
     caps.can_get_monitor_info = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/tc03t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/tc03t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -57,38 +57,32 @@
     NSK_DISPLAY1("Found deadlock #%d:\n", numberOfDeadlocks);
     for (pThread = dThread;;pThread = cThread) {
         NSK_DISPLAY1(" \"%s\":\n", threadList[pThread].name);
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetCurrentContendedMonitor,
-                jvmti, threadList[pThread].thread, &monitor)))
+        if (!NSK_JVMTI_VERIFY(
+                jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)))
             return NSK_FALSE;
         if (monitor != NULL) {
-            if (!NSK_JNI_VERIFY(jni, (klass =
-                    NSK_CPP_STUB2(GetObjectClass, jni, monitor)) != NULL))
+            if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(monitor)) != NULL))
                 return NSK_FALSE;
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(
-                    GetClassSignature, jvmti, klass, &name, NULL)))
+            if (!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &name, NULL)))
                 return NSK_FALSE;
             NSK_DISPLAY2("    waiting to lock %p (%s),\n", monitor, name);
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)name);
+            jvmti->Deallocate((unsigned char*)name);
         } else {
             NSK_DISPLAY0(" (JVMTI raw monitor),\n");
         }
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage,
-                jvmti, monitor, &usageInfo)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(monitor, &usageInfo)))
             return NSK_FALSE;
         if (usageInfo.owner == NULL)
             break;
         for (cThread = 0; cThread < threads_count; cThread++) {
-            if (NSK_CPP_STUB3(IsSameObject, jni,
-                    threadList[cThread].thread, usageInfo.owner))
+            if (jni->IsSameObject(threadList[cThread].thread, usageInfo.owner))
                 break;
         }
         if (usageInfo.waiters != NULL) {
-            NSK_CPP_STUB2(Deallocate, jvmti,
-                    (unsigned char*)usageInfo.waiters);
+            jvmti->Deallocate((unsigned char*)usageInfo.waiters);
         }
         if (usageInfo.notify_waiters != NULL) {
-            NSK_CPP_STUB2(Deallocate, jvmti,
-                    (unsigned char*)usageInfo.notify_waiters);
+            jvmti->Deallocate((unsigned char*)usageInfo.notify_waiters);
         }
         if (!NSK_VERIFY(cThread != threads_count))
             return NSK_FALSE;
@@ -113,15 +107,14 @@
     NSK_DISPLAY0("Create threadList\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))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti,
-            threads_count*sizeof(threadDesc), (unsigned char**)&threadList)))
+    if (!NSK_JVMTI_VERIFY(
+            jvmti->Allocate(threads_count*sizeof(threadDesc), (unsigned char**)&threadList)))
         return NSK_FALSE;
 
     for (i = 0; i < threads_count; i++) {
@@ -129,8 +122,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]);
@@ -141,8 +133,7 @@
     }
 
     /* deallocate thread list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     for (i = 0; i < threads_count; i++) {
@@ -150,28 +141,24 @@
             tDfn = gDfn;
             threadList[i].dfn = gDfn++;
             for (pThread = i;;pThread = cThread) {
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetCurrentContendedMonitor,
-                        jvmti, threadList[pThread].thread, &monitor)))
+                if (!NSK_JVMTI_VERIFY(
+                        jvmti->GetCurrentContendedMonitor(threadList[pThread].thread, &monitor)))
                     return NSK_FALSE;
                 if (monitor == NULL)
                     break;
-                if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage,
-                        jvmti, monitor, &usageInfo)))
+                if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(monitor, &usageInfo)))
                     return NSK_FALSE;
                 if (usageInfo.owner == NULL)
                     break;
                 for (cThread = 0; cThread < threads_count; cThread++) {
-                    if (NSK_CPP_STUB3(IsSameObject, jni,
-                            threadList[cThread].thread, usageInfo.owner))
+                    if (jni->IsSameObject(threadList[cThread].thread, usageInfo.owner))
                         break;
                 }
                 if (usageInfo.waiters != NULL) {
-                    NSK_CPP_STUB2(Deallocate, jvmti,
-                            (unsigned char*)usageInfo.waiters);
+                    jvmti->Deallocate((unsigned char*)usageInfo.waiters);
                 }
                 if (usageInfo.notify_waiters != NULL) {
-                    NSK_CPP_STUB2(Deallocate, jvmti,
-                            (unsigned char*)usageInfo.notify_waiters);
+                    jvmti->Deallocate((unsigned char*)usageInfo.notify_waiters);
                 }
                 if (!NSK_VERIFY(cThread != threads_count))
                     return NSK_FALSE;
@@ -194,8 +181,7 @@
     /* deallocate thread names */
     for (i = 0; i < threads_count; i++) {
         if (threadList[i].name != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    Deallocate, jvmti, (unsigned char*)threadList[i].name)))
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadList[i].name)))
                 return NSK_FALSE;
         }
     }
@@ -261,7 +247,7 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_get_current_contended_monitor = 1;
     caps.can_get_monitor_info = 1;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+    if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC04/tc04t001/tc04t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC04/tc04t001/tc04t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -44,14 +44,14 @@
 
 
 static jboolean lockSyncLock(jvmtiEnv* jvmti) {
-    jboolean status = NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock));
+    jboolean status = NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock));
     if (!status)
         nsk_jvmti_setFailStatus();
     return status;
 }
 
 static void unlockSyncLock(jvmtiEnv* jvmti) {
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 }
 
@@ -73,7 +73,7 @@
     }
 
     /* check if event is for tested object */
-    if (NSK_CPP_STUB3(IsInstanceOf, jni, obj, object_M)) {
+    if (jni->IsInstanceOf(obj, object_M)) {
         if (lockSyncLock(jvmti)) {
             waitEventsCount++;
             unlockSyncLock(jvmti);
@@ -96,7 +96,7 @@
     }
 
     /* check if event is for tested object */
-    if (NSK_CPP_STUB3(IsInstanceOf, jni, obj, object_M)) {
+    if (jni->IsInstanceOf(obj, object_M)) {
         if (lockSyncLock(jvmti)) {
             waitedEventsCount++;
             unlockSyncLock(jvmti);
@@ -118,7 +118,7 @@
     }
 
     /* check if event is for tested object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
+    if (jni->IsSameObject(object_M, obj)) {
         jvmtiMonitorUsage usageInfo;
 
         if (lockSyncLock(jvmti)) {
@@ -126,12 +126,10 @@
             unlockSyncLock(jvmti);
         }
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetObjectMonitorUsage,
-                jvmti, obj, &usageInfo))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetObjectMonitorUsage(obj, &usageInfo))) {
             nsk_jvmti_setFailStatus();
         } else if (usageInfo.owner != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    InterruptThread, jvmti, usageInfo.owner)))
+            if (!NSK_JVMTI_VERIFY(jvmti->InterruptThread(usageInfo.owner)))
                 nsk_jvmti_setFailStatus();
         }
     }
@@ -151,7 +149,7 @@
     }
 
     /* check if event is for tested object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
+    if (jni->IsSameObject(object_M, obj)) {
         if (lockSyncLock(jvmti)) {
             enteredEventsCount++;
             unlockSyncLock(jvmti);
@@ -166,40 +164,35 @@
 
     NSK_DISPLAY0("Obtain tested object from debugee thread class\n");
 
-    if (!NSK_JNI_VERIFY(jni, (object_M =
-            NSK_CPP_STUB2(FindClass, jni, CLASS_NAME)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = jni->FindClass(CLASS_NAME)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (object_M = (jclass)
-            NSK_CPP_STUB2(NewGlobalRef, jni, object_M)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = (jclass)jni->NewGlobalRef(object_M)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock)))
         return NSK_FALSE;
 
     /* enable MonitorWait event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_WAIT, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* enable MonitorWaited event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_WAITED, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* enable MonitorContendedEnter event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* enable MonitorContendedEntered event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_ENABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
         nsk_jvmti_setFailStatus();
 
     return NSK_TRUE;
@@ -209,30 +202,27 @@
 
     /* disable MonitorWait event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_WAIT, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* disable MonitorWaited event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_WAITED, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* disable MonitorContendedEnter event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_DISABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* disable MonitorContendedEntered event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_DISABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL)))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
     return NSK_TRUE;
@@ -336,7 +326,7 @@
     caps.can_generate_monitor_events = 1;
     caps.can_get_monitor_info = 1;
     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;
 
     memset(&callbacks, 0, sizeof(callbacks));
@@ -344,8 +334,7 @@
     callbacks.MonitorWaited = &MonitorWaited;
     callbacks.MonitorContendedEnter = &MonitorContendedEnter;
     callbacks.MonitorContendedEntered = &MonitorContendedEntered;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-            &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/contention/TC05/tc05t001/tc05t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -72,14 +72,12 @@
     }
 
     /* check if event is for tested thread and object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, thread, thr) &&
-            NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-                GetThreadCpuTime, jvmti, thr, &waitThreadCpuTime))) {
+    if (jni->IsSameObject(thread, thr) &&
+            jni->IsSameObject(object_M, obj)) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTime(thr, &waitThreadCpuTime))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(GetTime, jvmti, &waitTime))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetTime(&waitTime))) {
             nsk_jvmti_setFailStatus();
         }
         waitEventsCount++;
@@ -113,14 +111,12 @@
     }
 
     /* check if event is for tested thread and object */
-    if (NSK_CPP_STUB3(IsSameObject, jni, thread, thr) &&
-            NSK_CPP_STUB3(IsSameObject, jni, object_M, obj)) {
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(
-                GetThreadCpuTime, jvmti, thr, &waitedThreadCpuTime))) {
+    if (jni->IsSameObject(thread, thr) &&
+            jni->IsSameObject(object_M, obj)) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadCpuTime(thr, &waitedThreadCpuTime))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(GetTime, jvmti, &waitedTime))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->GetTime(&waitedTime))) {
             nsk_jvmti_setFailStatus();
         }
         waitedEventsCount++;
@@ -149,8 +145,7 @@
     NSK_DISPLAY0("Prepare: find tested thread\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))
@@ -162,8 +157,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]);
@@ -174,15 +168,13 @@
         }
 
         if (info.name != NULL) {
-            if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(
-                    Deallocate, jvmti, (unsigned char*)info.name)))
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)info.name)))
                 return NSK_FALSE;
         }
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NSK_FALSE;
 
     if (thread == NULL) {
@@ -191,39 +183,32 @@
     }
 
     /* make thread accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (thread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread class */
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni, thread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->GetObjectClass(thread)) != NULL))
         return NSK_FALSE;
 
     /* get tested thread field 'M' */
-    if (!NSK_JNI_VERIFY(jni, (field =
-            NSK_CPP_STUB4(GetFieldID, jni, klass, "M", FIELD_SIG)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, "M", FIELD_SIG)) != NULL))
         return NSK_FALSE;
 
-    if (!NSK_JNI_VERIFY(jni, (object_M =
-            NSK_CPP_STUB3(GetObjectField, jni, thread, field)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = jni->GetObjectField(thread, field)) != NULL))
         return NSK_FALSE;
 
     /* make object accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (object_M =
-            NSK_CPP_STUB2(NewGlobalRef, jni, object_M)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (object_M = jni->NewGlobalRef(object_M)) != NULL))
         return NSK_FALSE;
 
     /* enable MonitorWait event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_WAIT, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
         return NSK_FALSE;
 
     /* enable MonitorWaited event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_ENABLE,
-                JVMTI_EVENT_MONITOR_WAITED, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -233,14 +218,12 @@
 
     /* disable MonitorWait event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_WAIT, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAIT, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* disable MonitorWaited event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_WAITED, NULL)))
+            jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_MONITOR_WAITED, NULL)))
         nsk_jvmti_setFailStatus();
 
     return NSK_TRUE;
@@ -343,14 +326,13 @@
     memset(&caps, 0, sizeof(caps));
     caps.can_generate_monitor_events = 1;
     caps.can_get_thread_cpu_time = 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.MonitorWait = &MonitorWait;
     callbacks.MonitorWaited = &MonitorWaited;
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-            &callbacks, sizeof(callbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
         return JNI_ERR;
 
     /* register agent proc and arg */
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t001/em01t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t001/em01t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -54,12 +54,12 @@
 static void
 changeCount(jvmtiEvent event) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     eventCount[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -92,9 +92,7 @@
     char *generic;
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, klass,
-                                &className, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -107,7 +105,7 @@
                             className);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -125,13 +123,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)className))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) {
         nsk_jvmti_setFailStatus();
     }
     if (generic != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)generic))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -145,15 +141,12 @@
     jvmtiPhase phase;
 
 
-    if (!NSK_JNI_VERIFY(jni_env, (classObject =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, thread)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (classObject = jni_env->GetObjectClass(thread)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, classObject,
-                                &className, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(classObject, &className, &generic))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -166,7 +159,7 @@
                             className);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -184,13 +177,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)className))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) {
         nsk_jvmti_setFailStatus();
     }
     if (generic != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)generic))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -200,7 +191,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -221,7 +212,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -242,7 +233,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -257,8 +248,7 @@
     currentPhase = JVMTI_PHASE_DEAD;
     changeCount(JVMTI_EVENT_VM_DEATH);
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -294,9 +284,7 @@
 static int
 enableEvent(jvmtiEventMode enable, jvmtiEvent event) {
     NSK_DISPLAY1("enabling %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;
     }
@@ -369,10 +357,7 @@
     eventCallbacks.ThreadStart  = cbThreadStart;
     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;
@@ -446,8 +431,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t002/em01t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t002/em01t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -65,22 +65,20 @@
     jmethodID methodID;
     jclass loadedClass;
 
-    if (!NSK_JNI_VERIFY(jni_env, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, loader)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(loader)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
 
-    if (!NSK_JNI_VERIFY(jni_env, (methodID =
-            NSK_CPP_STUB4(GetMethodID, jni_env, klass, "loadClass",
-                        "(Ljava/lang/String;)Ljava/lang/Class;")) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env,
+            (methodID = jni_env->GetMethodID(
+                klass, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;")) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
 
     if (!NSK_JNI_VERIFY(jni_env, (loadedClass = (jclass)
-            NSK_CPP_STUB4(CallObjectMethod, jni_env, loader, methodID,
-                                    className)) != NULL)) {
+            jni_env->CallObjectMethod(loader, methodID, className)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
@@ -99,8 +97,7 @@
     jfieldID fieldID;
 
     if (!NSK_JNI_VERIFY(jni_env, (fieldID =
-            NSK_CPP_STUB4(GetStaticFieldID, jni_env, klass,
-                        "toProvokePreparation", "I")) != NULL)) {
+            jni_env->GetStaticFieldID(klass, "toProvokePreparation", "I")) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -119,20 +116,18 @@
     jclass klass;
     jmethodID methodID;
 
-    if (!NSK_JNI_VERIFY(jni_env, (klass =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, thread)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(thread)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
     if (!NSK_JNI_VERIFY(jni_env, (methodID =
-            NSK_CPP_STUB4(GetMethodID, jni_env, klass, "start", "()V")) != NULL)) {
+            jni_env->GetMethodID(klass, "start", "()V")) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
-    if (!NSK_JNI_VERIFY_VOID(jni_env,
-            NSK_CPP_STUB3(CallVoidMethod, jni_env, thread, methodID)) ) {
+    if (!NSK_JNI_VERIFY_VOID(jni_env,jni_env->CallVoidMethod(thread, methodID)) ) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -146,12 +141,12 @@
 static void
 changeCount(jvmtiEvent event) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     eventCount[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -184,9 +179,7 @@
     char *generic;
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, klass,
-                                &className, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -199,7 +192,7 @@
                             className);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -217,13 +210,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)className))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) {
         nsk_jvmti_setFailStatus();
     }
     if (generic != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)generic))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -237,15 +228,12 @@
     jvmtiPhase phase;
 
 
-    if (!NSK_JNI_VERIFY(jni_env, (classObject =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, thread)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (classObject = jni_env->GetObjectClass(thread)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, classObject,
-                                &className, &generic))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(classObject, &className, &generic))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -258,7 +246,7 @@
                             className);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -276,13 +264,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)className))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) {
         nsk_jvmti_setFailStatus();
     }
     if (generic != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)generic))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -292,7 +278,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -313,7 +299,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -334,7 +320,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -349,8 +335,7 @@
     currentPhase = JVMTI_PHASE_DEAD;
     changeCount(JVMTI_EVENT_VM_DEATH);
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -393,9 +378,7 @@
     }
 
 
-    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;
     }
@@ -468,10 +451,7 @@
     eventCallbacks.ThreadStart  = cbThreadStart;
     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;
@@ -544,8 +524,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t001/em02t001.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t001/em02t001.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -68,8 +68,7 @@
     int i;
 
     /* 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 NULL;
 
     if (!NSK_VERIFY(threads != NULL))
@@ -81,8 +80,7 @@
             break;
 
         /* get thread information */
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+        if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
             break;
 
         /* find by name */
@@ -92,8 +90,7 @@
     }
 
     /* deallocate threads list */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
         return NULL;
 
     return returnValue;
@@ -108,16 +105,14 @@
     jfieldID fieldID;
     jclass klass = NULL;
 
-    if (!NSK_JNI_VERIFY(jni, (klass =
-            NSK_CPP_STUB2(FindClass, jni, className)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass(className)) != NULL))
         return NULL;
 
     if (!NSK_JNI_VERIFY(jni, (fieldID =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, klass, objFieldName,
-                                signature)) != NULL))
+            jni->GetStaticFieldID(klass, objFieldName, signature)) != NULL))
         return NULL;
 
-    return NSK_CPP_STUB3(GetStaticObjectField, jni, klass, fieldID);
+    return jni->GetStaticObjectField(klass, fieldID);
 }
 
 /* ============================================================================= */
@@ -130,8 +125,7 @@
     }
 
     /* make thread accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (mainThread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, mainThread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (mainThread = jni->NewGlobalRef(mainThread)) != NULL))
         return NSK_FALSE;
 
     if (!NSK_VERIFY((startObject =
@@ -140,8 +134,7 @@
         return NSK_FALSE;
 
     /*make object accessable for a long time*/
-    if (!NSK_JNI_VERIFY(jni, (startObject =
-            NSK_CPP_STUB2(NewGlobalRef, jni, startObject)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (startObject = jni->NewGlobalRef(startObject)) != NULL))
         return NSK_FALSE;
 
 
@@ -151,8 +144,7 @@
         return NSK_FALSE;
 
     /*make object accessable for a long time*/
-    if (!NSK_JNI_VERIFY(jni, (endObject =
-            NSK_CPP_STUB2(NewGlobalRef, jni, endObject)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (endObject = jni->NewGlobalRef(endObject)) != NULL))
         return NSK_FALSE;
 
 
@@ -162,8 +154,7 @@
         return NSK_FALSE;
 
     /* make thread accessable for a long time */
-    if (!NSK_JNI_VERIFY(jni, (debuggeeThread =
-            NSK_CPP_STUB2(NewGlobalRef, jni, debuggeeThread)) != NULL))
+    if (!NSK_JNI_VERIFY(jni, (debuggeeThread = jni->NewGlobalRef(debuggeeThread)) != NULL))
         return NSK_FALSE;
 
     return NSK_TRUE;
@@ -176,15 +167,15 @@
 
     /* disable MonitorContendedEnter event */
     if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, JVMTI_DISABLE,
-                JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
+            jvmti->SetEventNotificationMode(
+                JVMTI_DISABLE, JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL)))
         nsk_jvmti_setFailStatus();
 
     /* dispose global references */
-    NSK_CPP_STUB2(DeleteGlobalRef, jni, startObject);
-    NSK_CPP_STUB2(DeleteGlobalRef, jni, endObject);
-    NSK_CPP_STUB2(DeleteGlobalRef, jni, debuggeeThread);
-    NSK_CPP_STUB2(DeleteGlobalRef, jni, mainThread);
+    jni->DeleteGlobalRef(startObject);
+    jni->DeleteGlobalRef(endObject);
+    jni->DeleteGlobalRef(debuggeeThread);
+    jni->DeleteGlobalRef(mainThread);
 
     startObject = NULL;
     endObject = NULL;
@@ -219,8 +210,7 @@
 static void
 showThreadInfo(jthread thread) {
     jvmtiThreadInfo info;
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetThreadInfo, jvmti, thread, &info)))
+    if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &info)))
         return;
 
     NSK_DISPLAY2("\tthread (%s): %p\n", info.name, thread);
@@ -231,12 +221,12 @@
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -327,8 +317,7 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -420,13 +409,13 @@
         return;
 
     /* check if event is for tested thread and for tested object */
-    if (NSK_CPP_STUB3(IsSameObject, jni_env, expectedThread, thread) &&
-            NSK_CPP_STUB3(IsSameObject, jni_env, expectedObject, object)) {
+    if (jni_env->IsSameObject(expectedThread, thread) &&
+            jni_env->IsSameObject(expectedObject, object)) {
 
         NSK_DISPLAY1("--->%-40s is received\n", TranslateEvent(event));
 
         showThreadInfo(thread);
-        if (NSK_CPP_STUB3(IsSameObject, jni_env, expectedObject, endObject))
+        if (jni_env->IsSameObject(expectedObject, endObject))
             NSK_DISPLAY0("\tobject: 'endingMonitor'\n");
         else
             NSK_DISPLAY0("\tobject: 'startingMonitor'\n");
@@ -506,13 +495,13 @@
         return;
 
     /* check if event is for tested thread and for tested object */
-    if (NSK_CPP_STUB3(IsSameObject, jni_env, expectedThread, thread) &&
-            NSK_CPP_STUB3(IsSameObject, jni_env, expectedObject, object)) {
+    if (jni_env->IsSameObject(expectedThread, thread) &&
+            jni_env->IsSameObject(expectedObject, object)) {
 
         NSK_DISPLAY1("--->%-40s is received (new callbacks)\n", TranslateEvent(event));
 
         showThreadInfo(thread);
-        if (NSK_CPP_STUB3(IsSameObject, jni_env, expectedObject, endObject))
+        if (jni_env->IsSameObject(expectedObject, endObject))
             NSK_DISPLAY0("\tobject: 'endingMonitor'\n");
         else
             NSK_DISPLAY0("\tobject: 'startingMonitor'\n");
@@ -572,16 +561,13 @@
             && (event != JVMTI_EVENT_MONITOR_WAIT)
             && (event != JVMTI_EVENT_MONITOR_WAITED)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     } else {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
@@ -679,10 +665,7 @@
             break;
 
     }
-    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;
@@ -771,8 +754,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
@@ -782,7 +764,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_generate_monitor_events = 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/scenarios/events/EM02/em02t002/em02t002.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t002/em02t002.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -150,12 +150,12 @@
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -177,8 +177,7 @@
     if (!checkEvents(STEP_AMOUNT))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -345,16 +344,13 @@
             && (event != JVMTI_EVENT_GARBAGE_COLLECTION_START)
             && (event != JVMTI_EVENT_GARBAGE_COLLECTION_FINISH)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     } else {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
@@ -450,10 +446,7 @@
             break;
 
     }
-    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;
@@ -519,8 +512,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
@@ -530,7 +522,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_generate_garbage_collection_events = 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/scenarios/events/EM02/em02t003/em02t003.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t003/em02t003.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -134,12 +134,12 @@
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -159,8 +159,7 @@
     if (!checkEvents(STEP_AMOUNT))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -265,9 +264,7 @@
     char *sign;
     char *genc;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(
-                GetMethodName, jvmti, method, &name, &sign, &genc))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(method, &name, &sign, &genc))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -277,17 +274,14 @@
         changeCount(event, &eventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti, (unsigned char*)name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)name))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti, (unsigned char*)sign))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)sign))) {
         nsk_jvmti_setFailStatus();
     }
     if (genc != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti, (unsigned char*)genc))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)genc))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -338,9 +332,7 @@
     char *sign;
     char *genc;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(
-                GetMethodName, jvmti, method, &name, &sign, &genc))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetMethodName(method, &name, &sign, &genc))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -348,17 +340,14 @@
     NSK_DISPLAY2("\tMethod: %s, signature: %s\n", name, sign);
     changeCount(event, &newEventCount[0]);
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti, (unsigned char*)name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)name))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti, (unsigned char*)sign))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)sign))) {
         nsk_jvmti_setFailStatus();
     }
     if (genc != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti, (unsigned char*)genc))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)genc))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -389,16 +378,13 @@
             && (event != JVMTI_EVENT_COMPILED_METHOD_LOAD)
             && (event != JVMTI_EVENT_COMPILED_METHOD_UNLOAD)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     } else {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
@@ -498,10 +484,7 @@
             break;
 
     }
-    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;
@@ -568,8 +551,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
@@ -579,7 +561,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_generate_compiled_method_load_events = 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/scenarios/events/EM02/em02t004/em02t004.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t004/em02t004.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -146,12 +146,12 @@
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -171,8 +171,7 @@
     if (!checkEvents(STEP_AMOUNT))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -310,7 +309,7 @@
     char *genc;
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -318,9 +317,7 @@
         return;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(
-                GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
         return;
     }
 
@@ -331,17 +328,14 @@
         changeCount(JVMTI_EVENT_NATIVE_METHOD_BIND, &eventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)sign))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
         nsk_jvmti_setFailStatus();
     }
     if (genc != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)genc))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -355,7 +349,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -363,9 +357,7 @@
         return;
     }
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB5(
-                GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
         return;
     }
 
@@ -376,17 +368,14 @@
         changeCount(JVMTI_EVENT_NATIVE_METHOD_BIND, &newEventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)sign))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
         nsk_jvmti_setFailStatus();
     }
     if (genc != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)genc))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -398,16 +387,13 @@
     if (nsk_jvmti_isOptionalEvent(event)
             && (event != JVMTI_EVENT_NATIVE_METHOD_BIND)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     } else {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
@@ -505,10 +491,7 @@
             break;
 
     }
-    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;
@@ -574,8 +557,7 @@
     if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
@@ -585,7 +567,7 @@
         memset(&caps, 0, sizeof(caps));
 
         caps.can_generate_native_method_bind_events = 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/scenarios/events/EM02/em02t005/em02t005.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t005/em02t005.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -133,12 +133,12 @@
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -158,8 +158,7 @@
     if (!checkEvents(STEP_NUMBER))
         nsk_jvmti_setFailStatus();
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
@@ -302,9 +301,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, object_klass,
-                                &sign_ptr, &gen_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(object_klass, &sign_ptr, &gen_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -313,7 +310,7 @@
         changeCount(JVMTI_EVENT_VM_OBJECT_ALLOC, &eventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -326,13 +323,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)sign_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign_ptr))) {
         nsk_jvmti_setFailStatus();
     }
     if (gen_ptr != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)gen_ptr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)gen_ptr))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -346,9 +341,7 @@
 
     jvmtiPhase phase;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(GetClassSignature, jvmti_env, object_klass,
-                                &sign_ptr, &gen_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(object_klass, &sign_ptr, &gen_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
@@ -357,7 +350,7 @@
         changeCount(JVMTI_EVENT_VM_OBJECT_ALLOC, &newEventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, jvmti_env, &phase))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
         nsk_jvmti_setFailStatus();
     }
 
@@ -370,13 +363,11 @@
         nsk_jvmti_setFailStatus();
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)sign_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign_ptr))) {
         nsk_jvmti_setFailStatus();
     }
     if (gen_ptr != NULL)
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-                jvmti_env, (unsigned char*)gen_ptr))) {
+        if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)gen_ptr))) {
             nsk_jvmti_setFailStatus();
         }
 }
@@ -388,16 +379,13 @@
     if (nsk_jvmti_isOptionalEvent(event)
             && (event != JVMTI_EVENT_VM_OBJECT_ALLOC)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     } else {
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
@@ -490,10 +478,7 @@
             break;
 
     }
-    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;
@@ -553,8 +538,7 @@
         return JNI_ERR;
 
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
@@ -564,7 +548,7 @@
         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;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/JNIGlobalRefLocker.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -20,10 +20,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 #include <jni.h>
 #include <stdio.h>
 #include <time.h>
 #include "jni_tools.h"
+#include "ExceptionCheckingJniEnv.hpp"
 
 extern "C" {
 
@@ -35,28 +37,18 @@
  * Signature: (JJ)V
  */
 JNIEXPORT void JNICALL Java_nsk_share_gc_lock_jniref_JNIGlobalRefLocker_criticalNative
-  (JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) {
+  (JNIEnv *jni_env, jobject o, jlong enterTime, jlong sleepTime) {
+        ExceptionCheckingJniEnvPtr env(jni_env);
+
         jobject obj;
         jobject gref;
         time_t start_time, current_time;
 
         if (objFieldId == NULL) {
                 jclass klass = env->GetObjectClass(o);
-                if (klass == NULL) {
-                        printf("Error: GetObjectClass returned NULL\n");
-                        return;
-                }
                 objFieldId = env->GetFieldID(klass, "obj", "Ljava/lang/Object;");
-                if (objFieldId == NULL) {
-                        printf("Error: GetFieldID returned NULL\n");
-                        return;
-                }
         }
         obj = env->GetObjectField(o, objFieldId);
-        if (obj == NULL) {
-                printf("Error: GetObjectField returned NULL\n");
-                return;
-        }
         env->SetObjectField(o, objFieldId, NULL);
         start_time = time(NULL);
         enterTime /= 1000;
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/jniref/libJNIGlobalRefLocker.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -24,3 +24,4 @@
 #include "JNIGlobalRefLocker.cpp"
 #include "jni_tools.cpp"
 #include "nsk_tools.cpp"
+#include "ExceptionCheckingJniEnv.cpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.cpp	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Google 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "ExceptionCheckingJniEnv.hpp"
+
+namespace {
+
+template<class T = void*>
+class JNIVerifier {
+ public:
+  JNIVerifier(ExceptionCheckingJniEnv *env, const char* base_msg)
+      : _env(env), _base_msg(base_msg), _return_error(NULL) {
+  }
+
+  ~JNIVerifier() {
+    JNIEnv* jni_env = _env->GetJNIEnv();
+    if (jni_env->ExceptionCheck()) {
+      _env->HandleError(_base_msg);
+      return;
+    }
+
+    if (_return_error != NULL) {
+      ProcessReturnError();
+    }
+  }
+
+  void ProcessReturnError() {
+    int len = snprintf(NULL, 0, "%s : %s", _base_msg, _return_error) + 1;
+
+    if (len <= 0) {
+      _env->HandleError(_return_error);
+      return;
+    }
+
+    char* full_message = (char*) malloc(len);
+    if (full_message == NULL) {
+      _env->HandleError(_return_error);
+      return;
+    }
+
+    snprintf(full_message, len, "%s : %s", _base_msg, _return_error);
+
+    _env->HandleError(full_message);
+    free(full_message);
+  }
+
+  T ResultNotNull(T ptr) {
+    if (ptr == NULL) {
+      _return_error = "Return is NULL";
+    }
+    return ptr;
+  }
+
+ private:
+  ExceptionCheckingJniEnv* _env;
+  const char* const _base_msg;
+  const char* _return_error;
+};
+
+}
+
+jclass ExceptionCheckingJniEnv::GetObjectClass(jobject obj) {
+  JNIVerifier<jclass> marker(this, "GetObjectClass");
+  return marker.ResultNotNull(_jni_env->GetObjectClass(obj));
+}
+
+jfieldID ExceptionCheckingJniEnv::GetFieldID(jclass klass, const char *name, const char* type) {
+  JNIVerifier<jfieldID> marker(this, "GetObjectClass");
+  return marker.ResultNotNull(_jni_env->GetFieldID(klass, name, type));
+}
+
+jobject ExceptionCheckingJniEnv::GetObjectField(jobject obj, jfieldID field) {
+  JNIVerifier<jobject> marker(this, "GetObjectField");
+  return marker.ResultNotNull(_jni_env->GetObjectField(obj, field));
+}
+
+void ExceptionCheckingJniEnv::SetObjectField(jobject obj, jfieldID field, jobject value) {
+  JNIVerifier<> marker(this, "SetObjectField");
+  _jni_env->SetObjectField(obj, field, value);
+}
+
+jobject ExceptionCheckingJniEnv::NewGlobalRef(jobject obj) {
+  JNIVerifier<jobject> marker(this, "GetObjectField");
+  return marker.ResultNotNull(_jni_env->NewGlobalRef(obj));
+}
+
+void ExceptionCheckingJniEnv::DeleteGlobalRef(jobject obj) {
+  JNIVerifier<> marker(this, "DeleteGlobalRef");
+  _jni_env->DeleteGlobalRef(obj);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Google 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+#ifndef NSK_EXCEPTIONCHECKINGJNIENV_DEFINED
+#define NSK_EXCEPTIONCHECKINGJNIENV_DEFINED
+
+#include <jni.h>
+
+/**
+ * ExceptionCheckingJniEnv wraps around the JNIEnv data structure and
+ * methods to enable automatic exception checking. This allows test writers
+ * and readers to concentrate on what the test is to do and leave the
+ * error checking and throwing to this data structure and subsystem.
+ *
+ * For example:
+ *
+ * ... JNIEnv* env ...
+ *  jclass klass = env->GetObjectClass(o);
+ *  if (klass == NULL) {
+ *      printf("Error: GetObjectClass returned NULL\n");
+ *      return;
+ *  }
+ *  if (env->ExceptionCheck()) {
+ *    ...
+ *  }
+ *
+ *  Can be simplified to:
+ * ... ExceptionCheckingJniEnv* env ...
+ *  jclass klass = env->GetObjectClass(o);
+ *
+ *  Where now the JNI Exception checking and the NULL return checking are done
+ *  internally and will perform whatever action the ErrorHandler requires.
+ *
+ *  By default, the error handler describes the exception via the JNI
+ *  ExceptionDescribe method and calls FatalError.
+ *
+ *  Note: at a future date, this will also include the tracing mechanism done in
+ *  NSK_VERIFY, which will thus embed its logic into the ExceptionCheckingJniEnv
+ *  and clearing that up for the code readers and writers.
+ */
+class ExceptionCheckingJniEnv {
+ public:
+  // JNIEnv API redefinitions.
+  jfieldID GetFieldID(jclass klass, const char *name, const char* type);
+  jclass GetObjectClass(jobject obj);
+  jobject GetObjectField(jobject obj, jfieldID field);
+  void SetObjectField(jobject obj, jfieldID field, jobject value);
+
+  jobject NewGlobalRef(jobject obj);
+  void DeleteGlobalRef(jobject obj);
+
+  // ExceptionCheckingJniEnv methods.
+  JNIEnv* GetJNIEnv() {
+    return _jni_env;
+  }
+
+  void HandleError(const char* msg) {
+    if (_error_handler) {
+      _error_handler(_jni_env, msg);
+    }
+  }
+
+  typedef void (*ErrorHandler)(JNIEnv* env, const char* error_message);
+
+  static void FatalError(JNIEnv* env, const char* message) {
+    if (env->ExceptionCheck()) {
+      env->ExceptionDescribe();
+    }
+    env->FatalError(message);
+  }
+
+  ExceptionCheckingJniEnv(JNIEnv* jni_env, ErrorHandler error_handler) :
+    _jni_env(jni_env), _error_handler(error_handler) {}
+
+ private:
+  JNIEnv* _jni_env;
+  ErrorHandler _error_handler;
+};
+
+// We cannot use unique_ptr due to this being gnu98++, so use this instead:
+class ExceptionCheckingJniEnvPtr {
+ private:
+  ExceptionCheckingJniEnv _env;
+
+ public:
+  ExceptionCheckingJniEnv* operator->() {
+    return &_env;
+  }
+
+  ExceptionCheckingJniEnvPtr(
+      JNIEnv* jni_env,
+      ExceptionCheckingJniEnv::ErrorHandler error_handler = ExceptionCheckingJniEnv::FatalError) :
+          _env(jni_env, error_handler) {
+  }
+};
+
+#endif
--- a/test/jdk/Makefile	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/Makefile	Thu Oct 11 20:58:37 2018 -0400
@@ -29,8 +29,6 @@
 
 USE_FAILURE_HANDLER := true
 
-TREAT_EXIT_CODE_1_AS_0 := true
-
 include ../TestCommon.gmk
 
 # Default make rule (runs default jdk tests)
--- a/test/jdk/ProblemList.txt	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/ProblemList.txt	Thu Oct 11 20:58:37 2018 -0400
@@ -874,8 +874,6 @@
 
 javax/rmi/ssl/SSLSocketParametersTest.sh                        8162906 generic-all
 
-javax/naming/module/RunBasic.java                               8211850 generic-all
-
 ############################################################################
 
 ###########################################################################
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/MethodInvokeWithTraceOnTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8193879 8193801 8129348
+ * @summary Invokes static and instance methods when debugger trace
+ * mode is on.
+ * @library /test/lib
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MethodInvokeWithTraceOnTest.java
+ * @run driver MethodInvokeWithTraceOnTest
+ */
+
+import com.sun.jdi.*;
+import com.sun.jdi.event.*;
+import com.sun.jdi.request.*;
+
+import java.util.*;
+
+import static lib.jdb.JdbTest.*;
+
+/********** target program **********/
+
+class MethodInvokeWithTraceOnTestTarg {
+    public static void main(String[] args) {
+        new MethodInvokeWithTraceOnTestTarg().test();
+    }
+
+    private void test() {
+        Thread thread = Thread.currentThread();
+        print(thread); // @1 breakpoint
+        String str = "test";
+        printStatic(str); // @2 breakpoint
+
+    }
+
+    public void print(Object obj) {
+        System.out.println(obj);
+    }
+
+    public static void printStatic(Object obj) {
+        System.out.println(obj);
+    }
+
+}
+
+
+/********** test program **********/
+
+public class MethodInvokeWithTraceOnTest extends TestScaffold {
+
+    MethodInvokeWithTraceOnTest(String args[]) {
+        super(args);
+    }
+
+    public static void main(String[] args)
+            throws Exception {
+        new MethodInvokeWithTraceOnTest(args).startTests();
+    }
+
+    /********** test core **********/
+
+    protected void runTests() throws Exception {
+        init();
+
+        // Test with suspend policy set to SUSPEND_EVENT_THREAD
+        BreakpointEvent be = resumeToBreakpoint(true, 1);
+        System.out.println("Breakpoint 1 is hit, suspendPolicy:" + be.request().suspendPolicy());
+        testMethods(be);
+
+        // Test with suspend policy set to SUSPEND_ALL
+        be = resumeToBreakpoint(false, 2);
+        System.out.println("Breakpoint 2 is hit, suspendPolicy:" + be.request().suspendPolicy());
+        testMethods(be);
+
+        listenUntilVMDisconnect();
+    }
+
+    private void init() throws Exception {
+        startToMain("MethodInvokeWithTraceOnTestTarg");
+        vm().setDebugTraceMode(VirtualMachine.TRACE_ALL);
+    }
+
+    private BreakpointEvent resumeToBreakpoint(boolean suspendThread, int breakpointId) throws Exception {
+        int bkpLine = parseBreakpoints(getTestSourcePath("MethodInvokeWithTraceOnTest.java"), breakpointId).get(0);
+        System.out.println("Running to line: " + bkpLine);
+        return resumeTo("MethodInvokeWithTraceOnTestTarg", bkpLine, suspendThread);
+    }
+
+    private void testMethods(BreakpointEvent be) throws Exception {
+        System.out.println("Testing  methods...");
+        ThreadReference thread = be.thread();
+        StackFrame frame = thread.frame(0);
+        ObjectReference thisObj = frame.thisObject();
+        LocalVariable threadVar = frame.visibleVariableByName("thread");
+        ThreadReference threadObj = (ThreadReference) frame.getValue(threadVar);
+        StringReference stringObj = vm().mirrorOf("test string");
+        int invokeOptions = getMethodInvokeOptions(be);
+
+        testInstanceMethod1(thread, thisObj, stringObj, threadObj, invokeOptions);
+        testStaticMethod1(thread, thisObj, stringObj, threadObj, invokeOptions);
+        testStaticMethod2(thread, invokeOptions);
+    }
+
+    private void testInstanceMethod1(ThreadReference thread, ObjectReference thisObj, StringReference stringObj,
+                                     ThreadReference threadObj, int invokeOptions) throws Exception {
+        ClassType classType = (ClassType) thisObj.referenceType();
+        Method printMethod = classType.methodsByName("print",
+                "(Ljava/lang/Object;)V").get(0);
+
+        System.out.println("Passing StringReference to instance method...");
+        thisObj.invokeMethod(thread, printMethod, Collections.singletonList(stringObj), invokeOptions);
+
+        System.out.println("Passing ThreadReference to instance method...");
+        thisObj.invokeMethod(thread, printMethod, Collections.singletonList(threadObj), invokeOptions);
+    }
+
+    private void testStaticMethod1(ThreadReference thread, ObjectReference thisObj, StringReference stringObj,
+                                   ThreadReference threadObj, int invokeOptions) throws Exception {
+        ClassType classType = (ClassType) thisObj.referenceType();
+        Method printMethod = classType.methodsByName("printStatic",
+                "(Ljava/lang/Object;)V").get(0);
+
+        System.out.println("Passing StringReference to static method...");
+        classType.invokeMethod(thread, printMethod, Collections.singletonList(stringObj), invokeOptions);
+
+        System.out.println("Passing ThreadReference to static method...");
+        classType.invokeMethod(thread, printMethod, Collections.singletonList(threadObj), invokeOptions);
+    }
+
+    private void testStaticMethod2(ThreadReference thread, int invokeOptions) throws Exception {
+        ClassType classType = getClassType("java.lang.Class");
+        Method forNameMethod = classType.methodsByName("forName",
+                "(Ljava/lang/String;)Ljava/lang/Class;").get(0);
+        StringReference classNameParam = vm().mirrorOf("java.lang.String");
+        classType.invokeMethod(thread, forNameMethod, Collections.singletonList(classNameParam), invokeOptions);
+    }
+
+    private ClassType getClassType(String className) {
+        List classes = vm().classesByName(className);
+        return (ClassType) classes.get(0);
+    }
+
+    private int getMethodInvokeOptions(BreakpointEvent be) {
+        return be.request().suspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD ?
+                ObjectReference.INVOKE_SINGLE_THREADED : 0;
+    }
+}
--- a/test/jdk/com/sun/jdi/TestScaffold.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/com/sun/jdi/TestScaffold.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -784,9 +784,16 @@
     }
 
     public BreakpointEvent resumeTo(Location loc) {
+        return resumeTo(loc, false);
+    }
+
+    public BreakpointEvent resumeTo(Location loc, boolean suspendThread) {
         final BreakpointRequest request =
-            requestManager.createBreakpointRequest(loc);
+                requestManager.createBreakpointRequest(loc);
         request.addCountFilter(1);
+        if (suspendThread) {
+            request.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
+        }
         request.enable();
         return (BreakpointEvent)waitForRequestedEvent(request);
     }
@@ -845,12 +852,16 @@
     }
 
     public BreakpointEvent resumeTo(String clsName, int lineNumber) throws AbsentInformationException {
+        return resumeTo(clsName, lineNumber, false);
+    }
+
+    public BreakpointEvent resumeTo(String clsName, int lineNumber, boolean suspendThread) throws AbsentInformationException {
         ReferenceType rt = findReferenceType(clsName);
         if (rt == null) {
             rt = resumeToPrepareOf(clsName).referenceType();
         }
 
-        return resumeTo(findLocation(rt, lineNumber));
+        return resumeTo(findLocation(rt, lineNumber), suspendThread);
     }
 
     public ClassPrepareEvent resumeToPrepareOf(String className) {
--- a/test/jdk/com/sun/jdi/lib/jdb/JdbTest.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/com/sun/jdi/lib/jdb/JdbTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -238,7 +238,7 @@
     }
 
     // gets full test source path for the given test filename
-    protected static String getTestSourcePath(String fileName) {
+    public static String getTestSourcePath(String fileName) {
         return Paths.get(System.getProperty("test.src")).resolve(fileName).toString();
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/System/AllowSecurityManager.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8191053
+ * @summary Test that the allow/disallow options of the java.security.manager
+ *          system property work correctly
+ * @run main/othervm AllowSecurityManager
+ * @run main/othervm -Djava.security.manager=disallow AllowSecurityManager
+ * @run main/othervm -Djava.security.manager=allow AllowSecurityManager
+ */
+
+public class AllowSecurityManager {
+
+    public static void main(String args[]) throws Exception {
+        String prop = System.getProperty("java.security.manager");
+        boolean disallow = "disallow".equals(prop);
+        try {
+            System.setSecurityManager(new SecurityManager());
+            if (disallow) {
+                throw new Exception("System.setSecurityManager did not " +
+                                    "throw UnsupportedOperationException");
+            }
+        } catch (UnsupportedOperationException uoe) {
+            if (!disallow) {
+                throw new Exception("UnsupportedOperationException " +
+                                    "unexpectedly thrown by " +
+                                    "System.setSecurityManager");
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/lang/annotation/typeAnnotations/TestObjectMethods.java	Thu Oct 11 20:58:37 2018 -0400
@@ -0,0 +1,314 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8058202
+ * @summary Test java.lang.Object methods on AnnotatedType objects.
+ */
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * Test toString, equals, and hashCode on various AnnotatedType objects.
+ */
+public class TestObjectMethods {
+    private static int errors = 0;
+
+    /*
+     * There are various subtypes of AnnotatedType implementations:
+     *
+     * AnnotatedType
+     * AnnotatedArrayType
+     * AnnotatedParameterizedType
+     * AnnotatedTypeVariable
+     * AnnotatedWildcardType
+     *
+     * The implementations of each these implementations are
+     * examined. Wildcards don't appear as top-level types and need to
+     * be extracted from bounds.
+     *
+     * AnnotatedTypes with and without annotations are examined as
+     * well.
+     */
+    public static void main(String... args) {
+        Class<?>[] testClasses = {TypeHost.class, AnnotatedTypeHost.class};
+
+        for (Class<?> clazz : testClasses) {
+            testEqualsReflexivity(clazz);
+            testEquals(clazz);
+        }
+
+        testToString(TypeHost.class, false);
+        testToString(AnnotatedTypeHost.class, true);
+
+        testAnnotationsMatterForEquals(TypeHost.class, AnnotatedTypeHost.class);
+
+        testGetAnnotations(TypeHost.class, false);
+        testGetAnnotations(AnnotatedTypeHost.class, true);
+
+        testWildcards();
+
+        if (errors > 0) {
+            throw new RuntimeException(errors + " errors");
+        }
+    }
+
+    /*
+     * For non-array types, verify toString version of the annotated
+     * type ends with the same string as the generic type.
+     */
+    static void testToString(Class<?> clazz, boolean leadingAnnotations) {
+        System.err.println("Testing toString on methods of class " + clazz.getName());
+        Method[] methods = clazz.getDeclaredMethods();
+        for (Method m : methods) {
+            AnnotatedType annotType = m.getAnnotatedReturnType();
+            String annotTypeString = annotType.toString();
+
+            Type type = m.getGenericReturnType();
+            String typeString = type.toString();
+
+            boolean isArray = annotType instanceof AnnotatedArrayType;
+            boolean isVoid = "void".equals(typeString);
+
+            boolean valid;
+            if (!isArray) {
+                if (leadingAnnotations && !isVoid) {
+                    valid =
+                        annotTypeString.endsWith(typeString) &&
+                        !annotTypeString.startsWith(typeString);
+                } else {
+                    valid = annotTypeString.equals(typeString);
+                }
+            } else {
+                // Find final non-array component type and gets its name.
+                typeString = null;
+
+                AnnotatedType componentType = annotType;
+                while (componentType instanceof AnnotatedArrayType) {
+                    AnnotatedArrayType annotatedArrayType = (AnnotatedArrayType) componentType;
+                    componentType = annotatedArrayType.getAnnotatedGenericComponentType();
+                }
+
+                String componentName = componentType.getType().getTypeName();
+                valid = annotTypeString.contains(componentName);
+            }
+
+            if (!valid) {
+                errors++;
+                System.err.println(typeString + "\n" + annotTypeString +
+                                   "\n " + valid  +
+                                   "\n\n");
+            }
+        }
+    }
+
+    static void testGetAnnotations(Class<?> clazz, boolean annotationsExpectedOnMethods) {
+        System.err.println("Testing getAnnotations on methods of class " + clazz.getName());
+        Method[] methods = clazz.getDeclaredMethods();
+        for (Method m : methods) {
+            Type type = m.getGenericReturnType();
+            AnnotatedType annotType = m.getAnnotatedReturnType();
+            Annotation[] annotations = annotType.getAnnotations();
+
+            boolean isVoid = "void".equals(type.toString());
+
+            if (annotationsExpectedOnMethods && !isVoid) {
+                if (annotations.length == 0 ) {
+                    errors++;
+                    System.err.println("Expected annotations missing on " + annotType);
+                }
+            } else {
+                if (annotations.length > 0 ) {
+                    errors++;
+                    System.err.println("Unexpected annotations present on " + annotType);
+                }
+            }
+        }
+    }
+
+    static void testEqualsReflexivity(Class<?> clazz) {
+        System.err.println("Testing reflexivity of equals on methods of class " + clazz.getName());
+        Method[] methods = clazz.getDeclaredMethods();
+        for (Method m : methods) {
+            checkTypesForEquality(m.getAnnotatedReturnType(),
+                                  m.getAnnotatedReturnType(),
+                                  true);
+        }
+    }
+
+    private static void checkTypesForEquality(AnnotatedType annotType1,
+                                              AnnotatedType annotType2,
+                                              boolean expected) {
+        boolean comparison = annotType1.equals(annotType2);
+
+        if (comparison) {
+            int hash1 = annotType1.hashCode();
+            int hash2 = annotType2.hashCode();
+            if (hash1 != hash2) {
+                errors++;
+                System.err.format("Equal AnnotatedTypes with unequal hash codes: %n%s%n%s%n",
+                                  annotType1.toString(), annotType2.toString());
+            }
+        }
+
+        if (comparison != expected) {
+            errors++;
+            System.err.println(annotType1);
+            System.err.println(expected ? " is not equal to " : " is equal to ");
+            System.err.println(annotType2);
+            System.err.println();
+        }
+    }
+
+    /*
+     * For each of the type host classes, the return type of a method
+     * should only equal the return type of that method.
+     */
+    static void testEquals(Class<?> clazz) {
+        Method[] methods = clazz.getDeclaredMethods();
+
+        for (int i = 0; i < methods.length; i++) {
+            for (int j = 0; j < methods.length; j++) {
+                if (i == j)
+                    continue;
+                else {
+                    checkTypesForEquality(methods[i].getAnnotatedReturnType(),
+                                          methods[j].getAnnotatedReturnType(),
+                                          false);
+                }
+            }
+        }
+    }
+
+    /**
+     * Roughly, compare the return types of corresponding methods on
+     * TypeHost and AnnotatedtypeHost and verify the AnnotatedType
+     * objects are *not* equal even if their underlying generic types
+     * are.
+     */
+    static void testAnnotationsMatterForEquals(Class<?> clazz1, Class<?> clazz2) {
+        System.err.println("Testing that presence/absence of annotations matters for equals comparison.");
+
+        String methodName = null;
+        for (Method method :  clazz1.getDeclaredMethods()) {
+            if ("void".equals(method.getReturnType().toString())) {
+                continue;
+            }
+
+            methodName = method.getName();
+            try {
+                checkTypesForEquality(method.getAnnotatedReturnType(),
+                                      clazz2.getDeclaredMethod(methodName).getAnnotatedReturnType(),
+                                      false);
+            } catch (Exception e) {
+                errors++;
+                System.err.println("Method " + methodName + " not found.");
+            }
+        }
+    }
+
+
+    static void testWildcards() {
+        System.err.println("Testing wildcards");
+        // public @AnnotType(10) Set<? extends Number> fooNumberSet() {return null;}
+        // public @AnnotType(11) Set<@AnnotType(13) ? extends Number> fooNumberSet2() {return null;}
+        AnnotatedWildcardType awt1 = extractWildcard("fooNumberSet");
+        AnnotatedWildcardType awt2 = extractWildcard("fooNumberSet2");
+
+        if (!awt1.equals(extractWildcard("fooNumberSet")) ||
+            !awt2.equals(extractWildcard("fooNumberSet2"))) {
+            errors++;
+            System.err.println("Bad equality comparison on wildcards.");
+        }
+
+        checkTypesForEquality(awt1, awt2, false);
+
+        if (awt2.getAnnotations().length == 0) {
+            errors++;
+            System.err.println("Expected annotations not found.");
+        }
+    }
+
+    private static AnnotatedWildcardType extractWildcard(String methodName) {
+        try {
+            return (AnnotatedWildcardType)
+                (((AnnotatedParameterizedType)(AnnotatedTypeHost.class.getMethod(methodName).
+                                               getAnnotatedReturnType())).
+                 getAnnotatedActualTypeArguments()[0] );
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    // The TypeHost and AnnotatedTypeHost classes declare methods with
+    // the same name and signatures but with the AnnotatedTypeHost
+    // methods having annotations on their return type, where
+    // possible.
+
+    static class TypeHost<E, F extends Number> {
+        public void fooVoid() {return;}
+
+        public int foo() {return 0;}
+        public String fooString() {return null;}
+
+        public int[] fooIntArray() {return null;}
+        public String[] fooStringArray() {return null;}
+        public String [][] fooStringArrayArray() {return null;}
+
+        public Set<String> fooSetString() {return null;}
+        public E fooE() {return null;}
+        public F fooF() {return null;}
+        public <G> G fooG() {return null;}
+
+        public  Set<? extends Number> fooNumberSet() {return null;}
+        public  Set<? extends Integer> fooNumberSet2() {return null;}
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.TYPE_USE)
+    static @interface AnnotType {
+        int value() default 0;
+    }
+
+    static class AnnotatedTypeHost<E, F extends Number> {
+        public /*@AnnotType(0)*/ void fooVoid() {return;} // Illegal to annotate void
+
+        public @AnnotType(1) int foo() {return 0;}
+        public @AnnotType(2) String fooString() {return null;}
+
+        public  int @AnnotType(3) [] fooIntArray() {return null;}
+        public  String @AnnotType(4) [] fooStringArray() {return null;}
+        public  @AnnotType(5) String  @AnnotType(0) [] @AnnotType(1) [] fooStringArrayArray() {return null;}
+
+        public @AnnotType(6) Set<String> fooSetString() {return null;}
+        public @AnnotType(7) E fooE() {return null;}
+        public @AnnotType(8) F fooF() {return null;}
+        public @AnnotType(9) <G> G fooG() {return null;}
+
+        public @AnnotType(10) Set<? extends Number> fooNumberSet() {return null;}
+        public @AnnotType(11) Set<@AnnotType(13) ? extends Number> fooNumberSet2() {return null;}
+    }
+}
--- a/test/jdk/lib/security/CheckBlacklistedCerts.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/lib/security/CheckBlacklistedCerts.java	Thu Oct 11 20:58:37 2018 -0400
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8011402
+ * @bug 8011402 8211969
  * @summary Move blacklisting certificate logic from hard code to data
  * @modules java.base/sun.security.util
  */
@@ -60,38 +60,20 @@
         Set<Certificate> blacklisted = new HashSet<>();
 
         // Assumes the full src is available
-        File[] blacklists = {
-            new File(System.getProperty("test.src"),
-                "../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem"),
-            new File(System.getProperty("test.src"),
-                "../../../make/closed/data/blacklistedcertsconverter/blacklisted.certs.pem")
-        };
-
-        // Is this an OPENJDK build?
-        String prop = System.getProperty("java.runtime.name");
-        if (prop != null && prop.startsWith("OpenJDK")) {
-            System.out.println("This is a OpenJDK build.");
-            blacklists = Arrays.copyOf(blacklists, 1);
-        }
+        File blacklist = new File(System.getProperty("test.src"),
+                "../../../../make/data/blacklistedcertsconverter/blacklisted.certs.pem");
 
         CertificateFactory cf = CertificateFactory.getInstance("X.509");
-        for (File blacklist: blacklists) {
-            System.out.print("Check for " + blacklist + ": ");
-            if (!blacklist.exists()) {
-                System.out.println("does not exist");
-            } else {
-                try (FileInputStream fis = new FileInputStream(blacklist)) {
-                    Collection<? extends Certificate> certs
-                            = cf.generateCertificates(fis);
-                    System.out.println(certs.size());
-                    for (Certificate c: certs) {
-                        blacklisted.add(c);
-                        X509Certificate cert = ((X509Certificate)c);
-                        if (!UntrustedCertificates.isUntrusted(cert)) {
-                            System.out.println(cert.getSubjectDN() + " is trusted");
-                            failed = true;
-                        }
-                    }
+        try (FileInputStream fis = new FileInputStream(blacklist)) {
+            Collection<? extends Certificate> certs
+                    = cf.generateCertificates(fis);
+            System.out.println(certs.size());
+            for (Certificate c: certs) {
+                blacklisted.add(c);
+                X509Certificate cert = ((X509Certificate)c);
+                if (!UntrustedCertificates.isUntrusted(cert)) {
+                    System.out.println(cert.getSubjectDN() + " is trusted");
+                    failed = true;
                 }
             }
         }
--- a/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/DialogDemoTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -27,6 +27,7 @@
 import java.awt.Dimension;
 import java.awt.Point;
 import javax.swing.JDialog;
+import javax.swing.UIManager;
 import static org.testng.AssertJUnit.*;
 import org.testng.annotations.Test;
 import static org.jemmy2ext.JemmyExt.isIconified;
@@ -61,8 +62,9 @@
 
     private final ComponentChooser jDialogClassChooser = new ByClassChooser(JDialog.class);
 
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
         new ClassReference(DialogDemo.class.getCanonicalName()).startApplication();
         JFrameOperator mainFrame = new JFrameOperator(DIALOG_DEMO_TITLE);
         JDialogOperator dialog = new JDialogOperator(DIALOG_TITLE);
--- a/test/jdk/sanity/client/SwingSet/src/SwingSet2DemoTest.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/SwingSet2DemoTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -27,6 +27,7 @@
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JRadioButtonMenuItem;
 import javax.swing.ToolTipManager;
+import javax.swing.UIManager;
 import javax.swing.plaf.metal.MetalLookAndFeel;
 
 import org.jtregext.GuiTestListener;
@@ -58,7 +59,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build SwingSet2
- * @run testng SwingSet2DemoTest
+ * @run testng/timeout=600 SwingSet2DemoTest
  */
 @Listeners(GuiTestListener.class)
 public class SwingSet2DemoTest {
@@ -74,8 +75,9 @@
      *
      * @throws Exception
      */
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
 
         new ClassReference(SwingSet2.class.getCanonicalName()).startApplication();
         JFrameOperator frameOperator = new JFrameOperator(SwingSet2.FRAME_TITLE);
@@ -192,4 +194,4 @@
         }
     }
 
-}
\ No newline at end of file
+}
--- a/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/sanity/client/SwingSet/src/WindowDemoTest.java	Thu Oct 11 20:58:37 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -26,6 +26,7 @@
 import static com.sun.swingset3.demos.window.WindowDemo.*;
 import static org.jemmy2ext.JemmyExt.*;
 import static org.testng.AssertJUnit.*;
+import javax.swing.UIManager;
 import org.testng.annotations.Test;
 import org.netbeans.jemmy.ClassReference;
 import org.netbeans.jemmy.operators.JButtonOperator;
@@ -53,8 +54,9 @@
 @Listeners(GuiTestListener.class)
 public class WindowDemoTest {
 
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
 
         new ClassReference(WindowDemo.class.getCanonicalName()).startApplication();
 
--- a/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/sanity/client/lib/Extensions/src/org/jemmy2ext/JemmyExt.java	Thu Oct 11 20:58:37 2018 -0400
@@ -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
@@ -406,7 +406,7 @@
                 Window[] windows = Window.getWindows();
                 int windowCount = 0;
                 for (Window w : windows) {
-                    if (w.getClass().equals(JWindow.class)) {
+                    if (w.getClass().equals(JWindow.class) && ((JWindow)w).isShowing()) {
                         windowCount++;
                     }
                 }
@@ -427,7 +427,7 @@
                 Window[] windows = Window.getWindows();
                 int windowIndex = 0;
                 for (Window w : windows) {
-                    if (w.getClass().equals(JWindow.class)) {
+                    if (w.getClass().equals(JWindow.class) && ((JWindow)w).isShowing()) {
                         if (windowIndex == index) {
                             return (JWindow) w;
                         }
@@ -565,7 +565,7 @@
 
         @Override
         public boolean checkComponent(Component comp) {
-            return comp.getClass().equals(clazz);
+            return comp.getClass().equals(clazz) && comp.isShowing();
         }
 
         @Override
--- a/test/jdk/sanity/client/lib/SwingSet2/src/SwingSet2.java	Thu Oct 11 20:53:02 2018 -0400
+++ b/test/jdk/sanity/client/lib/SwingSet2/src/SwingSet2.java	Thu Oct 11 20:58:37 2018 -0400
@@ -323,8 +323,6 @@
                        "FileMenu.exit_accessible_description", new ExitAction(this)
         );
 
-        // Create these menu items for the first SwingSet only.
-        if (numSSs == 0) {
         // ***** create laf switcher menu
         lafMenu = (JMenu) menuBar.add(new JMenu(getString("LafMenu.laf_label")));
         lafMenu.setMnemonic(getMnemonic("LafMenu.laf_mnemonic"));
@@ -432,7 +430,6 @@
                 "OptionsMenu.dragEnabled_mnemonic",
                 "OptionsMenu.dragEnabled_accessible_description",
                 new DragSupportAction());
-        }
 
         // ***** create the multiscreen menu, if we have multiple screens
         GraphicsDevice[] screens = GraphicsEnvironment.
@@ -1258,4 +1255,4 @@
             return className;
         }
     }
-}
\ No newline at end of file
+}