Commit 5020d83e authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [baseline] Fallback to handle references on heap compilation

Port 642a4673

Original Commit Message:

    If a GC happens between Code object allocation and Code finalization,
    we might have invalid embedded object references. We fallback and patch
    the refernces back to handles, then unbox the handles and relocate.

R=victorgomes@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I680cc33fa9d06d7a00cc52c142599bb5536a9b88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3060487Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76004}
parent 64556d13
......@@ -1925,6 +1925,12 @@ bool Assembler::IsNop(Instr instr, int type) {
return instr == (ORI | reg * B21 | reg * B16);
}
void Assembler::FixOnHeapReferences() {
// TODO(v8:11872) This function should never be called if Sparkplug on heap
// compilation is not supported.
UNREACHABLE();
}
void Assembler::GrowBuffer(int needed) {
DCHECK_EQ(buffer_start_, buffer_->start());
......
......@@ -196,6 +196,11 @@ class Assembler : public AssemblerBase {
GetCode(isolate, desc, kNoSafepointTable, kNoHandlerTable);
}
// This function is called when on-heap-compilation invariants are
// invalidated. For instance, when the assembler buffer grows or a GC happens
// between Code object allocation and Code object finalization.
void FixOnHeapReferences();
void MaybeEmitOutOfLineConstantPool() { EmitConstantPool(); }
inline void CheckTrampolinePoolQuick(int extra_space = 0) {
......
......@@ -750,6 +750,12 @@ void Assembler::dumy(int r1, int x2, int b2, int d2) {
#endif
}
void Assembler::FixOnHeapReferences() {
// TODO(v8:11872) This function should never be called if Sparkplug on heap
// compilation is not supported.
UNREACHABLE();
}
void Assembler::GrowBuffer(int needed) {
DCHECK_EQ(buffer_start_, buffer_->start());
......
......@@ -241,6 +241,11 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
GetCode(isolate, desc, kNoSafepointTable, kNoHandlerTable);
}
// This function is called when on-heap-compilation invariants are
// invalidated. For instance, when the assembler buffer grows or a GC happens
// between Code object allocation and Code object finalization.
void FixOnHeapReferences();
// Unused on this architecture.
void MaybeEmitOutOfLineConstantPool() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment