< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page

        

@@ -1621,10 +1621,15 @@
     // The merge can fail due to memory allocation failure or due
     // to robustness checks.
     return JVMTI_ERROR_INTERNAL;
   }
 
+ if (old_cp->has_dynamic_constant()) {
+   merge_cp->set_has_dynamic_constant();
+   scratch_cp->set_has_dynamic_constant();
+}
+
   log_info(redefine, class, constantpool)("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count);
 
   if (_index_map_count == 0) {
     // there is nothing to map between the new and merged constant pools
 

@@ -3244,10 +3249,14 @@
 
   // attach klass to new constant pool
   // reference to the cp holder is needed for copy_operands()
   smaller_cp->set_pool_holder(scratch_class);
 
+  if (scratch_cp->has_dynamic_constant()) {
+    smaller_cp->set_has_dynamic_constant();
+  }
+
   scratch_cp->copy_cp_to(1, scratch_cp_length - 1, smaller_cp, 1, THREAD);
   if (HAS_PENDING_EXCEPTION) {
     // Exception is handled in the caller
     loader_data->add_to_deallocate_list(smaller_cp());
     return;
< prev index next >