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