< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -330,33 +330,10 @@
         map_index(scratch_cp, scratch_i, *merge_cp_length_p);
       }
       (*merge_cp_length_p)++;
     } break;
 
-    // this is an indirect CP entry so it needs special handling
-    case JVM_CONSTANT_Value:
-    case JVM_CONSTANT_UnresolvedValue:
-    {
-      int name_i = scratch_cp->klass_name_index_at(scratch_i);
-      int new_name_i = find_or_append_indirect_entry(scratch_cp, name_i, merge_cp_p,
-                                                     merge_cp_length_p, THREAD);
-
-      if (new_name_i != name_i) {
-        log_trace(redefine, class, constantpool)
-          ("Value type entry@%d name_index change: %d to %d",
-           *merge_cp_length_p, name_i, new_name_i);
-      }
-
-      (*merge_cp_p)->temp_unresolved_value_type_at_put(*merge_cp_length_p, new_name_i);
-      if (scratch_i != *merge_cp_length_p) {
-        // The new entry in *merge_cp_p is at a different index than
-        // the new entry in scratch_cp so we need to map the index values.
-        map_index(scratch_cp, scratch_i, *merge_cp_length_p);
-      }
-      (*merge_cp_length_p)++;
-    } break;
-
     // these are direct CP entries so they can be directly appended,
     // but double and long take two constant pool entries
     case JVM_CONSTANT_Double:  // fall through
     case JVM_CONSTANT_Long:
     {

@@ -554,11 +531,10 @@
     } break;
 
     // At this stage, Class or UnresolvedClass could be in scratch_cp, but not
     // ClassIndex
     case JVM_CONSTANT_ClassIndex: // fall through
-    case JVM_CONSTANT_ValueIndex: // fall through
 
     // Invalid is used as the tag for the second constant pool entry
     // occupied by JVM_CONSTANT_Double or JVM_CONSTANT_Long. It should
     // not be seen by itself.
     case JVM_CONSTANT_Invalid: // fall through

@@ -567,13 +543,10 @@
     case JVM_CONSTANT_StringIndex: // fall through
 
     // At this stage JVM_CONSTANT_UnresolvedClassInError should not be here
     case JVM_CONSTANT_UnresolvedClassInError: // fall through
 
-    // At this stage JVM_CONSTANT_UnresolvedValueInError should not be here
-    case JVM_CONSTANT_UnresolvedValueInError: // fall through
-
     default:
     {
       // leave a breadcrumb
       jbyte bad_value = scratch_cp->tag_at(scratch_i).value();
       ShouldNotReachHere();

@@ -1017,18 +990,16 @@
 // class pair. Otherwise, returns false.
 bool VM_RedefineClasses::is_unresolved_class_mismatch(const constantPoolHandle& cp1,
        int index1, const constantPoolHandle& cp2, int index2) {
 
   jbyte t1 = cp1->tag_at(index1).value();
-  if (t1 != JVM_CONSTANT_Class && t1 != JVM_CONSTANT_UnresolvedClass &&
-      t1 != JVM_CONSTANT_Value && t1 != JVM_CONSTANT_UnresolvedValue) {
+  if (t1 != JVM_CONSTANT_Class && t1 != JVM_CONSTANT_UnresolvedClass) {
     return false;  // wrong entry type; not our special case
   }
 
   jbyte t2 = cp2->tag_at(index2).value();
-  if (t2 != JVM_CONSTANT_Class && t2 != JVM_CONSTANT_UnresolvedClass &&
-      t2 != JVM_CONSTANT_Value && t2 != JVM_CONSTANT_UnresolvedValue) {
+  if (t2 != JVM_CONSTANT_Class && t2 != JVM_CONSTANT_UnresolvedClass) {
     return false;  // wrong entry type; not our special case
   }
 
   if (t1 == t2) {
     return false;  // not a mismatch; not our special case

@@ -1308,11 +1279,10 @@
     // The old_cp is copied to *merge_cp_p; this means that any code
     // using old_cp does not have to change. This work looks like a
     // perfect fit for ConstantPool*::copy_cp_to(), but we need to
     // handle one special case:
     // - revert JVM_CONSTANT_Class to JVM_CONSTANT_UnresolvedClass
-    // - revert JVM_CONSTANT_Value to JVM_CONSTANT_UnresolvedValue
     // This will make verification happy.
 
     int old_i;  // index into old_cp
 
     // index zero (0) is not used in constantPools

@@ -1327,19 +1297,10 @@
         // JVM_CONSTANT_UnresolvedClass (klass_name_at() deals with transition)
         (*merge_cp_p)->temp_unresolved_klass_at_put(old_i,
           old_cp->klass_name_index_at(old_i));
         break;
 
-      case JVM_CONSTANT_Value:
-      case JVM_CONSTANT_UnresolvedValue:
-        // revert the copy to JVM_CONSTANT_UnresolvedValue
-        // May be resolving while calling this so do the same for
-        // JVM_CONSTANT_UnresolvedValue (klass_name_at() deals with transition)
-        (*merge_cp_p)->temp_unresolved_value_type_at_put(old_i,
-          old_cp->klass_name_index_at(old_i));
-        break;
-
       case JVM_CONSTANT_Double:
       case JVM_CONSTANT_Long:
         // just copy the entry to *merge_cp_p, but double and long take
         // two constant pool entries
         ConstantPool::copy_entry_to(old_cp, old_i, *merge_cp_p, old_i, CHECK_0);
< prev index next >