< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page

 330       ("redefine_single_class: phase1=" JULONG_FORMAT "  phase2=" JULONG_FORMAT,
 331        (julong)_timer_rsc_phase1.milliseconds(), (julong)_timer_rsc_phase2.milliseconds());
 332   }
 333 }
 334 
 335 bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
 336   // classes for primitives cannot be redefined
 337   if (java_lang_Class::is_primitive(klass_mirror)) {
 338     return false;
 339   }
 340   Klass* k = java_lang_Class::as_Klass(klass_mirror);
 341   // classes for arrays cannot be redefined
 342   if (k == nullptr || !k->is_instance_klass()) {
 343     return false;
 344   }
 345 
 346   // Cannot redefine or retransform a hidden class.
 347   if (InstanceKlass::cast(k)->is_hidden()) {
 348     return false;
 349   }



 350   if (InstanceKlass::cast(k) == vmClasses::Continuation_klass()) {
 351     // Don't redefine Continuation class. See 8302779.
 352     return false;
 353   }
 354   return true;
 355 }
 356 
 357 // Append the current entry at scratch_i in scratch_cp to *merge_cp_p
 358 // where the end of *merge_cp_p is specified by *merge_cp_length_p. For
 359 // direct CP entries, there is just the current entry to append. For
 360 // indirect and double-indirect CP entries, there are zero or more
 361 // referenced CP entries along with the current entry to append.
 362 // Indirect and double-indirect CP entries are handled by recursive
 363 // calls to append_entry() as needed. The referenced CP entries are
 364 // always appended to *merge_cp_p before the referee CP entry. These
 365 // referenced CP entries may already exist in *merge_cp_p in which case
 366 // there is nothing extra to append and only the current entry is
 367 // appended.
 368 void VM_RedefineClasses::append_entry(const constantPoolHandle& scratch_cp,
 369        int scratch_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p) {

 330       ("redefine_single_class: phase1=" JULONG_FORMAT "  phase2=" JULONG_FORMAT,
 331        (julong)_timer_rsc_phase1.milliseconds(), (julong)_timer_rsc_phase2.milliseconds());
 332   }
 333 }
 334 
 335 bool VM_RedefineClasses::is_modifiable_class(oop klass_mirror) {
 336   // classes for primitives cannot be redefined
 337   if (java_lang_Class::is_primitive(klass_mirror)) {
 338     return false;
 339   }
 340   Klass* k = java_lang_Class::as_Klass(klass_mirror);
 341   // classes for arrays cannot be redefined
 342   if (k == nullptr || !k->is_instance_klass()) {
 343     return false;
 344   }
 345 
 346   // Cannot redefine or retransform a hidden class.
 347   if (InstanceKlass::cast(k)->is_hidden()) {
 348     return false;
 349   }
 350   if (InstanceKlass::cast(k) == vmClasses::Object_klass()) {
 351     return false;
 352   }
 353   if (InstanceKlass::cast(k) == vmClasses::Continuation_klass()) {
 354     // Don't redefine Continuation class. See 8302779.
 355     return false;
 356   }
 357   return true;
 358 }
 359 
 360 // Append the current entry at scratch_i in scratch_cp to *merge_cp_p
 361 // where the end of *merge_cp_p is specified by *merge_cp_length_p. For
 362 // direct CP entries, there is just the current entry to append. For
 363 // indirect and double-indirect CP entries, there are zero or more
 364 // referenced CP entries along with the current entry to append.
 365 // Indirect and double-indirect CP entries are handled by recursive
 366 // calls to append_entry() as needed. The referenced CP entries are
 367 // always appended to *merge_cp_p before the referee CP entry. These
 368 // referenced CP entries may already exist in *merge_cp_p in which case
 369 // there is nothing extra to append and only the current entry is
 370 // appended.
 371 void VM_RedefineClasses::append_entry(const constantPoolHandle& scratch_cp,
 372        int scratch_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p) {
< prev index next >