comparison src/share/vm/oops/klass.cpp @ 20375:6e0cb14ce59b

8046070: Class Data Sharing clean up and refactoring Summary: Cleaned up CDS to be more configurable, maintainable and extensible Reviewed-by: dholmes, coleenp, acorn, mchung
author iklam
date Thu, 21 Aug 2014 13:57:51 -0700
parents 2c6ef90f030a
children 47e3110c47e8 8cb56c8cb30d
comparison
equal deleted inserted replaced
20374:999824269b71 20375:6e0cb14ce59b
182 set_last_biased_lock_bulk_revocation_time(0); 182 set_last_biased_lock_bulk_revocation_time(0);
183 183
184 // The klass doesn't have any references at this point. 184 // The klass doesn't have any references at this point.
185 clear_modified_oops(); 185 clear_modified_oops();
186 clear_accumulated_modified_oops(); 186 clear_accumulated_modified_oops();
187 _shared_class_path_index = -1;
187 } 188 }
188 189
189 jint Klass::array_layout_helper(BasicType etype) { 190 jint Klass::array_layout_helper(BasicType etype) {
190 assert(etype >= T_BOOLEAN && etype <= T_OBJECT, "valid etype"); 191 assert(etype >= T_BOOLEAN && etype <= T_OBJECT, "valid etype");
191 // Note that T_ARRAY is not allowed here. 192 // Note that T_ARRAY is not allowed here.
506 507
507 // Null out class_loader_data because we don't share that yet. 508 // Null out class_loader_data because we don't share that yet.
508 set_class_loader_data(NULL); 509 set_class_loader_data(NULL);
509 } 510 }
510 511
511 void Klass::restore_unshareable_info(TRAPS) { 512 void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
512 TRACE_INIT_ID(this); 513 TRACE_INIT_ID(this);
513 // If an exception happened during CDS restore, some of these fields may already be 514 // If an exception happened during CDS restore, some of these fields may already be
514 // set. We leave the class on the CLD list, even if incomplete so that we don't 515 // set. We leave the class on the CLD list, even if incomplete so that we don't
515 // modify the CLD list outside a safepoint. 516 // modify the CLD list outside a safepoint.
516 if (class_loader_data() == NULL) { 517 if (class_loader_data() == NULL) {
517 ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data(); 518 // Restore class_loader_data
518 // Restore class_loader_data to the null class loader data
519 set_class_loader_data(loader_data); 519 set_class_loader_data(loader_data);
520 520
521 // Add to null class loader list first before creating the mirror 521 // Add to class loader list first before creating the mirror
522 // (same order as class file parsing) 522 // (same order as class file parsing)
523 loader_data->add_class(this); 523 loader_data->add_class(this);
524 } 524 }
525 525
526 // Recreate the class mirror. The protection_domain is always null for 526 // Recreate the class mirror.
527 // boot loader, for now.
528 // Only recreate it if not present. A previous attempt to restore may have 527 // Only recreate it if not present. A previous attempt to restore may have
529 // gotten an OOM later but keep the mirror if it was created. 528 // gotten an OOM later but keep the mirror if it was created.
530 if (java_mirror() == NULL) { 529 if (java_mirror() == NULL) {
531 java_lang_Class::create_mirror(this, Handle(NULL), CHECK); 530 java_lang_Class::create_mirror(this, protection_domain, CHECK);
532 } 531 }
533 } 532 }
534 533
535 Klass* Klass::array_klass_or_null(int rank) { 534 Klass* Klass::array_klass_or_null(int rank) {
536 EXCEPTION_MARK; 535 EXCEPTION_MARK;