changeset 49064:280275ccdeac lworld

[lworld] Compiler cleanups part 1
author thartmann
date Wed, 14 Mar 2018 13:55:05 +0100
parents b2ef243da446
children af136ae07e4f
files src/hotspot/share/ci/ciField.cpp src/hotspot/share/ci/ciInstanceKlass.cpp src/hotspot/share/ci/ciStreams.cpp src/hotspot/share/ci/ciTypeFlow.cpp src/hotspot/share/ci/ciTypeFlow.hpp src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/opto/macro.cpp src/hotspot/share/opto/parseHelper.cpp src/hotspot/share/opto/type.cpp src/hotspot/share/opto/type.hpp src/hotspot/share/runtime/arguments.cpp src/hotspot/share/runtime/deoptimization.cpp src/hotspot/share/utilities/globalDefinitions.cpp src/hotspot/share/utilities/globalDefinitions.hpp test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue3.java test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue4.java test/hotspot/jtreg/compiler/valhalla/valuetypes/SimpleValueType.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestArrays.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBoundValueTypes.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestCallingConvention.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestIntrinsics.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMethodHandles.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMinimalValueTypes.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestOnStackReplacement.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnresolvedValueClass.java test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueCapableClass1.java test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueCapableClass2.java test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueTypeTest.java
diffstat 32 files changed, 459 insertions(+), 1219 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/ci/ciField.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/ci/ciField.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -260,7 +260,6 @@
   assert(field_holder != NULL, "null field_holder");
   _holder = CURRENT_ENV->get_instance_klass(field_holder);
   _is_flattened = fd->is_flattened();
-  assert(fd->field_type() == T_VALUETYPE || !_is_flattened, "flattening is only supported for value type fields");
 
   // Check to see if the field is constant.
   Klass* k = _holder->get_Klass();
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -540,7 +540,6 @@
     if (fs.access_flags().is_static())  continue;
     fieldDescriptor& fd = fs.field_descriptor();
     if (fd.is_flattened() && flatten) {
-      assert(fd.field_type() == T_VALUETYPE, "flattening is only supported for value type fields");
       // Value type fields are embedded
       int field_offset = fd.offset();
       // Get ValueKlass and adjust number of fields
--- a/src/hotspot/share/ci/ciStreams.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/ci/ciStreams.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -182,8 +182,8 @@
 // ------------------------------------------------------------------
 // ciBytecodeStream::get_klass
 //
-// If this bytecode is a new, newarray, multianewarray, instanceof, vbox,
-// vunbox, or checkcast, get the referenced klass.
+// If this bytecode is a new, newarray, multianewarray, instanceof,
+// or checkcast, get the referenced klass.
 ciKlass* ciBytecodeStream::get_klass(bool& will_link) {
   VM_ENTRY_MARK;
   constantPoolHandle cpool(_method->get_Method()->constants());
--- a/src/hotspot/share/ci/ciTypeFlow.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/ci/ciTypeFlow.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -772,8 +772,8 @@
 }
 
 // ------------------------------------------------------------------
-// ciTypeFlow::StateVector::do_vdefault
-void ciTypeFlow::StateVector::do_vdefault(ciBytecodeStream* str) {
+// ciTypeFlow::StateVector::do_defaultvalue
+void ciTypeFlow::StateVector::do_defaultvalue(ciBytecodeStream* str) {
   bool will_link;
   ciKlass* klass = str->get_klass(will_link);
   assert(klass->is_valuetype(), "should be value type");
@@ -785,8 +785,8 @@
 }
 
 // ------------------------------------------------------------------
-// ciTypeFlow::StateVector::do_vwithfield
-void ciTypeFlow::StateVector::do_vwithfield(ciBytecodeStream* str) {
+// ciTypeFlow::StateVector::do_withfield
+void ciTypeFlow::StateVector::do_withfield(ciBytecodeStream* str) {
   bool will_link;
   ciField* field = str->get_field(will_link);
   ciKlass* klass = field->holder();
@@ -854,26 +854,6 @@
   set_type_at(index, bottom_type());
 }
 
-void ciTypeFlow::StateVector::do_vunbox(ciBytecodeStream* str) {
-  bool will_link;
-  ciKlass* klass = str->get_klass(will_link);
-  // TODO: Handle case when class is not loaded.
-  guarantee(will_link, "Class to which the value-capable class will unbox to must be loaded for JIT compilation");
-  assert(klass->is_instance_klass(), "must be an instance class");
-  pop_object();
-  push_object(klass->as_instance_klass());
-}
-
-void ciTypeFlow::StateVector::do_vbox(ciBytecodeStream* str) {
-  bool will_link;
-  ciKlass* klass = str->get_klass(will_link);
-  // TODO: Handle case when class is not loaded.
-  guarantee(will_link, "Class to which value type will box to must be loaded for JIT compilation");
-  assert(klass->is_instance_klass(), "must be an instance class");
-  pop_object();
-  push_object(klass->as_instance_klass());
-}
-
 // ------------------------------------------------------------------
 // ciTypeFlow::StateVector::trap
 //
@@ -1492,8 +1472,8 @@
 
   case Bytecodes::_new:      do_new(str);                           break;
 
-  case Bytecodes::_defaultvalue: do_vdefault(str);                  break;
-  case Bytecodes::_withfield: do_vwithfield(str);                   break;
+  case Bytecodes::_defaultvalue: do_defaultvalue(str);              break;
+  case Bytecodes::_withfield: do_withfield(str);                    break;
 
   case Bytecodes::_newarray: do_newarray(str);                      break;
 
--- a/src/hotspot/share/ci/ciTypeFlow.hpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/ci/ciTypeFlow.hpp	Wed Mar 14 13:55:05 2018 +0100
@@ -367,14 +367,12 @@
     void do_ldc(ciBytecodeStream* str);
     void do_multianewarray(ciBytecodeStream* str);
     void do_new(ciBytecodeStream* str);
-    void do_vdefault(ciBytecodeStream* str);
-    void do_vwithfield(ciBytecodeStream* str);
+    void do_defaultvalue(ciBytecodeStream* str);
+    void do_withfield(ciBytecodeStream* str);
     void do_newarray(ciBytecodeStream* str);
     void do_putfield(ciBytecodeStream* str);
     void do_putstatic(ciBytecodeStream* str);
     void do_ret(ciBytecodeStream* str);
-    void do_vunbox(ciBytecodeStream* str);
-    void do_vbox(ciBytecodeStream* str);
 
     void overwrite_local_double_long(int index) {
       // Invalidate the previous local if it contains first half of
--- a/src/hotspot/share/classfile/classFileParser.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -1471,6 +1471,7 @@
   NONSTATIC_DOUBLE,    // T_LONG        = 11,
   NONSTATIC_OOP,       // T_OBJECT      = 12,
   NONSTATIC_OOP,       // T_ARRAY       = 13,
+  NONSTATIC_OOP,       // T_VALUETYPE   = 14,
   BAD_ALLOCATION_TYPE, // T_VOID        = 15,
   BAD_ALLOCATION_TYPE, // T_ADDRESS     = 16,
   BAD_ALLOCATION_TYPE, // T_NARROWOOP   = 17,
@@ -1492,6 +1493,7 @@
   STATIC_DOUBLE,       // T_LONG        = 11,
   STATIC_OOP,          // T_OBJECT      = 12,
   STATIC_OOP,          // T_ARRAY       = 13,
+  STATIC_OOP,          // T_VALUETYPE   = 14,
   BAD_ALLOCATION_TYPE, // T_VOID        = 15,
   BAD_ALLOCATION_TYPE, // T_ADDRESS     = 16,
   BAD_ALLOCATION_TYPE, // T_NARROWOOP   = 17,
--- a/src/hotspot/share/opto/macro.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/opto/macro.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -2703,7 +2703,7 @@
   Node* mask2 = MakeConX(-2);
   Node* masked2 = transform_later(new AndXNode(cast, mask2));
   Node* rawklassptr = transform_later(new CastX2PNode(masked2));
-  Node* klass_node = transform_later(new CheckCastPPNode(allocation_ctl, rawklassptr, TypeKlassPtr::VALUE));
+  Node* klass_node = transform_later(new CheckCastPPNode(allocation_ctl, rawklassptr, TypeKlassPtr::OBJECT_OR_NULL));
 
   Node* slowpath_bol = NULL;
   Node* top_adr = NULL;
--- a/src/hotspot/share/opto/parseHelper.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/opto/parseHelper.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -337,7 +337,7 @@
 void Parse::do_defaultvalue() {
   bool will_link;
   ciValueKlass* vk = iter().get_klass(will_link)->as_value_klass();
-  assert(will_link, "vdefault: typeflow responsibility");
+  assert(will_link, "defaultvalue: typeflow responsibility");
   // Create and push a new default ValueTypeNode
   push(ValueTypeNode::make_default(_gvn, vk));
 }
@@ -346,7 +346,7 @@
 void Parse::do_withfield() {
   bool will_link;
   ciField* field = iter().get_field(will_link);
-  assert(will_link, "vdefault: typeflow responsibility");
+  assert(will_link, "withfield: typeflow responsibility");
   BasicType bt = field->layout_type();
   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
   Node* vt = pop();
--- a/src/hotspot/share/opto/type.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/opto/type.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -604,7 +604,7 @@
 
   TypeNarrowKlass::NULL_PTR = TypeNarrowKlass::make( TypePtr::NULL_PTR );
 
-  // TypeValueTypePtr::NOTNULL = EnableValhalla ? TypeValueTypePtr::make(TypePtr::NotNull, current->env()->___Value_klass()->as_value_klass()) : NULL;
+  // TypeValueTypePtr::NOTNULL = EnableValhalla ? TypeValueTypePtr::make(TypePtr::NotNull, current->env()->Object_klass()) : NULL;
   TypeValueTypePtr::NOTNULL = NULL;
 
   mreg2type[Op_Node] = Type::BOTTOM;
@@ -656,8 +656,6 @@
   TypeKlassPtr::OBJECT = TypeKlassPtr::make(TypePtr::NotNull, current->env()->Object_klass(), Offset(0) );
   TypeKlassPtr::OBJECT_OR_NULL = TypeKlassPtr::make(TypePtr::BotPTR, current->env()->Object_klass(), Offset(0) );
   TypeKlassPtr::BOTTOM = EnableValhalla ? TypeKlassPtr::make(TypePtr::BotPTR, NULL, Offset(0)) : TypeKlassPtr::OBJECT_OR_NULL;
-  // TypeKlassPtr::VALUE = TypeKlassPtr::make(TypePtr::NotNull, current->env()->___Value_klass(), Offset(0));
-  TypeKlassPtr::VALUE = NULL;
 
   const Type **fi2c = TypeTuple::fields(2);
   fi2c[TypeFunc::Parms+0] = TypeInstPtr::BOTTOM; // Method*
@@ -697,6 +695,7 @@
   _const_basic_type[T_OBJECT]      = TypeInstPtr::BOTTOM;
   _const_basic_type[T_VALUETYPEPTR]= TypeInstPtr::BOTTOM;
   _const_basic_type[T_ARRAY]       = TypeInstPtr::BOTTOM; // there is no separate bottom for arrays
+  _const_basic_type[T_VALUETYPE]   = TypeInstPtr::BOTTOM;
   _const_basic_type[T_VOID]        = TypePtr::NULL_PTR;   // reflection represents void this way
   _const_basic_type[T_ADDRESS]     = TypeRawPtr::BOTTOM;  // both interpreter return addresses & random raw ptrs
   _const_basic_type[T_CONFLICT]    = Type::BOTTOM;        // why not?
@@ -714,6 +713,7 @@
   _zero_type[T_OBJECT]      = TypePtr::NULL_PTR;
   _zero_type[T_VALUETYPEPTR]= TypePtr::NULL_PTR;
   _zero_type[T_ARRAY]       = TypePtr::NULL_PTR; // null array is null oop
+  _zero_type[T_VALUETYPE]   = TypePtr::NULL_PTR;
   _zero_type[T_ADDRESS]     = TypePtr::NULL_PTR; // raw pointers use the same null
   _zero_type[T_VOID]        = Type::TOP;         // the only void value is no value at all
 
@@ -4958,7 +4958,8 @@
 
 //------------------------------is__Value--------------------------------------
 bool TypeValueTypePtr::is__Value() const {
-  return klass()->equals(TypeKlassPtr::VALUE->klass());
+  // FIXME
+  return false;
 }
 
 //------------------------------dump2------------------------------------------
@@ -5319,7 +5320,6 @@
 const TypeKlassPtr *TypeKlassPtr::OBJECT;
 const TypeKlassPtr *TypeKlassPtr::OBJECT_OR_NULL;
 const TypeKlassPtr* TypeKlassPtr::BOTTOM;
-const TypeKlassPtr *TypeKlassPtr::VALUE;
 
 //------------------------------TypeKlassPtr-----------------------------------
 TypeKlassPtr::TypeKlassPtr( PTR ptr, ciKlass* klass, Offset offset )
--- a/src/hotspot/share/opto/type.hpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/opto/type.hpp	Wed Mar 14 13:55:05 2018 +0100
@@ -1437,7 +1437,6 @@
   // Convenience common pre-built types.
   static const TypeKlassPtr* OBJECT; // Not-null object klass or below
   static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
-  static const TypeKlassPtr* VALUE;
   static const TypeKlassPtr* BOTTOM;
 #ifndef PRODUCT
   virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping
--- a/src/hotspot/share/runtime/arguments.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -2341,12 +2341,16 @@
     }
   }
 
-  if (LP64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypePassFieldsAsArgs)) {
+  // FIXME
+  //if (LP64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypePassFieldsAsArgs)) {
+  if (!FLAG_IS_DEFAULT(ValueTypePassFieldsAsArgs)) {
     FLAG_SET_CMDLINE(bool, ValueTypePassFieldsAsArgs, false);
     warning("ValueTypePassFieldsAsArgs is not supported on this platform");
   }
 
-  if (LP64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypeReturnedAsFields)) {
+  // FIXME
+  //if (LP64_ONLY(false &&) !FLAG_IS_DEFAULT(ValueTypeReturnedAsFields)) {
+  if (!FLAG_IS_DEFAULT(ValueTypeReturnedAsFields)) {
     FLAG_SET_CMDLINE(bool, ValueTypeReturnedAsFields, false);
     warning("ValueTypeReturnedAsFields is not supported on this platform");
   }
--- a/src/hotspot/share/runtime/deoptimization.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -1015,7 +1015,7 @@
     if (!fs.access_flags().is_static() && (!skip_internal || !fs.access_flags().is_internal())) {
       ReassignedField field;
       field._offset = fs.offset();
-      field._type = FieldType::basic_type(fs.signature());
+      field._type = fs.is_flattened() ? T_VALUETYPE : FieldType::basic_type(fs.signature());
       if (field._type == T_VALUETYPE) {
         if (fs.is_flattened()) {
           // Resolve klass of flattened value type field
--- a/src/hotspot/share/utilities/globalDefinitions.cpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/utilities/globalDefinitions.cpp	Wed Mar 14 13:55:05 2018 +0100
@@ -94,7 +94,7 @@
       num_type_chars++;
     }
   }
-  assert(num_type_chars == 11, "must have tested the right number of mappings");
+  assert(num_type_chars == 12, "must have tested the right number of mappings");
   assert(char2type(0) == T_ILLEGAL, "correct illegality");
 
   {
@@ -179,11 +179,12 @@
   }
   _type2aelembytes[T_OBJECT] = heapOopSize;
   _type2aelembytes[T_ARRAY]  = heapOopSize;
+  _type2aelembytes[T_VALUETYPE]  = heapOopSize;
 }
 
 
 // Map BasicType to signature character
-char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'V', 0, 0, 0, 0, 0, 0};
+char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'Q', 'V', 0, 0, 0, 0, 0, 0};
 
 // Map BasicType to Java type name
 const char* type2name_tab[T_CONFLICT+1] = {
@@ -198,6 +199,7 @@
   "long",
   "object",
   "array",
+  "valuetype",
   "void",
   "*address*",
   "*narrowoop*",
@@ -218,7 +220,7 @@
 }
 
 // Map BasicType to size in words
-int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, -1};
+int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1, 1, 1, 1, -1};
 
 BasicType type2field[T_CONFLICT+1] = {
   (BasicType)0,            // 0,
@@ -235,6 +237,7 @@
   T_LONG,                  // T_LONG     = 11,
   T_OBJECT,                // T_OBJECT   = 12,
   T_OBJECT,                // T_ARRAY    = 13,
+  T_VALUETYPE,             // T_VALUETYPE = 14,
   T_VOID,                  // T_VOID     = 15,
   T_ADDRESS,               // T_ADDRESS  = 16,
   T_NARROWOOP,             // T_NARROWOOP= 17,
@@ -260,6 +263,7 @@
   T_LONG,    // T_LONG     = 11,
   T_OBJECT,  // T_OBJECT   = 12,
   T_OBJECT,  // T_ARRAY    = 13,
+  T_VALUETYPE, // T_VALUETYPE = 14,
   T_VOID,    // T_VOID     = 15,
   T_ADDRESS, // T_ADDRESS  = 16,
   T_NARROWOOP, // T_NARROWOOP  = 17,
@@ -285,12 +289,13 @@
   T_LONG_aelem_bytes,        // T_LONG     = 11,
   T_OBJECT_aelem_bytes,      // T_OBJECT   = 12,
   T_ARRAY_aelem_bytes,       // T_ARRAY    = 13,
+  T_VALUETYPE_aelem_bytes,   // T_VALUETYPE = 14,
   0,                         // T_VOID     = 15,
   T_OBJECT_aelem_bytes,      // T_ADDRESS  = 16,
   T_NARROWOOP_aelem_bytes,   // T_NARROWOOP= 17,
   T_OBJECT_aelem_bytes,      // T_METADATA = 18,
   T_NARROWKLASS_aelem_bytes, // T_NARROWKLASS= 19,
-  T_VALUETYPEPTR_aelem_bytes,// T_VALUETYPEPTR = 20
+  T_VALUETYPEPTR_aelem_bytes,// T_VALUETYPEPTR = 20,
   0                          // T_CONFLICT = 21,
 };
 
--- a/src/hotspot/share/utilities/globalDefinitions.hpp	Wed Mar 14 09:37:27 2018 +0100
+++ b/src/hotspot/share/utilities/globalDefinitions.hpp	Wed Mar 14 13:55:05 2018 +0100
@@ -583,15 +583,15 @@
   T_LONG        = 11,
   T_OBJECT      = 12,
   T_ARRAY       = 13,
-  T_VOID        = 14,
-  T_ADDRESS     = 15,
-  T_NARROWOOP   = 16,
-  T_METADATA    = 17,
-  T_NARROWKLASS = 18,
-  T_VALUETYPEPTR= 19, // the compiler needs a way to identify buffered values
-  T_CONFLICT    = 20, // for stack value type with conflicting contents
-  T_ILLEGAL     = 99,
-  T_VALUETYPE   = 100  // temporary hack for the transition for VVT to LWVT
+  T_VALUETYPE   = 14,
+  T_VOID        = 15,
+  T_ADDRESS     = 16,
+  T_NARROWOOP   = 17,
+  T_METADATA    = 18,
+  T_NARROWKLASS = 19,
+  T_VALUETYPEPTR= 20, // the compiler needs a way to identify buffered values
+  T_CONFLICT    = 21, // for stack value type with conflicting contents
+  T_ILLEGAL     = 99
 };
 
 inline bool is_java_primitive(BasicType t) {
@@ -625,6 +625,7 @@
   case 'V': return T_VOID;
   case 'L': return T_OBJECT;
   case '[': return T_ARRAY;
+  case 'Q': return T_VALUETYPE;
   }
   return T_ILLEGAL;
 }
@@ -679,9 +680,11 @@
 #ifdef _LP64
   T_OBJECT_aelem_bytes      = 8,
   T_ARRAY_aelem_bytes       = 8,
+  T_VALUETYPE_aelem_bytes   = 8,
 #else
   T_OBJECT_aelem_bytes      = 4,
   T_ARRAY_aelem_bytes       = 4,
+  T_VALUETYPE_aelem_bytes   = 4,
 #endif
   T_NARROWOOP_aelem_bytes   = 4,
   T_NARROWKLASS_aelem_bytes = 4,
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue1.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -31,9 +31,9 @@
     final short z;
     final Integer o;
     final int[] oa;
-    final MyValue2 v1;
-    final MyValue2 v2;
-    static final MyValue2 v3 = MyValue2.createWithFieldsInline(ValueTypeTest.rI, true);
+    __Flattenable final MyValue2 v1;
+    __Flattenable final MyValue2 v2;
+    __Flattenable static final MyValue2 v3 = MyValue2.createWithFieldsInline(ValueTypeTest.rI, true);
     final int c;
 
     private MyValue1() {
@@ -49,12 +49,12 @@
     }
 
     @DontInline
