8036956: remove EnableInvokeDynamic flag
authoranoll
Tue, 29 Apr 2014 08:08:44 +0200
changeset 24322 c2978d1578e3
parent 24320 394d55c783dc
child 24323 f84b15cd9e1a
8036956: remove EnableInvokeDynamic flag Summary: The EnableInvokeDynamic flag and all support code is removed because it is not longer used in JDK 9. Reviewed-by: kvn, twisti Contributed-by: Tobias Hartmann <tobias.hartmann@oracle.com>
hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp
hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp
hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp
hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
hotspot/src/share/vm/ci/ciObject.cpp
hotspot/src/share/vm/classfile/classFileParser.cpp
hotspot/src/share/vm/classfile/classFileParser.hpp
hotspot/src/share/vm/classfile/javaClasses.cpp
hotspot/src/share/vm/classfile/systemDictionary.cpp
hotspot/src/share/vm/classfile/systemDictionary.hpp
hotspot/src/share/vm/classfile/verifier.cpp
hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
hotspot/src/share/vm/interpreter/bytecodes.hpp
hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
hotspot/src/share/vm/interpreter/linkResolver.cpp
hotspot/src/share/vm/oops/constantPool.cpp
hotspot/src/share/vm/oops/constantPool.hpp
hotspot/src/share/vm/oops/instanceKlass.cpp
hotspot/src/share/vm/oops/klass.cpp
hotspot/src/share/vm/oops/method.hpp
hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp
hotspot/src/share/vm/prims/methodHandles.cpp
hotspot/src/share/vm/prims/unsafe.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/thread.cpp
--- a/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/cppInterpreter_ppc.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -419,10 +419,8 @@
   // TODO: PPC port: assert(2 == ConstMethod::sz_max_stack(), "unexpected field size");
   __ lhz(max_stack, in_bytes(ConstMethod::max_stack_offset()), max_stack);
 
-  if (EnableInvokeDynamic) {
-    // Take into account 'extra_stack_entries' needed by method handles (see method.hpp).
+  // Take into account 'extra_stack_entries' needed by method handles (see method.hpp).
     __ addi(max_stack, max_stack, Method::extra_stack_entries());
-  }
 
   // mem_stack_limit = thread->stack_limit();
   __ ld(mem_stack_limit, thread_(stack_overflow_limit));
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -380,7 +380,6 @@
   if (index_size == sizeof(u2)) {
     get_2_byte_integer_at_bcp(bcp_offset, Rdst, Unsigned);
   } else if (index_size == sizeof(u4)) {
-    assert(EnableInvokeDynamic, "giant index used only for JSR 292");
     get_4_byte_integer_at_bcp(bcp_offset, Rdst, Signed);
     assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
     nand(Rdst, Rdst, Rdst); // convert to plain index
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3453,16 +3453,6 @@
                  Rscratch1 = R11_scratch1,
                  Rscratch2 = R12_scratch2;
 
-  if (!EnableInvokeDynamic) {
-    // We should not encounter this bytecode if !EnableInvokeDynamic.
-    // The verifier will stop it. However, if we get past the verifier,
-    // this will stop the thread in a reasonable way, without crashing the JVM.
-    __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeError));
-    // The call_VM checks for exception, so we should never return here.
-    __ should_not_reach_here();
-    return;
-  }
-
   prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, noreg, Rflags, Rscratch2);
 
   // Profile this call.
@@ -3486,12 +3476,6 @@
                  Rscratch1 = R11_scratch1,
                  Rscratch2 = R12_scratch2;
 
-  if (!EnableInvokeDynamic) {
-    // Rewriter does not generate this bytecode.
-    __ should_not_reach_here();
-    return;
-  }
-
   prepare_invoke(byte_no, Rmethod, Rret_addr, Rscratch1, Rrecv, Rflags, Rscratch2);
   __ verify_method_ptr(Rmethod);
   __ null_check_throw(Rrecv, -1, Rscratch2);
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -727,7 +727,6 @@
   if (index_size == sizeof(u2)) {
     get_2_byte_integer_at_bcp(bcp_offset, temp, index, Unsigned);
   } else if (index_size == sizeof(u4)) {
-    assert(EnableInvokeDynamic, "giant index used only for JSR 292");
     get_4_byte_integer_at_bcp(bcp_offset, temp, index);
     assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
     xor3(index, -1, index);  // convert to plain index
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -1888,7 +1888,7 @@
   }
 
 #if INCLUDE_JVMTI
