mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
7200776: Implement default methods in interfaces
Add generic type analysis and default method selection algorithms Reviewed-by: coleenp, acorn
This commit is contained in:
parent
ff6a68b801
commit
6563cda42b
27 changed files with 4301 additions and 203 deletions
|
@ -1143,16 +1143,21 @@ void ConstantPool::copy_cp_to_impl(constantPoolHandle from_cp, int start_i, int
|
|||
int from_oplen = operand_array_length(from_cp->operands());
|
||||
int old_oplen = operand_array_length(to_cp->operands());
|
||||
if (from_oplen != 0) {
|
||||
ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data();
|
||||
// append my operands to the target's operands array
|
||||
if (old_oplen == 0) {
|
||||
to_cp->set_operands(from_cp->operands()); // reuse; do not merge
|
||||
// Can't just reuse from_cp's operand list because of deallocation issues
|
||||
int len = from_cp->operands()->length();
|
||||
Array<u2>* new_ops = MetadataFactory::new_array<u2>(loader_data, len, CHECK);
|
||||
Copy::conjoint_memory_atomic(
|
||||
from_cp->operands()->adr_at(0), new_ops->adr_at(0), len * sizeof(u2));
|
||||
to_cp->set_operands(new_ops);
|
||||
} else {
|
||||
int old_len = to_cp->operands()->length();
|
||||
int from_len = from_cp->operands()->length();
|
||||
int old_off = old_oplen * sizeof(u2);
|
||||
int from_off = from_oplen * sizeof(u2);
|
||||
// Use the metaspace for the destination constant pool
|
||||
ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data();
|
||||
Array<u2>* new_operands = MetadataFactory::new_array<u2>(loader_data, old_len + from_len, CHECK);
|
||||
int fillp = 0, len = 0;
|
||||
// first part of dest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue