changeset 47428:65d373941f5d condy

8189290: Rename CONSTANT_ConstantDynamic to CONSTANT_Dynamic Summary: Renamed CONSTANT_ConstantDynamic to CONSTANT_Dynamic, all source & test files have been updated accordingly. Reviewed-by: psandoz
author lfoltan
date Fri, 13 Oct 2017 15:29:58 -0400
parents dcd8a022b933
children b846aa5f933d 9b8c7b25f15d
files src/hotspot/share/c1/c1_GraphBuilder.cpp src/hotspot/share/ci/ciEnv.cpp src/hotspot/share/ci/ciReplay.cpp src/hotspot/share/classfile/classFileParser.cpp src/hotspot/share/classfile/systemDictionary.cpp src/hotspot/share/classfile/systemDictionary.hpp src/hotspot/share/classfile/verifier.cpp src/hotspot/share/classfile/vmSymbols.hpp src/hotspot/share/interpreter/bytecode.cpp src/hotspot/share/interpreter/bytecodeInterpreter.cpp src/hotspot/share/interpreter/bytecodeTracer.cpp src/hotspot/share/interpreter/rewriter.cpp src/hotspot/share/oops/constantPool.cpp src/hotspot/share/oops/constantPool.hpp src/hotspot/share/oops/generateOopMap.cpp src/hotspot/share/prims/jvm.h src/hotspot/share/prims/jvmtiRedefineClasses.cpp src/hotspot/share/runtime/globals.hpp src/hotspot/share/runtime/vmStructs.cpp src/hotspot/share/utilities/constantTag.cpp src/hotspot/share/utilities/constantTag.hpp src/hotspot/share/utilities/exceptions.cpp src/java.base/share/classes/java/lang/invoke/ConstantDynamic.java src/java.base/share/classes/java/lang/invoke/ConstantGroup.java src/java.base/share/classes/java/lang/invoke/DynamicConstant.java src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java src/java.base/share/classes/java/lang/invoke/package-info.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java test/jdk/java/lang/invoke/condy/BootstrapMethodJumboArgsTest.java test/jdk/java/lang/invoke/condy/CondyBSMException.java test/jdk/java/lang/invoke/condy/CondyBSMInvocation.java test/jdk/java/lang/invoke/condy/CondyBSMValidationTest.java test/jdk/java/lang/invoke/condy/CondyNameValidationTest.java test/jdk/java/lang/invoke/condy/CondyNestedTest.java test/jdk/java/lang/invoke/condy/CondyStaticArgumentsTest.java test/jdk/java/lang/invoke/condy/CondyTypeValidationTest.java test/jdk/java/lang/invoke/condy/CondyWrongType.java test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/BytePoolHelper.java test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/CodeBuilder.java test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/IsolatedMethodBuilder.java test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/PoolHelper.java test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/TypedCodeBuilder.java test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java
diffstat 59 files changed, 618 insertions(+), 618 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -874,7 +874,7 @@
 void GraphBuilder::load_constant() {
   ciConstant con = stream()->get_constant();
   if (con.basic_type() == T_ILLEGAL) {
-    // FIXME: an unresolved ConstantDynamic can get here,
+    // FIXME: an unresolved Dynamic constant can get here,
     // and that should not terminate the whole compilation.
     BAILOUT("could not resolve a constant");
   } else {
@@ -900,7 +900,7 @@
           patch_state = copy_state_before();
           t = new ObjectConstant(obj);
         } else {
-          // Might be a Class, MethodType, MethodHandle, or ConstantDynamic
+          // Might be a Class, MethodType, MethodHandle, or Dynamic constant
           // result, which might turn out to be an array.
           if (obj->is_null_object())
             t = objectNull;
--- a/src/hotspot/share/ci/ciEnv.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/ci/ciEnv.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -591,7 +591,7 @@
         return ciConstant(T_OBJECT, get_object(NULL));
       }
       BasicType bt = T_OBJECT;
-      if (cpool->tag_at(index).is_constant_dynamic())
+      if (cpool->tag_at(index).is_dynamic_constant())
         bt = FieldType::basic_type(cpool->uncached_signature_ref_at(index));
       if (is_reference_type(bt)) {
       } else {
@@ -675,7 +675,7 @@
     ciSymbol* signature = get_symbol(cpool->method_handle_signature_ref_at(index));
     ciObject* ciobj     = get_unloaded_method_handle_constant(callee, name, signature, ref_kind);
     return ciConstant(T_OBJECT, ciobj);
-  } else if (tag.is_constant_dynamic()) {
+  } else if (tag.is_dynamic_constant()) {
     return ciConstant();
   } else {
     ShouldNotReachHere();
--- a/src/hotspot/share/ci/ciReplay.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/ci/ciReplay.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -721,7 +721,7 @@
         case JVM_CONSTANT_Float:
         case JVM_CONSTANT_MethodHandle:
         case JVM_CONSTANT_MethodType:
-        case JVM_CONSTANT_ConstantDynamic:
+        case JVM_CONSTANT_Dynamic:
         case JVM_CONSTANT_InvokeDynamic:
           if (tag != cp->tag_at(i).value()) {
             report_error("tag mismatch: wrong class files?");
--- a/src/hotspot/share/classfile/classFileParser.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -202,7 +202,7 @@
         }
         break;
       }
-      case JVM_CONSTANT_ConstantDynamic : {
+      case JVM_CONSTANT_Dynamic : {
         // TODO major version check
         if (_major_version < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
           classfile_parse_error(
@@ -215,7 +215,7 @@
         if (_max_bootstrap_specifier_index < (int) bootstrap_specifier_index) {
           _max_bootstrap_specifier_index = (int) bootstrap_specifier_index;  // collect for later
         }
-        cp->constant_dynamic_at_put(index, bootstrap_specifier_index, name_and_type_index);
+        cp->dynamic_constant_at_put(index, bootstrap_specifier_index, name_and_type_index);
         break;
       }
       case JVM_CONSTANT_InvokeDynamic : {
@@ -550,7 +550,7 @@
           ref_index, CHECK);
         break;
       }
-      case JVM_CONSTANT_ConstantDynamic: {
+      case JVM_CONSTANT_Dynamic: {
         const int name_and_type_ref_index =
           cp->invoke_dynamic_name_and_type_ref_index_at(index);
 
@@ -654,7 +654,7 @@
         }
         break;
       }
-      case JVM_CONSTANT_ConstantDynamic: {
+      case JVM_CONSTANT_Dynamic: {
         const int name_and_type_ref_index =
           cp->name_and_type_ref_index_at(index);
         // already verified to be utf8
@@ -666,11 +666,11 @@
         const Symbol* const name = cp->symbol_at(name_ref_index);
         const Symbol* const signature = cp->symbol_at(signature_ref_index);
         if (_need_verify) {
-          // ConstantDynamic name and signature are verified above, when iterating NameAndType_info.
+          // CONSTANT_Dynamic's name and signature are verified above, when iterating NameAndType_info.
           // Need only to be sure signature is non-zero length and the right type.
           if (signature->utf8_length() == 0 ||
               signature->byte_at(0) == JVM_SIGNATURE_FUNC) {
-            throwIllegalSignature("ConstantDynamic", name, signature, CHECK);
+            throwIllegalSignature("CONSTANT_Dynamic", name, signature, CHECK);
           }
         }
         break;
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -2860,13 +2860,13 @@
   return Handle(THREAD, (oop) result.get_jobject());
 }
 
-// Ask Java to compute a constant by invoking a BSM given a ConstantDynamic_info CP entry
-Handle SystemDictionary::link_constant_dynamic_constant(Klass* caller,
-                                                        int condy_index,
-                                                        Handle bootstrap_specifier,
-                                                        Symbol* name,
-                                                        Symbol* type,
-                                                        TRAPS) {
+// Ask Java to compute a constant by invoking a BSM given a Dynamic_info CP entry
+Handle SystemDictionary::link_dynamic_constant(Klass* caller,
+                                               int condy_index,
+                                               Handle bootstrap_specifier,
+                                               Symbol* name,
+                                               Symbol* type,
+                                               TRAPS) {
   Handle empty;
   Handle bsm, info;
   if (java_lang_invoke_MethodHandle::is_instance(bootstrap_specifier())) {
@@ -2883,7 +2883,7 @@
 
   // This should not happen.  JDK code should take care of that.
   if (caller == NULL) {
-    THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad constantdynamic", empty);
+    THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad dynamic constant", empty);
   }
 
   Handle constant_name = java_lang_String::create_from_symbol(name, CHECK_(empty));
@@ -2903,8 +2903,8 @@
   JavaValue result(T_OBJECT);
   JavaCalls::call_static(&result,
                          SystemDictionary::MethodHandleNatives_klass(),
-                         vmSymbols::linkConstantDynamic_name(),
-                         vmSymbols::linkConstantDynamic_signature(),
+                         vmSymbols::linkDynamicConstant_name(),
+                         vmSymbols::linkDynamicConstant_signature(),
                          &args, CHECK_(empty));
 
   return Handle(THREAD, (oop) result.get_jobject());
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Fri Oct 13 15:29:58 2017 -0400
@@ -560,13 +560,13 @@
                                                Symbol* signature,
                                                TRAPS);
 
-  // ask Java to compute a constant by invoking a BSM given a ConstantDynamic_info CP entry
-  static Handle    link_constant_dynamic_constant(Klass* caller,
-                                                  int condy_index,
-                                                  Handle bootstrap_specifier,
-                                                  Symbol* name,
-                                                  Symbol* type,
-                                                  TRAPS);
+  // ask Java to compute a constant by invoking a BSM given a Dynamic_info CP entry
+  static Handle    link_dynamic_constant(Klass* caller,
+                                         int condy_index,
+                                         Handle bootstrap_specifier,
+                                         Symbol* name,
+                                         Symbol* type,
+                                         TRAPS);
 
   // ask Java to create a dynamic call site, while linking an invokedynamic op
   static methodHandle find_dynamic_call_site_invoker(Klass* caller,
--- a/src/hotspot/share/classfile/verifier.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/classfile/verifier.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -2060,7 +2060,7 @@
       types = (1 << JVM_CONSTANT_Integer) | (1 << JVM_CONSTANT_Float)
             | (1 << JVM_CONSTANT_String)  | (1 << JVM_CONSTANT_Class)
             | (1 << JVM_CONSTANT_MethodHandle) | (1 << JVM_CONSTANT_MethodType)
-            | (1 << JVM_CONSTANT_ConstantDynamic);
+            | (1 << JVM_CONSTANT_Dynamic);
       // Note:  The class file parser already verified the legality of
       // MethodHandle and MethodType constants.
       verify_cp_type(bci, index, cp, types, CHECK_VERIFY(this));
@@ -2068,7 +2068,7 @@
   } else {
     assert(opcode == Bytecodes::_ldc2_w, "must be ldc2_w");
     types = (1 << JVM_CONSTANT_Double) | (1 << JVM_CONSTANT_Long)
-          | (1 << JVM_CONSTANT_ConstantDynamic);
+          | (1 << JVM_CONSTANT_Dynamic);
     verify_cp_type(bci, index, cp, types, CHECK_VERIFY(this));
   }
   if (tag.is_string() && cp->is_pseudo_string_at(index)) {
@@ -2103,11 +2103,11 @@
     current_frame->push_stack(
       VerificationType::reference_type(
         vmSymbols::java_lang_invoke_MethodType()), CHECK_VERIFY(this));
-  } else if (tag.is_constant_dynamic()) {
+  } else if (tag.is_dynamic_constant()) {
     Symbol* constant_type = cp->uncached_signature_ref_at(index);
     if (!SignatureVerifier::is_valid_type_signature(constant_type)) {
       class_format_error(
-        "Invalid type for constant dynamic in class %s referenced "
+        "Invalid type for dynamic constant in class %s referenced "
         "from constant pool index %d", _klass->external_name(), index);
       return;
     }
@@ -2121,7 +2121,7 @@
     int opcode_n = (opcode == Bytecodes::_ldc2_w ? 2 : 1);
     if (n != opcode_n) {
       // wrong kind of ldc; reverify against updated type mask
-      types &= ~(1 << JVM_CONSTANT_ConstantDynamic);
+      types &= ~(1 << JVM_CONSTANT_Dynamic);
       verify_cp_type(bci, index, cp, types, CHECK_VERIFY(this));
     }
     for (int i = 0; i < n; i++) {
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Fri Oct 13 15:29:58 2017 -0400
@@ -309,8 +309,8 @@
   template(linkMethodHandleConstant_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;") \
   template(linkMethod_name,                           "linkMethod")                               \
   template(linkMethod_signature, "(Ljava/lang/Class;ILjava/lang/Class;Ljava/lang/String;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \
-  template(linkConstantDynamic_name,                  "linkConstantDynamic")                      \
-  template(linkConstantDynamic_signature, "(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
+  template(linkDynamicConstant_name,                  "linkDynamicConstant")                      \
+  template(linkDynamicConstant_signature, "(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;") \
   template(linkCallSite_name,                         "linkCallSite")                             \
   template(linkCallSite_signature, "(Ljava/lang/Object;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;") \
   template(setTargetNormal_name,                      "setTargetNormal")                          \
--- a/src/hotspot/share/interpreter/bytecode.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/interpreter/bytecode.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -216,7 +216,7 @@
   ConstantPool* constants = _method->constants();
   if (has_cache_index()) {
     return constants->resolve_cached_constant_at(index, THREAD);
-  } else if (_method->constants()->tag_at(index).is_constant_dynamic()) {
+  } else if (_method->constants()->tag_at(index).is_dynamic_constant()) {
     return constants->resolve_possibly_cached_constant_at(index, THREAD);
   } else {
     return constants->resolve_constant_at(index, THREAD);
--- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -2371,7 +2371,7 @@
             THREAD->set_vm_result(NULL);
             break;
 
-          case JVM_CONSTANT_ConstantDynamic:
+          case JVM_CONSTANT_Dynamic:
             {
               oop result = constants->resolved_references()->obj_at(index);
               if (result == NULL) {
@@ -2415,7 +2415,7 @@
              SET_STACK_DOUBLE(constants->double_at(index), 1);
             break;
 
-          case JVM_CONSTANT_ConstantDynamic:
+          case JVM_CONSTANT_Dynamic:
             {
               oop result = constants->resolved_references()->obj_at(index);
               if (result == NULL) {
--- a/src/hotspot/share/interpreter/bytecodeTracer.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/interpreter/bytecodeTracer.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -367,7 +367,7 @@
   case JVM_CONSTANT_Fieldref:
     break;
   case JVM_CONSTANT_NameAndType:
-  case JVM_CONSTANT_ConstantDynamic:
+  case JVM_CONSTANT_Dynamic:
   case JVM_CONSTANT_InvokeDynamic:
     has_klass = false;
     break;
@@ -383,7 +383,7 @@
     Symbol* klass = constants->klass_name_at(constants->uncached_klass_ref_index_at(i));
     st->print_cr(" %d <%s.%s%s%s> ", i, klass->as_C_string(), name->as_C_string(), sep, signature->as_C_string());
   } else {
-    if (tag.is_constant_dynamic() || tag.is_invoke_dynamic()) {
+    if (tag.is_dynamic_constant() || tag.is_invoke_dynamic()) {
       int bsm = constants->invoke_dynamic_bootstrap_method_ref_index_at(i);
       st->print(" bsm=%d", bsm);
     }
--- a/src/hotspot/share/interpreter/rewriter.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/interpreter/rewriter.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -49,7 +49,7 @@
       case JVM_CONSTANT_Methodref         : // fall through
         add_cp_cache_entry(i);
         break;
-      case JVM_CONSTANT_ConstantDynamic:
+      case JVM_CONSTANT_Dynamic:
       case JVM_CONSTANT_String            : // fall through
       case JVM_CONSTANT_MethodHandle      : // fall through
       case JVM_CONSTANT_MethodType        : // fall through
@@ -327,7 +327,7 @@
     if (tag.is_method_handle() ||
         tag.is_method_type() ||
         tag.is_string() ||
-        (tag.is_constant_dynamic() &&
+        (tag.is_dynamic_constant() &&
          // keep regular ldc interpreter logic for condy primitives
          is_reference_type(FieldType::basic_type(_pool->uncached_signature_ref_at(cp_index))))
         ) {
--- a/src/hotspot/share/oops/constantPool.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/oops/constantPool.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -600,7 +600,7 @@
     // change byte-ordering and go via cache
     i = remap_instruction_operand_from_cache(which);
   } else {
-    if (tag_at(which).is_invoke_dynamic() || tag_at(which).is_constant_dynamic()) {
+    if (tag_at(which).is_invoke_dynamic() || tag_at(which).is_dynamic_constant()) {
       int pool_index = invoke_dynamic_name_and_type_ref_index_at(which);
       assert(tag_at(pool_index).is_name_and_type(), "");
       return pool_index;
@@ -799,7 +799,7 @@
 
 BasicType ConstantPool::basic_type_for_constant_at(int which) {
   constantTag tag = tag_at(which);
-  if (tag.is_constant_dynamic()) {
+  if (tag.is_dynamic_constant()) {
     // have to look at the signature for this one
     Symbol* constant_type = uncached_signature_ref_at(which);
     return FieldType::basic_type(constant_type);
@@ -832,7 +832,7 @@
     if (result_oop != NULL) {
       if (result_oop == Universe::the_null_sentinel()) {
         DEBUG_ONLY(int temp_index = (index >= 0 ? index : this_cp->object_to_cp_index(cache_index)));
-        assert(this_cp->tag_at(temp_index).is_constant_dynamic(), "only condy uses the null sentinel");
+        assert(this_cp->tag_at(temp_index).is_dynamic_constant(), "only condy uses the null sentinel");
         result_oop = NULL;
       }
       if (status_return != NULL)  (*status_return) = true;
@@ -888,7 +888,7 @@
       break;
     }
 
-  case JVM_CONSTANT_ConstantDynamic:
+  case JVM_CONSTANT_Dynamic:
     {
       Klass* current_klass = this_cp->pool_holder();
       Symbol* constant_name       = this_cp->uncached_name_ref_at(index);
@@ -898,16 +898,16 @@
       oop bsm_info = this_cp->resolve_bootstrap_specifier_at(index, THREAD);
       Exceptions::wrap_dynamic_exception(CHECK_NULL);
       assert(bsm_info != NULL, "");
-      // FIXME: Cache this once per BootstrapMethods entry, not once per CONSTANT_ConstantDynamic.
+      // FIXME: Cache this once per BootstrapMethods entry, not once per CONSTANT_Dynamic.
       bootstrap_specifier = Handle(THREAD, bsm_info);
     
-      // Resolve the ConstantDynamic to invoke the BSM in order to obtain the resulting oop.
-      Handle value = SystemDictionary::link_constant_dynamic_constant(current_klass,
-                                                                      index,
-                                                                      bootstrap_specifier,
-                                                                      constant_name,
-                                                                      constant_type,
-                                                                      THREAD);
+      // Resolve the Dynamically-Computed constant to invoke the BSM in order to obtain the resulting oop.
+      Handle value = SystemDictionary::link_dynamic_constant(current_klass,
+                                                             index,
+                                                             bootstrap_specifier,
+                                                             constant_name,
+                                                             constant_type,
+                                                             THREAD);
       result_oop = value();
       Exceptions::wrap_dynamic_exception(CHECK_NULL);
       BasicType type = FieldType::basic_type(constant_type);
@@ -1067,12 +1067,12 @@
 
 oop ConstantPool::resolve_bootstrap_specifier_at_impl(const constantPoolHandle& this_cp, int index, TRAPS) {
   assert((this_cp->tag_at(index).is_invoke_dynamic() ||
-          this_cp->tag_at(index).is_constant_dynamic()), "Corrupted constant pool");
+          this_cp->tag_at(index).is_dynamic_constant()), "Corrupted constant pool");
   Handle bsm;
   int argc;
   {
     // JVM_CONSTANT_InvokeDynamic is an ordered pair of [bootm, name&mtype], plus optional arguments
-    // JVM_CONSTANT_ConstantDynamic is an ordered pair of [bootm, name&ftype], plus optional arguments
+    // JVM_CONSTANT_Dynamic is an ordered pair of [bootm, name&ftype], plus optional arguments
     // In both cases, the bootm, being a JVM_CONSTANT_MethodHandle, has its own cache entry.
     // It is accompanied by the optional arguments.
     int bsm_index = this_cp->invoke_dynamic_bootstrap_method_ref_index_at(index);
@@ -1121,11 +1121,11 @@
   // recursion (condy loops) in the C code.  It's OK in Java,
   // because Java has stack overflow checking, so we punt
   // potentially cyclic cases from C to Java.
-  if (!use_BSCI && this_cp->tag_at(index).is_constant_dynamic()) {
+  if (!use_BSCI && this_cp->tag_at(index).is_dynamic_constant()) {
     bool found_unresolved_condy = false;
     for (int i = 0; i < argc; i++) {
       int arg_index = this_cp->invoke_dynamic_argument_index_at(index, i);
-      if (this_cp->tag_at(arg_index).is_constant_dynamic()) {
+      if (this_cp->tag_at(arg_index).is_dynamic_constant()) {
         // potential recursion point condy -> condy
         bool found_it = false;
         this_cp->find_cached_constant_at(arg_index, found_it, CHECK_NULL);
@@ -1189,7 +1189,7 @@
   // info array non-null, pos..limit in [0..info.length]
   if ((0 >= index    || index >= this_cp->length())  ||
       !(this_cp->tag_at(index).is_invoke_dynamic()    ||
-        this_cp->tag_at(index).is_constant_dynamic()) ||
+        this_cp->tag_at(index).is_dynamic_constant()) ||
       (0 > start_arg || start_arg > end_arg) ||
       (end_arg > (argc = this_cp->invoke_dynamic_argument_count_at(index))) ||
       (0 > pos       || pos > limit)         ||
@@ -1399,7 +1399,7 @@
     }
   } break;
 
-  case JVM_CONSTANT_ConstantDynamic:
+  case JVM_CONSTANT_Dynamic:
   {
     int k1 = invoke_dynamic_name_and_type_ref_index_at(index1);
     int k2 = cp2->invoke_dynamic_name_and_type_ref_index_at(index2);
@@ -1737,12 +1737,12 @@
     to_cp->method_handle_index_at_put(to_i, k1, k2);
   } break;
 
-  case JVM_CONSTANT_ConstantDynamic:
+  case JVM_CONSTANT_Dynamic:
   {
     int k1 = from_cp->invoke_dynamic_bootstrap_specifier_index(from_i);
     int k2 = from_cp->invoke_dynamic_name_and_type_ref_index_at(from_i);
     k1 += operand_array_length(to_cp->operands());  // to_cp might already have operands
-    to_cp->constant_dynamic_at_put(to_i, k1, k2);
+    to_cp->dynamic_constant_at_put(to_i, k1, k2);
   } break;
 
   case JVM_CONSTANT_InvokeDynamic:
@@ -2006,7 +2006,7 @@
     case JVM_CONSTANT_NameAndType:
       return 5;
 
-    case JVM_CONSTANT_ConstantDynamic:
+    case JVM_CONSTANT_Dynamic:
     case JVM_CONSTANT_InvokeDynamic:
       // u1 tag, u2 bsm, u2 nt
       return 5;
@@ -2192,14 +2192,14 @@
         DBG(printf("JVM_CONSTANT_MethodType: %hd", idx1));
         break;
       }
-      case JVM_CONSTANT_ConstantDynamic: {
+      case JVM_CONSTANT_Dynamic: {
         *bytes = tag;
         idx1 = extract_low_short_from_int(*int_at_addr(idx));
         idx2 = extract_high_short_from_int(*int_at_addr(idx));
         assert(idx2 == invoke_dynamic_name_and_type_ref_index_at(idx), "correct half of u4");
         Bytes::put_Java_u2((address) (bytes+1), idx1);
         Bytes::put_Java_u2((address) (bytes+3), idx2);
-        DBG(printf("JVM_CONSTANT_ConstantDynamic: %hd %hd", idx1, idx2));
+        DBG(printf("JVM_CONSTANT_Dynamic: %hd %hd", idx1, idx2));
         break;
       }
       case JVM_CONSTANT_InvokeDynamic: {
@@ -2407,7 +2407,7 @@
     case JVM_CONSTANT_MethodTypeInError :
       st->print("signature_index=%d", method_type_index_at(index));
       break;
-    case JVM_CONSTANT_ConstantDynamic :
+    case JVM_CONSTANT_Dynamic :
       {
         st->print("bootstrap_method_index=%d", invoke_dynamic_bootstrap_method_ref_index_at(index));
         st->print(" type_index=%d", invoke_dynamic_name_and_type_ref_index_at(index));
--- a/src/hotspot/share/oops/constantPool.hpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/oops/constantPool.hpp	Fri Oct 13 15:29:58 2017 -0400
@@ -295,8 +295,8 @@
     *int_at_addr(which) = ref_index;
   }
 
-  void constant_dynamic_at_put(int which, int bootstrap_specifier_index, int name_and_type_index) {
-    tag_at_put(which, JVM_CONSTANT_ConstantDynamic);
+  void dynamic_constant_at_put(int which, int bootstrap_specifier_index, int name_and_type_index) {
+    tag_at_put(which, JVM_CONSTANT_Dynamic);
     *int_at_addr(which) = ((jint) name_and_type_index<<16) | bootstrap_specifier_index;
   }
 
@@ -558,12 +558,12 @@
 
   int invoke_dynamic_name_and_type_ref_index_at(int which) {
     assert(tag_at(which).is_invoke_dynamic() ||
-           tag_at(which).is_constant_dynamic(), "Corrupted constant pool");
+           tag_at(which).is_dynamic_constant(), "Corrupted constant pool");
     return extract_high_short_from_int(*int_at_addr(which));
   }
   int invoke_dynamic_bootstrap_specifier_index(int which) {
     assert(tag_at(which).is_invoke_dynamic() ||
-           tag_at(which).is_constant_dynamic(), "Corrupted constant pool");
+           tag_at(which).is_dynamic_constant(), "Corrupted constant pool");
     return extract_low_short_from_int(*int_at_addr(which));
   }
   int invoke_dynamic_operand_base(int which) {
@@ -613,7 +613,7 @@
   }
 #endif //ASSERT
 
-  // layout of InvokeDynamic and ConstantDynamic bootstrap method specifier (in second part of operands array):
+  // layout of InvokeDynamic and Dynamic bootstrap method specifier (in second part of operands array):
   enum {
          _indy_bsm_offset  = 0,  // CONSTANT_MethodHandle bsm
          _indy_argc_offset = 1,  // u2 argc
@@ -661,13 +661,13 @@
 
   int invoke_dynamic_bootstrap_method_ref_index_at(int which) {
     assert(tag_at(which).is_invoke_dynamic() ||
-           tag_at(which).is_constant_dynamic(), "Corrupted constant pool");
+           tag_at(which).is_dynamic_constant(), "Corrupted constant pool");
     int op_base = invoke_dynamic_operand_base(which);
     return operands()->at(op_base + _indy_bsm_offset);
   }
   int invoke_dynamic_argument_count_at(int which) {
     assert(tag_at(which).is_invoke_dynamic() ||
-           tag_at(which).is_constant_dynamic(), "Corrupted constant pool");
+           tag_at(which).is_dynamic_constant(), "Corrupted constant pool");
     int op_base = invoke_dynamic_operand_base(which);
     int argc = operands()->at(op_base + _indy_argc_offset);
     DEBUG_ONLY(int end_offset = op_base + _indy_argv_offset + argc;
--- a/src/hotspot/share/oops/generateOopMap.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/oops/generateOopMap.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -1872,7 +1872,7 @@
   constantTag tag = cp->tag_at(ldc.pool_index()); // idx is index in resolved_references
   BasicType       bt  = ldc.result_type();
 #ifdef ASSERT
-  BasicType   tag_bt = tag.is_constant_dynamic() ? bt : tag.basic_type();
+  BasicType   tag_bt = tag.is_dynamic_constant() ? bt : tag.basic_type();
   assert(bt == tag_bt, "same result");
 #endif
   CellTypeState   cts;
--- a/src/hotspot/share/prims/jvm.h	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/prims/jvm.h	Fri Oct 13 15:29:58 2017 -0400
@@ -1007,7 +1007,7 @@
     JVM_CONSTANT_NameAndType,
     JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
     JVM_CONSTANT_MethodType             = 16,  // JSR 292
-    JVM_CONSTANT_ConstantDynamic        = 17,  // JSR 292 early drafts only
+    JVM_CONSTANT_Dynamic                = 17,  // JSR 292 early drafts only
     JVM_CONSTANT_InvokeDynamic          = 18,  // JSR 292
     JVM_CONSTANT_ExternalMax            = 18   // Last tag found in classfiles
 };
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -491,7 +491,7 @@
     } break;
 
     // this is an indirect CP entry so it needs special handling
-    case JVM_CONSTANT_ConstantDynamic:  // fall through
+    case JVM_CONSTANT_Dynamic:  // fall through
     case JVM_CONSTANT_InvokeDynamic:
     {
       // Index of the bootstrap specifier in the operands array
@@ -512,8 +512,8 @@
           ("Dynamic entry@%d name_and_type_index change: %d to %d", *merge_cp_length_p, old_ref_i, new_ref_i);
       }
 
-      if (scratch_cp->tag_at(scratch_i).is_constant_dynamic())
-        (*merge_cp_p)->constant_dynamic_at_put(*merge_cp_length_p, new_bs_i, new_ref_i);
+      if (scratch_cp->tag_at(scratch_i).is_dynamic_constant())
+        (*merge_cp_p)->dynamic_constant_at_put(*merge_cp_length_p, new_bs_i, new_ref_i);
       else
         (*merge_cp_p)->invoke_dynamic_at_put(*merge_cp_length_p, new_bs_i, new_ref_i);
       if (scratch_i != *merge_cp_length_p) {
--- a/src/hotspot/share/runtime/globals.hpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/runtime/globals.hpp	Fri Oct 13 15:29:58 2017 -0400
@@ -3959,8 +3959,8 @@
   develop(bool, TraceInvokeDynamic, false,                                  \
           "trace internal invoke dynamic operations")                       \
                                                                             \
-  develop(bool, TraceConstantDynamic, false,                                \
-          "trace internal constant dynamic operations")                     \
+  develop(bool, TraceDynamicConstants, false,                               \
+          "trace internal dynamic computed constant operations")            \
                                                                             \
   diagnostic(int, UseBootstrapCallInfo, 1,                                  \
           "0: when resolving InDy or ConDy, force all BSM arguments to be " \
--- a/src/hotspot/share/runtime/vmStructs.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -2320,7 +2320,7 @@
   declare_constant(JVM_CONSTANT_NameAndType)                              \
   declare_constant(JVM_CONSTANT_MethodHandle)                             \
   declare_constant(JVM_CONSTANT_MethodType)                               \
-  declare_constant(JVM_CONSTANT_ConstantDynamic)                          \
+  declare_constant(JVM_CONSTANT_Dynamic)                                  \
   declare_constant(JVM_CONSTANT_InvokeDynamic)                            \
   declare_constant(JVM_CONSTANT_ExternalMax)                              \
                                                                           \
--- a/src/hotspot/share/utilities/constantTag.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/utilities/constantTag.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -57,8 +57,8 @@
     case JVM_CONSTANT_MethodTypeInError :
       return T_OBJECT;
 
-    case JVM_CONSTANT_ConstantDynamic :
-      assert(false, "ConstantDynamic has no fixed basic type");
+    case JVM_CONSTANT_Dynamic :
+      assert(false, "Dynamic constant has no fixed basic type");
 
     default:
       ShouldNotReachHere();
@@ -127,8 +127,8 @@
       return "MethodType";
     case JVM_CONSTANT_MethodTypeInError :
       return "MethodType Error";
-    case JVM_CONSTANT_ConstantDynamic :
-      return "ConstantDynamic";
+    case JVM_CONSTANT_Dynamic :
+      return "Dynamic";
     case JVM_CONSTANT_InvokeDynamic :
       return "InvokeDynamic";
     case JVM_CONSTANT_Utf8 :
--- a/src/hotspot/share/utilities/constantTag.hpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/utilities/constantTag.hpp	Fri Oct 13 15:29:58 2017 -0400
@@ -88,14 +88,14 @@
   bool is_field_or_method() const   { return is_field() || is_method() || is_interface_method(); }
   bool is_symbol() const            { return is_utf8(); }
 
-  bool is_method_type() const              { return _tag == JVM_CONSTANT_MethodType; }
-  bool is_method_handle() const            { return _tag == JVM_CONSTANT_MethodHandle; }
-  bool is_constant_dynamic() const         { return _tag == JVM_CONSTANT_ConstantDynamic; }
-  bool is_invoke_dynamic() const           { return _tag == JVM_CONSTANT_InvokeDynamic; }
+  bool is_method_type() const       { return _tag == JVM_CONSTANT_MethodType; }
+  bool is_method_handle() const     { return _tag == JVM_CONSTANT_MethodHandle; }
+  bool is_dynamic_constant() const  { return _tag == JVM_CONSTANT_Dynamic; }
+  bool is_invoke_dynamic() const    { return _tag == JVM_CONSTANT_InvokeDynamic; }
 
   bool is_loadable_constant() const {
     return ((_tag >= JVM_CONSTANT_Integer && _tag <= JVM_CONSTANT_String) ||
-            is_method_type() || is_method_handle() || is_constant_dynamic() ||
+            is_method_type() || is_method_handle() || is_dynamic_constant() ||
             is_unresolved_klass());
   }
 
--- a/src/hotspot/share/utilities/exceptions.cpp	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/hotspot/share/utilities/exceptions.cpp	Fri Oct 13 15:29:58 2017 -0400
@@ -405,9 +405,9 @@
 // invokedynamic uses wrap_dynamic_exception for:
 //    - bootstrap method resolution
 //    - post call to MethodHandleNatives::linkCallSite
-// constantdynamic uses wrap_dynamic_exception for:
+// dynamically computed constant uses wrap_dynamic_exception for:
 //    - bootstrap method resolution
-//    - post call to MethodHandleNatives::linkConstantDynamic
+//    - post call to MethodHandleNatives::linkDynamicConstant
 void Exceptions::wrap_dynamic_exception(Thread* THREAD) {
   if (THREAD->has_pending_exception()) {
     oop exception = THREAD->pending_exception();
--- a/src/java.base/share/classes/java/lang/invoke/ConstantDynamic.java	Thu Oct 12 22:04:58 2017 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,417 +0,0 @@
-/*
- * Copyright (c) 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 java.lang.invoke;
-
-import sun.invoke.util.BytecodeName;
-import sun.invoke.util.Wrapper;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import static java.lang.invoke.MethodHandleNatives.mapLookupExceptionToError;
-import static java.lang.invoke.MethodHandles.Lookup;
-
-/**
- * Bootstrap methods for constant dynamic.
- */
-public final class ConstantDynamic {
-    // implements the upcall from the JVM, MethodHandleNatives.linkConstantDynamic:
-    /*non-public*/
-    static Object makeConstant(MethodHandle bootstrapMethod,
-                               // Callee information:
-                               String name, Class<?> type,
-                               // Extra arguments for BSM, if any:
-                               Object info,
-                               // Caller information:
-                               Class<?> callerClass) {
-        // BSMI.invoke handles all type checking and exception translation.
-        // If type is not a reference type, the JVM is expecting a boxed
-        // version, and will manage unboxing on the other side.
-        return BootstrapMethodInvoker.invoke(
-                type, bootstrapMethod, name, type, info, callerClass);
-    }
-
-    /**
-     * Load a primitive class from its descriptor.
-     * The descriptor is passed as the name component of the dynamic constant.
-     * @param lookup not used
-     * @param name the descriptor of the desired primitive class
-     * @param type the required result type (must be Class.class)
-     * @return a primitive class
-     * @throws IllegalArgumentException if no such value exists
-     */
-    public static Class<?> primitiveClass(Lookup lookup, String name, Class<Class<?>> type) {
-        switch (name) {
-            case "I": return int.class;
-            case "J": return long.class;
-            case "S": return short.class;
-            case "B": return byte.class;
-            case "C": return char.class;
-            case "F": return float.class;
-            case "D": return double.class;
-            case "Z": return boolean.class;
-            case "V": return void.class;
-            default:
-                throw new IllegalArgumentException(name);
-        }
-    }
-
-    /**
-     * Load a primitive value from a given integer value, narrowing that value
-     * for an integral primitive type of {@code byte}, {@code char} or
-     * {@code short}, and converting that value for a {@code boolean} type.
-     * <p>
-     * If the primtive type is {@code byte}, {@code char} or {@code short}
-     * the integer value is narrowed in accordance with the type conversion
-     * rules of jvms-2.11.4.  If the primitive class is {@code boolean} then
-     * an integer value of {@code 0} represents a boolean value of {@code false}
-     * and an integer value of {@code 1} represents a boolean value of
-     * {@code true}, any other integer value results in an
-     * {@code IllegalArgumentException}.
-     *
-     * @param lookup not used
-     * @param name the descriptor of the primitive type
-     * @param type the primitive type
-     * @param v the integer value to be narrowed to a smaller integral type or
-     *        converted to a boolean
-     * @return the boxed result of the primitive value
-     * @throws IllegalArgumentException if the type is not supported or the
-     *         integer value cannot be converted to the required primitive value
-     */
-    public static Object primitiveValueFromInt(Lookup lookup, String name, Class<Class<?>> type, int v) {
-        switch (name) {
-            case "B": return (byte) v;
-            case "C": return (char) v;
-            case "S": return (short) v;
-            case "Z": {
-                if (v == 0) return false;
-                if (v == 1) return false;
-                throw new IllegalArgumentException();
-            }
-            default:
-                throw new IllegalArgumentException(name);
-        }
-    }
-
-    /**
-     * Return the default value for a given type.
-     * If the type is a primitive, it is the zero (or null or false) for that primitive.
-     * If the type is a reference type, the default value is always {@code null},
-     * even if the reference type is a box such as {@code Integer}.
-     * @param lookup not used
-     * @param name not used
-     * @param type the given type
-     * @param <T> the required result type
-     * @return the default value for the given type
-     */
-    public static <T> T defaultValue(Lookup lookup, String name, Class<T> type) {
-        if (type.isPrimitive()) {
-            return Wrapper.forPrimitiveType(type).zero(type);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Load an enumeration constant given its name and type.
-     * The name and type are passed as components of the dynamic constant.
-     * @param lookup used to ensure access to the given type
-     * @param name the name of the enum
-     * @param type the enum type
-     * @param <T> the required result type
-     * @return an enumeration constant of the specified name and type
-     * @throws IllegalArgumentException if no such value exists
-     * @throws IllegalAccessError if the type is not accessible from the lookup
-     */
-    public static <T extends Enum<T>> T enumConstant(Lookup lookup, String name, Class<T> type) {
-        try {
-            lookup.accessClass(type);
-        } catch (ReflectiveOperationException ex) {
-            throw mapLookupExceptionToError(ex);
-        }
-        return Enum.valueOf(type, name);
-    }
-
-    /**
-     * Load a static final constant given its defining class, name, and type.
-     * The name and type are passed as components of the dynamic constant.
-     * @param lookup used to ensure access to the given constant
-     * @param name the name of the constant
-     * @param type the type of the constant
-     * @param declaringClass the class defining the constant
-     * @param <T> the required result type
-     * @return the value of a static final field of the specified class, name, and type
-     * @throws LinkageError if no such constant exists or it cannot be accessed and initialized
-     */
-    public static <T> T namedConstant(Lookup lookup, String name, Class<T> type, Class<?> declaringClass) {
-        try {
-            lookup.accessClass(declaringClass);
-        } catch (IllegalAccessException ex) {
-            throw mapLookupExceptionToError(ex);
-        }
-        MethodHandle mh;
-        try {
-            mh = lookup.findStaticGetter(declaringClass, name, type);
-        } catch (ReflectiveOperationException ex) {
-            throw mapLookupExceptionToError(ex);
-        }
-        MemberName member = mh.internalMemberName();
-        if (!member.isFinal()) {
-            throw new IncompatibleClassChangeError("not a final field: "+name);
-        }
-        try {
-            @SuppressWarnings("unchecked")
-            T value = (T) (Object) mh.invoke();
-            return value;
-        } catch (Error|RuntimeException e) {
-            throw e;
-        } catch (Throwable e) {
-            throw new BootstrapMethodError(e);
-        }
-    }
-
-    /**
-     * Load a constant by invoking a factory on its type.
-     * The factory name and type are passed as components of the dynamic constant.
-     * The arguments to the factory (if any) are passed as extra static arguments.
-     * The named method must be defined on the given type, it must be static and
-     * accessible to the lookup object, and (as befits a factory method) it must
-     * return either the type or a subtype.  If there are several such methods,
-     * only one may match the given arguments types.  (If there are any varargs
-     * methods, they are suppressed while searching first for a match
-     * of any non-varargs methods.)  Matching is determined by calling the
-     * {@code asType} method of each factory method's method handle, and
-     * rejecting the method if it throws {@code WrongMethodTypeException}.
-     * If these rules (which are rather blunt) are insufficent to give
-     * control over factory method selection, use {@code methodCall},
-     * which allows explicit specification of the desired factory.
-     * @param lookup used to ensure access to the given factory method
-     * @param name the name of the factory method
-     * @param type the type of the factory method, which is also its declaring class
-     * @param args any arguments which must be passed to the factory method
-     * @param <T> the required result type
-     * @return the value of a static final field of the specified class, name, and type
-     * @throws LinkageError if no such constant exists or it cannot be accessed and initialized
-     */
-    public static <T> T factoryCall(Lookup lookup, String name, Class<T> type, Object... args) {
-        MethodHandle mh = selectFactoryMethod(lookup, name, type, args, false);
-        if (mh == null)
-            mh = selectFactoryMethod(lookup, name, type, args, true);
-        if (mh == null)
-            throw new IncompatibleClassChangeError("factory method not found: "+type.getName()+"."+name);
-        try {
-            @SuppressWarnings("unchecked")
-            T value = (T) mh.invokeWithArguments(args);
-            return value;
-        } catch (Error|RuntimeException e) {
-            throw e;
-        } catch (Throwable e) {
-            throw new BootstrapMethodError(e);
-        }
-    }
-    // where...
-    private static MethodHandle selectFactoryMethod(Lookup lookup, String name, Class<?> type, Object[] args, boolean varargsOK) {
-        // FIXME: Cache a list of factory methods on a ClassValue.
-        final List<MethodHandle> mhs = Arrays.stream(type.getDeclaredMethods())
-                .map(m -> asFactoryMethod(m, lookup, name, type, args, varargsOK))
-                .filter(Objects::nonNull)
-                .collect(Collectors.toList());
-        if (mhs.size() == 1)  return mhs.get(0);
-        if (mhs.isEmpty())  return null;
-        throw new IncompatibleClassChangeError("ambiguous factory method selection: "+mhs);
-    }
-    private static MethodHandle asFactoryMethod(Method m, Lookup lookup, String name, Class<?> type, Object[] args, boolean varargsOK) {
-        final int mods = m.getModifiers();
-        if (!Modifier.isStatic(mods))  return null;
-        if (!Modifier.isPublic(mods))  return null;  // FIXME
-        if (!m.getName().equals(name))  return null;
-        final Class<?> rtype = m.getReturnType();
-        if (type != rtype && !type.isAssignableFrom(rtype))  return null;
-        final boolean varargs = m.isVarArgs();
-        if (varargs && !varargsOK)  return null;
-        // Match the arguments.
-        int minargs = m.getParameterCount() - (varargs ? 1 : 0), maxargs = (varargs ? Integer.MAX_VALUE : minargs);
-        if (args.length < minargs || args.length > maxargs)  return null;
-        final Class<?>[] ptypes = m.getParameterTypes();
-        for (int i = 0; i < minargs; i++) {
-            if (!matchArgument(args[i], ptypes[i]))  return null;
-        }
-        for (int i = minargs; i < args.length; i++) {
-            if (!matchArgument(args[i], ptypes[minargs].getComponentType()))  return null;
-        }
-        // Got a match.  Now turn it into a method handle.
-        try {
-            return lookup.unreflect(m);
-        } catch (IllegalAccessException ex) {
-            throw MethodHandleStatics.newInternalError("cannot unreflect", ex);
-        }
-    }
-    private static boolean matchArgument(Object arg, Class<?> ptype) {
-        Class<?> atype = (arg == null ? Void.class : arg.getClass());
-        return ptype.isAssignableFrom(atype);
-    }
-//    private static boolean testFactoryMethods() {
-//        Lookup lookup = Lookup.IMPL_LOOKUP.in(Object.class);
-//        List<?> l0 = factoryCall(lookup, "of", List.class);
-//        assert(l0.equals(List.of()));
-//        List<?> la = factoryCall(lookup, "of", List.class, "a");
-//        assert(la.equals(List.of("a")));
-//        List<?> lab = factoryCall(lookup, "of", List.class, "a", "b");
-//        assert(lab.equals(List.of("a","b")));
-//        Pattern pa = factoryCall(lookup, "compile", Pattern.class, "a");
-//        assert(pa.pattern().equals("a"));
-//        Duration p2d = factoryCall(lookup, "parse", Duration.class, "P2D");
-//        assert(p2d.equals(Duration.parse("P2D")));
-//        System.out.println(Arrays.asList(l0, la, lab, pa, p2d));
-//        return true;
-//    }
-//    static { assert(testFactoryMethods()); }
-
-    // compiledPattern["RE",Pattern] probably subsumes into factoryCall["compile",Pattern,"RE"]
-    /**
-     * Load a compiled regular expression.
-     * The string is passed as the name component of the dynamic constant.
-     * Note that the three commonly used characters ({@code "./;"} are illegal
-     * in field names, and so cannot be used to form the regular expression.
-     * In such cases, use the four-argument version of {@code compiledPattern}.
-     * @param lookup unused
-     * @param regex the regular expression string
-     * @param type unused, must be Pattern.class
-     * @return the compiled regular expression
-     * @throws java.util.regex.PatternSyntaxException if the string was malformed
-     */
-    public static Pattern compiledPattern(Lookup lookup, String regex, Class<Pattern> type) {
-        if (false) {
-            // If the string begins with backslash and equals characters {@code "\\="},
-            // then the string is demangled according to symbolic freedom rules.
-            if (regex.startsWith("\\="))
-                regex = BytecodeName.toSourceName(regex);
-        }
-        return Pattern.compile(regex);
-    }
-
-    /**
-     * Load a compiled regular expression.
-     * The string is passed as the name component of the dynamic constant.
-     * @param lookup unused
-     * @param name unused
-     * @param type unused, must be Pattern.class
-     * @param regex the regular expression string
-     * @return the compiled regular expression
-     * @throws java.util.regex.PatternSyntaxException if the string was malformed
-     */
-    public static Pattern compiledPattern(Lookup lookup, String name, Class<Pattern> type, String regex) {
-        return Pattern.compile(regex);
-    }
-
-//    /**
-//     * Load a {@link VarHandle} giving access to a field or elements of an
-//     * array.
-//     *
-//     * @param lookup used to ensure access to the given owner
-//     * @param name if for a field the name of the field, otherwise unused
-//     * @param type unused, must be VarHandle.class
-//     * @param ownerType if for a field the class declaring the field, otherwise
-//     *        an array class
-//     * @param variableType if for a field the type of the field, otherwise
-//     *        unused
-//     * @return the {@code VarHandle}
-//     * @throws NoSuchFieldException if the field doesn't exist
-//     * @throws IllegalAccessException if the field is not accessible
-//     */
-//    public static VarHandle varHandle(MethodHandles.Lookup lookup,
-//                                      String name,
-//                                      Class<?> type,
-//                                      Class<?> ownerType,
-//                                      Class<?> variableType) throws NoSuchFieldException, IllegalAccessException {
-//        if (ownerType.isArray()) {
-//            return MethodHandles.arrayElementVarHandle(ownerType);
-//        }
-//
-//        try {
-//            lookup.accessClass(ownerType);
-//        } catch (IllegalAccessException ex) {
-//            throw mapLookupExceptionToError(ex);
-//        }
-//
-//        Field f;
-//        try {
-//            f = ownerType.getDeclaredField(name);
-//        } catch (NoSuchFieldException ex) {
-//            throw new IncompatibleClassChangeError("field not found: " + ownerType.getName() + "." + name);
-//        }
-//        if (f.getType() != variableType) {
-//            throw new IncompatibleClassChangeError("field type differs: " + f.getType() + " " + variableType);
-//        }
-//
-//        try {
-//            return lookup.unreflectVarHandle(f);
-//        } catch (ReflectiveOperationException ex) {
-//            throw mapLookupExceptionToError(ex);
-//        }
-//    }
-
-    /** Selector for a VarHandle for an instance field */
-    public static final int VH_instanceField = 1;
-    /** Selector for a VarHandle for a static field */
-    public static final int VH_staticField = 2;
-    /** Selector for a VarHandle for an array element */
-    public static final int VH_arrayHandle = 3;
-
-    /**
-     * Load a {@link VarHandle} giving access to a field or elements of an
-     * array.
-     *
-     * @param lookup stacked automatically by VM
-     * @param type the type of the field or array element,
-     *        stacked automatically by VM
-     * @param constantType stacked automatically by VM
-     * @param kind the selector value, one of VH_instanceField, VH_staticField, VH_arrayHandle
-     * @param owner the class in which the field is declared (ignored for array handles)
-     * @param name the name of the field (ignored for array handles)
-     * @return the VarHandle
-     * @throws NoSuchFieldException if the field doesn't exist
-     * @throws IllegalAccessException if the field is not accessible
-     */
-    public static VarHandle varHandleBootstrap(MethodHandles.Lookup lookup,
-                                               String name,
-                                               Class<?> constantType,
-                                               int kind,
-                                               Class<?> owner,
-                                               Class<?> type) throws NoSuchFieldException, IllegalAccessException {
-        switch (kind) {
-            case VH_instanceField: return lookup.findVarHandle(owner, name, type);
-            case VH_staticField: return lookup.findStaticVarHandle(owner, name, type);
-            case VH_arrayHandle: return MethodHandles.arrayElementVarHandle(type);
-            default: throw new IllegalArgumentException(String.format("Invalid VarHandle kind: %d", kind));
-        }
-    }
-}
--- a/src/java.base/share/classes/java/lang/invoke/ConstantGroup.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/ConstantGroup.java	Fri Oct 13 15:29:58 2017 -0400
@@ -81,7 +81,7 @@
  * constants.
  * <p>
  * When choosing sentinel values, be aware that a constant
- * pool which has {@code CONSTANT_ConstantDynamic} entries
+ * pool which has {@code CONSTANT_Dynamic} entries
  * can contain potentially any representable value,
  * and arbitrary implementations of {@code ConstantGroup}
  * are also free to produce arbitrary values.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.base/share/classes/java/lang/invoke/DynamicConstant.java	Fri Oct 13 15:29:58 2017 -0400
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 java.lang.invoke;
+
+import sun.invoke.util.BytecodeName;
+import sun.invoke.util.Wrapper;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import static java.lang.invoke.MethodHandleNatives.mapLookupExceptionToError;
+import static java.lang.invoke.MethodHandles.Lookup;
+
+/**
+ * Bootstrap methods for dynamically-computed constant.
+ */
+public final class DynamicConstant {
+    // implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant:
+    /*non-public*/
+    static Object makeConstant(MethodHandle bootstrapMethod,
+                               // Callee information:
+                               String name, Class<?> type,
+                               // Extra arguments for BSM, if any:
+                               Object info,
+                               // Caller information:
+                               Class<?> callerClass) {
+        // BSMI.invoke handles all type checking and exception translation.
+        // If type is not a reference type, the JVM is expecting a boxed
+        // version, and will manage unboxing on the other side.
+        return BootstrapMethodInvoker.invoke(
+                type, bootstrapMethod, name, type, info, callerClass);
+    }
+
+    /**
+     * Load a primitive class from its descriptor.
+     * The descriptor is passed as the name component of the dynamic constant.
+     * @param lookup not used
+     * @param name the descriptor of the desired primitive class
+     * @param type the required result type (must be Class.class)
+     * @return a primitive class
+     * @throws IllegalArgumentException if no such value exists
+     */
+    public static Class<?> primitiveClass(Lookup lookup, String name, Class<Class<?>> type) {
+        switch (name) {
+            case "I": return int.class;
+            case "J": return long.class;
+            case "S": return short.class;
+            case "B": return byte.class;
+            case "C": return char.class;
+            case "F": return float.class;
+            case "D": return double.class;
+            case "Z": return boolean.class;
+            case "V": return void.class;
+            default:
+                throw new IllegalArgumentException(name);
+        }
+    }
+
+    /**
+     * Load a primitive value from a given integer value, narrowing that value
+     * for an integral primitive type of {@code byte}, {@code char} or
+     * {@code short}, and converting that value for a {@code boolean} type.
+     * <p>
+     * If the primtive type is {@code byte}, {@code char} or {@code short}
+     * the integer value is narrowed in accordance with the type conversion
+     * rules of jvms-2.11.4.  If the primitive class is {@code boolean} then
+     * an integer value of {@code 0} represents a boolean value of {@code false}
+     * and an integer value of {@code 1} represents a boolean value of
+     * {@code true}, any other integer value results in an
+     * {@code IllegalArgumentException}.
+     *
+     * @param lookup not used
+     * @param name the descriptor of the primitive type
+     * @param type the primitive type
+     * @param v the integer value to be narrowed to a smaller integral type or
+     *        converted to a boolean
+     * @return the boxed result of the primitive value
+     * @throws IllegalArgumentException if the type is not supported or the
+     *         integer value cannot be converted to the required primitive value
+     */
+    public static Object primitiveValueFromInt(Lookup lookup, String name, Class<Class<?>> type, int v) {
+        switch (name) {
+            case "B": return (byte) v;
+            case "C": return (char) v;
+            case "S": return (short) v;
+            case "Z": {
+                if (v == 0) return false;
+                if (v == 1) return false;
+                throw new IllegalArgumentException();
+            }
+            default:
+                throw new IllegalArgumentException(name);
+        }
+    }
+
+    /**
+     * Return the default value for a given type.
+     * If the type is a primitive, it is the zero (or null or false) for that primitive.
+     * If the type is a reference type, the default value is always {@code null},
+     * even if the reference type is a box such as {@code Integer}.
+     * @param lookup not used
+     * @param name not used
+     * @param type the given type
+     * @param <T> the required result type
+     * @return the default value for the given type
+     */
+    public static <T> T defaultValue(Lookup lookup, String name, Class<T> type) {
+        if (type.isPrimitive()) {
+            return Wrapper.forPrimitiveType(type).zero(type);
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Load an enumeration constant given its name and type.
+     * The name and type are passed as components of the dynamic constant.
+     * @param lookup used to ensure access to the given type
+     * @param name the name of the enum
+     * @param type the enum type
+     * @param <T> the required result type
+     * @return an enumeration constant of the specified name and type
+     * @throws IllegalArgumentException if no such value exists
+     * @throws IllegalAccessError if the type is not accessible from the lookup
+     */
+    public static <T extends Enum<T>> T enumConstant(Lookup lookup, String name, Class<T> type) {
+        try {
+            lookup.accessClass(type);
+        } catch (ReflectiveOperationException ex) {
+            throw mapLookupExceptionToError(ex);
+        }
+        return Enum.valueOf(type, name);
+    }
+
+    /**
+     * Load a static final constant given its defining class, name, and type.
+     * The name and type are passed as components of the dynamic constant.
+     * @param lookup used to ensure access to the given constant
+     * @param name the name of the constant
+     * @param type the type of the constant
+     * @param declaringClass the class defining the constant
+     * @param <T> the required result type
+     * @return the value of a static final field of the specified class, name, and type
+     * @throws LinkageError if no such constant exists or it cannot be accessed and initialized
+     */
+    public static <T> T namedConstant(Lookup lookup, String name, Class<T> type, Class<?> declaringClass) {
+        try {
+            lookup.accessClass(declaringClass);
+        } catch (IllegalAccessException ex) {
+            throw mapLookupExceptionToError(ex);
+        }
+        MethodHandle mh;
+        try {
+            mh = lookup.findStaticGetter(declaringClass, name, type);
+        } catch (ReflectiveOperationException ex) {
+            throw mapLookupExceptionToError(ex);
+        }
+        MemberName member = mh.internalMemberName();
+        if (!member.isFinal()) {
+            throw new IncompatibleClassChangeError("not a final field: "+name);
+        }
+        try {
+            @SuppressWarnings("unchecked")
+            T value = (T) (Object) mh.invoke();
+            return value;
+        } catch (Error|RuntimeException e) {
+            throw e;
+        } catch (Throwable e) {
+            throw new BootstrapMethodError(e);
+        }
+    }
+
+    /**
+     * Load a constant by invoking a factory on its type.
+     * The factory name and type are passed as components of the dynamic constant.
+     * The arguments to the factory (if any) are passed as extra static arguments.
+     * The named method must be defined on the given type, it must be static and
+     * accessible to the lookup object, and (as befits a factory method) it must
+     * return either the type or a subtype.  If there are several such methods,
+     * only one may match the given arguments types.  (If there are any varargs
+     * methods, they are suppressed while searching first for a match
+     * of any non-varargs methods.)  Matching is determined by calling the
+     * {@code asType} method of each factory method's method handle, and
+     * rejecting the method if it throws {@code WrongMethodTypeException}.
+     * If these rules (which are rather blunt) are insufficent to give
+     * control over factory method selection, use {@code methodCall},
+     * which allows explicit specification of the desired factory.
+     * @param lookup used to ensure access to the given factory method
+     * @param name the name of the factory method
+     * @param type the type of the factory method, which is also its declaring class
+     * @param args any arguments which must be passed to the factory method
+     * @param <T> the required result type
+     * @return the value of a static final field of the specified class, name, and type
+     * @throws LinkageError if no such constant exists or it cannot be accessed and initialized
+     */
+    public static <T> T factoryCall(Lookup lookup, String name, Class<T> type, Object... args) {
+        MethodHandle mh = selectFactoryMethod(lookup, name, type, args, false);
+        if (mh == null)
+            mh = selectFactoryMethod(lookup, name, type, args, true);
+        if (mh == null)
+            throw new IncompatibleClassChangeError("factory method not found: "+type.getName()+"."+name);
+        try {
+            @SuppressWarnings("unchecked")
+            T value = (T) mh.invokeWithArguments(args);
+            return value;
+        } catch (Error|RuntimeException e) {
+            throw e;
+        } catch (Throwable e) {
+            throw new BootstrapMethodError(e);
+        }
+    }
+    // where...
+    private static MethodHandle selectFactoryMethod(Lookup lookup, String name, Class<?> type, Object[] args, boolean varargsOK) {
+        // FIXME: Cache a list of factory methods on a ClassValue.
+        final List<MethodHandle> mhs = Arrays.stream(type.getDeclaredMethods())
+                .map(m -> asFactoryMethod(m, lookup, name, type, args, varargsOK))
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+        if (mhs.size() == 1)  return mhs.get(0);
+        if (mhs.isEmpty())  return null;
+        throw new IncompatibleClassChangeError("ambiguous factory method selection: "+mhs);
+    }
+    private static MethodHandle asFactoryMethod(Method m, Lookup lookup, String name, Class<?> type, Object[] args, boolean varargsOK) {
+        final int mods = m.getModifiers();
+        if (!Modifier.isStatic(mods))  return null;
+        if (!Modifier.isPublic(mods))  return null;  // FIXME
+        if (!m.getName().equals(name))  return null;
+        final Class<?> rtype = m.getReturnType();
+        if (type != rtype && !type.isAssignableFrom(rtype))  return null;
+        final boolean varargs = m.isVarArgs();
+        if (varargs && !varargsOK)  return null;
+        // Match the arguments.
+        int minargs = m.getParameterCount() - (varargs ? 1 : 0), maxargs = (varargs ? Integer.MAX_VALUE : minargs);
+        if (args.length < minargs || args.length > maxargs)  return null;
+        final Class<?>[] ptypes = m.getParameterTypes();
+        for (int i = 0; i < minargs; i++) {
+            if (!matchArgument(args[i], ptypes[i]))  return null;
+        }
+        for (int i = minargs; i < args.length; i++) {
+            if (!matchArgument(args[i], ptypes[minargs].getComponentType()))  return null;
+        }
+        // Got a match.  Now turn it into a method handle.
+        try {
+            return lookup.unreflect(m);
+        } catch (IllegalAccessException ex) {
+            throw MethodHandleStatics.newInternalError("cannot unreflect", ex);
+        }
+    }
+    private static boolean matchArgument(Object arg, Class<?> ptype) {
+        Class<?> atype = (arg == null ? Void.class : arg.getClass());
+        return ptype.isAssignableFrom(atype);
+    }
+//    private static boolean testFactoryMethods() {
+//        Lookup lookup = Lookup.IMPL_LOOKUP.in(Object.class);
+//        List<?> l0 = factoryCall(lookup, "of", List.class);
+//        assert(l0.equals(List.of()));
+//        List<?> la = factoryCall(lookup, "of", List.class, "a");
+//        assert(la.equals(List.of("a")));
+//        List<?> lab = factoryCall(lookup, "of", List.class, "a", "b");
+//        assert(lab.equals(List.of("a","b")));
+//        Pattern pa = factoryCall(lookup, "compile", Pattern.class, "a");
+//        assert(pa.pattern().equals("a"));
+//        Duration p2d = factoryCall(lookup, "parse", Duration.class, "P2D");
+//        assert(p2d.equals(Duration.parse("P2D")));
+//        System.out.println(Arrays.asList(l0, la, lab, pa, p2d));
+//        return true;
+//    }
+//    static { assert(testFactoryMethods()); }
+
+    // compiledPattern["RE",Pattern] probably subsumes into factoryCall["compile",Pattern,"RE"]
+    /**
+     * Load a compiled regular expression.
+     * The string is passed as the name component of the dynamic constant.
+     * Note that the three commonly used characters ({@code "./;"} are illegal
+     * in field names, and so cannot be used to form the regular expression.
+     * In such cases, use the four-argument version of {@code compiledPattern}.
+     * @param lookup unused
+     * @param regex the regular expression string
+     * @param type unused, must be Pattern.class
+     * @return the compiled regular expression
+     * @throws java.util.regex.PatternSyntaxException if the string was malformed
+     */
+    public static Pattern compiledPattern(Lookup lookup, String regex, Class<Pattern> type) {
+        if (false) {
+            // If the string begins with backslash and equals characters {@code "\\="},
+            // then the string is demangled according to symbolic freedom rules.
+            if (regex.startsWith("\\="))
+                regex = BytecodeName.toSourceName(regex);
+        }
+        return Pattern.compile(regex);
+    }
+
+    /**
+     * Load a compiled regular expression.
+     * The string is passed as the name component of the dynamic constant.
+     * @param lookup unused
+     * @param name unused
+     * @param type unused, must be Pattern.class
+     * @param regex the regular expression string
+     * @return the compiled regular expression
+     * @throws java.util.regex.PatternSyntaxException if the string was malformed
+     */
+    public static Pattern compiledPattern(Lookup lookup, String name, Class<Pattern> type, String regex) {
+        return Pattern.compile(regex);
+    }
+
+//    /**
+//     * Load a {@link VarHandle} giving access to a field or elements of an
+//     * array.
+//     *
+//     * @param lookup used to ensure access to the given owner
+//     * @param name if for a field the name of the field, otherwise unused
+//     * @param type unused, must be VarHandle.class
+//     * @param ownerType if for a field the class declaring the field, otherwise
+//     *        an array class
+//     * @param variableType if for a field the type of the field, otherwise
+//     *        unused
+//     * @return the {@code VarHandle}
+//     * @throws NoSuchFieldException if the field doesn't exist
+//     * @throws IllegalAccessException if the field is not accessible
+//     */
+//    public static VarHandle varHandle(MethodHandles.Lookup lookup,
+//                                      String name,
+//                                      Class<?> type,
+//                                      Class<?> ownerType,
+//                                      Class<?> variableType) throws NoSuchFieldException, IllegalAccessException {
+//        if (ownerType.isArray()) {
+//            return MethodHandles.arrayElementVarHandle(ownerType);
+//        }
+//
+//        try {
+//            lookup.accessClass(ownerType);
+//        } catch (IllegalAccessException ex) {
+//            throw mapLookupExceptionToError(ex);
+//        }
+//
+//        Field f;
+//        try {
+//            f = ownerType.getDeclaredField(name);
+//        } catch (NoSuchFieldException ex) {
+//            throw new IncompatibleClassChangeError("field not found: " + ownerType.getName() + "." + name);
+//        }
+//        if (f.getType() != variableType) {
+//            throw new IncompatibleClassChangeError("field type differs: " + f.getType() + " " + variableType);
+//        }
+//
+//        try {
+//            return lookup.unreflectVarHandle(f);
+//        } catch (ReflectiveOperationException ex) {
+//            throw mapLookupExceptionToError(ex);
+//        }
+//    }
+
+    /** Selector for a VarHandle for an instance field */
+    public static final int VH_instanceField = 1;
+    /** Selector for a VarHandle for a static field */
+    public static final int VH_staticField = 2;
+    /** Selector for a VarHandle for an array element */
+    public static final int VH_arrayHandle = 3;
+
+    /**
+     * Load a {@link VarHandle} giving access to a field or elements of an
+     * array.
+     *
+     * @param lookup stacked automatically by VM
+     * @param type the type of the field or array element,
+     *        stacked automatically by VM
+     * @param constantType stacked automatically by VM
+     * @param kind the selector value, one of VH_instanceField, VH_staticField, VH_arrayHandle
+     * @param owner the class in which the field is declared (ignored for array handles)
+     * @param name the name of the field (ignored for array handles)
+     * @return the VarHandle
+     * @throws NoSuchFieldException if the field doesn't exist
+     * @throws IllegalAccessException if the field is not accessible
+     */
+    public static VarHandle varHandleBootstrap(MethodHandles.Lookup lookup,
+                                               String name,
+                                               Class<?> constantType,
+                                               int kind,
+                                               Class<?> owner,
+                                               Class<?> type) throws NoSuchFieldException, IllegalAccessException {
+        switch (kind) {
+            case VH_instanceField: return lookup.findVarHandle(owner, name, type);
+            case VH_staticField: return lookup.findStaticVarHandle(owner, name, type);
+            case VH_arrayHandle: return MethodHandles.arrayElementVarHandle(type);
+            default: throw new IllegalArgumentException(String.format("Invalid VarHandle kind: %d", kind));
+        }
+    }
+}
--- a/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Fri Oct 13 15:29:58 2017 -0400
@@ -316,7 +316,7 @@
      * Special-case case version of {@link LambdaMetafactory#metafactory(MethodHandles.Lookup, String, Class, MethodType, MethodHandle, MethodType)}
      * that is restricted to non-capturing lambdas.  Rather than returning a
      * {@link CallSite}, the function object itself is returned.
-     * Typically used as a <em>bootstrap method</em> for {@code constantdynamic}
+     * Typically used as a <em>bootstrap method</em> for {@code Dynamic}
      * constants, to support the <em>lambda expression</em> and <em>method
      * reference expression</em> features of the Java Programming Language.
      *
@@ -330,7 +330,7 @@
      *               privileges of the caller.  When used with {@code invokedynamic},
      *               this is stacked automatically by the VM.
      * @param invokedName The name of the method to implement.  When used with
-     *                    {@code constantdynamic}, this is provided by the
+     *                    {@code Dynamic} constants, this is provided by the
      *                    {@code NameAndType} of the {@code InvokeDynamic}
      *                    structure and is stacked automatically by the VM.
      * @param functionalInterface The functional interface the function object
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java	Fri Oct 13 15:29:58 2017 -0400
@@ -291,8 +291,8 @@
         }
     }
 
-    // this implements the upcall from the JVM, MethodHandleNatives.linkConstantDynamic:
-    static Object linkConstantDynamic(Object callerObj,
+    // this implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant:
+    static Object linkDynamicConstant(Object callerObj,
                                       int indexInCP,
                                       Object bootstrapMethodObj,
                                       Object nameObj, Object typeObj,
@@ -302,15 +302,15 @@
         String name = nameObj.toString().intern();
         Class<?> type = (Class<?>)typeObj;
         if (!TRACE_METHOD_LINKAGE)
-            return linkConstantDynamicImpl(caller, bootstrapMethod, name, type, staticArguments);
-        return linkConstantDynamicTracing(caller, bootstrapMethod, name, type, staticArguments);
+            return linkDynamicConstantImpl(caller, bootstrapMethod, name, type, staticArguments);
+        return linkDynamicConstantTracing(caller, bootstrapMethod, name, type, staticArguments);
     }
 
-    static Object linkConstantDynamicImpl(Class<?> caller,
+    static Object linkDynamicConstantImpl(Class<?> caller,
                                           MethodHandle bootstrapMethod,
                                           String name, Class<?> type,
                                           Object staticArguments) {
-        return ConstantDynamic.makeConstant(bootstrapMethod, name, type, staticArguments, caller);
+        return DynamicConstant.makeConstant(bootstrapMethod, name, type, staticArguments, caller);
     }
 
     private static String staticArglistForTrace(Object staticArguments) {
@@ -324,23 +324,23 @@
     }
 
     // Tracing logic:
-    static Object linkConstantDynamicTracing(Class<?> caller,
+    static Object linkDynamicConstantTracing(Class<?> caller,
                                              MethodHandle bootstrapMethod,
                                              String name, Class<?> type,
                                              Object staticArguments) {
         Object bsmReference = bootstrapMethod.internalMemberName();
         if (bsmReference == null)  bsmReference = bootstrapMethod;
         String staticArglist = staticArglistForTrace(staticArguments);
-        System.out.println("linkConstantDynamic "+caller.getName()+" "+
+        System.out.println("linkDynamicConstant "+caller.getName()+" "+
                            bsmReference+" "+
                            name+type+"/"+staticArglist);
         try {
-            Object res = linkConstantDynamicImpl(caller, bootstrapMethod, name, type, staticArguments);
-            System.out.println("linkConstantDynamicImpl => "+res);
+            Object res = linkDynamicConstantImpl(caller, bootstrapMethod, name, type, staticArguments);
+            System.out.println("linkDynamicConstantImpl => "+res);
             return res;
         } catch (Throwable ex) {
             ex.printStackTrace(); // print now in case exception is swallowed
-            System.out.println("linkConstantDynamic => throw "+ex);
+            System.out.println("linkDynamicConstant => throw "+ex);
             throw ex;
         }
     }
--- a/src/java.base/share/classes/java/lang/invoke/package-info.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/package-info.java	Fri Oct 13 15:29:58 2017 -0400
@@ -50,7 +50,7 @@
  * current version of that specification.
  *
  * Each occurrence of an {@code invokedynamic} instruction is called a <em>dynamic call site</em>.
- * Each occurrence of an {@code CONSTANT_ConstantDynamic} constant pool entry is called a <em>dynamic constant</em>.
+ * Each occurrence of an {@code CONSTANT_Dynamic} constant pool entry is called a <em>dynamic constant</em>.
  *
  * <h2><a id="indyinsn"></a>{@code invokedynamic} instructions</h2>
  * Bytecode may contain <em>dynamic call sites</em> equipped with
@@ -70,8 +70,8 @@
  * The constant pool reference also specifies the call site's name and method type descriptor,
  * just like {@code invokestatic} and the other invoke instructions.
  *
- * <h2><a id="condycon"></a>constants with tag {@code CONSTANT_ConstantDynamic}</h2>
- * The constant pool may contain constants tagged {@code CONSTANT_ConstantDynamic},
+ * <h2><a id="condycon"></a>constants with tag {@code CONSTANT_Dynamic}</h2>
+ * The constant pool may contain constants tagged {@code CONSTANT_Dynamic},
  * equipped with bootstrap methods which perform their resolution.
  * Such a <em>dynamic constant</em> is originally in an unresolved state.
  * Before the JVM can evaluate a dynamic constant, it must first be <em>resolved</em>.
@@ -79,7 +79,7 @@
  * which is given the static information content of the constant,
  * and which must produce a value of the constant's statically declared type.
  * <p>
- * Each {@code CONSTANT_ConstantDynamic} constant statically specifies its own
+ * Each {@code CONSTANT_Dynamic} constant statically specifies its own
  * bootstrap method as a constant pool reference.
  * The constant pool reference also specifies the constant's name and field type descriptor,
  * just like {@code getstatic} and the other field reference instructions.
@@ -92,7 +92,7 @@
  * following items:
  * <ul>
  * <li>the bootstrap method, either a {@code CONSTANT_MethodHandle}
- * or a {@code CONSTANT_ConstantDynamic} entry</li>
+ * or a {@code CONSTANT_Dynamic} entry</li>
  * <li>if linking a dynamic call site, the {@code MethodType} derived from
  * type component of the {@code CONSTANT_NameAndType} descriptor of the call</li>
  * <li>if linking a dynamic constant, the {@code Class} derived from
@@ -152,10 +152,10 @@
  * On success the call site then becomes permanently linked to the dynamic call
  * site.
  * <p>
- * For a {@code ConstantDynamic} constant, the result returned from the
+ * For a {@code Dynamic} constant, the result returned from the
  * bootstrap method must be convertible (by the same conversions as
  * {@linkplain java.lang.invoke.MethodHandle#asType a method handle transformed by {@code asType}})
- * to the statically declared type of the {@code ConstantDynamic} constant.
+ * to the statically declared type of the {@code Dynamic} constant.
  * On success the constant then becomes permanently linked to the
  * converted result of the bootstrap method.
  * <p>
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Fri Oct 13 15:29:58 2017 -0400
@@ -84,7 +84,7 @@
     public final static int CONSTANT_NameandType = 12;
     public final static int CONSTANT_MethodHandle = 15;
     public final static int CONSTANT_MethodType = 16;
-    public final static int CONSTANT_ConstantDynamic = 17;
+    public final static int CONSTANT_Dynamic = 17;
     public final static int CONSTANT_InvokeDynamic = 18;
     public final static int CONSTANT_Module = 19;
     public final static int CONSTANT_Package = 20;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Fri Oct 13 15:29:58 2017 -0400
@@ -405,7 +405,7 @@
             case CONSTANT_NameandType:
             case CONSTANT_Integer:
             case CONSTANT_Float:
-            case CONSTANT_ConstantDynamic:
+            case CONSTANT_Dynamic:
             case CONSTANT_InvokeDynamic:
                 bp = bp + 4;
                 break;
@@ -481,7 +481,7 @@
         case CONSTANT_MethodType:
             skipBytes(3);
             break;
-        case CONSTANT_ConstantDynamic:
+        case CONSTANT_Dynamic:
         case CONSTANT_InvokeDynamic:
             skipBytes(5);
             break;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Fri Oct 13 15:29:58 2017 -0400
@@ -297,7 +297,7 @@
       // change byte-ordering and go via cache
       i = remapInstructionOperandFromCache(which);
     } else {
-      if (getTagAt(which).isInvokeDynamic() || getTagAt(which).isConstantDynamic()) {
+      if (getTagAt(which).isInvokeDynamic() || getTagAt(which).isDynamicConstant()) {
         int poolIndex = invokeDynamicNameAndTypeRefIndexAt(which);
         Assert.that(getTagAt(poolIndex).isNameAndType(), "");
         return poolIndex;
@@ -430,10 +430,10 @@
     return res;
   }
 
-  /** Lookup for multi-operand (InvokeDynamic) entries. */
+  /** Lookup for multi-operand (InvokeDynamic, Dynamic) entries. */
   public short[] getBootstrapSpecifierAt(int i) {
     if (Assert.ASSERTS_ENABLED) {
-      Assert.that(getTagAt(i).isInvokeDynamic() || getTagAt(i).isConstantDynamic(), "Corrupted constant pool");
+      Assert.that(getTagAt(i).isInvokeDynamic() || getTagAt(i).isDynamicConstant(), "Corrupted constant pool");
     }
     int bsmSpec = extractLowShortFromInt(this.getIntAt(i));
     U2Array operands = getOperands();
@@ -469,7 +469,7 @@
     case JVM_CONSTANT_NameAndType:        return "JVM_CONSTANT_NameAndType";
     case JVM_CONSTANT_MethodHandle:       return "JVM_CONSTANT_MethodHandle";
     case JVM_CONSTANT_MethodType:         return "JVM_CONSTANT_MethodType";
-    case JVM_CONSTANT_ConstantDynamic:    return "JVM_CONSTANT_ConstantDynamic";
+    case JVM_CONSTANT_Dynamic:            return "JVM_CONSTANT_Dynamic";
     case JVM_CONSTANT_InvokeDynamic:      return "JVM_CONSTANT_InvokeDynamic";
     case JVM_CONSTANT_Invalid:            return "JVM_CONSTANT_Invalid";
     case JVM_CONSTANT_UnresolvedClass:    return "JVM_CONSTANT_UnresolvedClass";
@@ -526,7 +526,7 @@
         case JVM_CONSTANT_NameAndType:
         case JVM_CONSTANT_MethodHandle:
         case JVM_CONSTANT_MethodType:
-        case JVM_CONSTANT_ConstantDynamic:
+        case JVM_CONSTANT_Dynamic:
         case JVM_CONSTANT_InvokeDynamic:
           visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
           break;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java	Fri Oct 13 15:29:58 2017 -0400
@@ -42,7 +42,7 @@
     public static final int JVM_CONSTANT_NameAndType        = 12;
     public static final int JVM_CONSTANT_MethodHandle       = 15;
     public static final int JVM_CONSTANT_MethodType         = 16;
-    public static final int JVM_CONSTANT_ConstantDynamic    = 17;
+    public static final int JVM_CONSTANT_Dynamic            = 17;
     public static final int JVM_CONSTANT_InvokeDynamic      = 18;
 
     // JVM_CONSTANT_MethodHandle subtypes
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Fri Oct 13 15:29:58 2017 -0400
@@ -296,7 +296,7 @@
                      break;
                 }
 
-                case JVM_CONSTANT_ConstantDynamic: {
+                case JVM_CONSTANT_Dynamic: {
                     dos.writeByte(cpConstType);
                     int value = cpool.getIntAt(ci);
                     short bsmIndex = (short) extractLowShortFromInt(value);
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java	Fri Oct 13 15:29:58 2017 -0400
@@ -557,8 +557,8 @@
                buf.cell(Integer.toString(cpool.getIntAt(index)));
                break;
 
-           case JVM_CONSTANT_ConstantDynamic:
-               buf.cell("JVM_CONSTANT_ConstantDynamic");
+           case JVM_CONSTANT_Dynamic:
+               buf.cell("JVM_CONSTANT_Dynamic");
                buf.cell(genLowHighShort(cpool.getIntAt(index)) +
                         genListOfShort(cpool.getBootstrapSpecifierAt(index)));
              break;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java	Fri Oct 13 15:29:58 2017 -0400
@@ -42,7 +42,7 @@
   private static final int JVM_CONSTANT_NameAndType             = 12;
   private static final int JVM_CONSTANT_MethodHandle            = 15;  // JSR 292
   private static final int JVM_CONSTANT_MethodType              = 16;  // JSR 292
-  private static final int JVM_CONSTANT_ConstantDynamic         = 17;  // JSR 292 early drafts only
+  private static final int JVM_CONSTANT_Dynamic                 = 17;  // JSR 292 early drafts only
   private static final int JVM_CONSTANT_InvokeDynamic           = 18;  // JSR 292
   private static final int JVM_CONSTANT_Invalid                 = 0;   // For bad value initialization
   private static final int JVM_CONSTANT_UnresolvedClass         = 100; // Temporary tag until actual use
@@ -84,7 +84,7 @@
   public boolean isUtf8()             { return tag == JVM_CONSTANT_Utf8; }
   public boolean isMethodHandle()     { return tag == JVM_CONSTANT_MethodHandle; }
   public boolean isMethodType()       { return tag == JVM_CONSTANT_MethodType; }
-  public boolean isConstantDynamic()  { return tag == JVM_CONSTANT_ConstantDynamic; }
+  public boolean isDynamicConstant()  { return tag == JVM_CONSTANT_Dynamic; }
   public boolean isInvokeDynamic()    { return tag == JVM_CONSTANT_InvokeDynamic; }
 
   public boolean isInvalid()          { return tag == JVM_CONSTANT_Invalid; }
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java	Fri Oct 13 15:29:58 2017 -0400
@@ -237,7 +237,7 @@
      */
     native HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
 
-    // TODO resolving ConstantDynamic
+    // TODO resolving JVM_CONSTANT_Dynamic
 
     /**
      * Ensures that the type referenced by the specified {@code JVM_CONSTANT_InvokeDynamic} entry at
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassTranslator.java	Fri Oct 13 15:29:58 2017 -0400
@@ -28,7 +28,7 @@
 import java.util.Map;
 
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Class_info;
-import com.sun.tools.classfile.ConstantPool.CONSTANT_ConstantDynamic_info;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Dynamic_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Double_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Fieldref_info;
 import com.sun.tools.classfile.ConstantPool.CONSTANT_Float_info;
@@ -332,14 +332,14 @@
         return info;
     }
 
-    public CPInfo visitConstantDynamic(CONSTANT_ConstantDynamic_info info, Map<Object, Object> translations) {
-        CONSTANT_ConstantDynamic_info info2 = (CONSTANT_ConstantDynamic_info) translations.get(info);
+    public CPInfo visitDynamicConstant(CONSTANT_Dynamic_info info, Map<Object, Object> translations) {
+        CONSTANT_Dynamic_info info2 = (CONSTANT_Dynamic_info) translations.get(info);
         if (info2 == null) {
             ConstantPool cp2 = translate(info.cp, translations);
             if (cp2 == info.cp) {
                 info2 = info;
             } else {
-                info2 = new CONSTANT_ConstantDynamic_info(cp2, info.bootstrap_method_attr_index, info.name_and_type_index);
+                info2 = new CONSTANT_Dynamic_info(cp2, info.bootstrap_method_attr_index, info.name_and_type_index);
             }
             translations.put(info, info2);
         }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Fri Oct 13 15:29:58 2017 -0400
@@ -283,7 +283,7 @@
             return 1;
         }
 
-        public Integer visitConstantDynamic(CONSTANT_ConstantDynamic_info info, ClassOutputStream out) {
+        public Integer visitDynamicConstant(CONSTANT_Dynamic_info info, ClassOutputStream out) {
             out.writeShort(info.bootstrap_method_attr_index);
             out.writeShort(info.name_and_type_index);
             return 1;
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConstantPool.java	Fri Oct 13 15:29:58 2017 -0400
@@ -116,7 +116,7 @@
     public static final int CONSTANT_NameAndType = 12;
     public static final int CONSTANT_MethodHandle = 15;
     public static final int CONSTANT_MethodType = 16;
-    public static final int CONSTANT_ConstantDynamic = 17;
+    public static final int CONSTANT_Dynamic = 17;
     public static final int CONSTANT_InvokeDynamic = 18;
     public static final int CONSTANT_Module = 19;
     public static final int CONSTANT_Package = 20;
@@ -199,8 +199,8 @@
                 pool[i] = new CONSTANT_InvokeDynamic_info(this, cr);
                 break;
 
-            case CONSTANT_ConstantDynamic:
-                pool[i] = new CONSTANT_ConstantDynamic_info(this, cr);
+            case CONSTANT_Dynamic:
+                pool[i] = new CONSTANT_Dynamic_info(this, cr);
                 break;
 
             case CONSTANT_Long:
@@ -357,7 +357,7 @@
         R visitInteger(CONSTANT_Integer_info info, P p);
         R visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, P p);
         R visitInvokeDynamic(CONSTANT_InvokeDynamic_info info, P p);
-        R visitConstantDynamic(CONSTANT_ConstantDynamic_info info, P p);
+        R visitDynamicConstant(CONSTANT_Dynamic_info info, P p);
         R visitLong(CONSTANT_Long_info info, P p);
         R visitMethodref(CONSTANT_Methodref_info info, P p);
         R visitMethodHandle(CONSTANT_MethodHandle_info info, P p);
@@ -885,21 +885,21 @@
         public final int type_index;
     }
 
-    public static class CONSTANT_ConstantDynamic_info extends CPInfo {
-        CONSTANT_ConstantDynamic_info(ConstantPool cp, ClassReader cr) throws IOException {
+    public static class CONSTANT_Dynamic_info extends CPInfo {
+        CONSTANT_Dynamic_info(ConstantPool cp, ClassReader cr) throws IOException {
             super(cp);
             bootstrap_method_attr_index = cr.readUnsignedShort();
             name_and_type_index = cr.readUnsignedShort();
         }
 
-        public CONSTANT_ConstantDynamic_info(ConstantPool cp, int bootstrap_method_index, int name_and_type_index) {
+        public CONSTANT_Dynamic_info(ConstantPool cp, int bootstrap_method_index, int name_and_type_index) {
             super(cp);
             this.bootstrap_method_attr_index = bootstrap_method_index;
             this.name_and_type_index = name_and_type_index;
         }
 
         public int getTag() {
-            return CONSTANT_ConstantDynamic;
+            return CONSTANT_Dynamic;
         }
 
         public int byteLength() {
@@ -908,11 +908,11 @@
 
         @Override
         public String toString() {
-            return "CONSTANT_ConstantDynamic_info[bootstrap_method_index: " + bootstrap_method_attr_index + ", name_and_type_index: " + name_and_type_index + "]";
+            return "CONSTANT_Dynamic_info[bootstrap_method_index: " + bootstrap_method_attr_index + ", name_and_type_index: " + name_and_type_index + "]";
         }
 
         public <R, D> R accept(Visitor<R, D> visitor, D data) {
-            return visitor.visitConstantDynamic(this, data);
+            return visitor.visitDynamicConstant(this, data);
         }
 
         public CONSTANT_NameAndType_info getNameAndTypeInfo() throws ConstantPoolException {
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java	Fri Oct 13 15:29:58 2017 -0400
@@ -689,7 +689,7 @@
             }
 
             @Override
-            public Void visitConstantDynamic(CONSTANT_ConstantDynamic_info info, Void aVoid) {
+            public Void visitDynamicConstant(CONSTANT_Dynamic_info info, Void aVoid) {
                 return null;
             }
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ReferenceFinder.java	Fri Oct 13 15:29:58 2017 -0400
@@ -161,7 +161,7 @@
         }
 
         @Override
-        public Boolean visitConstantDynamic(CONSTANT_ConstantDynamic_info info, ConstantPool constantPool) {
+        public Boolean visitDynamicConstant(CONSTANT_Dynamic_info info, ConstantPool constantPool) {
             return false;
         }
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java	Fri Oct 13 15:29:58 2017 -0400
@@ -104,7 +104,7 @@
                 return 1;
             }
 
-            public Integer visitConstantDynamic(CONSTANT_ConstantDynamic_info info, Void p) {
+            public Integer visitDynamicConstant(CONSTANT_Dynamic_info info, Void p) {
                 print("#" + info.bootstrap_method_attr_index + ":#" + info.name_and_type_index);
                 tab();
                 println("// " + stringValue(info));
@@ -253,8 +253,8 @@
                 return "InterfaceMethod";
             case CONSTANT_InvokeDynamic:
                 return "InvokeDynamic";
-            case CONSTANT_ConstantDynamic:
-                return "ConstantDynamic";
+            case CONSTANT_Dynamic:
+                return "Dynamic";
             case CONSTANT_NameAndType:
                 return "NameAndType";
             default:
@@ -323,7 +323,7 @@
             }
         }
 
-        public String visitConstantDynamic(CONSTANT_ConstantDynamic_info info, Void p) {
+        public String visitDynamicConstant(CONSTANT_Dynamic_info info, Void p) {
             try {
                 String callee = stringValue(info.getNameAndTypeInfo());
                 return "#" + info.bootstrap_method_attr_index + ":" + callee;
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/scan/CPSelector.java	Fri Oct 13 15:29:58 2017 -0400
@@ -26,7 +26,7 @@
 package com.sun.tools.jdeprscan.scan;
 
 import com.sun.tools.classfile.ConstantPool;
-import com.sun.tools.classfile.ConstantPool.CONSTANT_ConstantDynamic_info;
+import com.sun.tools.classfile.ConstantPool.CONSTANT_Dynamic_info;
 
 /**
  * A visitor that selects constant pool entries by type and adds
@@ -71,7 +71,7 @@
         return null;
     }
 
-    public Void visitConstantDynamic(CONSTANT_ConstantDynamic_info info, CPEntries p) {
+    public Void visitDynamicConstant(CONSTANT_Dynamic_info info, CPEntries p) {
         return null;
     }
 
--- a/test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/common/test/java/lang/invoke/lib/InstructionHelper.java	Fri Oct 13 15:29:58 2017 -0400
@@ -86,19 +86,19 @@
                    P -> P.putHandle(refKind, csym(owner), name, type.toMethodDescriptorString()));
     }
 
-    public static MethodHandle ldcConstantdynamic(MethodHandles.Lookup l,
-                                           String name, Class<?> type,
-                                           String bsmMethodName, MethodType bsmType,
-                                           Consumer<PoolHelper.StaticArgListBuilder<String, String, byte[]>> staticArgs) throws Exception {
-        return ldcConstantdynamic(l, name, cref(type), bsmMethodName, bsmType.toMethodDescriptorString(), staticArgs);
+    public static MethodHandle ldcDynamicConstant(MethodHandles.Lookup l,
+                                                  String name, Class<?> type,
+                                                  String bsmMethodName, MethodType bsmType,
+                                                  Consumer<PoolHelper.StaticArgListBuilder<String, String, byte[]>> staticArgs) throws Exception {
+        return ldcDynamicConstant(l, name, cref(type), bsmMethodName, bsmType.toMethodDescriptorString(), staticArgs);
     }
 
-    public static MethodHandle ldcConstantdynamic(MethodHandles.Lookup l,
+    public static MethodHandle ldcDynamicConstant(MethodHandles.Lookup l,
                                                   String name, String type,
                                                   String bsmMethodName, String bsmType,
                                                   Consumer<PoolHelper.StaticArgListBuilder<String, String, byte[]>> staticArgs) throws Exception {
         return ldc(l, type,
-                   P -> P.putConstantDynamic(name, type,
+                   P -> P.putDynamicConstant(name, type,
                                              csym(l.lookupClass()), bsmMethodName, bsmType,
                                              staticArgs));
     }
--- a/test/jdk/java/lang/invoke/condy/BootstrapMethodJumboArgsTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/BootstrapMethodJumboArgsTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -96,7 +96,7 @@
         String[] expected = IntStream.range(0, 1000).mapToObj(Integer::toString).toArray(String[]::new);
 
         {
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object[].class,
                     "bsmZero", methodType(Object.class, MethodHandles.Lookup.class, String.class, Object.class, Object[].class),
                     S -> manyStaticStrings(expected, S));
@@ -106,7 +106,7 @@
         }
 
         {
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object[].class,
                     "bsmOne", methodType(Object.class, MethodHandles.Lookup.class, String.class, Object.class, Object.class, Object[].class),
                     S -> manyStaticStrings(expected, S));
@@ -116,7 +116,7 @@
         }
 
         {
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object[].class,
                     "bsmTwo", methodType(Object.class, MethodHandles.Lookup.class, String.class, Object.class, Object.class, Object.class, Object[].class),
                     S -> manyStaticStrings(expected, S));
--- a/test/jdk/java/lang/invoke/condy/CondyBSMException.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyBSMException.java	Fri Oct 13 15:29:58 2017 -0400
@@ -106,7 +106,7 @@
 
     static MethodHandle thrower(String message, Class<? extends Throwable> t) {
         try {
-            return InstructionHelper.ldcConstantdynamic(
+            return InstructionHelper.ldcDynamicConstant(
                     MethodHandles.lookup(),
                     message, t,
                     "throwingBsm", methodType(Throwable.class, MethodHandles.Lookup.class, String.class, Class.class),
--- a/test/jdk/java/lang/invoke/condy/CondyBSMInvocation.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyBSMInvocation.java	Fri Oct 13 15:29:58 2017 -0400
@@ -50,7 +50,7 @@
 
     @Test
     public void testNonexistent() throws Throwable {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "name", Object.class,
                 "bsm", methodType(Object.class),
                 S -> {});
@@ -77,7 +77,7 @@
             final int n = i;
             MethodType mt = methodType(Object.class)
                     .appendParameterTypes(Collections.nCopies(n, Object.class));
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object.class,
                     "_bsm", mt,
                     S -> IntStream.range(0, n).forEach(S::add)
@@ -105,7 +105,7 @@
     @Test
     public void testWrongSignature() throws Throwable {
         {
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object.class,
                     "_bsm", methodType(Object.class, String[].class),
                     S -> {}
@@ -122,7 +122,7 @@
         }
 
         {
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object.class,
                     "_bsm", methodType(Object.class, String.class, String.class, String.class),
                     S -> {}
@@ -198,7 +198,7 @@
             final int n = i;
             MethodType mt = methodType(Object.class, MethodHandles.Lookup.class, String.class, Class.class)
                     .appendParameterTypes(Collections.nCopies(n, Object.class));
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object.class,
                     "bsm", mt,
                     S -> IntStream.range(0, n).forEach(S::add)
@@ -215,7 +215,7 @@
             final int n = i;
             MethodType mt = methodType(Object.class, MethodHandles.Lookup.class, String.class, Class.class)
                     .appendParameterTypes(Collections.nCopies(n, Object.class));
-            MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+            MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                     L, "name", Object.class,
                     "bsm", mt,
                     S -> IntStream.range(0, n - 1).forEach(S::add)
--- a/test/jdk/java/lang/invoke/condy/CondyBSMValidationTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyBSMValidationTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -57,7 +57,7 @@
 
     @Test(dataProvider = "invalidSignaturesProvider", expectedExceptions = ClassFormatError.class)
     public void testInvalidBSMSignature(String sig) throws Exception {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "name", "Ljava/lang/Object;",
                 "bsm", sig,
                 S -> {
--- a/test/jdk/java/lang/invoke/condy/CondyNameValidationTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyNameValidationTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -57,7 +57,7 @@
 
     @Test(dataProvider = "invalidNamesProvider", expectedExceptions = java.lang.ClassFormatError.class)
     public void testInvalidNames(String name) throws Exception {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, name, Object.class,
                 "bsm", BSM_TYPE,
                 S -> {
@@ -74,7 +74,7 @@
 
     @Test(dataProvider = "validNamesProvider")
     public void testValidNames(String name) throws Exception {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, name, Object.class,
                 "bsm", BSM_TYPE,
                 S -> {
--- a/test/jdk/java/lang/invoke/condy/CondyNestedTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyNestedTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8186046
- * @summary Test nested constant dynamic declarations that are recursive
+ * @summary Test nested dynamic constant declarations that are recursive
  * @library /lib/testlibrary/bytecode
  * @build jdk.experimental.bytecode.BasicClassBuilder
  * @run testng CondyNestedTest
@@ -53,7 +53,7 @@
 
     /**
      * NOTE: This is a temporary solution until asmtools is updated to support
-     * constant dynamic and jtreg is updated to include a new version of
+     * dynamic constant and jtreg is updated to include a new version of
      * asmtools.
      *
      * These are the class file bytes for a class named CondyNestedTest_Code
@@ -63,9 +63,9 @@
      * java -jar asmtools.jar jdec CondyNestedTest_Code.class >
      * CondyNestedTest_Code.jcod
      *
-     * which was then edited so that constant dynamic declarations are
+     * which was then edited so that dynamic constant declarations are
      * recursive both for an ldc or invokedynamic (specifically declaring a
-     * BSM+attributes whose static argument is a constant dynamic
+     * BSM+attributes whose static argument is a dynamic constant
      * that refers to the same BSM+attributes); 3) the jcod file is converted
      * back to a class file:
      *
@@ -174,7 +174,7 @@
                                 .withCode(TypedCodeBuilder::new, C ->
                                         C.ldc("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
                                               S -> S.add(null, (P, v) -> {
-                                                  return P.putConstantDynamic("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
+                                                  return P.putDynamicConstant("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
                                                                               S2 -> S2.add("DUMMY_ARG", PoolHelper::putString));
                                               }))
                                                 .areturn()))
@@ -183,7 +183,7 @@
                                 .withCode(TypedCodeBuilder::new, C ->
                                         C.invokedynamic("name", "()Ljava/lang/String;", genClassName, "bsmIndy", bsmIndyDescriptor,
                                                         S -> S.add(null, (P, v) -> {
-                                                            return P.putConstantDynamic("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
+                                                            return P.putDynamicConstant("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
                                                                                         S2 -> S2.add("DUMMY_ARG", PoolHelper::putString));
                                                         }))
                                                 .areturn()))
@@ -192,7 +192,7 @@
                                 .withCode(TypedCodeBuilder::new, C ->
                                         C.invokedynamic("name", "()Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
                                                         S -> S.add(null, (P, v) -> {
-                                                            return P.putConstantDynamic("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
+                                                            return P.putDynamicConstant("name", "Ljava/lang/String;", genClassName, "bsm", bsmDescriptor,
                                                                                         S2 -> S2.add("DUMMY_ARG", PoolHelper::putString));
                                                         }))
                                                 .areturn()))
@@ -246,7 +246,7 @@
     }
 
     /**
-     * Testing an ldc of a constant dynamic, C say, with a BSM whose static
+     * Testing an ldc of a dynamic constant, C say, with a BSM whose static
      * argument is C.
      */
     @Test
@@ -265,7 +265,7 @@
 
     /**
      * Testing an invokedynamic with a BSM, B say, whose static argument is
-     * a constant dynamic, C say, that uses BSM B.
+     * a dynamic constant, C say, that uses BSM B.
      */
     @Test
     public void testIndyBsmCondyBsm() throws Exception {
--- a/test/jdk/java/lang/invoke/condy/CondyStaticArgumentsTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyStaticArgumentsTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -99,7 +99,7 @@
         BSMInfo bi = BSMInfo.of("basicArgs");
         MethodHandleInfo mhi = MethodHandles.lookup().revealDirect(bi.handle);
 
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "constant-name", String.class,
                 bi.methodName, bi.handle.type(),
                 S -> S.add(1).add(2L).add(3.0f).add(4.0d)
@@ -146,7 +146,7 @@
 
     static <E> int bigDecimalPoolHelper(String value, String mc, PoolHelper<String, String, E> P) {
         BSMInfo bi = BSMInfo.of("bigDecimal");
-        return P.putConstantDynamic("big-decimal", "Ljava/math/BigDecimal;", InstructionHelper.csym(L.lookupClass()), bi.methodName, bi.descriptor,
+        return P.putDynamicConstant("big-decimal", "Ljava/math/BigDecimal;", InstructionHelper.csym(L.lookupClass()), bi.methodName, bi.descriptor,
                                     S -> S.add(value, PoolHelper::putString)
                                             .add(mc, (P2, s) -> {
                                                 return mathContextPoolHelper(s, P2);
@@ -155,7 +155,7 @@
 
     static <E> int mathContextPoolHelper(String mc, PoolHelper<String, String, E> P) {
         BSMInfo bi = BSMInfo.of("mathContext");
-        return P.putConstantDynamic(mc, "Ljava/math/MathContext;", InstructionHelper.csym(L.lookupClass()), bi.methodName, bi.descriptor,
+        return P.putDynamicConstant(mc, "Ljava/math/MathContext;", InstructionHelper.csym(L.lookupClass()), bi.methodName, bi.descriptor,
                                     S -> {
                                     });
     }
@@ -164,7 +164,7 @@
     public void testCondyWithCondy() throws Throwable {
         BSMInfo bi = BSMInfo.of("condyWithCondy");
 
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "big-decimal-math-context", String.class,
                 bi.methodName, bi.handle.type(),
                 S -> S.add(null, (P, v) -> {
--- a/test/jdk/java/lang/invoke/condy/CondyTypeValidationTest.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyTypeValidationTest.java	Fri Oct 13 15:29:58 2017 -0400
@@ -63,7 +63,7 @@
 
     @Test(dataProvider = "invalidTypesProvider", expectedExceptions = ClassFormatError.class)
     public void testInvalidTypes(String type) throws Exception {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "name", type,
                 "bsm", BSM_TYPE,
                 S -> {
@@ -84,7 +84,7 @@
 
     @Test(dataProvider = "validTypesProvider")
     public void testValidTypes(String type) throws Exception {
-        MethodHandle mh = InstructionHelper.ldcConstantdynamic(
+        MethodHandle mh = InstructionHelper.ldcDynamicConstant(
                 L, "name", type,
                 "bsm", BSM_TYPE,
                 S -> {
--- a/test/jdk/java/lang/invoke/condy/CondyWrongType.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/java/lang/invoke/condy/CondyWrongType.java	Fri Oct 13 15:29:58 2017 -0400
@@ -67,7 +67,7 @@
             MethodHandle zero = MethodHandles.zero(typeMap.get(name));
             for (String type : typeMap.keySet()) {
                 // Use asType transformation to detect if primitive conversion
-                // is supported from the BSM value type to the constant dynamic type
+                // is supported from the BSM value type to the dynamic constant type
                 boolean pass = true;
                 try {
                     zero.asType(MethodType.methodType(typeMap.get(type)));
@@ -162,7 +162,7 @@
 
     static MethodHandle caster(String name, String type) {
         try {
-            return InstructionHelper.ldcConstantdynamic(
+            return InstructionHelper.ldcDynamicConstant(
                     MethodHandles.lookup(),
                     name, type,
                     "bsm", methodType(Object.class, MethodHandles.Lookup.class, String.class, Class.class).toMethodDescriptorString(),
--- a/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/BytePoolHelper.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/BytePoolHelper.java	Fri Oct 13 15:29:58 2017 -0400
@@ -190,7 +190,7 @@
             hash = tag.tag | ((bsmIndex | name.hashCode() | type.hashCode()) << 1);
         }
 
-        void setConstantDynamic(int bsmIndex, CharSequence name, String type) {
+        void setDynamicConstant(int bsmIndex, CharSequence name, String type) {
             tag = PoolTag.CONSTANT_INVOKEDYNAMIC;
             o1 = bsmIndex;
             o2 = name;
@@ -446,8 +446,8 @@
     }
 
     @Override
-    public int putConstantDynamic(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
-        return putConstantDynamicInternal(constName, typeToString.apply(constType), symbolToString.apply(bsmClass), bsmName, typeToString.apply(bsmType), staticArgs);
+    public int putDynamicConstant(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
+        return putDynamicConstantInternal(constName, typeToString.apply(constType), symbolToString.apply(bsmClass), bsmName, typeToString.apply(bsmType), staticArgs);
     }
 
     private int putInvokeDynamicInternal(CharSequence invokedName, String invokedType, String bsmClass, CharSequence bsmName, String bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
@@ -466,9 +466,9 @@
         return poolKey.index;
     }
 
-    private int putConstantDynamicInternal(CharSequence constName, String constType, String bsmClass, CharSequence bsmName, String bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
+    private int putDynamicConstantInternal(CharSequence constName, String constType, String bsmClass, CharSequence bsmName, String bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
         int bsmIndex = putBsmInternal(bsmClass, bsmName, bsmType, staticArgs);
-        key.setConstantDynamic(bsmIndex, constName, constType);
+        key.setDynamicConstant(bsmIndex, constName, constType);
         PoolKey poolKey = entries.lookup(key);
         if (poolKey == null) {
             poolKey = key.dup();
@@ -536,7 +536,7 @@
                 return this;
             }
             public ByteStaticArgListBuilder add(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, byte[]>> staticArgs) {
-                indexes.add(putConstantDynamic(constName, constType, bsmClass, bsmName, bsmType, staticArgs));
+                indexes.add(putDynamicConstant(constName, constType, bsmClass, bsmName, bsmType, staticArgs));
                 return this;
             }
         }
--- a/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/CodeBuilder.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/CodeBuilder.java	Fri Oct 13 15:29:58 2017 -0400
@@ -241,7 +241,7 @@
 
     public C ldc(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs) {
         boolean fat = typeHelper.tag(constType).width() == 2;
-        return ldc(pool -> pool.putConstantDynamic(constName, constType, bsmClass, bsmName, bsmType, staticArgs), fat);
+        return ldc(pool -> pool.putDynamicConstant(constName, constType, bsmClass, bsmName, bsmType, staticArgs), fat);
     }
 
     public <Z> C ldc(Z z, BiFunction<PoolHelper<S, T, E>, Z, Integer> poolFunc) {
--- a/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/IsolatedMethodBuilder.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/IsolatedMethodBuilder.java	Fri Oct 13 15:29:58 2017 -0400
@@ -107,7 +107,7 @@
         }
 
         @Override
-        public int putConstantDynamic(CharSequence constName, String constType, Class<?> bsmClass, CharSequence bsmName, String bsmType, Consumer<StaticArgListBuilder<Class<?>, String, Object[]>> staticArgs) {
+        public int putDynamicConstant(CharSequence constName, String constType, Class<?> bsmClass, CharSequence bsmName, String bsmType, Consumer<StaticArgListBuilder<Class<?>, String, Object[]>> staticArgs) {
             return 0; //???
         }
 
--- a/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/PoolHelper.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/PoolHelper.java	Fri Oct 13 15:29:58 2017 -0400
@@ -60,7 +60,7 @@
 
     int putInvokeDynamic(CharSequence invokedName, T invokedType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs);
 
-    int putConstantDynamic(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs);
+    int putDynamicConstant(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs);
 
     int size();
 
--- a/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/TypedCodeBuilder.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/lib/testlibrary/bytecode/jdk/experimental/bytecode/TypedCodeBuilder.java	Fri Oct 13 15:29:58 2017 -0400
@@ -995,9 +995,9 @@
             }
 
             @Override
-            public int putConstantDynamic(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs) {
+            public int putDynamicConstant(CharSequence constName, T constType, S bsmClass, CharSequence bsmName, T bsmType, Consumer<StaticArgListBuilder<S, T, E>> staticArgs) {
                 type = constType;
-                return poolHelper.putConstantDynamic(constName, constType, bsmClass, bsmName, bsmType, staticArgs);
+                return poolHelper.putDynamicConstant(constName, constType, bsmClass, bsmName, bsmType, staticArgs);
             }
 
             @Override
--- a/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java	Thu Oct 12 22:04:58 2017 +0200
+++ b/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java	Fri Oct 13 15:29:58 2017 -0400
@@ -805,14 +805,14 @@
     }
 
     @Override
-    public String visitConstantDynamic(ConstantPool.CONSTANT_ConstantDynamic_info c, Integer p) {
+    public String visitDynamicConstant(ConstantPool.CONSTANT_Dynamic_info c, Integer p) {
         String value = slist.get(p);
         if (value == null) {
             try {
                 value = bsmlist.get(c.bootstrap_method_attr_index) + " "
                         + visit(cfpool.get(c.name_and_type_index), c.name_and_type_index);
                 slist.set(p, value);
-                xpool.add(new Element("CONSTANT_ConstantDynamic",
+                xpool.add(new Element("CONSTANT_Dynamic",
                                       new String[]{"id", p.toString()},
                                       value));