-  if (EnableInvokeDynamic) {
+  {
     Label L_done;
 
     __ ldub(Address(Lbcp, 0), G1_scratch);  // Load current bytecode
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3209,12 +3209,6 @@
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");
 
-  if (!EnableInvokeDynamic) {
-    // rewriter does not generate this bytecode
-    __ should_not_reach_here();
-    return;
-  }
-
   const Register Rret       = Lscratch;
   const Register G4_mtype   = G4_scratch;
   const Register O0_recv    = O0;
@@ -3240,17 +3234,6 @@
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");
 
-  if (!EnableInvokeDynamic) {
-    // We should not encounter this bytecode if !EnableInvokeDynamic.
-    // The verifier will stop it.  However, if we get past the verifier,
-    // this will stop the thread in a reasonable way, without crashing the JVM.
-    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
-                     InterpreterRuntime::throw_IncompatibleClassChangeError));
-    // the call_VM checks for exception, so we should never return here.
-    __ should_not_reach_here();
-    return;
-  }
-
   const Register Rret        = Lscratch;
   const Register G4_callsite = G4_scratch;
   const Register Rscratch    = G3_scratch;
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -207,7 +207,6 @@
   if (index_size == sizeof(u2)) {
     load_unsigned_short(reg, Address(rsi, bcp_offset));
   } else if (index_size == sizeof(u4)) {
-    assert(EnableInvokeDynamic, "giant index used only for JSR 292");
     movl(reg, Address(rsi, bcp_offset));
     // Check if the secondary index definition is still ~x, otherwise
     // we have to change the following assembler code to calculate the
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -205,7 +205,6 @@
   if (index_size == sizeof(u2)) {
     load_unsigned_short(index, Address(r13, bcp_offset));
   } else if (index_size == sizeof(u4)) {
-    assert(EnableInvokeDynamic, "giant index used only for JSR 292");
     movl(index, Address(r13, bcp_offset));
     // Check if the secondary index definition is still ~x, otherwise
     // we have to change the following assembler code to calculate the
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -76,12 +76,7 @@
     Interpreter::stackElementWords;
 
 #ifdef ASSERT
-  if (!EnableInvokeDynamic) {
-    // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences?
-    // Probably, since deoptimization doesn't work yet.
-    assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable");
-  }
-  assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)");
+  assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable");
 #endif
 
   interpreter_frame->interpreter_frame_set_method(method);
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -1831,7 +1831,7 @@
   __ movl(Address(thread, JavaThread::popframe_condition_offset()), JavaThread::popframe_inactive);
 
 #if INCLUDE_JVMTI
-  if (EnableInvokeDynamic) {
+  {
     Label L_done;
     const Register local0 = rdi;
 
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -1848,7 +1848,7 @@
           JavaThread::popframe_inactive);
 
 #if INCLUDE_JVMTI
-  if (EnableInvokeDynamic) {
+  {
     Label L_done;
     const Register local0 = r14;
 
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3128,12 +3128,6 @@
   const Register rcx_recv   = rcx;
   const Register rdx_flags  = rdx;
 
-  if (!EnableInvokeDynamic) {
-    // rewriter does not generate this bytecode
-    __ should_not_reach_here();
-    return;
-  }
-
   prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
   __ verify_method_ptr(rbx_method);
   __ verify_oop(rcx_recv);
@@ -3156,17 +3150,6 @@
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");
 
-  if (!EnableInvokeDynamic) {
-    // We should not encounter this bytecode if !EnableInvokeDynamic.
-    // The verifier will stop it.  However, if we get past the verifier,
-    // this will stop the thread in a reasonable way, without crashing the JVM.
-    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
-                     InterpreterRuntime::throw_IncompatibleClassChangeError));
-    // the call_VM checks for exception, so we should never return here.
-    __ should_not_reach_here();
-    return;
-  }
-
   const Register rbx_method   = rbx;
   const Register rax_callsite = rax;
 
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3179,12 +3179,6 @@
   const Register rcx_recv   = rcx;
   const Register rdx_flags  = rdx;
 
-  if (!EnableInvokeDynamic) {
-    // rewriter does not generate this bytecode
-    __ should_not_reach_here();
-    return;
-  }
-
   prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
   __ verify_method_ptr(rbx_method);
   __ verify_oop(rcx_recv);
@@ -3207,17 +3201,6 @@
   transition(vtos, vtos);
   assert(byte_no == f1_byte, "use this argument");
 
-  if (!EnableInvokeDynamic) {
-    // We should not encounter this bytecode if !EnableInvokeDynamic.
-    // The verifier will stop it.  However, if we get past the verifier,
-    // this will stop the thread in a reasonable way, without crashing the JVM.
-    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
-                     InterpreterRuntime::throw_IncompatibleClassChangeError));
-    // the call_VM checks for exception, so we should never return here.
-    __ should_not_reach_here();
-    return;
-  }
-
   const Register rbx_method   = rbx;
   const Register rax_callsite = rax;
 
