提交 8cd715d7 编写于 作者: N never

7103380: assertion failure with -XX:+PrintNativeNMethods

Reviewed-by: kvn, iveresov
上级 71e3118c
...@@ -632,7 +632,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) { ...@@ -632,7 +632,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
// CodeBuffer gets the final layout (consts, insts, stubs in order of // CodeBuffer gets the final layout (consts, insts, stubs in order of
// ascending address). // ascending address).
void CodeBuffer::relocate_code_to(CodeBuffer* dest) const { void CodeBuffer::relocate_code_to(CodeBuffer* dest) const {
DEBUG_ONLY(address dest_end = dest->_total_start + dest->_total_size); address dest_end = dest->_total_start + dest->_total_size;
address dest_filled = NULL;
for (int n = (int) SECT_FIRST; n < (int) SECT_LIMIT; n++) { for (int n = (int) SECT_FIRST; n < (int) SECT_LIMIT; n++) {
// pull code out of each section // pull code out of each section
const CodeSection* cs = code_section(n); const CodeSection* cs = code_section(n);
...@@ -654,6 +655,8 @@ void CodeBuffer::relocate_code_to(CodeBuffer* dest) const { ...@@ -654,6 +655,8 @@ void CodeBuffer::relocate_code_to(CodeBuffer* dest) const {
Copy::fill_to_bytes(dest_cs->end(), dest_cs->remaining(), Copy::fill_to_bytes(dest_cs->end(), dest_cs->remaining(),
Assembler::code_fill_byte()); Assembler::code_fill_byte());
} }
// Keep track of the highest filled address
dest_filled = MAX2(dest_filled, dest_cs->end() + dest_cs->remaining());
assert(cs->locs_start() != (relocInfo*)badAddress, assert(cs->locs_start() != (relocInfo*)badAddress,
"this section carries no reloc storage, but reloc was attempted"); "this section carries no reloc storage, but reloc was attempted");
...@@ -668,6 +671,14 @@ void CodeBuffer::relocate_code_to(CodeBuffer* dest) const { ...@@ -668,6 +671,14 @@ void CodeBuffer::relocate_code_to(CodeBuffer* dest) const {
} }
} }
} }
if (dest->blob() == NULL) {
// Destination is a final resting place, not just another buffer.
// Normalize uninitialized bytes in the final padding.
Copy::fill_to_bytes(dest_filled, dest_end - dest_filled,
Assembler::code_fill_byte());
}
} }
csize_t CodeBuffer::figure_expanded_capacities(CodeSection* which_cs, csize_t CodeBuffer::figure_expanded_capacities(CodeSection* which_cs,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册