< prev index next >

src/hotspot/share/classfile/defaultMethods.cpp

Print this page




 902   m->set_name_index(cp->utf8(name));
 903   m->set_signature_index(cp->utf8(sig));
 904   ResultTypeFinder rtf(sig);
 905   m->constMethod()->set_result_type(rtf.type());
 906   m->set_size_of_parameters(params);
 907   m->set_max_stack(max_stack);
 908   m->set_max_locals(params);
 909   m->constMethod()->set_stackmap_data(NULL);
 910   m->set_code(code_start);
 911 
 912   return m;
 913 }
 914 
 915 static void switchover_constant_pool(BytecodeConstantPool* bpool,
 916     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
 917 
 918   if (new_methods->length() > 0) {
 919     ConstantPool* cp = bpool->create_constant_pool(CHECK);
 920     if (cp != klass->constants()) {
 921       // Copy resolved anonymous class into new constant pool.
 922       if (klass->is_unsafe_anonymous()) {
 923         cp->klass_at_put(klass->this_class_index(), klass);
 924       }
 925       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
 926       klass->set_constants(cp);
 927       cp->set_pool_holder(klass);
 928 
 929       for (int i = 0; i < new_methods->length(); ++i) {
 930         new_methods->at(i)->set_constants(cp);
 931       }
 932       for (int i = 0; i < klass->methods()->length(); ++i) {
 933         Method* mo = klass->methods()->at(i);
 934         mo->set_constants(cp);
 935       }
 936     }
 937   }
 938 }
 939 
 940 // Create default_methods list for the current class.
 941 // With the VM only processing erased signatures, the VM only
 942 // creates an overpass in a conflict case or a case with no candidates.




 902   m->set_name_index(cp->utf8(name));
 903   m->set_signature_index(cp->utf8(sig));
 904   ResultTypeFinder rtf(sig);
 905   m->constMethod()->set_result_type(rtf.type());
 906   m->set_size_of_parameters(params);
 907   m->set_max_stack(max_stack);
 908   m->set_max_locals(params);
 909   m->constMethod()->set_stackmap_data(NULL);
 910   m->set_code(code_start);
 911 
 912   return m;
 913 }
 914 
 915 static void switchover_constant_pool(BytecodeConstantPool* bpool,
 916     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
 917 
 918   if (new_methods->length() > 0) {
 919     ConstantPool* cp = bpool->create_constant_pool(CHECK);
 920     if (cp != klass->constants()) {
 921       // Copy resolved anonymous class into new constant pool.
 922       if (klass->is_unsafe_anonymous() || klass->is_hidden()) {
 923         cp->klass_at_put(klass->this_class_index(), klass);
 924       }
 925       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
 926       klass->set_constants(cp);
 927       cp->set_pool_holder(klass);
 928 
 929       for (int i = 0; i < new_methods->length(); ++i) {
 930         new_methods->at(i)->set_constants(cp);
 931       }
 932       for (int i = 0; i < klass->methods()->length(); ++i) {
 933         Method* mo = klass->methods()->at(i);
 934         mo->set_constants(cp);
 935       }
 936     }
 937   }
 938 }
 939 
 940 // Create default_methods list for the current class.
 941 // With the VM only processing erased signatures, the VM only
 942 // creates an overpass in a conflict case or a case with no candidates.


< prev index next >