--- a/hotspot/src/share/vm/ci/ciObject.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/ci/ciObject.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -181,9 +181,8 @@
     if (klass() == env->String_klass() || klass() == env->Class_klass()) {
       return true;
     }
-  if (EnableInvokeDynamic &&
-      (klass()->is_subclass_of(env->MethodHandle_klass()) ||
-       klass()->is_subclass_of(env->CallSite_klass()))) {
+  if (klass()->is_subclass_of(env->MethodHandle_klass()) ||
+      klass()->is_subclass_of(env->CallSite_klass())) {
     assert(ScavengeRootsInCode >= 1, "must be");
     // We want to treat these aggressively.
     return true;
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -164,11 +164,6 @@
             "Class file version does not support constant tag %u in class file %s",
             tag, CHECK);
         }
-        if (!EnableInvokeDynamic) {
-          classfile_parse_error(
-            "This JVM does not support constant tag %u in class file %s",
-            tag, CHECK);
-        }
         if (tag == JVM_CONSTANT_MethodHandle) {
           cfs->guarantee_more(4, CHECK);  // ref_kind, method_index, tag/access_flags
           u1 ref_kind = cfs->get_u1_fast();
@@ -189,11 +184,6 @@
               "Class file version does not support constant tag %u in class file %s",
               tag, CHECK);
           }
-          if (!EnableInvokeDynamic) {
-            classfile_parse_error(
-              "This JVM does not support constant tag %u in class file %s",
-              tag, CHECK);
-          }
           cfs->guarantee_more(5, CHECK);  // bsm_index, nt, tag/access_flags
           u2 bootstrap_specifier_index = cfs->get_u2_fast();
           u2 name_and_type_index = cfs->get_u2_fast();
@@ -263,7 +253,7 @@
             verify_legal_utf8((unsigned char*)utf8_buffer, utf8_length, CHECK);
           }
 
-          if (EnableInvokeDynamic && has_cp_patch_at(index)) {
+          if (has_cp_patch_at(index)) {
             Handle patch = clear_cp_patch_at(index);
             guarantee_property(java_lang_String::is_instance(patch()),
                                "Illegal utf8 patch at %d in class file %s",
@@ -419,8 +409,7 @@
         {
           int ref_index = cp->method_handle_index_at(index);
           check_property(
-            valid_cp_range(ref_index, length) &&
-                EnableInvokeDynamic,
+            valid_cp_range(ref_index, length),
               "Invalid constant pool index %u in class file %s",
               ref_index, CHECK_(nullHandle));
           constantTag tag = cp->tag_at(ref_index);
@@ -466,7 +455,7 @@
       case JVM_CONSTANT_MethodType :
         {
           int ref_index = cp->method_type_index_at(index);
-          check_property(valid_symbol_at(ref_index) && EnableInvokeDynamic,
+          check_property(valid_symbol_at(ref_index),
                  "Invalid constant pool index %u in class file %s",
                  ref_index, CHECK_(nullHandle));
         }
@@ -492,7 +481,6 @@
 
   if (_cp_patches != NULL) {
     // need to treat this_class specially...
-    assert(EnableInvokeDynamic, "");
     int this_class_index;
     {
       cfs->guarantee_more(8, CHECK_(nullHandle));  // flags, this_class, super_class, infs_len
@@ -640,7 +628,6 @@
 
 
 void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) {
-  assert(EnableInvokeDynamic, "");
   BasicType patch_type = T_VOID;
 
   switch (cp->tag_at(index).value()) {
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -377,11 +377,9 @@
   char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS);
 
   bool is_anonymous() {
-    assert(EnableInvokeDynamic || _host_klass.is_null(), "");
     return _host_klass.not_null();
   }
   bool has_cp_patch_at(int index) {
-    assert(EnableInvokeDynamic, "");
     assert(index >= 0, "oob");
     return (_cp_patches != NULL
             && index < _cp_patches->length()
@@ -404,10 +402,7 @@
   // constant pool construction, but in later versions they can.
   // %%% Let's phase out the old is_klass_reference.
   bool valid_klass_reference_at(int index) {
-    return _cp->is_within_bounds(index) &&
-         (EnableInvokeDynamic
-            ? _cp->tag_at(index).is_klass_or_reference()
-            : _cp->tag_at(index).is_klass_reference());
+    return _cp->is_within_bounds(index) && _cp->tag_at(index).is_klass_or_reference();
   }
 
   // Checks that the cpool index is in range and is a utf8
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -2637,7 +2637,7 @@
 
 void java_lang_invoke_DirectMethodHandle::compute_offsets() {
   Klass* klass_oop = SystemDictionary::DirectMethodHandle_klass();
-  if (klass_oop != NULL && EnableInvokeDynamic) {
+  if (klass_oop != NULL) {
     compute_offset(_member_offset, klass_oop, vmSymbols::member_name(), vmSymbols::java_lang_invoke_MemberName_signature());
   }
 }
@@ -2659,18 +2659,15 @@
 
 void java_lang_invoke_MethodHandle::compute_offsets() {
   Klass* klass_oop = SystemDictionary::MethodHandle_klass();
-  if (klass_oop != NULL && EnableInvokeDynamic) {
+  if (klass_oop != NULL) {
     compute_offset(_type_offset, klass_oop, vmSymbols::type_name(), vmSymbols::java_lang_invoke_MethodType_signature());
-    compute_optional_offset(_form_offset, klass_oop, vmSymbols::form_name(), vmSymbols::java_lang_invoke_LambdaForm_signature());
-    if (_form_offset == 0) {
-      EnableInvokeDynamic = false;
-    }
+    compute_offset(_form_offset, klass_oop, vmSymbols::form_name(), vmSymbols::java_lang_invoke_LambdaForm_signature());
   }
 }
 
 void java_lang_invoke_MemberName::compute_offsets() {
   Klass* klass_oop = SystemDictionary::MemberName_klass();
-  if (klass_oop != NULL && EnableInvokeDynamic) {
+  if (klass_oop != NULL) {
     compute_offset(_clazz_offset,     klass_oop, vmSymbols::clazz_name(),     vmSymbols::class_signature());
     compute_offset(_name_offset,      klass_oop, vmSymbols::name_name(),      vmSymbols::string_signature());
     compute_offset(_type_offset,      klass_oop, vmSymbols::type_name(),      vmSymbols::object_signature());
@@ -2681,7 +2678,7 @@
 
 void java_lang_invoke_LambdaForm::compute_offsets() {
   Klass* klass_oop = SystemDictionary::LambdaForm_klass();
-  if (klass_oop != NULL && EnableInvokeDynamic) {
+  if (klass_oop != NULL) {
     compute_offset(_vmentry_offset, klass_oop, vmSymbols::vmentry_name(), vmSymbols::java_lang_invoke_MemberName_signature());
   }
 }
@@ -2896,7 +2893,6 @@
 int java_lang_invoke_CallSite::_target_offset;
 
 void java_lang_invoke_CallSite::compute_offsets() {
-  if (!EnableInvokeDynamic)  return;
   Klass* k = SystemDictionary::CallSite_klass();
   if (k != NULL) {
     compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
@@ -3287,14 +3283,12 @@
   java_lang_ClassLoader::compute_offsets();
   java_lang_Thread::compute_offsets();
   java_lang_ThreadGroup::compute_offsets();
-  if (EnableInvokeDynamic) {
-    java_lang_invoke_MethodHandle::compute_offsets();
-    java_lang_invoke_DirectMethodHandle::compute_offsets();
-    java_lang_invoke_MemberName::compute_offsets();
-    java_lang_invoke_LambdaForm::compute_offsets();
-    java_lang_invoke_MethodType::compute_offsets();
-    java_lang_invoke_CallSite::compute_offsets();
-  }
+  java_lang_invoke_MethodHandle::compute_offsets();
+  java_lang_invoke_DirectMethodHandle::compute_offsets();
+  java_lang_invoke_MemberName::compute_offsets();
+  java_lang_invoke_LambdaForm::compute_offsets();
+  java_lang_invoke_MethodType::compute_offsets();
+  java_lang_invoke_CallSite::compute_offsets();
   java_security_AccessControlContext::compute_offsets();
   // Initialize reflection classes. The layouts of these classes
   // changed with the new reflection implementation in JDK 1.4, and
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -971,7 +971,6 @@
   if (host_klass.not_null()) {
     // Create a new CLD for anonymous class, that uses the same class loader
     // as the host_klass
-    assert(EnableInvokeDynamic, "");
     guarantee(host_klass->class_loader() == class_loader(), "should be the same");
     loader_data = ClassLoaderData::anonymous_class_loader_data(class_loader(), CHECK_NULL);
     loader_data->record_dependency(host_klass(), CHECK_NULL);
@@ -996,7 +995,6 @@
 
 
   if (host_klass.not_null() && k.not_null()) {
-    assert(EnableInvokeDynamic, "");
     k->set_host_klass(host_klass());
     // If it's anonymous, initialize it now, since nobody else will.
 
@@ -1877,13 +1875,7 @@
   WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
   WKID jsr292_group_end   = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);
   initialize_wk_klasses_until(jsr292_group_start, scan, CHECK);
-  if (EnableInvokeDynamic) {
-    initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
-  } else {
-    // Skip the JSR 292 classes, if not enabled.
-    scan = WKID(jsr292_group_end + 1);
-  }
-
+  initialize_wk_klasses_through(jsr292_group_end, scan, CHECK);
   initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK);
 
   _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass);
@@ -2221,7 +2213,6 @@
                                                             Symbol* signature,
                                                             TRAPS) {
   methodHandle empty;
-  assert(EnableInvokeDynamic, "");
   assert(MethodHandles::is_signature_polymorphic(iid) &&
          MethodHandles::is_signature_polymorphic_intrinsic(iid) &&
          iid != vmIntrinsics::_invokeGeneric,
@@ -2295,7 +2286,6 @@
                                                           Handle *method_type_result,
                                                           TRAPS) {
   methodHandle empty;
-  assert(EnableInvokeDynamic, "");
   assert(!THREAD->is_Compiler_thread(), "");
   Handle method_type =
     SystemDictionary::find_method_handle_type(signature, accessing_klass, CHECK_(empty));
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -151,16 +151,16 @@
                                                                                                                          \
   /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */                                            \
   do_klass(DirectMethodHandle_klass,                    java_lang_invoke_DirectMethodHandle,       Opt                 ) \
-  do_klass(MethodHandle_klass,                          java_lang_invoke_MethodHandle,             Pre_JSR292          ) \
-  do_klass(MemberName_klass,                            java_lang_invoke_MemberName,               Pre_JSR292          ) \
-  do_klass(MethodHandleNatives_klass,                   java_lang_invoke_MethodHandleNatives,      Pre_JSR292          ) \
+  do_klass(MethodHandle_klass,                          java_lang_invoke_MethodHandle,             Pre                 ) \
+  do_klass(MemberName_klass,                            java_lang_invoke_MemberName,               Pre                 ) \
+  do_klass(MethodHandleNatives_klass,                   java_lang_invoke_MethodHandleNatives,      Pre                 ) \
   do_klass(LambdaForm_klass,                            java_lang_invoke_LambdaForm,               Opt                 ) \
-  do_klass(MethodType_klass,                            java_lang_invoke_MethodType,               Pre_JSR292          ) \
-  do_klass(BootstrapMethodError_klass,                  java_lang_BootstrapMethodError,            Pre_JSR292          ) \
-  do_klass(CallSite_klass,                              java_lang_invoke_CallSite,                 Pre_JSR292          ) \
-  do_klass(ConstantCallSite_klass,                      java_lang_invoke_ConstantCallSite,         Pre_JSR292          ) \
-  do_klass(MutableCallSite_klass,                       java_lang_invoke_MutableCallSite,          Pre_JSR292          ) \
-  do_klass(VolatileCallSite_klass,                      java_lang_invoke_VolatileCallSite,         Pre_JSR292          ) \
+  do_klass(MethodType_klass,                            java_lang_invoke_MethodType,               Pre                 ) \
+  do_klass(BootstrapMethodError_klass,                  java_lang_BootstrapMethodError,            Pre                 ) \
+  do_klass(CallSite_klass,                              java_lang_invoke_CallSite,                 Pre                 ) \
+  do_klass(ConstantCallSite_klass,                      java_lang_invoke_ConstantCallSite,         Pre                 ) \
+  do_klass(MutableCallSite_klass,                       java_lang_invoke_MutableCallSite,          Pre                 ) \
+  do_klass(VolatileCallSite_klass,                      java_lang_invoke_VolatileCallSite,         Pre                 ) \
   /* Note: MethodHandle must be first, and VolatileCallSite last in group */                                             \
                                                                                                                          \
   do_klass(StringBuffer_klass,                          java_lang_StringBuffer,                    Pre                 ) \
@@ -204,7 +204,6 @@
 
   enum InitOption {
     Pre,                        // preloaded; error if not present
-    Pre_JSR292,                 // preloaded if EnableInvokeDynamic
 
     // Order is significant.  Options before this point require resolve_or_fail.
     // Options after this point will use resolve_or_null instead.
@@ -385,7 +384,6 @@
   }
 
   static Klass* check_klass_Pre(       Klass* k) { return check_klass(k); }
-  static Klass* check_klass_Pre_JSR292(Klass* k) { return EnableInvokeDynamic ? check_klass(k) : k; }
   static Klass* check_klass_Opt(       Klass* k) { return k; }
   static Klass* check_klass_Opt_Only_JDK15(Klass* k) {
     assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only");
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -2361,12 +2361,9 @@
   // Get referenced class type
   VerificationType ref_class_type;
   if (opcode == Bytecodes::_invokedynamic) {
-    if (!EnableInvokeDynamic ||
-        _klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
+    if (_klass->major_version() < Verifier::INVOKEDYNAMIC_MAJOR_VERSION) {
       class_format_error(
-        (!EnableInvokeDynamic ?
-         "invokedynamic instructions not enabled in this JVM" :
-         "invokedynamic instructions not supported by this class file version"),
+        "invokedynamic instructions not supported by this class file version",
         _klass->external_name());
       return;
     }
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -507,25 +507,8 @@
 
 #ifdef ASSERT
   if (istate->_msg != initialize) {
-    // We have a problem here if we are running with a pre-hsx24 JDK (for example during bootstrap)
-    // because in that case, EnableInvokeDynamic is true by default but will be later switched off
-    // if java_lang_invoke_MethodHandle::compute_offsets() detects that the JDK only has the classes
-    // for the old JSR292 implementation.
-    // This leads to a situation where 'istate->_stack_limit' always accounts for
-    // methodOopDesc::extra_stack_entries() because it is computed in
-    // CppInterpreterGenerator::generate_compute_interpreter_state() which was generated while
-    // EnableInvokeDynamic was still true. On the other hand, istate->_method->max_stack() doesn't
-    // account for extra_stack_entries() anymore because at the time when it is called
-    // EnableInvokeDynamic was already set to false.
-    // So we have a second version of the assertion which handles the case where EnableInvokeDynamic was
-    // switched off because of the wrong classes.
-    if (EnableInvokeDynamic || FLAG_IS_CMDLINE(EnableInvokeDynamic)) {
-      assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
-    } else {
-      const int extra_stack_entries = Method::extra_stack_entries_for_jsr292;
-      assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + extra_stack_entries
-                                                                                               + 1), "bad stack limit");
-    }
+    assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
+  }
 #ifndef SHARK
     IA32_ONLY(assert(istate->_stack_limit == istate->_thread->last_Java_sp() + 1, "wrong"));
 #endif // !SHARK
@@ -2458,15 +2441,6 @@
 
       CASE(_invokedynamic): {
 
-        if (!EnableInvokeDynamic) {
-          // We should not encounter this bytecode if !EnableInvokeDynamic.
-          // The verifier will stop it.  However, if we get past the verifier,
-          // this will stop the thread in a reasonable way, without crashing the JVM.
-          CALL_VM(InterpreterRuntime::throw_IncompatibleClassChangeError(THREAD),
-                  handle_exception);
-          ShouldNotReachHere();
-        }
-
         u4 index = Bytes::get_native_u4(pc+1);
         ConstantPoolCacheEntry* cache = cp->constant_pool()->invokedynamic_cp_cache_entry_at(index);
 
@@ -2501,10 +2475,6 @@
 
       CASE(_invokehandle): {
 
-        if (!EnableInvokeDynamic) {
-          ShouldNotReachHere();
-        }
-
         u2 index = Bytes::get_native_u2(pc+1);
         ConstantPoolCacheEntry* cache = cp->entry_at(index);
 
--- a/hotspot/src/share/vm/interpreter/bytecodes.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -224,7 +224,7 @@
     _invokespecial        = 183, // 0xb7
     _invokestatic         = 184, // 0xb8
     _invokeinterface      = 185, // 0xb9
-    _invokedynamic        = 186, // 0xba     // if EnableInvokeDynamic
+    _invokedynamic        = 186, // 0xba
     _new                  = 187, // 0xbb
     _newarray             = 188, // 0xbc
     _anewarray            = 189, // 0xbd
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -769,7 +769,6 @@
 
 // First time execution:  Resolve symbols, create a permanent MethodType object.
 IRT_ENTRY(void, InterpreterRuntime::resolve_invokehandle(JavaThread* thread)) {
-  assert(EnableInvokeDynamic, "");
   const Bytecodes::Code bytecode = Bytecodes::_invokehandle;
 
   // resolve method
@@ -789,7 +788,6 @@
 
 // First time execution:  Resolve symbols, create a permanent CallSite object.
 IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
-  assert(EnableInvokeDynamic, "");
   const Bytecodes::Code bytecode = Bytecodes::_invokedynamic;
 
   //TO DO: consider passing BCI to Java.
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -270,7 +270,7 @@
     }
   }
 
-  if (checkpolymorphism && EnableInvokeDynamic && result_oop != NULL) {
+  if (checkpolymorphism && result_oop != NULL) {
     vmIntrinsics::ID iid = result_oop->intrinsic_id();
     if (MethodHandles::is_signature_polymorphic(iid)) {
       // Do not link directly to these.  The VM must produce a synthetic one using lookup_polymorphic_method.
@@ -345,8 +345,7 @@
                   vmIntrinsics::name_at(iid), klass->external_name(),
                   name->as_C_string(), full_signature->as_C_string());
   }
-  if (EnableInvokeDynamic &&
-      klass() == SystemDictionary::MethodHandle_klass() &&
+  if (klass() == SystemDictionary::MethodHandle_klass() &&
       iid != vmIntrinsics::_none) {
     if (MethodHandles::is_signature_polymorphic_intrinsic(iid)) {
       // Most of these do not need an up-call to Java to resolve, so can be done anywhere.
@@ -1543,7 +1542,6 @@
 
 
 void LinkResolver::resolve_invokehandle(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
-  assert(EnableInvokeDynamic, "");
   // This guy is reached from InterpreterRuntime::resolve_invokehandle.
   KlassHandle  resolved_klass;
   Symbol* method_name = NULL;
@@ -1575,8 +1573,6 @@
 
 
 void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
-  assert(EnableInvokeDynamic, "");
-
   //resolve_pool(<resolved_klass>, method_name, method_signature, current_klass, pool, index, CHECK);
   Symbol* method_name       = pool->name_ref_at(index);
   Symbol* method_signature  = pool->signature_ref_at(index);
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -1827,9 +1827,7 @@
 // We can't do this during classfile parsing, which is how the other indexes are
 // patched.  The other patches are applied early for some error checking
 // so only defer the pseudo_strings.
-void ConstantPool::patch_resolved_references(
-                                            GrowableArray<Handle>* cp_patches) {
-  assert(EnableInvokeDynamic, "");
+void ConstantPool::patch_resolved_references(GrowableArray<Handle>* cp_patches) {
   for (int index = 1; index < cp_patches->length(); index++) { // Index 0 is unused
     Handle patch = cp_patches->at(index);
     if (patch.not_null()) {
--- a/hotspot/src/share/vm/oops/constantPool.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -413,9 +413,9 @@
   // Version that can be used before string oop array is created.
   oop uncached_string_at(int which, TRAPS);
 
-  // A "pseudo-string" is an non-string oop that has found is way into
+  // A "pseudo-string" is an non-string oop that has found its way into
   // a String entry.
-  // Under EnableInvokeDynamic this can happen if the user patches a live
+  // This can happen if the user patches a live
   // object into a CONSTANT_String entry of an anonymous class.
   // Method oops internally created for method handles may also
   // use pseudo-strings to link themselves to related metaobjects.
@@ -441,7 +441,6 @@
   }
 
   void pseudo_string_at_put(int which, int obj_index, oop x) {
-    assert(EnableInvokeDynamic, "");
     assert(tag_at(which).is_string(), "Corrupted constant pool");
     unresolved_string_at_put(which, NULL); // indicates patched string
     string_at_put(which, obj_index, x);    // this works just fine
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -2398,7 +2398,6 @@
 
   // If this is an anonymous class, append a hash to make the name unique
   if (is_anonymous()) {
-    assert(EnableInvokeDynamic, "EnableInvokeDynamic was not set.");
     intptr_t hash = (java_mirror() != NULL) ? java_mirror()->identity_hash() : 0;
     sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash);
     hash_len = (int)strlen(hash_buf);
--- a/hotspot/src/share/vm/oops/klass.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/oops/klass.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -543,7 +543,6 @@
   if (oop_is_instance()) {
     InstanceKlass* ik = (InstanceKlass*) this;
     if (ik->is_anonymous()) {
-      assert(EnableInvokeDynamic, "");
       intptr_t hash = 0;
       if (ik->java_mirror() != NULL) {
         // java_mirror might not be created yet, return 0 as hash.
--- a/hotspot/src/share/vm/oops/method.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/oops/method.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -661,7 +661,7 @@
   // this operates only on invoke methods:
   // presize interpreter frames for extra interpreter stack entries, if needed
   // Account for the extra appendix argument for invokehandle/invokedynamic
-  static int extra_stack_entries() { return EnableInvokeDynamic ? extra_stack_entries_for_jsr292 : 0; }
+  static int extra_stack_entries() { return extra_stack_entries_for_jsr292; }
   static int extra_stack_words();  // = extra_stack_entries() * Interpreter::stackElementSize
 
   // RedefineClasses() support:
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -851,7 +851,7 @@
                "sanity check");
 
         int cpci = Bytes::get_native_u2(bcp+1);
-        bool is_invokedynamic = (EnableInvokeDynamic && code == Bytecodes::_invokedynamic);
+        bool is_invokedynamic = (code == Bytecodes::_invokedynamic);
         ConstantPoolCacheEntry* entry;
         if (is_invokedynamic) {
           cpci = Bytes::get_native_u4(bcp+1);
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -59,7 +59,7 @@
 // MethodHandles::generate_adapters
 //
 void MethodHandles::generate_adapters() {
-  if (!EnableInvokeDynamic || SystemDictionary::MethodHandle_klass() == NULL)  return;
+  if (SystemDictionary::MethodHandle_klass() == NULL)  return;
 
   assert(_adapter_code == NULL, "generate only once");
 
@@ -98,7 +98,7 @@
 
 void MethodHandles::set_enabled(bool z) {
   if (_enabled != z) {
-    guarantee(z && EnableInvokeDynamic, "can only enable once, and only if -XX:+EnableInvokeDynamic");
+    guarantee(z, "can only enable once");
     _enabled = z;
   }
 }
@@ -1374,11 +1374,6 @@
  * This one function is exported, used by NativeLookup.
  */
 JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) {
-  if (!EnableInvokeDynamic) {
-    warning("JSR 292 is disabled in this JVM.  Use -XX:+UnlockDiagnosticVMOptions -XX:+EnableInvokeDynamic to enable.");
-    return;  // bind nothing
-  }
-
   assert(!MethodHandles::enabled(), "must not be enabled");
   bool enable_MH = true;
 
--- a/hotspot/src/share/vm/prims/unsafe.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/prims/unsafe.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -1727,14 +1727,10 @@
     }
 
     // Unsafe.defineAnonymousClass
-    if (EnableInvokeDynamic) {
-      register_natives("1.7 define anonymous class method", env, unsafecls, anonk_methods, sizeof(anonk_methods)/sizeof(JNINativeMethod));
-    }
+    register_natives("1.7 define anonymous class method", env, unsafecls, anonk_methods, sizeof(anonk_methods)/sizeof(JNINativeMethod));
 
     // Unsafe.shouldBeInitialized
-    if (EnableInvokeDynamic) {
-      register_natives("1.7 LambdaForm support", env, unsafecls, lform_methods, sizeof(lform_methods)/sizeof(JNINativeMethod));
-    }
+    register_natives("1.7 LambdaForm support", env, unsafecls, lform_methods, sizeof(lform_methods)/sizeof(JNINativeMethod));
 
     // Fence methods
     register_natives("1.8 fence methods", env, unsafecls, fence_methods, sizeof(fence_methods)/sizeof(JNINativeMethod));
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3638,19 +3638,9 @@
   }
 #endif // PRODUCT
 
-  // JSR 292 is not supported before 1.7
-  if (!JDK_Version::is_gte_jdk17x_version()) {
-    if (EnableInvokeDynamic) {
-      if (!FLAG_IS_DEFAULT(EnableInvokeDynamic)) {
-        warning("JSR 292 is not supported before 1.7.  Disabling support.");
-      }
-      EnableInvokeDynamic = false;
-    }
-  }
-
-  if (EnableInvokeDynamic && ScavengeRootsInCode == 0) {
+  if (ScavengeRootsInCode == 0) {
     if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
-      warning("forcing ScavengeRootsInCode non-zero because EnableInvokeDynamic is true");
+      warning("forcing ScavengeRootsInCode non-zero");
     }
     ScavengeRootsInCode = 1;
   }
--- a/hotspot/src/share/vm/runtime/globals.hpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3784,10 +3784,6 @@
           NOT_LP64(LINUX_ONLY(2*G) NOT_LINUX(0)),                           \
           "Address to allocate shared memory region for class data")        \
                                                                             \
-  diagnostic(bool, EnableInvokeDynamic, true,                               \
-          "support JSR 292 (method handles, invokedynamic, "                \
-          "anonymous classes")                                              \
-                                                                            \
   diagnostic(bool, PrintMethodHandleStubs, false,                           \
           "Print generated stub code for method handles")                   \
                                                                             \
--- a/hotspot/src/share/vm/runtime/thread.cpp	Mon Apr 28 16:05:12 2014 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Tue Apr 29 08:08:44 2014 +0200
@@ -3602,9 +3602,7 @@
   // It is done after compilers are initialized, because otherwise compilations of
   // signature polymorphic MH intrinsics can be missed
   // (see SystemDictionary::find_method_handle_intrinsic).
-  if (EnableInvokeDynamic) {
-    initialize_jsr292_core_classes(CHECK_JNI_ERR);
-  }
+  initialize_jsr292_core_classes(CHECK_JNI_ERR);
 
 #if INCLUDE_MANAGEMENT
   Management::initialize(THREAD);