mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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:
parent
094178fdba
commit
b89ae10df2
4 changed files with 197 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue