src/hotspot/share/prims/jvmtiRedefineClasses.cpp
changeset 57566 ad84ae073248
parent 55635 0fb70c9118ce
child 58358 d658f4379c63
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Mon Jul 29 11:14:06 2019 +0200
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Mon Jul 29 09:57:37 2019 -0400
@@ -1623,6 +1623,11 @@
     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) {
@@ -3246,6 +3251,10 @@
   // 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