< prev index next >

src/hotspot/share/classfile/defaultMethods.cpp

Print this page




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




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


< prev index next >