Mercurial > hg > graal-jvmci-8
diff src/share/vm/oops/constantPool.cpp @ 6934:4735d2c84362
7200776: Implement default methods in interfaces
Summary: Add generic type analysis and default method selection algorithms
Reviewed-by: coleenp, acorn
author | kamg |
---|---|
date | Thu, 11 Oct 2012 12:25:42 -0400 |
parents | 6e5a59a8e4a7 |
children | 18fb7da42534 |
line wrap: on
line diff
--- a/src/share/vm/oops/constantPool.cpp Thu Nov 01 13:05:47 2012 +0100 +++ b/src/share/vm/oops/constantPool.cpp Thu Oct 11 12:25:42 2012 -0400 @@ -1143,16 +1143,21 @@ 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