-    __ValueFactory static MyValue1 createDefaultDontInline() {
+    static MyValue1 createDefaultDontInline() {
         return createDefaultInline();
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 createDefaultInline() {
+    static MyValue1 createDefaultInline() {
         return __MakeDefault MyValue1();
     }
 
@@ -106,50 +106,50 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setX(MyValue1 v, int x) {
-        v.x = x;
+    static MyValue1 setX(MyValue1 v, int x) {
+        v = __WithField(v.x, x);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setY(MyValue1 v, long y) {
-        v.y = y;
+    static MyValue1 setY(MyValue1 v, long y) {
+        v = __WithField(v.y, y);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setZ(MyValue1 v, short z) {
-        v.z = z;
+    static MyValue1 setZ(MyValue1 v, short z) {
+        v = __WithField(v.z, z);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setO(MyValue1 v, Integer o) {
-        v.o = o;
+    static MyValue1 setO(MyValue1 v, Integer o) {
+        v = __WithField(v.o, o);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setOA(MyValue1 v, int[] oa) {
-        v.oa = oa;
+    static MyValue1 setOA(MyValue1 v, int[] oa) {
+        v = __WithField(v.oa, oa);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setC(MyValue1 v, int c) {
-        v.c = c;
+    static MyValue1 setC(MyValue1 v, int c) {
+        v = __WithField(v.c, c);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setV1(MyValue1 v, MyValue2 v1) {
-        v.v1 = v1;
+    static MyValue1 setV1(MyValue1 v, MyValue2 v1) {
+        v = __WithField(v.v1, v1);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue1 setV2(MyValue1 v, MyValue2 v2) {
-        v.v2 = v2;
+    static MyValue1 setV2(MyValue1 v, MyValue2 v2) {
+        v = __WithField(v.v2, v2);
         return v;
     }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue2.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -33,19 +33,19 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue2Inline setB(MyValue2Inline v, boolean b) {
-        v.b = b;
+    static MyValue2Inline setB(MyValue2Inline v, boolean b) {
+        v = __WithField(v.b, b);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue2Inline setC(MyValue2Inline v, long c) {
-        v.c = c;
+    static MyValue2Inline setC(MyValue2Inline v, long c) {
+        v = __WithField(v.c, c);
         return v;
     }
 
     @ForceInline
-    __ValueFactory public static MyValue2Inline createDefault() {
+    public static MyValue2Inline createDefault() {
         return __MakeDefault MyValue2Inline();
     }
 
@@ -61,7 +61,7 @@
 __ByValue public final class MyValue2 {
     final int x;
     final byte y;
-    final MyValue2Inline v1;
+    __Flattenable final MyValue2Inline v1;
 
     private MyValue2() {
         this.x = 0;
@@ -70,7 +70,7 @@
     }
 
     @ForceInline
-    __ValueFactory public static MyValue2 createDefaultInline() {
+    public static MyValue2 createDefaultInline() {
         return __MakeDefault MyValue2();
     }
 
@@ -99,20 +99,20 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue2 setX(MyValue2 v, int x) {
-        v.x = x;
+    static MyValue2 setX(MyValue2 v, int x) {
+        v = __WithField(v.x, x);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue2 setY(MyValue2 v, byte y) {
-        v.y = y;
+    static MyValue2 setY(MyValue2 v, byte y) {
+        v = __WithField(v.y, y);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue2 setV1(MyValue2 v, MyValue2Inline v1) {
-        v.v1 = v1;
+    static MyValue2 setV1(MyValue2 v, MyValue2Inline v1) {
+        v = __WithField(v.v1, v1);
         return v;
     }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue3.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue3.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -36,19 +36,19 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue3Inline setF7(MyValue3Inline v, float f7) {
-        v.f7 = f7;
+    static MyValue3Inline setF7(MyValue3Inline v, float f7) {
+        v = __WithField(v.f7, f7);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3Inline setF8(MyValue3Inline v, double f8) {
-        v.f8 = f8;
+    static MyValue3Inline setF8(MyValue3Inline v, double f8) {
+        v = __WithField(v.f8, f8);
         return v;
     }
 
     @ForceInline
-    __ValueFactory public static MyValue3Inline createDefault() {
+    public static MyValue3Inline createDefault() {
         return __MakeDefault MyValue3Inline();
     }
 
@@ -76,7 +76,7 @@
     final double f4;
     final float f5;
     final double f6;
-    final MyValue3Inline v1;
+    __Flattenable final MyValue3Inline v1;
 
     private MyValue3() {
         this.c = 0;
@@ -95,85 +95,85 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setC(MyValue3 v, char c) {
-        v.c = c;
+    static MyValue3 setC(MyValue3 v, char c) {
+        v = __WithField(v.c, c);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setBB(MyValue3 v, byte bb) {
-        v.bb = bb;
+    static MyValue3 setBB(MyValue3 v, byte bb) {
+        v = __WithField(v.bb, bb);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setS(MyValue3 v, short s) {
-        v.s = s;
+    static MyValue3 setS(MyValue3 v, short s) {
+        v = __WithField(v.s, s);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setI(MyValue3 v, int i) {
-        v.i = i;
+    static MyValue3 setI(MyValue3 v, int i) {
+        v = __WithField(v.i, i);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setL(MyValue3 v, long l) {
-        v.l = l;
+    static MyValue3 setL(MyValue3 v, long l) {
+        v = __WithField(v.l, l);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setO(MyValue3 v, Object o) {
-        v.o = o;
+    static MyValue3 setO(MyValue3 v, Object o) {
+        v = __WithField(v.o, o);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF1(MyValue3 v, float f1) {
-        v.f1 = f1;
+    static MyValue3 setF1(MyValue3 v, float f1) {
+        v = __WithField(v.f1, f1);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF2(MyValue3 v, double f2) {
-        v.f2 = f2;
+    static MyValue3 setF2(MyValue3 v, double f2) {
+        v = __WithField(v.f2, f2);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF3(MyValue3 v, float f3) {
-        v.f3 = f3;
+    static MyValue3 setF3(MyValue3 v, float f3) {
+        v = __WithField(v.f3, f3);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF4(MyValue3 v, double f4) {
-        v.f4 = f4;
+    static MyValue3 setF4(MyValue3 v, double f4) {
+        v = __WithField(v.f4, f4);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF5(MyValue3 v, float f5) {
-        v.f5 = f5;
+    static MyValue3 setF5(MyValue3 v, float f5) {
+        v = __WithField(v.f5, f5);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setF6(MyValue3 v, double f6) {
-        v.f6 = f6;
+    static MyValue3 setF6(MyValue3 v, double f6) {
+        v = __WithField(v.f6, f6);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue3 setV1(MyValue3 v, MyValue3Inline v1) {
-        v.v1 = v1;
+    static MyValue3 setV1(MyValue3 v, MyValue3Inline v1) {
+        v = __WithField(v.v1, v1);
         return v;
     }
 
     @ForceInline
-    __ValueFactory public static MyValue3 createDefault() {
+    public static MyValue3 createDefault() {
         return __MakeDefault MyValue3();
     }
 
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue4.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/MyValue4.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -25,8 +25,8 @@
 
 // Value type definition with too many fields to return in registers
 __ByValue final class MyValue4 {
-    final MyValue3 v1;
-    final MyValue3 v2;
+    __Flattenable final MyValue3 v1;
+    __Flattenable final MyValue3 v2;
 
     private MyValue4() {
         this.v1 = MyValue3.createDefault();
@@ -34,19 +34,19 @@
     }
 
     @ForceInline
-    __ValueFactory static MyValue4 setV1(MyValue4 v, MyValue3 v1) {
-        v.v1 = v1;
+    static MyValue4 setV1(MyValue4 v, MyValue3 v1) {
+        v = __WithField(v.v1, v1);
         return v;
     }
 
     @ForceInline
-    __ValueFactory static MyValue4 setV2(MyValue4 v, MyValue3 v2) {
-        v.v2 = v2;
+    static MyValue4 setV2(MyValue4 v, MyValue3 v2) {
+        v = __WithField(v.v2, v2);
         return v;
     }
 
     @ForceInline
-    __ValueFactory public static MyValue4 createDefault() {
+    public static MyValue4 createDefault() {
         return __MakeDefault MyValue4();
     }
 
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/SimpleValueType.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/SimpleValueType.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -28,7 +28,7 @@
         x = 0;
     }
 
-    __ValueFactory static SimpleValueType create() {
+    static SimpleValueType create() {
         return __MakeDefault SimpleValueType();
     }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestArrays.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestArrays.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -30,10 +30,6 @@
  * @summary Test value type arrays
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestArrays.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBasicFunctionality.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -30,10 +30,6 @@
  * @summary Test the basic value type implementation in C2
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestBasicFunctionality.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
@@ -447,11 +443,11 @@
     }
 
     // Value type fields in regular object
-    MyValue1 val1;
-    MyValue2 val2;
-    final MyValue1 val3 = MyValue1.createWithFieldsInline(rI, rL);
-    static MyValue1 val4;
-    static final MyValue1 val5 = MyValue1.createWithFieldsInline(rI, rL);
+    __Flattenable MyValue1 val1;
+    __Flattenable MyValue2 val2;
+    __Flattenable final MyValue1 val3 = MyValue1.createWithFieldsInline(rI, rL);
+    __Flattenable static MyValue1 val4;
+    __Flattenable static final MyValue1 val5 = MyValue1.createWithFieldsInline(rI, rL);
 
     // Test value type fields in objects
     @Test(match = {ALLOC}, matchCount = {1}, failOn = (TRAP))
@@ -495,7 +491,7 @@
         Asserts.assertEQ(result, val5.hash() + val5.v3.hash());
     }
 
-    // test vdefault
+    // Test defaultvalue
     @Test(failOn = ALLOC + LOAD + LOADP + STORE + LOOP + TRAP)
     public long test23() {
         MyValue2 v = MyValue2.createDefaultInline();
@@ -508,7 +504,7 @@
         Asserts.assertEQ(result, MyValue2.createDefaultInline().hash());
     }
 
-    // test vdefault
+    // Test defaultvalue
     @Test(failOn = ALLOC + STORE + LOOP + TRAP)
     public long test24() {
         MyValue1 v1 = MyValue1.createDefaultInline();
@@ -522,7 +518,7 @@
         Asserts.assertEQ(result, 2 * MyValue1.createDefaultInline().hashPrimitive());
     }
 
-    // test vwithfield
+    // Test withfield
     @Test(failOn = ALLOC + LOAD + LOADP + STORE + LOOP + TRAP)
     public long test25() {
         MyValue2 v = MyValue2.createWithFieldsInline(rI, true);
@@ -535,7 +531,7 @@
         Asserts.assertEQ(result, MyValue2.createWithFieldsInline(rI, true).hash());
     }
 
-    // test vwithfield
+    // Test withfield
     @Test(failOn = ALLOC + STORE + LOOP + TRAP)
     public long test26() {
         MyValue1 v1 = MyValue1.createWithFieldsInline(rI, rL);
@@ -550,7 +546,7 @@
     }
 
     class TestClass27 {
-        public MyValue1 v;
+        __Flattenable public MyValue1 v;
     }
 
     // Test allocation elimination of unused object with initialized value type field
@@ -570,8 +566,8 @@
         test27(!warmup);
     }
 
-    static MyValue3 staticVal3;
-    static MyValue3 staticVal3_copy;
+    __Flattenable static MyValue3 staticVal3;
+    __Flattenable static MyValue3 staticVal3_copy;
 
     // Check elimination of redundant value type allocations
     @Test(match = {ALLOC}, matchCount = {1})
@@ -709,14 +705,14 @@
         Asserts.assertEQ(vt.i, (int)staticVal3.c);
     }
 
-    // Test __Value in the method signature
+    // Test passing a value type as an Object argument
     @DontInline
-    public __Value test34_callee(__Value vt) {
+    public Object test34_callee(Object vt) {
         return vt;
     }
 
     @Test()
-    public __Value test34(boolean b, __Value vt) throws Throwable {
+    public Object test34(boolean b, Object vt) throws Throwable {
         if (b) {
             return test34_callee(vt);
         } else {
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestBoundValueTypes.java	Wed Mar 14 09:37:27 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * 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
- * 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 compiler.valhalla.valuetypes;
-
-
-import java.lang.invoke.*;
-
-import jdk.experimental.value.MethodHandleBuilder;
-import jdk.incubator.mvt.ValueType;
-
-/**
- * @test
- * @bug 8185339
- * @summary Test correct compilation of MethodHandles with bound value type arguments.
- * @modules java.base/jdk.experimental.value
- *          jdk.incubator.mvt
- * @compile -XDenableValueTypes ValueCapableClass2.java TestBoundValueTypes.java
- * @run main/othervm -XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.TestBoundValueTypes::*
- *                   -XX:CompileCommand=compileonly,java.lang.invoke.*::* compiler.valhalla.valuetypes.TestBoundValueTypes
- */
-public class TestBoundValueTypes {
-    static final Object vcc = ValueCapableClass2.create(42L);
-
-    static final MethodHandle mh;
-    static {
-        final MethodHandle getU = MethodHandleBuilder.loadCode(MethodHandles.lookup(), "getU",
-                                        MethodType.methodType(long.class, ValueType.forClass(ValueCapableClass2.class).valueClass()),
-                                            CODE -> {
-                                                CODE.
-                                                vload(0).
-                                                vbox(ValueCapableClass2.class).
-                                                vunbox(ValueType.forClass(ValueCapableClass2.class).valueClass()).
-                                                getfield(ValueType.forClass(ValueCapableClass2.class).valueClass(), "u", "J").
-                                                lreturn();
-                                            });
-        // Bind the value type argument to 'vcc'
-        mh = MethodHandles.insertArguments(getU, 0, vcc);
-    }
-
-    long test() throws Throwable {
-        return (long)mh.invoke();
-    }
-
-    public static void main(String[] args) throws Throwable {
-        TestBoundValueTypes t = new TestBoundValueTypes();
-        for (int i = 0; i < 100_000; ++i) {
-            if (t.test() != 42) {
-                throw new RuntimeException("Test failed");
-            }
-        }
-    }
-}
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestCallingConvention.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestCallingConvention.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -32,10 +32,6 @@
  * @summary Test value type calling convention optimizations
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestCallingConvention.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestIntrinsics.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestIntrinsics.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -30,16 +30,12 @@
  * @summary Test intrinsic support for value types
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestIntrinsics.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
  * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+EnableValhalla
- *                   compiler.valhalla.valuetypes.TestIntrinsics
+ *                               -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+EnableValhalla
+ *                               compiler.valhalla.valuetypes.TestIntrinsics
  */
 public class TestIntrinsics extends ValueTypeTest {
 
@@ -55,12 +51,10 @@
     }
 
     public void test1_verifier(boolean warmup) {
-        Asserts.assertTrue(test1(__Value.class, MyValue1.class), "test1_1 failed");
+        Asserts.assertTrue(test1(Object.class, MyValue1.class), "test1_1 failed");
         Asserts.assertTrue(test1(MyValue1.class, MyValue1.class), "test1_2 failed");
         Asserts.assertTrue(test1(Object.class, java.util.ArrayList.class), "test1_3 failed");
         Asserts.assertTrue(test1(java.util.ArrayList.class, java.util.ArrayList.class), "test1_4 failed");
-        Asserts.assertTrue(!test1(Object.class, MyValue1.class), "test1_5 failed");
-        Asserts.assertTrue(!test1(__Value.class, java.util.ArrayList.class), "test1_6 failed");
     }
 
     // Verify that Class::isAssignableFrom checks with statically known classes are folded
@@ -69,10 +63,9 @@
         boolean check1 = java.util.AbstractList.class.isAssignableFrom(java.util.ArrayList.class);
         boolean check2 = MyValue1.class.isAssignableFrom(MyValue1.class);
         boolean check3 = Object.class.isAssignableFrom(java.util.ArrayList.class);
-        boolean check4 = java.lang.__Value.class.isAssignableFrom(MyValue1.class);
-        boolean check5 = !Object.class.isAssignableFrom(MyValue1.class);
-        boolean check6 = !MyValue1.class.isAssignableFrom(Object.class);
-        return check1 && check2 && check3 && check4 && check5 && check6;
+        boolean check4 = Object.class.isAssignableFrom(MyValue1.class);
+        boolean check5 = !MyValue1.class.isAssignableFrom(Object.class);
+        return check1 && check2 && check3 && check4 && check5;
     }
 
     public void test2_verifier(boolean warmup) {
@@ -86,23 +79,45 @@
     }
 
     public void test3_verifier(boolean warmup) {
-        Asserts.assertTrue(test3(__Value.class) == null, "test3_1 failed");
-        Asserts.assertTrue(test3(Object.class) == null, "test3_2 failed");
-        Asserts.assertTrue(test3(MyValue1.class) == __Value.class, "test3_3 failed");
-        Asserts.assertTrue(test3(Class.class) == Object.class, "test3_4 failed");
+        Asserts.assertTrue(test3(Object.class) == null, "test3_1 failed");
+        Asserts.assertTrue(test3(MyValue1.class) == Object.class, "test3_2 failed");
+        Asserts.assertTrue(test3(Class.class) == Object.class, "test3_3 failed");
     }
 
     // Verify that Class::getSuperclass checks with statically known classes are folded
     @Test(failOn = LOADK)
     public boolean test4() {
-        boolean check1 = __Value.class.getSuperclass() == null;
-        boolean check2 = Object.class.getSuperclass() == null;
-        boolean check3 = MyValue1.class.getSuperclass() == __Value.class;
-        boolean check4 = Class.class.getSuperclass() == Object.class;
-        return check1 && check2 && check3 && check4;
+        boolean check1 = Object.class.getSuperclass() == null;
+        boolean check2 = MyValue1.class.getSuperclass() == Object.class;
+        boolean check3 = Class.class.getSuperclass() == Object.class;
+        return check1 && check2 && check3;
     }
 
     public void test4_verifier(boolean warmup) {
         Asserts.assertTrue(test4(), "test4 failed");
     }
+
+    // Test toString() method
+    @Test(failOn = ALLOC + STORE + LOAD)
+    public String test5(MyValue1 v) {
+        return v.toString();
+    }
+
+    @DontCompile
+    public void test5_verifier(boolean warmup) {
+        MyValue1 v = MyValue1.createDefaultInline();
+        test5(v);
+    }
+
+    // Test hashCode() method
+    @Test()
+    public int test6(MyValue1 v) {
+        return v.hashCode();
+    }
+
+    @DontCompile
+    public void test6_verifier(boolean warmup) {
+        MyValue1 v = MyValue1.createDefaultInline();
+        test6(v);
+    }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMethodHandles.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMethodHandles.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -26,7 +26,6 @@
 import jdk.experimental.bytecode.MacroCodeBuilder.CondKind;
 import jdk.experimental.bytecode.TypeTag;
 import jdk.experimental.value.MethodHandleBuilder;
-import jdk.incubator.mvt.ValueType;
 import jdk.test.lib.Asserts;
 
 import java.lang.invoke.*;
@@ -40,7 +39,6 @@
  * @modules java.base/jdk.experimental.bytecode
  *          java.base/jdk.experimental.value
  *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestMethodHandles.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
@@ -78,73 +76,73 @@
             ClassLoader loader = clazz.getClassLoader();
             MethodHandles.Lookup lookup = MethodHandles.lookup();
 
-            MethodType mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue3;", loader);
+            MethodType mt = MethodType.methodType(MyValue3.class);
+            test1_mh = lookup.findVirtual(clazz, "test1_target", mt);
+            test2_mh = lookup.findVirtual(clazz, "test2_target", mt);
             test3_mh = lookup.findVirtual(clazz, "test3_target", mt);
-            test4_mh = lookup.findVirtual(clazz, "test4_target", mt);
-            test5_mh = lookup.findVirtual(clazz, "test5_target", mt);
 
-            MethodType test6_mt1 = MethodType.fromMethodDescriptorString("(Qcompiler/valhalla/valuetypes/MyValue1;)I", loader);
-            MethodType test6_mt2 = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue1;", loader);
-            MethodHandle test6_mh1 = lookup.findStatic(clazz, "test6_helper1", test6_mt1);
-            MethodHandle test6_mh2 = lookup.findStatic(clazz, "test6_helper2", test6_mt2);
-            test6_mh = MethodHandles.filterReturnValue(test6_mh2, test6_mh1);
+            MethodType test4_mt1 = MethodType.methodType(int.class, MyValue1.class);
+            MethodType test4_mt2 = MethodType.methodType(MyValue1.class);
+            MethodHandle test4_mh1 = lookup.findStatic(clazz, "test4_helper1", test4_mt1);
+            MethodHandle test4_mh2 = lookup.findStatic(clazz, "test4_helper2", test4_mt2);
+            test4_mh = MethodHandles.filterReturnValue(test4_mh2, test4_mh1);
 
-            MethodType test7_mt = MethodType.fromMethodDescriptorString("(Qcompiler/valhalla/valuetypes/MyValue1;)I", loader);
-            test7_mh = lookup.findVirtual(clazz, "test7_target", test7_mt);
+            MethodType test5_mt = MethodType.methodType(int.class, MyValue1.class);
+            test5_mh = lookup.findVirtual(clazz, "test5_target", test5_mt);
 
-            MethodType test8_mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue3;", loader);
-            MethodHandle test8_mh1 = lookup.findVirtual(clazz, "test8_target1", test8_mt);
-            MethodHandle test8_mh2 = lookup.findVirtual(clazz, "test8_target2", test8_mt);
+            MethodType test6_mt = MethodType.methodType(MyValue3.class);
+            MethodHandle test6_mh1 = lookup.findVirtual(clazz, "test6_target1", test6_mt);
+            MethodHandle test6_mh2 = lookup.findVirtual(clazz, "test6_target2", test6_mt);
             MethodType boolean_mt = MethodType.methodType(boolean.class);
-            MethodHandle test8_mh_test = lookup.findVirtual(clazz, "test8_test", boolean_mt);
-            test8_mh = MethodHandles.guardWithTest(test8_mh_test, test8_mh1, test8_mh2);
+            MethodHandle test6_mh_test = lookup.findVirtual(clazz, "test6_test", boolean_mt);
+            test6_mh = MethodHandles.guardWithTest(test6_mh_test, test6_mh1, test6_mh2);
 
-            MethodType myvalue2_mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue2;", loader);
-            test9_mh1 = lookup.findStatic(clazz, "test9_target1", myvalue2_mt);
-            MethodHandle test9_mh2 = lookup.findStatic(clazz, "test9_target2", myvalue2_mt);
-            MethodHandle test9_mh_test = lookup.findStatic(clazz, "test9_test", boolean_mt);
-            test9_mh = MethodHandles.guardWithTest(test9_mh_test,
+            MethodType myvalue2_mt = MethodType.methodType(MyValue2.class);
+            test7_mh1 = lookup.findStatic(clazz, "test7_target1", myvalue2_mt);
+            MethodHandle test7_mh2 = lookup.findStatic(clazz, "test7_target2", myvalue2_mt);
+            MethodHandle test7_mh_test = lookup.findStatic(clazz, "test7_test", boolean_mt);
+            test7_mh = MethodHandles.guardWithTest(test7_mh_test,
                                                     MethodHandles.invoker(myvalue2_mt),
-                                                    MethodHandles.dropArguments(test9_mh2, 0, MethodHandle.class));
+                                                    MethodHandles.dropArguments(test7_mh2, 0, MethodHandle.class));
 
-            MethodHandle test10_mh1 = lookup.findStatic(clazz, "test10_target1", myvalue2_mt);
-            test10_mh2 = lookup.findStatic(clazz, "test10_target2", myvalue2_mt);
-            MethodHandle test10_mh_test = lookup.findStatic(clazz, "test10_test", boolean_mt);
-            test10_mh = MethodHandles.guardWithTest(test10_mh_test,
-                                                    MethodHandles.dropArguments(test10_mh1, 0, MethodHandle.class),
+            MethodHandle test8_mh1 = lookup.findStatic(clazz, "test8_target1", myvalue2_mt);
+            test8_mh2 = lookup.findStatic(clazz, "test8_target2", myvalue2_mt);
+            MethodHandle test8_mh_test = lookup.findStatic(clazz, "test8_test", boolean_mt);
+            test8_mh = MethodHandles.guardWithTest(test8_mh_test,
+                                                    MethodHandles.dropArguments(test8_mh1, 0, MethodHandle.class),
                                                     MethodHandles.invoker(myvalue2_mt));
 
-            MethodType test11_mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue3;", loader);
-            MethodHandle test11_mh1 = lookup.findVirtual(clazz, "test11_target1", test11_mt);
-            MethodHandle test11_mh2 = lookup.findVirtual(clazz, "test11_target2", test11_mt);
-            MethodHandle test11_mh3 = lookup.findVirtual(clazz, "test11_target3", test11_mt);
-            MethodType test11_mt2 = MethodType.methodType(boolean.class);
-            MethodHandle test11_mh_test1 = lookup.findVirtual(clazz, "test11_test1", test11_mt2);
-            MethodHandle test11_mh_test2 = lookup.findVirtual(clazz, "test11_test2", test11_mt2);
-            test11_mh = MethodHandles.guardWithTest(test11_mh_test1,
-                                                    test11_mh1,
-                                                    MethodHandles.guardWithTest(test11_mh_test2, test11_mh2, test11_mh3));
+            MethodType test9_mt = MethodType.methodType(MyValue3.class);
+            MethodHandle test9_mh1 = lookup.findVirtual(clazz, "test9_target1", test9_mt);
+            MethodHandle test9_mh2 = lookup.findVirtual(clazz, "test9_target2", test9_mt);
+            MethodHandle test9_mh3 = lookup.findVirtual(clazz, "test9_target3", test9_mt);
+            MethodType test9_mt2 = MethodType.methodType(boolean.class);
+            MethodHandle test9_mh_test1 = lookup.findVirtual(clazz, "test9_test1", test9_mt2);
+            MethodHandle test9_mh_test2 = lookup.findVirtual(clazz, "test9_test2", test9_mt2);
+            test9_mh = MethodHandles.guardWithTest(test9_mh_test1,
+                                                    test9_mh1,
+                                                    MethodHandles.guardWithTest(test9_mh_test2, test9_mh2, test9_mh3));
 
-            MethodType test12_mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue2;", loader);
-            MethodHandle test12_mh1 = lookup.findStatic(clazz, "test12_target1", test12_mt);
-            test12_mh2 = lookup.findStatic(clazz, "test12_target2", test12_mt);
-            test12_mh3 = lookup.findStatic(clazz, "test12_target3", test12_mt);
-            MethodType test12_mt2 = MethodType.methodType(boolean.class);
-            MethodType test12_mt3 = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue2;", loader);
-            MethodHandle test12_mh_test1 = lookup.findStatic(clazz, "test12_test1", test12_mt2);
-            MethodHandle test12_mh_test2 = lookup.findStatic(clazz, "test12_test2", test12_mt2);
-            test12_mh = MethodHandles.guardWithTest(test12_mh_test1,
-                                                    MethodHandles.dropArguments(test12_mh1, 0, MethodHandle.class, MethodHandle.class),
-                                                    MethodHandles.guardWithTest(test12_mh_test2,
-                                                                                MethodHandles.dropArguments(MethodHandles.invoker(test12_mt3), 1, MethodHandle.class),
-                                                                                MethodHandles.dropArguments(MethodHandles.invoker(test12_mt3), 0, MethodHandle.class))
+            MethodType test10_mt = MethodType.methodType(MyValue2.class);
+            MethodHandle test10_mh1 = lookup.findStatic(clazz, "test10_target1", test10_mt);
+            test10_mh2 = lookup.findStatic(clazz, "test10_target2", test10_mt);
+            test10_mh3 = lookup.findStatic(clazz, "test10_target3", test10_mt);
+            MethodType test10_mt2 = MethodType.methodType(boolean.class);
+            MethodType test10_mt3 = MethodType.methodType(MyValue2.class);
+            MethodHandle test10_mh_test1 = lookup.findStatic(clazz, "test10_test1", test10_mt2);
+            MethodHandle test10_mh_test2 = lookup.findStatic(clazz, "test10_test2", test10_mt2);
+            test10_mh = MethodHandles.guardWithTest(test10_mh_test1,
+                                                    MethodHandles.dropArguments(test10_mh1, 0, MethodHandle.class, MethodHandle.class),
+                                                    MethodHandles.guardWithTest(test10_mh_test2,
+                                                                                MethodHandles.dropArguments(MethodHandles.invoker(test10_mt3), 1, MethodHandle.class),
+                                                                                MethodHandles.dropArguments(MethodHandles.invoker(test10_mt3), 0, MethodHandle.class))
                                                     );
 
-            MethodHandle test13_mh1 = lookup.findStatic(clazz, "test13_target1", myvalue2_mt);
-            test13_mh2 = lookup.findStatic(clazz, "test13_target2", myvalue2_mt);
-            MethodHandle test13_mh_test = lookup.findStatic(clazz, "test13_test", boolean_mt);
-            test13_mh = MethodHandles.guardWithTest(test13_mh_test,
-                                                    MethodHandles.dropArguments(test13_mh1, 0, MethodHandle.class),
+            MethodHandle test11_mh1 = lookup.findStatic(clazz, "test11_target1", myvalue2_mt);
+            test11_mh2 = lookup.findStatic(clazz, "test11_target2", myvalue2_mt);
+            MethodHandle test11_mh_test = lookup.findStatic(clazz, "test11_test", boolean_mt);
+            test11_mh = MethodHandles.guardWithTest(test11_mh_test,
+                                                    MethodHandles.dropArguments(test11_mh1, 0, MethodHandle.class),
                                                     MethodHandles.invoker(myvalue2_mt));
         } catch (NoSuchMethodException | IllegalAccessException e) {
             e.printStackTrace();
@@ -157,232 +155,276 @@
         test.run(args, MyValue1.class, MyValue2.class, MyValue2Inline.class);
     }
 
-    MyValue1 val1 = MyValue1.createDefaultInline();
+    // Everything inlined
+    final MyValue3 test1_vt = MyValue3.create();
 
-    // When calling a method on __Value, passing fields as arguments is impossible
-    @Test(failOn = ALLOC + STORE + LOAD)
-    public String test1(MyValue1 v) {
-        return v.toString();
+    @ForceInline
+    MyValue3 test1_target() {
+        return test1_vt;
+    }
+
+    static final MethodHandle test1_mh;
+
+    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + STORE + CALL)
+    @Test(valid = ValueTypeReturnedAsFieldsOff, match = { ALLOC, STORE }, matchCount = { 1, 11 })
+    MyValue3 test1() throws Throwable {
+        return (MyValue3)test1_mh.invokeExact(this);
     }
 
     @DontCompile
-    public void test1_verifier(boolean warmup) {
-        boolean failed = false;
-        try {
-            test1(val1);
-            failed = true;
-        } catch (UnsupportedOperationException uoe) {
-        }
-        Asserts.assertFalse(failed);
+    public void test1_verifier(boolean warmup) throws Throwable {
+        MyValue3 vt = test1();
+        test1_vt.verify(vt);
     }
 
-    // Same as above, but the method on __Value is inlined
-    // hashCode allocates an exception so can't really check the graph shape
-    @Test()
-    public int test2(MyValue1 v) {
-        return v.hashCode();
+    // Leaf method not inlined but returned type is known
+    final MyValue3 test2_vt = MyValue3.create();
+    @DontInline
+    MyValue3 test2_target() {
+        return test2_vt;
+    }
+
+    static final MethodHandle test2_mh;
+
+    @Test
+    MyValue3 test2() throws Throwable {
+        return (MyValue3)test2_mh.invokeExact(this);
     }
 
     @DontCompile
-    public void test2_verifier(boolean warmup) {
-        boolean failed = false;
-        try {
-            test2(val1);
-            failed = true;
-        } catch (UnsupportedOperationException uoe) {
+    public void test2_verifier(boolean warmup) throws Throwable {
+        Method helper_m = getClass().getDeclaredMethod("test2_target");
+        if (!warmup && USE_COMPILER && !WHITE_BOX.isMethodCompiled(helper_m, false)) {
+            WHITE_BOX.enqueueMethodForCompilation(helper_m, COMP_LEVEL_FULL_OPTIMIZATION);
+            Asserts.assertTrue(WHITE_BOX.isMethodCompiled(helper_m, false), "test2_target not compiled");
         }
-        Asserts.assertFalse(failed);
+        MyValue3 vt = test2();
+        test2_vt.verify(vt);
     }
 
-    // Return values and method handles tests
-
-    // Everything inlined
+    // Leaf method not inlined and returned type not known
     final MyValue3 test3_vt = MyValue3.create();
-
-    @ForceInline
+    @DontInline
     MyValue3 test3_target() {
         return test3_vt;
     }
 
     static final MethodHandle test3_mh;
 
-    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + STORE + CALL)
-    @Test(valid = ValueTypeReturnedAsFieldsOff, match = { ALLOC, STORE }, matchCount = { 1, 11 })
+    @Test
     MyValue3 test3() throws Throwable {
         return (MyValue3)test3_mh.invokeExact(this);
     }
 
     @DontCompile
     public void test3_verifier(boolean warmup) throws Throwable {
+        // hack so C2 doesn't know the target of the invoke call
+        Class c = Class.forName("java.lang.invoke.DirectMethodHandle");
+        Method m = c.getDeclaredMethod("internalMemberName", Object.class);
+        WHITE_BOX.testSetDontInlineMethod(m, warmup);
         MyValue3 vt = test3();
         test3_vt.verify(vt);
     }
 
-    // Leaf method not inlined but returned type is known
-    final MyValue3 test4_vt = MyValue3.create();
-    @DontInline
-    MyValue3 test4_target() {
+    // When test75_helper1 is inlined in test75, the method handle
+    // linker that called it is passed a pointer to a copy of vt
+    // stored in memory. The method handle linker needs to load the
+    // fields from memory before it inlines test75_helper1.
+    static public int test4_helper1(MyValue1 vt) {
+        return vt.x;
+    }
+
+    static MyValue1 test4_vt = MyValue1.createWithFieldsInline(rI, rL);
+    static public MyValue1 test4_helper2() {
         return test4_vt;
     }
 
     static final MethodHandle test4_mh;
 
     @Test
-    MyValue3 test4() throws Throwable {
-        return (MyValue3)test4_mh.invokeExact(this);
+    public int test4() throws Throwable {
+        return (int)test4_mh.invokeExact();
     }
 
     @DontCompile
     public void test4_verifier(boolean warmup) throws Throwable {
-        Method helper_m = getClass().getDeclaredMethod("test64_target");
-        if (!warmup && USE_COMPILER && !WHITE_BOX.isMethodCompiled(helper_m, false)) {
-            WHITE_BOX.enqueueMethodForCompilation(helper_m, COMP_LEVEL_FULL_OPTIMIZATION);
-            Asserts.assertTrue(WHITE_BOX.isMethodCompiled(helper_m, false), "test64_target not compiled");
-        }
-        MyValue3 vt = test4();
-        test4_vt.verify(vt);
+        int i = test4();
+        Asserts.assertEQ(i, test4_vt.x);
     }
 
-    // Leaf method not inlined and returned type not known
-    final MyValue3 test5_vt = MyValue3.create();
-    @DontInline
-    MyValue3 test5_target() {
-        return test5_vt;
+    // Test method handle call with value type argument
+    public int test5_target(MyValue1 vt) {
+        return vt.x;
     }
 
     static final MethodHandle test5_mh;
+    MyValue1 test5_vt = MyValue1.createWithFieldsInline(rI, rL);
 
     @Test
-    MyValue3 test5() throws Throwable {
-        return (MyValue3)test5_mh.invokeExact(this);
+    public int test5() throws Throwable {
+        return (int)test5_mh.invokeExact(this, test5_vt);
     }
 
     @DontCompile
     public void test5_verifier(boolean warmup) throws Throwable {
-        // hack so C2 doesn't know the target of the invoke call
-        Class c = Class.forName("java.lang.invoke.DirectMethodHandle");
-        Method m = c.getDeclaredMethod("internalMemberName", Object.class);
-        WHITE_BOX.testSetDontInlineMethod(m, warmup);
-        MyValue3 vt = test5();
-        test5_vt.verify(vt);
+        int i = test5();
+        Asserts.assertEQ(i, test5_vt.x);
     }
 
-    // When test75_helper1 is inlined in test75, the method handle
-    // linker that called it is passed a pointer to a copy of vt
-    // stored in memory. The method handle linker needs to load the
-    // fields from memory before it inlines test75_helper1.
-    static public int test6_helper1(MyValue1 vt) {
-        return vt.x;
+    // Return of target1 and target2 merged in a Lambda Form as an
+    // Object. Shouldn't cause any allocation
+    final MyValue3 test6_vt1 = MyValue3.create();
+    @ForceInline
+    MyValue3 test6_target1() {
+        return test6_vt1;
     }
 
-    static MyValue1 test6_vt = MyValue1.createWithFieldsInline(rI, rL);
-    static public MyValue1 test6_helper2() {
-        return test6_vt;
+    final MyValue3 test6_vt2 = MyValue3.create();
+    @ForceInline
+    MyValue3 test6_target2() {
+        return test6_vt2;
+    }
+
+    boolean test6_bool = true;
+    @ForceInline
+    boolean test6_test() {
+        return test6_bool;
     }
 
     static final MethodHandle test6_mh;
 
-    @Test
-    public int test6() throws Throwable {
-        return (int)test6_mh.invokeExact();
+    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
+    @Test(valid = ValueTypeReturnedAsFieldsOff)
+    MyValue3 test6() throws Throwable {
+        return (MyValue3)test6_mh.invokeExact(this);
     }
 
     @DontCompile
     public void test6_verifier(boolean warmup) throws Throwable {
-        int i = test6();
-        Asserts.assertEQ(i, test6_vt.x);
+        test6_bool = !test6_bool;
+        MyValue3 vt = test6();
+        vt.verify(test6_bool ? test6_vt1 : test6_vt2);
     }
 
-    // Test method handle call with value type argument
-    public int test7_target(MyValue1 vt) {
-        return vt.x;
+    // Similar as above but with the method handle for target1 not
+    // constant. Shouldn't cause any allocation.
+    @ForceInline
+    static MyValue2 test7_target1() {
+        return MyValue2.createWithFieldsInline(rI, true);
+    }
+
+    @ForceInline
+    static MyValue2 test7_target2() {
+        return MyValue2.createWithFieldsInline(rI+1, false);
+    }
+
+    static boolean test7_bool = true;
+    @ForceInline
+    static boolean test7_test() {
+        return test7_bool;
     }
 
     static final MethodHandle test7_mh;
-    MyValue1 test7_vt = MyValue1.createWithFieldsInline(rI, rL);
+    static MethodHandle test7_mh1;
 
-    @Test
-    public int test7() throws Throwable {
-        return (int)test7_mh.invokeExact(this, test7_vt);
+    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
+    @Test(valid = ValueTypeReturnedAsFieldsOff)
+    long test7() throws Throwable {
+        return ((MyValue2)test7_mh.invokeExact(test7_mh1)).hash();
     }
 
     @DontCompile
     public void test7_verifier(boolean warmup) throws Throwable {
-        int i = test7();
-        Asserts.assertEQ(i, test7_vt.x);
+        test7_bool = !test7_bool;
+        long hash = test7();
+        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+(test7_bool ? 0 : 1), test7_bool).hash());
     }
 
-    // Return of target1 and target2 merged in a Lambda Form as an
-    // __Value. Shouldn't cause any allocation
-    final MyValue3 test8_vt1 = MyValue3.create();
+    // Same as above but with the method handle for target2 not
+    // constant. Shouldn't cause any allocation.
     @ForceInline
-    MyValue3 test8_target1() {
-        return test8_vt1;
+    static MyValue2 test8_target1() {
+        return MyValue2.createWithFieldsInline(rI, true);
     }
 
-    final MyValue3 test8_vt2 = MyValue3.create();
     @ForceInline
-    MyValue3 test8_target2() {
-        return test8_vt2;
+    static MyValue2 test8_target2() {
+        return MyValue2.createWithFieldsInline(rI+1, false);
     }
 
-    boolean test8_bool = true;
+    static boolean test8_bool = true;
     @ForceInline
-    boolean test8_test() {
+    static boolean test8_test() {
         return test8_bool;
     }
 
     static final MethodHandle test8_mh;
+    static MethodHandle test8_mh2;
 
     @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
     @Test(valid = ValueTypeReturnedAsFieldsOff)
-    MyValue3 test8() throws Throwable {
-        return (MyValue3)test8_mh.invokeExact(this);
+    long test8() throws Throwable {
+        return ((MyValue2)test8_mh.invokeExact(test8_mh2)).hash();
     }
 
     @DontCompile
     public void test8_verifier(boolean warmup) throws Throwable {
         test8_bool = !test8_bool;
-        MyValue3 vt = test8();
-        vt.verify(test8_bool ? test8_vt1 : test8_vt2);
+        long hash = test8();
+        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+(test8_bool ? 0 : 1), test8_bool).hash());
     }
 
-    // Similar as above but with the method handle for target1 not
-    // constant. Shouldn't cause any allocation.
+    // Return of target1, target2 and target3 merged in Lambda Forms
+    // as an Object. Shouldn't cause any allocation
+    final MyValue3 test9_vt1 = MyValue3.create();
     @ForceInline
-    static MyValue2 test9_target1() {
-        return MyValue2.createWithFieldsInline(rI, true);
+    MyValue3 test9_target1() {
+        return test9_vt1;
     }
 
+    final MyValue3 test9_vt2 = MyValue3.create();
     @ForceInline
-    static MyValue2 test9_target2() {
-        return MyValue2.createWithFieldsInline(rI+1, false);
+    MyValue3 test9_target2() {
+        return test9_vt2;
     }
 
-    static boolean test9_bool = true;
+    final MyValue3 test9_vt3 = MyValue3.create();
     @ForceInline
-    static boolean test9_test() {
-        return test9_bool;
+    MyValue3 test9_target3() {
+        return test9_vt3;
+    }
+
+    boolean test9_bool1 = true;
+    @ForceInline
+    boolean test9_test1() {
+        return test9_bool1;
+    }
+
+    boolean test9_bool2 = true;
+    @ForceInline
+    boolean test9_test2() {
+        return test9_bool2;
     }
 
     static final MethodHandle test9_mh;
-    static MethodHandle test9_mh1;
 
     @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
     @Test(valid = ValueTypeReturnedAsFieldsOff)
-    long test9() throws Throwable {
-        return ((MyValue2)test9_mh.invokeExact(test9_mh1)).hash();
+    MyValue3 test9() throws Throwable {
+        return (MyValue3)test9_mh.invokeExact(this);
     }
 
+    static int test9_i = 0;
     @DontCompile
     public void test9_verifier(boolean warmup) throws Throwable {
-        test9_bool = !test9_bool;
-        long hash = test9();
-        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+(test9_bool ? 0 : 1), test9_bool).hash());
+        test9_i++;
+        test9_bool1 = (test9_i % 2) == 0;
+        test9_bool2 = (test9_i % 3) == 0;
+        MyValue3 vt = test9();
+        vt.verify(test9_bool1 ? test9_vt1 : (test9_bool2 ? test9_vt2 : test9_vt3));
     }
 
-    // Same as above but with the method handle for target2 not
-    // constant. Shouldn't cause any allocation.
+    // Same as above but with non constant target2 and target3
     @ForceInline
     static MyValue2 test10_target1() {
         return MyValue2.createWithFieldsInline(rI, true);
@@ -393,163 +435,80 @@
         return MyValue2.createWithFieldsInline(rI+1, false);
     }
 
-    static boolean test10_bool = true;
     @ForceInline
-    static boolean test10_test() {
-        return test10_bool;
+    static MyValue2 test10_target3() {
+        return MyValue2.createWithFieldsInline(rI+2, true);
+    }
+
+    static boolean test10_bool1 = true;
+    @ForceInline
+    static boolean test10_test1() {
+        return test10_bool1;
+    }
+
+    static boolean test10_bool2 = true;
+    @ForceInline
+    static boolean test10_test2() {
+        return test10_bool2;
     }
 
     static final MethodHandle test10_mh;
     static MethodHandle test10_mh2;
+    static MethodHandle test10_mh3;
 
     @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
     @Test(valid = ValueTypeReturnedAsFieldsOff)
     long test10() throws Throwable {
-        return ((MyValue2)test10_mh.invokeExact(test10_mh2)).hash();
+        return ((MyValue2)test10_mh.invokeExact(test10_mh2, test10_mh3)).hash();
     }
 
+    static int test10_i = 0;
+
     @DontCompile
     public void test10_verifier(boolean warmup) throws Throwable {
-        test10_bool = !test10_bool;
+        test10_i++;
+        test10_bool1 = (test10_i % 2) == 0;
+        test10_bool2 = (test10_i % 3) == 0;
         long hash = test10();
-        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+(test10_bool ? 0 : 1), test10_bool).hash());
+        int i = rI+(test10_bool1 ? 0 : (test10_bool2 ? 1 : 2));
+        boolean b = test10_bool1 ? true : (test10_bool2 ? false : true);
+        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(i, b).hash());
     }
 
-    // Return of target1, target2 and target3 merged in Lambda Forms
-    // as an __Value. Shouldn't cause any allocation
-    final MyValue3 test11_vt1 = MyValue3.create();
+    static int test11_i = 0;
+
     @ForceInline
-    MyValue3 test11_target1() {
-        return test11_vt1;
+    static MyValue2 test11_target1() {
+        return MyValue2.createWithFieldsInline(rI+test11_i, true);
     }
 
-    final MyValue3 test11_vt2 = MyValue3.create();
     @ForceInline
-    MyValue3 test11_target2() {
-        return test11_vt2;
+    static MyValue2 test11_target2() {
+        return MyValue2.createWithFieldsInline(rI-test11_i, false);
     }
 
-    final MyValue3 test11_vt3 = MyValue3.create();
     @ForceInline
-    MyValue3 test11_target3() {
-        return test11_vt3;
-    }
-
-    boolean test11_bool1 = true;
-    @ForceInline
-    boolean test11_test1() {
-        return test11_bool1;
-    }
-
-    boolean test11_bool2 = true;
-    @ForceInline
-    boolean test11_test2() {
-        return test11_bool2;
+    static boolean test11_test() {
+        return (test11_i % 100) == 0;
     }
 
     static final MethodHandle test11_mh;
-
-    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
-    @Test(valid = ValueTypeReturnedAsFieldsOff)
-    MyValue3 test11() throws Throwable {
-        return (MyValue3)test11_mh.invokeExact(this);
-    }
-
-    static int test11_i = 0;
-    @DontCompile
-    public void test11_verifier(boolean warmup) throws Throwable {
-        test11_i++;
-        test11_bool1 = (test11_i % 2) == 0;
-        test11_bool2 = (test11_i % 3) == 0;
-        MyValue3 vt = test11();
-        vt.verify(test11_bool1 ? test11_vt1 : (test11_bool2 ? test11_vt2 : test11_vt3));
-    }
-
-    // Same as above but with non constant target2 and target3
-    @ForceInline
-    static MyValue2 test12_target1() {
-        return MyValue2.createWithFieldsInline(rI, true);
-    }
-
-    @ForceInline
-    static MyValue2 test12_target2() {
-        return MyValue2.createWithFieldsInline(rI+1, false);
-    }
-
-    @ForceInline
-    static MyValue2 test12_target3() {
-        return MyValue2.createWithFieldsInline(rI+2, true);
-    }
-
-    static boolean test12_bool1 = true;
-    @ForceInline
-    static boolean test12_test1() {
-        return test12_bool1;
-    }
-
-    static boolean test12_bool2 = true;
-    @ForceInline
-    static boolean test12_test2() {
-        return test12_bool2;
-    }
-
-    static final MethodHandle test12_mh;
-    static MethodHandle test12_mh2;
-    static MethodHandle test12_mh3;
-
-    @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
-    @Test(valid = ValueTypeReturnedAsFieldsOff)
-    long test12() throws Throwable {
-        return ((MyValue2)test12_mh.invokeExact(test12_mh2, test12_mh3)).hash();
-    }
-
-    static int test12_i = 0;
-
-    @DontCompile
-    public void test12_verifier(boolean warmup) throws Throwable {
-        test12_i++;
-        test12_bool1 = (test12_i % 2) == 0;
-        test12_bool2 = (test12_i % 3) == 0;
-        long hash = test12();
-        int i = rI+(test12_bool1 ? 0 : (test12_bool2 ? 1 : 2));
-        boolean b = test12_bool1 ? true : (test12_bool2 ? false : true);
-        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(i, b).hash());
-    }
-
-    static int test13_i = 0;
-
-    @ForceInline
-    static MyValue2 test13_target1() {
-        return MyValue2.createWithFieldsInline(rI+test13_i, true);
-    }
-
-    @ForceInline
-    static MyValue2 test13_target2() {
-        return MyValue2.createWithFieldsInline(rI-test13_i, false);
-    }
-
-    @ForceInline
-    static boolean test13_test() {
-        return (test13_i % 100) == 0;
-    }
-
-    static final MethodHandle test13_mh;
-    static MethodHandle test13_mh2;
+    static MethodHandle test11_mh2;
 
     // Check that a buffered value returned by a compiled lambda form
     // is properly handled by the caller.
     @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE + STOREVALUETYPEFIELDS)
     @Test(valid = ValueTypeReturnedAsFieldsOff)
     @Warmup(11000)
-    long test13() throws Throwable {
-        return ((MyValue2)test13_mh.invokeExact(test13_mh2)).hash();
+    long test11() throws Throwable {
+        return ((MyValue2)test11_mh.invokeExact(test11_mh2)).hash();
     }
 
     @DontCompile
-    public void test13_verifier(boolean warmup) throws Throwable {
-        test13_i++;
-        long hash = test13();
-        boolean b = (test13_i % 100) == 0;
-        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+test13_i * (b ? 1 : -1), b).hash());
+    public void test11_verifier(boolean warmup) throws Throwable {
+        test11_i++;
+        long hash = test11();
+        boolean b = (test11_i % 100) == 0;
+        Asserts.assertEQ(hash, MyValue2.createWithFieldsInline(rI+test11_i * (b ? 1 : -1), b).hash());
     }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMinimalValueTypes.java	Wed Mar 14 09:37:27 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,523 +0,0 @@
-/*
- * 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
- * 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 compiler.valhalla.valuetypes;
-
-import jdk.experimental.bytecode.MacroCodeBuilder.CondKind;
-import jdk.experimental.bytecode.TypeTag;
-import jdk.experimental.value.MethodHandleBuilder;
-import jdk.incubator.mvt.ValueType;
-import jdk.test.lib.Asserts;
-
-import java.lang.invoke.*;
-import java.lang.reflect.Method;
-
-/*
- * @test
- * @summary Test Minimal Value Types
- * @library /testlibrary /test/lib /compiler/whitebox /
- * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
- * @compile -XDenableValueTypes ValueCapableClass1.java ValueCapableClass2.java TestMinimalValueTypes.java
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ClassFileInstaller jdk.test.lib.Platform
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+AlwaysIncrementalInline
- *                   -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
- *                   -XX:ValueFieldMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
- *                   compiler.valhalla.valuetypes.TestMinimalValueTypes
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-UseCompressedOops
- *                   -XX:-ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
- *                   -XX:ValueFieldMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
- *                   compiler.valhalla.valuetypes.TestMinimalValueTypes
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:-UseCompressedOops
- *                   -XX:+ValueTypePassFieldsAsArgs -XX:+ValueTypeReturnedAsFields -XX:-ValueArrayFlatten
- *                   -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0 -XX:ValueArrayElemMaxFlatOops=0
- *                   -DVerifyIR=false compiler.valhalla.valuetypes.TestMinimalValueTypes
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI -XX:+AlwaysIncrementalInline
- *                   -XX:-ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:-ValueArrayFlatten
- *                   -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0 -XX:ValueArrayElemMaxFlatOops=0
- *                   -DVerifyIR=false compiler.valhalla.valuetypes.TestMinimalValueTypes
- * @run main/othervm/timeout=120 -Xbootclasspath/a:. -ea -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
- *                   -XX:+UnlockExperimentalVMOptions -XX:+WhiteBoxAPI
- *                   -XX:+ValueTypePassFieldsAsArgs -XX:-ValueTypeReturnedAsFields -XX:+ValueArrayFlatten
- *                   -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=-1 -XX:ValueArrayElemMaxFlatOops=-1
- *                   -DVerifyIR=false compiler.valhalla.valuetypes.TestMinimalValueTypes
- */
-public class TestMinimalValueTypes extends ValueTypeTest {
-
-    static {
-        try {
-            MethodHandles.Lookup lookup = MethodHandles.lookup();
-
-            // Generate a MethodHandle that obtains field t of the derived value type
-            vccUnboxLoadLongMH = MethodHandleBuilder.loadCode(lookup,
-                    "vccUnboxLoadLong",
-                    MethodType.methodType(long.class, ValueCapableClass1.class),
-                    CODE -> {
-                        CODE.
-                        aload_0().
-                        vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                        getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "t", "J").
-                        lreturn();
-                    }
-                    );
-
-            // Generate a MethodHandle that obtains field x of the derived value type
-            vccUnboxLoadIntMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "vccUnboxLoadInt",
-                        MethodType.methodType(int.class, ValueCapableClass1.class),
-                        CODE -> {
-                            CODE.
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "x", "I").
-                            ireturn();
-                        }
-                        );
-
-
-            // Generate a MethodHandle that takes a value-capable class,
-            // unboxes it, then boxes it again and returns it.
-            vccUnboxBoxMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "vccUnboxBox",
-                        MethodType.methodType(ValueCapableClass1.class, ValueCapableClass1.class),
-                        CODE -> {
-                            CODE.
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            vbox(ValueCapableClass1.class).
-                            areturn();
-                        }
-                        );
-
-            // Generate a MethodHandle that takes a value-capable class,
-            // unboxes it, boxes it, reads a field from it, and returns the field.
-            vccUnboxBoxLoadIntMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "vccUnboxBoxLoadInt",
-                        MethodType.methodType(int.class, ValueCapableClass1.class),
-                        CODE -> {
-                            CODE.
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            vbox(ValueCapableClass1.class).
-                            getfield(ValueCapableClass1.class, "x", "I").
-                            ireturn();
-                        }
-                        );
-
-            nullvccUnboxLoadLongMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "nullvccUnboxLoadLong",
-                        MethodType.methodType(long.class),
-                        CODE -> {
-                            CODE.
-                            aconst_null().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "t", "J").
-                            lreturn();
-                        }
-                        );
-
-            objectUnboxLoadLongMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "ObjectUnboxLoadLong",
-                        MethodType.methodType(long.class, Object.class),
-                        CODE -> {
-                            CODE.
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "t", "J").
-                            lreturn();
-                        }
-                        );
-
-            objectBoxMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "ObjectBox",
-                        MethodType.methodType(long.class, Object.class, boolean.class),
-                        CODE -> {
-                            CODE.
-                            iload_1().
-                            iconst_1().
-                            ifcmp(TypeTag.I, CondKind.NE, "not_equal").
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            vbox(ValueCapableClass1.class).
-                            getfield(ValueCapableClass1.class, "t", "J").
-                            lreturn().
-                            label("not_equal").
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass2.class).valueClass()).
-                            vbox(ValueCapableClass1.class).
-                            getfield(ValueCapableClass1.class, "t", "J").
-                            lreturn();
-                        }
-                        );
-
-            checkedvccUnboxLoadLongMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "checkedVCCUnboxLoadLongMH",
-                        MethodType.methodType(long.class),
-                        CODE -> {
-                            CODE.
-                            invokestatic(ValueCapableClass1.class, "createInline", "()Lcompiler/valhalla/valuetypes/ValueCapableClass1;", false).
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            getfield(ValueType.forClass(ValueCapableClass1.class).valueClass(), "t", "J").
-                            lreturn();
-                        }
-                        );
-
-            vastoreMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "Vastore",
-                        MethodType.methodType(void.class, ValueCapableClass1.class),
-                        CODE -> {
-                            CODE.
-                            iconst_1().
-                            anewarray(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            iconst_0().
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            vastore().
-                            return_();
-                        }
-                        );
-
-            invalidVastoreMH = MethodHandleBuilder.loadCode(MethodHandles.lookup(),
-                        "Vastore",
-                        MethodType.methodType(void.class, ValueCapableClass2.class),
-                        CODE -> {
-                            CODE.
-                            iconst_1().
-                            anewarray(ValueType.forClass(ValueCapableClass1.class).valueClass()).
-                            iconst_0().
-                            aload_0().
-                            vunbox(ValueType.forClass(ValueCapableClass2.class).valueClass()).
-                            vastore().
-                            return_();
-                        }
-                        );
-
-            MethodHandle test13_count = MethodHandles.constant(int.class, 100);
-            ValueType<?> test13_VT = ValueType.forClass(ValueCapableClass2.class);
-            MethodHandle test13_init = test13_VT.defaultValueConstant();
-            MethodHandle test13_getfield = test13_VT.findGetter(lookup, "u", long.class);
-            MethodHandle test13_add = lookup.findStatic(Long.class, "sum", MethodType.methodType(long.class, long.class, long.class));
-            MethodHandle test13_body = MethodHandles.collectArguments(ValueCapableClass2.FACTORY,
-                                                                      0,
-                                                                      MethodHandles.dropArguments(MethodHandles.collectArguments(MethodHandles.insertArguments(test13_add,
-                                                                                                                                                               0,
-                                                                                                                                                               1L),
-                                                                                                                                 0,
-                                                                                                                                 test13_getfield),
-                                                                                                  1,
-                                                                                                  int.class));
-            test13_mh = MethodHandles.collectArguments(test13_getfield,
-                                                       0,
-                                                       MethodHandles.countedLoop(test13_count, test13_init, test13_body));
-        } catch (NoSuchMethodException | IllegalAccessException | NoSuchFieldException e) {
-            e.printStackTrace();
-            throw new RuntimeException("Method handle lookup failed");
-        }
-    }
-
-    public static void main(String[] args) throws Throwable {
-        TestMinimalValueTypes test = new TestMinimalValueTypes();
-        test.run(args);
-    }
-
-    private static final ValueCapableClass1 vcc = ValueCapableClass1.create(rL, rI, (short)rI, (short)rI);
-    private static final ValueCapableClass2 vcc2 = ValueCapableClass2.create(rL + 1);
-
-    // Test vbox and vunbox
-
-    private static final MethodHandle vccUnboxLoadLongMH;
-
-    @Test
-    public long test1() throws Throwable {
-        return (long)vccUnboxLoadLongMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test1_verifier(boolean warmup) {
-        try {
-            long result = test1();
-            Asserts.assertEQ(vcc.t, result, "Field t of input and result must be equal.");
-        } catch (Throwable t) {
-            throw new RuntimeException("Test1 failed", t);
-        }
-    }
-
-    private static final MethodHandle vccUnboxLoadIntMH;
-
-    @Test
-    public int test2() throws Throwable {
-        return (int)vccUnboxLoadIntMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test2_verifier(boolean warmup) {
-        try {
-            int result = test2();
-            Asserts.assertEQ(vcc.x, result, "Field x of input and result must be equal.");
-        } catch (Throwable t) {
-            throw new RuntimeException("Test2 failed", t);
-        }
-    }
-
-
-    private static final MethodHandle vccUnboxBoxMH;
-
-    @Test
-    public ValueCapableClass1 test3() throws Throwable {
-        return (ValueCapableClass1)vccUnboxBoxMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test3_verifier(boolean warmup) {
-        try {
-            ValueCapableClass1 result = test3();
-            Asserts.assertEQ(vcc.value(), result.value(), "Value of VCC and returned VCC must be equal");
-        } catch (Throwable t) {
-            throw new RuntimeException("Test3 failed", t);
-        }
-    }
-
-    private static final MethodHandle vccUnboxBoxLoadIntMH;
-
-    @Test
-    public int test4() throws Throwable {
-        return (int)vccUnboxBoxLoadIntMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test4_verifier(boolean warmup) {
-        try {
-            int result = test4();
-            Asserts.assertEQ(vcc.x, result, "Field x of VCC and result must be equal");
-        } catch (Throwable t) {
-            throw new RuntimeException("Test4 failed in the interpeter", t);
-        }
-    }
-
-
-    /* The compiler is supposed to determine that the value to be
-     * unboxed in nullcvvUnboxLoadLong is always null. Therefore, the
-     * compiler generates only the path leading to the corresponding
-     * uncommon trap. */
-
-    private static final MethodHandle nullvccUnboxLoadLongMH;
-
-    @Test(failOn = RETURN)
-    public long test5() throws Throwable {
-        return (long)nullvccUnboxLoadLongMH.invokeExact();
-    }
-
-    @DontCompile
-    public void test5_verifier(boolean warmup) throws Throwable {
-        try {
-            long result = test5();
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (NullPointerException e) {
-            // Expected
-        }
-    }
-
-
-    /* The compiler is supposed to determine that the allocated
-     * ValueCapableClass1 instance is never null (and therefore not
-     * generate a null check). Also, the source and target type match
-     * (known at compile time), so no type check is needed either.*/
-
-    private static final MethodHandle checkedvccUnboxLoadLongMH;
-
-    @Test(failOn = NPE)
-    public long test6() throws Throwable {
-        return (long)checkedvccUnboxLoadLongMH.invokeExact();
-    }
-
-    @DontCompile
-    public void test6_verifier(boolean warmup) throws Throwable {
-        long result = test6();
-        Asserts.assertEQ(result, 17L);
-    }
-
-    /* The compiler is supposed to emit a runtime null check because
-     * it does not have enough information to determine that the value
-     * to be unboxed is not null (and either that it is null). The
-     * declared type of the */
-    @Test(match = {NPE}, matchCount = {1})
-    public long test7(ValueCapableClass1 vcc) throws Throwable {
-        return (long)vccUnboxLoadLongMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test7_verifier(boolean warmup) throws Throwable {
-        try {
-            long result = test7(null);
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (NullPointerException e) {
-        }
-    }
-
-
-    /* Attempt to unbox an object that is not a subclass of the
-     * value-capable class derived from the value type specified in
-     * the vunbox bytecode. */
-
-    private static final MethodHandle objectUnboxLoadLongMH;
-
-    @Test(match = {NPE,CCE}, matchCount = {1,1})
-    @Warmup(5000)
-    public long test8(Object vcc) throws Throwable {
-        return (long)objectUnboxLoadLongMH.invokeExact(vcc);
-    }
-
-    @DontCompile
-    public void test8_verifier(boolean warmup) throws Throwable {
-        try {
-            long result = test8(new Object());
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (ClassCastException e) {
-        }
-
-        try {
-            long result = test8(vcc2);
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (ClassCastException e) {
-        }
-
-        Asserts.assertEQ(test8(vcc), rL);
-    }
-
-
-    /* Generate an if-then-else construct with one path that contains
-     * an invalid boxing operation (boxing of a value-type to a
-     * non-matching value-capable class).*/
-
-    private static final MethodHandle objectBoxMH;
-
-    @Test(match = {NPE, CCE}, matchCount = {2, 2})
-    @Warmup(5000)
-    public long test9(Object obj, boolean warmup) throws Throwable {
-        return (long)objectBoxMH.invokeExact(obj, warmup);
-    }
-
-    @DontCompile
-    public void test9_verifier(boolean warmup) throws Throwable {
-        try {
-            long result = test9(vcc2, true);
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (ClassCastException e) {
-        }
-
-        Asserts.assertEQ(test9(vcc, true), rL);
-
-        try {
-            long result = test9(vcc2, false);
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (ClassCastException e) {
-        }
-
-        try {
-            long result = test9(vcc, false);
-            throw new RuntimeException("Test failed because no exception was thrown");
-        } catch (ClassCastException e) {
-        }
-    }
-
-
-    /* Create a new value type array and store a value type into
-     * it. The test should pass without throwing an exception. */
-
-    private static final MethodHandle vastoreMH;
-
-    @Test
-    public void test10() throws Throwable {
-        vastoreMH.invokeExact(vcc);
-    }
-
-    public void test10_verifier(boolean warmup) throws Throwable {
-        test10();
-    }
-
-
-    /* Create a new value type array with element type
-     * ValueCapableClass1 and attempt to store a value type of type
-     * ValueCapableClass2 into it. */
-
-    private static final MethodHandle invalidVastoreMH;
-
-    @Test
-    public void test11() throws Throwable {
-        invalidVastoreMH.invokeExact(vcc2);
-    }
-
-    public void test11_verifier(boolean warmup) throws Throwable {
-        boolean exceptionThrown = false;
-        try {
-            test11();
-        } catch (ArrayStoreException e) {
-            exceptionThrown = true;
-        }
-        Asserts.assertTrue(exceptionThrown, "ArrayStoreException must be thrown");
-    }
-
-    // Test Class::cast intrinsic
-    @Test()
-    public Object test12(Class<?> cls, Object o) throws ClassCastException {
-        return cls.cast(o);
-    }
-
-    public void test12_verifier(boolean warmup) {
-        try {
-            test12(ValueCapableClass1.class, vcc);
-        } catch (ClassCastException e) {
-            throw new RuntimeException("test12_1 failed");
-        }
-        try {
-            test12(__Value.class, new Object());
-            throw new RuntimeException("test12_2 failed");
-        } catch (ClassCastException e) {
-            // Expected
-        }
-    }
-
-    // Simple reduction with intermediate result merged in a Lambda
-    // Form as an __Value. Shouldn't cause any allocations. The entire
-    // loop should go away as the result is a constant.
-    static final MethodHandle test13_mh;
-
-    @Test(failOn = ALLOC + STORE + LOOP + STOREVALUETYPEFIELDS)
-    long test13() throws Throwable {
-        return (long)test13_mh.invokeExact();
-    }
-
-    @DontCompile
-    public void test13_verifier(boolean warmup) throws Throwable {
-        long v = test13();
-        Asserts.assertEQ(v, 100L);
-    }
-}
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestOnStackReplacement.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestOnStackReplacement.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -30,10 +30,6 @@
  * @summary Test on stack replacement (OSR) with value types
  * @library /testlibrary /test/lib /compiler/whitebox /
  * @requires os.simpleArch == "x64"
- * @modules java.base/jdk.experimental.bytecode
- *          java.base/jdk.experimental.value
- *          java.base/jdk.internal.misc:+open
- *          jdk.incubator.mvt
  * @compile -XDenableValueTypes TestOnStackReplacement.java
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main ClassFileInstaller jdk.test.lib.Platform
@@ -146,20 +142,20 @@
         test3();
     }
 
-    // OSR compilation with __Value local
+    // OSR compilation with Object local
     @DontCompile
-    public __Value test4_init() {
+    public Object test4_init() {
         return MyValue1.createWithFieldsInline(rI, rL);
     }
 
     @DontCompile
-    public __Value test4_body() {
+    public Object test4_body() {
         return MyValue1.createWithFieldsInline(rI, rL);
     }
 
     @Test()
-    public __Value test4() throws Throwable {
-        __Value vt = test4_init();
+    public Object test4() throws Throwable {
+        Object vt = test4_init();
         for (int i = 0; i < 50_000; i++) {
             if (i % 2 == 1) {
                 vt = test4_body();
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnloadedValueTypeArray.java	Wed Mar 14 13:55:05 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 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
@@ -25,7 +25,6 @@
  * @test
  * @bug 8182997
  * @summary Array of unloaded value class should consistently use L signature
- * @modules jdk.incubator.mvt
  * @compile -XDenableValueTypes TestUnloadedValueTypeArray.java
  * @run main/othervm -XX:+EnableValhalla -Xcomp -XX:CompileOnly=TestUnloadedValueTypeArray::test TestUnloadedValueTypeArray
  */
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnresolvedValueClass.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestUnresolvedValueClass.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -53,12 +53,15 @@
 
             // Run test in new VM instance
             String[] arg = {"-XX:+EnableValhalla", "-XX:+ValueTypePassFieldsAsArgs", "TestUnresolvedValueClass", "run"};
-            OutputAnalyzer output = ProcessTools.executeTestJvm(arg);
+            OutputAnalyzer oa = ProcessTools.executeTestJvm(arg);
 
             // Adapter creation for TestUnresolvedValueClass::test1 should fail with a
             // ClassNotFoundException because the class for argument 'vt' was not found.
-            output.shouldContain("java.lang.ClassNotFoundException: SimpleValueType");
-            output.shouldHaveExitValue(1);
+            String output = oa.getOutput();
+            if (!output.contains("ValueTypePassFieldsAsArgs is not supported on this platform")) {
+                oa.shouldContain("java.lang.ClassNotFoundException: SimpleValueType");
+                oa.shouldHaveExitValue(1);
+            }
         }
     }
 }
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueCapableClass1.java	Wed Mar 14 09:37:27 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2016, 2017, 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.
- */
-
-/*
- * A value-capable class (VCC) from which HotSpot derives a value
- * type. The derived value type (DVT) is referred to as
- * ValueCapableClass1$Value.
- */
-package compiler.valhalla.valuetypes;
-
-@jdk.incubator.mvt.ValueCapableClass
-public final class ValueCapableClass1 {
-    public final long t;
-    public final int x;
-    public final short y;
-    public final short z;
-
-    private ValueCapableClass1(long t, int x, short y, short z) {
-        this.t = t;
-        this.x = x;
-        this.y = y;
-        this.z = z;
-    }
-
-    public static ValueCapableClass1 create(long t, int x, short y, short z) {
-        return new ValueCapableClass1(t, x, y, z);
-    }
-
-    @ForceInline
-    public static ValueCapableClass1 createInline() {
-        return new ValueCapableClass1(17L, 2, (short)3, (short)4);
-    }
-
-    int value() {
-        return x + y + z;
-    }
-}
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueCapableClass2.java	Wed Mar 14 09:37:27 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2016, 2017, 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.
- */
-
-/*
- * A value-capable class (VCC) from which HotSpot derives a value
- * type. The derived value type (DVT) is referred to as
- * ValueCapableClass2$Value.
- */
-package compiler.valhalla.valuetypes;
-
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-
-import jdk.incubator.mvt.ValueType;
-
-@jdk.incubator.mvt.ValueCapableClass
-public final class ValueCapableClass2 {
-    public final long u;
-
-    public static final MethodHandle FACTORY;
-    static {
-        MethodHandles.Lookup lookup = MethodHandles.lookup();
-        ValueType<?> VT = ValueType.forClass(ValueCapableClass2.class);
-        try {
-            FACTORY = VT.unreflectWithers(lookup, true, VT.valueFields());
-        } catch (NoSuchFieldException|IllegalAccessException e) {
-            throw new RuntimeException("method handle lookup fails");
-        }
-    }
-
-    private ValueCapableClass2(long u) {
-        this.u = u;
-    }
-
-    public static ValueCapableClass2 create(long u) {
-        return new ValueCapableClass2(u);
-    }
-}
--- a/test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueTypeTest.java	Wed Mar 14 09:37:27 2018 +0100
+++ b/test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueTypeTest.java	Wed Mar 14 13:55:05 2018 +0100
@@ -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
@@ -94,6 +94,7 @@
     private static final boolean VERIFY_IR = Boolean.parseBoolean(System.getProperty("VerifyIR", "true"));
     private static final boolean VERIFY_VM = Boolean.parseBoolean(System.getProperty("VerifyVM", "false"));
     private static final String TESTLIST = System.getProperty("Testlist", "");
+    private static final String EXCLUDELIST = System.getProperty("Exclude", "");
     private static final int WARMUP = Integer.parseInt(System.getProperty("Warmup", "251"));
     private static final boolean DUMP_REPLAY = Boolean.parseBoolean(System.getProperty("DumpReplay", "false"));
 
@@ -111,9 +112,7 @@
         "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.MyValue3::*",
         "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.MyValue3Inline::*",
         "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.MyValue4::*",
-        "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.ValueCapableClass2_*::*",
-        "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.*::*",
-        "-XX:CompileCommand=inline,java.lang.__Value::hashCode");
+        "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.*::*");
     private static final List<String> verifyFlags = Arrays.asList(
         "-XX:+VerifyOops", "-XX:+VerifyStack", "-XX:+VerifyLastFrame", "-XX:+VerifyBeforeGC", "-XX:+VerifyAfterGC",
         "-XX:+VerifyDuringGC", "-XX:+VerifyAdapterSharing", "-XX:+StressValueTypeReturnedAsFields");
@@ -141,7 +140,8 @@
     protected static final String MID = ".*)+\\t===.*";
     protected static final String END = ")|";
     protected static final String ALLOC  = "(.*precise klass compiler/valhalla/valuetypes/MyValue.*\\R(.*(nop|spill).*\\R)*.*_new_instance_Java" + END;
-    protected static final String ALLOCA = "(.*precise klass \\[Qcompiler/valhalla/valuetypes/MyValue.*\\R(.*(nop|spill).*\\R)*.*_new_array_Java" + END;
+    // FIXME check if this still works for value array allocations
+    protected static final String ALLOCA = "(.*precise klass \\[Lcompiler/valhalla/valuetypes/MyValue.*\\R(.*(nop|spill).*\\R)*.*_new_array_Java" + END;
     protected static final String LOAD   = START + "Load(B|S|I|L|F|D)" + MID + "valuetype\\*" + END;
     protected static final String LOADP  = START + "Load(P|N)" + MID + "valuetype\\*" + END;
     protected static final String LOADK  = START + "LoadK" + MID + END;
@@ -152,8 +152,6 @@
     protected static final String RETURN = START + "Return" + MID + "returns" + END;
     protected static final String LINKTOSTATIC = START + "CallStaticJava" + MID + "linkToStatic" + END;
     protected static final String NPE = START + "CallStaticJava" + MID + "null_check" + END;
-    protected static final String CCE = "((.*cmp.*precise klass compiler/valhalla/valuetypes/ValueCapableClass.*)|" +
-                                         "(.*mov.*precise klass compiler/valhalla/valuetypes/ValueCapableClass.*\\R.*cmp.*)" + END;
     protected static final String CALL = START + "CallStaticJava" + MID + END;
     protected static final String STOREVALUETYPEFIELDS = START + "CallStaticJava" + MID + "store_value_type_fields" + END;
     protected static final String SCOBJ = "(.*# ScObj.*" + END;
@@ -161,14 +159,18 @@
 
     protected ValueTypeTest() {
         List<String> list = null;
+        List<String> exclude = null;
         if (!TESTLIST.isEmpty()) {
            list = Arrays.asList(TESTLIST.split(","));
         }
+        if (!EXCLUDELIST.isEmpty()) {
+           exclude = Arrays.asList(EXCLUDELIST.split(","));
+        }
         // Gather all test methods and put them in Hashtable
         for (Method m : getClass().getMethods()) {
             Test[] annos = m.getAnnotationsByType(Test.class);
             if (annos.length != 0 &&
-                (list == null || list.contains(m.getName()))) {
+                ((list == null || list.contains(m.getName())) && (exclude == null || !exclude.contains(m.getName())))) {
                 tests.put(getClass().getSimpleName() + "::" + m.getName(), m);
             }
         }