src/hotspot/share/classfile/defaultMethods.cpp
changeset 49677 a1a7456dd8b9
parent 48463 474cec233fb2
child 51334 cc2c79d22508
equal deleted inserted replaced
49676:0bb0c2f27ca9 49677:a1a7456dd8b9
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   882     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
   882     InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
   883 
   883 
   884   if (new_methods->length() > 0) {
   884   if (new_methods->length() > 0) {
   885     ConstantPool* cp = bpool->create_constant_pool(CHECK);
   885     ConstantPool* cp = bpool->create_constant_pool(CHECK);
   886     if (cp != klass->constants()) {
   886     if (cp != klass->constants()) {
       
   887       // Copy resolved anonymous class into new constant pool.
       
   888       if (klass->is_anonymous()) {
       
   889         cp->klass_at_put(klass->this_class_index(), klass);
       
   890       }
   887       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
   891       klass->class_loader_data()->add_to_deallocate_list(klass->constants());
   888       klass->set_constants(cp);
   892       klass->set_constants(cp);
   889       cp->set_pool_holder(klass);
   893       cp->set_pool_holder(klass);
   890 
   894 
   891       for (int i = 0; i < new_methods->length(); ++i) {
   895       for (int i = 0; i < new_methods->length(); ++i) {