8200261: Regression with JVM anonymous class

Restore resolved anonymous class when creating a new constantpool because of overpass methods

Reviewed-by: coleenp, lfoltan
This commit is contained in:
Harold Seigel 2018-04-05 13:19:25 -04:00
parent 094178fdba
commit b89ae10df2
4 changed files with 197 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -884,6 +884,10 @@ static void switchover_constant_pool(BytecodeConstantPool* bpool,
if (new_methods->length() > 0) {
ConstantPool* cp = bpool->create_constant_pool(CHECK);
if (cp != klass->constants()) {
// Copy resolved anonymous class into new constant pool.
if (klass->is_anonymous()) {
cp->klass_at_put(klass->this_class_index(), klass);
}
klass->class_loader_data()->add_to_deallocate_list(klass->constants());
klass->set_constants(cp);
cp->set_pool_holder(klass);