[wasm][liftoff] Implement write barrier for global.set on arm platforms
R=ulan@chromium.org, thibaudm@chromium.org Bug: v8:7581 Change-Id: Ie41f09339a1f5c022bd74fb3140ca66f40cc4476 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2412185 Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org> Commit-Queue: Andreas Haas <ahaas@chromium.org> Cr-Commit-Position: refs/heads/master@{#69974}
This commit is contained in:
parent
433b4984e0
commit
8414fd56ed
@ -5,6 +5,7 @@
|
||||
#ifndef V8_WASM_BASELINE_ARM_LIFTOFF_ASSEMBLER_ARM_H_
|
||||
#define V8_WASM_BASELINE_ARM_LIFTOFF_ASSEMBLER_ARM_H_
|
||||
|
||||
#include "src/heap/memory-chunk.h"
|
||||
#include "src/wasm/baseline/liftoff-assembler.h"
|
||||
#include "src/wasm/baseline/liftoff-register.h"
|
||||
|
||||
@ -663,7 +664,23 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
int32_t offset_imm,
|
||||
LiftoffRegister src,
|
||||
LiftoffRegList pinned) {
|
||||
bailout(kRefTypes, "GlobalSet");
|
||||
STATIC_ASSERT(kTaggedSize == kInt32Size);
|
||||
// Store the value.
|
||||
MemOperand dst_op(dst_addr, offset_imm);
|
||||
str(src.gp(), dst_op);
|
||||
// The write barrier.
|
||||
Label write_barrier;
|
||||
Label exit;
|
||||
CheckPageFlag(dst_addr, MemoryChunk::kPointersFromHereAreInterestingMask, ne,
|
||||
&write_barrier);
|
||||
b(&exit);
|
||||
bind(&write_barrier);
|
||||
JumpIfSmi(src.gp(), &exit);
|
||||
CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, eq,
|
||||
&exit);
|
||||
CallRecordWriteStub(dst_addr, Operand(offset_imm), EMIT_REMEMBERED_SET,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef V8_WASM_BASELINE_ARM64_LIFTOFF_ASSEMBLER_ARM64_H_
|
||||
#define V8_WASM_BASELINE_ARM64_LIFTOFF_ASSEMBLER_ARM64_H_
|
||||
|
||||
#include "src/heap/memory-chunk.h"
|
||||
#include "src/wasm/baseline/liftoff-assembler.h"
|
||||
|
||||
namespace v8 {
|
||||
@ -342,7 +343,25 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
int32_t offset_imm,
|
||||
LiftoffRegister src,
|
||||
LiftoffRegList pinned) {
|
||||
bailout(kRefTypes, "GlobalSet");
|
||||
// Store the value.
|
||||
MemOperand dst_op(dst_addr, offset_imm);
|
||||
StoreTaggedField(src.gp(), dst_op);
|
||||
// The write barrier.
|
||||
Label write_barrier;
|
||||
Label exit;
|
||||
CheckPageFlag(dst_addr, MemoryChunk::kPointersFromHereAreInterestingMask, eq,
|
||||
&write_barrier);
|
||||
b(&exit);
|
||||
bind(&write_barrier);
|
||||
JumpIfSmi(src.gp(), &exit);
|
||||
if (COMPRESS_POINTERS_BOOL) {
|
||||
DecompressTaggedPointer(src.gp(), src.gp());
|
||||
}
|
||||
CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, ne,
|
||||
&exit);
|
||||
CallRecordWriteStub(dst_addr, Operand(offset_imm), EMIT_REMEMBERED_SET,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
|
||||
|
Loading…
Reference in New Issue
Block a user