8297763: Fix missing stub code expansion before align() in shared trampolines
Reviewed-by: fyang, luhenry
This commit is contained in:
parent
2300ed458d
commit
f9e0f1d5b3
@ -52,7 +52,14 @@ static bool emit_shared_trampolines(CodeBuffer* cb, CodeBuffer::SharedTrampoline
|
|||||||
bool p_succeeded = true;
|
bool p_succeeded = true;
|
||||||
auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
|
auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
|
||||||
masm.set_code_section(cb->stubs());
|
masm.set_code_section(cb->stubs());
|
||||||
masm.align(wordSize);
|
if (!is_aligned(masm.offset(), wordSize)) {
|
||||||
|
if (cb->stubs()->maybe_expand_to_ensure_remaining(NativeInstruction::instruction_size) && cb->blob() == NULL) {
|
||||||
|
ciEnv::current()->record_failure("CodeCache is full");
|
||||||
|
p_succeeded = false;
|
||||||
|
return p_succeeded;
|
||||||
|
}
|
||||||
|
masm.align(wordSize);
|
||||||
|
}
|
||||||
|
|
||||||
LinkedListIterator<int> it(offsets.head());
|
LinkedListIterator<int> it(offsets.head());
|
||||||
int offset = *it.next();
|
int offset = *it.next();
|
||||||
|
@ -53,7 +53,14 @@ static bool emit_shared_trampolines(CodeBuffer* cb, CodeBuffer::SharedTrampoline
|
|||||||
bool p_succeeded = true;
|
bool p_succeeded = true;
|
||||||
auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
|
auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
|
||||||
masm.set_code_section(cb->stubs());
|
masm.set_code_section(cb->stubs());
|
||||||
masm.align(wordSize, NativeCallTrampolineStub::data_offset);
|
if (!is_aligned(masm.offset() + NativeCallTrampolineStub::data_offset, wordSize)) {
|
||||||
|
if (cb->stubs()->maybe_expand_to_ensure_remaining(NativeInstruction::instruction_size) && cb->blob() == NULL) {
|
||||||
|
ciEnv::current()->record_failure("CodeCache is full");
|
||||||
|
p_succeeded = false;
|
||||||
|
return p_succeeded;
|
||||||
|
}
|
||||||
|
masm.align(wordSize, NativeCallTrampolineStub::data_offset);
|
||||||
|
}
|
||||||
|
|
||||||
LinkedListIterator<int> it(offsets.head());
|
LinkedListIterator<int> it(offsets.head());
|
||||||
int offset = *it.next();
|
int offset = *it.next();
|
||||||
|
@ -3128,6 +3128,9 @@ address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset,
|
|||||||
return NULL; // CodeBuffer::expand failed
|
return NULL; // CodeBuffer::expand failed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We are always 4-byte aligned here.
|
||||||
|
assert_alignment(pc());
|
||||||
|
|
||||||
// Create a trampoline stub relocation which relates this trampoline stub
|
// Create a trampoline stub relocation which relates this trampoline stub
|
||||||
// with the call instruction at insts_call_instruction_offset in the
|
// with the call instruction at insts_call_instruction_offset in the
|
||||||
// instructions code-section.
|
// instructions code-section.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user