< prev index next >

src/hotspot/share/classfile/defaultMethods.cpp

Print this page




 845   m->set_name_index(cp->utf8(name));
 846   m->set_signature_index(cp->utf8(sig));
 847   ResultTypeFinder rtf(sig);
 848   m->constMethod()->set_result_type(rtf.type());
 849   m->set_size_of_parameters(params);
 850   m->set_max_stack(max_stack);
 851   m->set_max_locals(params);
 852   m->constMethod()->set_stackmap_data(NULL);
 853   m->set_code(code_start);
 854 
 855   return m;
 856 }
 857 
 858 static void switchover_constant_pool(BytecodeConstantPool* bpool,
 859     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
 860 
 861   if (new_methods->length() > 0) {
 862     ConstantPool* cp = bpool->create_constant_pool(CHECK);
 863     if (cp != klass->constants()) {
 864       // Copy resolved anonymous class into new constant pool.
 865       if (klass->is_unsafe_anonymous()) {
 866         cp->klass_at_put(klass->this_class_index(), klass);
 867       }
 868       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
 869       klass->set_constants(cp);
 870       cp->set_pool_holder(klass);
 871 
 872       for (int i = 0; i < new_methods->length(); ++i) {
 873         new_methods->at(i)->set_constants(cp);
 874       }
 875       for (int i = 0; i < klass->methods()->length(); ++i) {
 876         Method* mo = klass->methods()->at(i);
 877         mo->set_constants(cp);
 878       }
 879     }
 880   }
 881 }
 882 
 883 // Create default_methods list for the current class.
 884 // With the VM only processing erased signatures, the VM only
 885 // creates an overpass in a conflict case or a case with no candidates.




 845   m->set_name_index(cp->utf8(name));
 846   m->set_signature_index(cp->utf8(sig));
 847   ResultTypeFinder rtf(sig);
 848   m->constMethod()->set_result_type(rtf.type());
 849   m->set_size_of_parameters(params);
 850   m->set_max_stack(max_stack);
 851   m->set_max_locals(params);
 852   m->constMethod()->set_stackmap_data(NULL);
 853   m->set_code(code_start);
 854 
 855   return m;
 856 }
 857 
 858 static void switchover_constant_pool(BytecodeConstantPool* bpool,
 859     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
 860 
 861   if (new_methods->length() > 0) {
 862     ConstantPool* cp = bpool->create_constant_pool(CHECK);
 863     if (cp != klass->constants()) {
 864       // Copy resolved anonymous class into new constant pool.
 865       if (klass->is_unsafe_anonymous() || klass->is_hidden()) {
 866         cp->klass_at_put(klass->this_class_index(), klass);
 867       }
 868       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
 869       klass->set_constants(cp);
 870       cp->set_pool_holder(klass);
 871 
 872       for (int i = 0; i < new_methods->length(); ++i) {
 873         new_methods->at(i)->set_constants(cp);
 874       }
 875       for (int i = 0; i < klass->methods()->length(); ++i) {
 876         Method* mo = klass->methods()->at(i);
 877         mo->set_constants(cp);
 878       }
 879     }
 880   }
 881 }
 882 
 883 // Create default_methods list for the current class.
 884 // With the VM only processing erased signatures, the VM only
 885 // creates an overpass in a conflict case or a case with no candidates.


< prev index next >