hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 46689 59f0972cf342
parent 46630 75aa3e39d02c
equal deleted inserted replaced
46687:9843d494abd5 46689:59f0972cf342
   173 }
   173 }
   174 
   174 
   175 void VM_RedefineClasses::doit() {
   175 void VM_RedefineClasses::doit() {
   176   Thread *thread = Thread::current();
   176   Thread *thread = Thread::current();
   177 
   177 
       
   178 #if INCLUDE_CDS
   178   if (UseSharedSpaces) {
   179   if (UseSharedSpaces) {
   179     // Sharing is enabled so we remap the shared readonly space to
   180     // Sharing is enabled so we remap the shared readonly space to
   180     // shared readwrite, private just in case we need to redefine
   181     // shared readwrite, private just in case we need to redefine
   181     // a shared class. We do the remap during the doit() phase of
   182     // a shared class. We do the remap during the doit() phase of
   182     // the safepoint to be safer.
   183     // the safepoint to be safer.
   184       log_info(redefine, class, load)("failed to remap shared readonly space to readwrite, private");
   185       log_info(redefine, class, load)("failed to remap shared readonly space to readwrite, private");
   185       _res = JVMTI_ERROR_INTERNAL;
   186       _res = JVMTI_ERROR_INTERNAL;
   186       return;
   187       return;
   187     }
   188     }
   188   }
   189   }
       
   190 #endif
   189 
   191 
   190   // Mark methods seen on stack and everywhere else so old methods are not
   192   // Mark methods seen on stack and everywhere else so old methods are not
   191   // cleaned up if they're on the stack.
   193   // cleaned up if they're on the stack.
   192   MetadataOnStackMark md_on_stack(true);
   194   MetadataOnStackMark md_on_stack(true);
   193   HandleMark hm(thread);   // make sure any handles created are deleted
   195   HandleMark hm(thread);   // make sure any handles created are deleted