Commit 851854c4 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][mips64][heap] Remove write barrier builtin for incremental marking

Port commit e50d19cb

Bug: v8:11708
Change-Id: Ia9a8cb9d8cd9e768fc056bc5555959e0aaeb3694
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3692435Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#80974}
parent 72c20687
...@@ -813,7 +813,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm, ...@@ -813,7 +813,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
__ St_d(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset)); __ St_d(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset));
__ RecordWriteField(closure, JSFunction::kCodeOffset, optimized_code, __ RecordWriteField(closure, JSFunction::kCodeOffset, optimized_code,
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore, kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore,
RememberedSetAction::kOmit, SmiCheck::kOmit); SmiCheck::kOmit);
} }
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1, static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1,
......
...@@ -818,7 +818,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm, ...@@ -818,7 +818,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
__ mov(scratch1, optimized_code); // Write barrier clobbers scratch1 below. __ mov(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2, __ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore, kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore,
RememberedSetAction::kOmit, SmiCheck::kOmit); SmiCheck::kOmit);
} }
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1, static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1,
......
...@@ -130,7 +130,6 @@ void TurboAssembler::PushStandardFrame(Register function_reg) { ...@@ -130,7 +130,6 @@ void TurboAssembler::PushStandardFrame(Register function_reg) {
void MacroAssembler::RecordWriteField(Register object, int offset, void MacroAssembler::RecordWriteField(Register object, int offset,
Register value, RAStatus ra_status, Register value, RAStatus ra_status,
SaveFPRegsMode save_fp, SaveFPRegsMode save_fp,
RememberedSetAction remembered_set_action,
SmiCheck smi_check) { SmiCheck smi_check) {
ASM_CODE_COMMENT(this); ASM_CODE_COMMENT(this);
// First, check if a write barrier is even needed. The tests below // First, check if a write barrier is even needed. The tests below
...@@ -159,7 +158,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset, ...@@ -159,7 +158,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
} }
RecordWrite(object, Operand(offset - kHeapObjectTag), value, ra_status, RecordWrite(object, Operand(offset - kHeapObjectTag), value, ra_status,
save_fp, remembered_set_action, SmiCheck::kOmit); save_fp, SmiCheck::kOmit);
bind(&done); bind(&done);
} }
...@@ -192,9 +191,10 @@ void TurboAssembler::CallEphemeronKeyBarrier(Register object, Operand offset, ...@@ -192,9 +191,10 @@ void TurboAssembler::CallEphemeronKeyBarrier(Register object, Operand offset,
MaybeRestoreRegisters(registers); MaybeRestoreRegisters(registers);
} }
void TurboAssembler::CallRecordWriteStubSaveRegisters( void TurboAssembler::CallRecordWriteStubSaveRegisters(Register object,
Register object, Operand offset, RememberedSetAction remembered_set_action, Operand offset,
SaveFPRegsMode fp_mode, StubCallMode mode) { SaveFPRegsMode fp_mode,
StubCallMode mode) {
ASM_CODE_COMMENT(this); ASM_CODE_COMMENT(this);
RegList registers = WriteBarrierDescriptor::ComputeSavedRegisters(object); RegList registers = WriteBarrierDescriptor::ComputeSavedRegisters(object);
MaybeSaveRegisters(registers); MaybeSaveRegisters(registers);
...@@ -205,30 +205,27 @@ void TurboAssembler::CallRecordWriteStubSaveRegisters( ...@@ -205,30 +205,27 @@ void TurboAssembler::CallRecordWriteStubSaveRegisters(
MoveObjectAndSlot(object_parameter, slot_address_parameter, object, offset); MoveObjectAndSlot(object_parameter, slot_address_parameter, object, offset);
CallRecordWriteStub(object_parameter, slot_address_parameter, CallRecordWriteStub(object_parameter, slot_address_parameter, fp_mode, mode);
remembered_set_action, fp_mode, mode);
MaybeRestoreRegisters(registers); MaybeRestoreRegisters(registers);
} }
void TurboAssembler::CallRecordWriteStub( void TurboAssembler::CallRecordWriteStub(Register object, Register slot_address,
Register object, Register slot_address, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode, StubCallMode mode) {
StubCallMode mode) {
// Use CallRecordWriteStubSaveRegisters if the object and slot registers // Use CallRecordWriteStubSaveRegisters if the object and slot registers
// need to be caller saved. // need to be caller saved.
DCHECK_EQ(WriteBarrierDescriptor::ObjectRegister(), object); DCHECK_EQ(WriteBarrierDescriptor::ObjectRegister(), object);
DCHECK_EQ(WriteBarrierDescriptor::SlotAddressRegister(), slot_address); DCHECK_EQ(WriteBarrierDescriptor::SlotAddressRegister(), slot_address);
#if V8_ENABLE_WEBASSEMBLY #if V8_ENABLE_WEBASSEMBLY
if (mode == StubCallMode::kCallWasmRuntimeStub) { if (mode == StubCallMode::kCallWasmRuntimeStub) {
auto wasm_target = auto wasm_target = wasm::WasmCode::GetRecordWriteStub(fp_mode);
wasm::WasmCode::GetRecordWriteStub(remembered_set_action, fp_mode);
Call(wasm_target, RelocInfo::WASM_STUB_CALL); Call(wasm_target, RelocInfo::WASM_STUB_CALL);
#else #else
if (false) { if (false) {
#endif #endif
} else { } else {
auto builtin = Builtins::GetRecordWriteStub(remembered_set_action, fp_mode); auto builtin = Builtins::GetRecordWriteStub(fp_mode);
if (options().inline_offheap_trampolines) { if (options().inline_offheap_trampolines) {
// Inline the trampoline. // Inline the trampoline.
RecordCommentForOffHeapTrampoline(builtin); RecordCommentForOffHeapTrampoline(builtin);
...@@ -285,9 +282,7 @@ void TurboAssembler::MoveObjectAndSlot(Register dst_object, Register dst_slot, ...@@ -285,9 +282,7 @@ void TurboAssembler::MoveObjectAndSlot(Register dst_object, Register dst_slot,
// tag is shifted away. // tag is shifted away.
void MacroAssembler::RecordWrite(Register object, Operand offset, void MacroAssembler::RecordWrite(Register object, Operand offset,
Register value, RAStatus ra_status, Register value, RAStatus ra_status,
SaveFPRegsMode fp_mode, SaveFPRegsMode fp_mode, SmiCheck smi_check) {
RememberedSetAction remembered_set_action,
SmiCheck smi_check) {
DCHECK(!AreAliased(object, value)); DCHECK(!AreAliased(object, value));
if (FLAG_debug_code) { if (FLAG_debug_code) {
...@@ -299,9 +294,7 @@ void MacroAssembler::RecordWrite(Register object, Operand offset, ...@@ -299,9 +294,7 @@ void MacroAssembler::RecordWrite(Register object, Operand offset,
Operand(value)); Operand(value));
} }
if ((remembered_set_action == RememberedSetAction::kOmit && if (FLAG_disable_write_barriers) {
!FLAG_incremental_marking) ||
FLAG_disable_write_barriers) {
return; return;
} }
...@@ -329,7 +322,7 @@ void MacroAssembler::RecordWrite(Register object, Operand offset, ...@@ -329,7 +322,7 @@ void MacroAssembler::RecordWrite(Register object, Operand offset,
DCHECK(!AreAliased(object, slot_address, value)); DCHECK(!AreAliased(object, slot_address, value));
DCHECK(offset.IsImmediate()); DCHECK(offset.IsImmediate());
Add_d(slot_address, object, offset); Add_d(slot_address, object, offset);
CallRecordWriteStub(object, slot_address, remembered_set_action, fp_mode); CallRecordWriteStub(object, slot_address, fp_mode);
if (ra_status == kRAHasNotBeenSaved) { if (ra_status == kRAHasNotBeenSaved) {
Pop(ra); Pop(ra);
} }
......
...@@ -285,12 +285,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -285,12 +285,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
SaveFPRegsMode fp_mode); SaveFPRegsMode fp_mode);
void CallRecordWriteStubSaveRegisters( void CallRecordWriteStubSaveRegisters(
Register object, Operand offset, Register object, Operand offset, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode,
StubCallMode mode = StubCallMode::kCallBuiltinPointer); StubCallMode mode = StubCallMode::kCallBuiltinPointer);
void CallRecordWriteStub( void CallRecordWriteStub(
Register object, Register slot_address, Register object, Register slot_address, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode,
StubCallMode mode = StubCallMode::kCallBuiltinPointer); StubCallMode mode = StubCallMode::kCallBuiltinPointer);
// For a given |object| and |offset|: // For a given |object| and |offset|:
...@@ -856,19 +854,15 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { ...@@ -856,19 +854,15 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
// stored. // stored.
// The offset is the offset from the start of the object, not the offset from // The offset is the offset from the start of the object, not the offset from
// the tagged HeapObject pointer. For use with FieldOperand(reg, off). // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
void RecordWriteField( void RecordWriteField(Register object, int offset, Register value,
Register object, int offset, Register value, RAStatus ra_status, RAStatus ra_status, SaveFPRegsMode save_fp,
SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline);
RememberedSetAction remembered_set_action = RememberedSetAction::kEmit,
SmiCheck smi_check = SmiCheck::kInline);
// For a given |object| notify the garbage collector that the slot at |offset| // For a given |object| notify the garbage collector that the slot at |offset|
// has been written. |value| is the object being stored. // has been written. |value| is the object being stored.
void RecordWrite( void RecordWrite(Register object, Operand offset, Register value,
Register object, Operand offset, Register value, RAStatus ra_status, RAStatus ra_status, SaveFPRegsMode save_fp,
SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline);
RememberedSetAction remembered_set_action = RememberedSetAction::kEmit,
SmiCheck smi_check = SmiCheck::kInline);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Pseudo-instructions. // Pseudo-instructions.
......
...@@ -136,7 +136,6 @@ void MacroAssembler::RecordWriteField(Register object, int offset, ...@@ -136,7 +136,6 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
Register value, Register dst, Register value, Register dst,
RAStatus ra_status, RAStatus ra_status,
SaveFPRegsMode save_fp, SaveFPRegsMode save_fp,
RememberedSetAction remembered_set_action,
SmiCheck smi_check) { SmiCheck smi_check) {
ASM_CODE_COMMENT(this); ASM_CODE_COMMENT(this);
DCHECK(!AreAliased(value, dst, t8, object)); DCHECK(!AreAliased(value, dst, t8, object));
...@@ -163,8 +162,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset, ...@@ -163,8 +162,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
bind(&ok); bind(&ok);
} }
RecordWrite(object, dst, value, ra_status, save_fp, remembered_set_action, RecordWrite(object, dst, value, ra_status, save_fp, SmiCheck::kOmit);
SmiCheck::kOmit);
bind(&done); bind(&done);
...@@ -210,10 +208,10 @@ void TurboAssembler::CallEphemeronKeyBarrier(Register object, ...@@ -210,10 +208,10 @@ void TurboAssembler::CallEphemeronKeyBarrier(Register object,
MaybeRestoreRegisters(registers); MaybeRestoreRegisters(registers);
} }
void TurboAssembler::CallRecordWriteStubSaveRegisters( void TurboAssembler::CallRecordWriteStubSaveRegisters(Register object,
Register object, Register slot_address, Register slot_address,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode, SaveFPRegsMode fp_mode,
StubCallMode mode) { StubCallMode mode) {
DCHECK(!AreAliased(object, slot_address)); DCHECK(!AreAliased(object, slot_address));
RegList registers = RegList registers =
WriteBarrierDescriptor::ComputeSavedRegisters(object, slot_address); WriteBarrierDescriptor::ComputeSavedRegisters(object, slot_address);
...@@ -228,30 +226,27 @@ void TurboAssembler::CallRecordWriteStubSaveRegisters( ...@@ -228,30 +226,27 @@ void TurboAssembler::CallRecordWriteStubSaveRegisters(
Pop(slot_address_parameter); Pop(slot_address_parameter);
Pop(object_parameter); Pop(object_parameter);
CallRecordWriteStub(object_parameter, slot_address_parameter, CallRecordWriteStub(object_parameter, slot_address_parameter, fp_mode, mode);
remembered_set_action, fp_mode, mode);
MaybeRestoreRegisters(registers); MaybeRestoreRegisters(registers);
} }
void TurboAssembler::CallRecordWriteStub( void TurboAssembler::CallRecordWriteStub(Register object, Register slot_address,
Register object, Register slot_address, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode, StubCallMode mode) {
StubCallMode mode) {
// Use CallRecordWriteStubSaveRegisters if the object and slot registers // Use CallRecordWriteStubSaveRegisters if the object and slot registers
// need to be caller saved. // need to be caller saved.
DCHECK_EQ(WriteBarrierDescriptor::ObjectRegister(), object); DCHECK_EQ(WriteBarrierDescriptor::ObjectRegister(), object);
DCHECK_EQ(WriteBarrierDescriptor::SlotAddressRegister(), slot_address); DCHECK_EQ(WriteBarrierDescriptor::SlotAddressRegister(), slot_address);
#if V8_ENABLE_WEBASSEMBLY #if V8_ENABLE_WEBASSEMBLY
if (mode == StubCallMode::kCallWasmRuntimeStub) { if (mode == StubCallMode::kCallWasmRuntimeStub) {
auto wasm_target = auto wasm_target = wasm::WasmCode::GetRecordWriteStub(fp_mode);
wasm::WasmCode::GetRecordWriteStub(remembered_set_action, fp_mode);
Call(wasm_target, RelocInfo::WASM_STUB_CALL); Call(wasm_target, RelocInfo::WASM_STUB_CALL);
#else #else
if (false) { if (false) {
#endif #endif
} else { } else {
auto builtin = Builtins::GetRecordWriteStub(remembered_set_action, fp_mode); auto builtin = Builtins::GetRecordWriteStub(fp_mode);
if (options().inline_offheap_trampolines) { if (options().inline_offheap_trampolines) {
// Inline the trampoline. // Inline the trampoline.
RecordCommentForOffHeapTrampoline(builtin); RecordCommentForOffHeapTrampoline(builtin);
...@@ -270,9 +265,7 @@ void TurboAssembler::CallRecordWriteStub( ...@@ -270,9 +265,7 @@ void TurboAssembler::CallRecordWriteStub(
// tag is shifted away. // tag is shifted away.
void MacroAssembler::RecordWrite(Register object, Register address, void MacroAssembler::RecordWrite(Register object, Register address,
Register value, RAStatus ra_status, Register value, RAStatus ra_status,
SaveFPRegsMode fp_mode, SaveFPRegsMode fp_mode, SmiCheck smi_check) {
RememberedSetAction remembered_set_action,
SmiCheck smi_check) {
DCHECK(!AreAliased(object, address, value, t8)); DCHECK(!AreAliased(object, address, value, t8));
DCHECK(!AreAliased(object, address, value, t9)); DCHECK(!AreAliased(object, address, value, t9));
...@@ -285,9 +278,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, ...@@ -285,9 +278,7 @@ void MacroAssembler::RecordWrite(Register object, Register address,
Operand(value)); Operand(value));
} }
if ((remembered_set_action == RememberedSetAction::kOmit && if (FLAG_disable_write_barriers) {
!FLAG_incremental_marking) ||
FLAG_disable_write_barriers) {
return; return;
} }
...@@ -315,7 +306,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, ...@@ -315,7 +306,7 @@ void MacroAssembler::RecordWrite(Register object, Register address,
Register slot_address = WriteBarrierDescriptor::SlotAddressRegister(); Register slot_address = WriteBarrierDescriptor::SlotAddressRegister();
DCHECK(!AreAliased(object, slot_address, value)); DCHECK(!AreAliased(object, slot_address, value));
mov(slot_address, address); mov(slot_address, address);
CallRecordWriteStub(object, slot_address, remembered_set_action, fp_mode); CallRecordWriteStub(object, slot_address, fp_mode);
if (ra_status == kRAHasNotBeenSaved) { if (ra_status == kRAHasNotBeenSaved) {
pop(ra); pop(ra);
......
...@@ -358,12 +358,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -358,12 +358,10 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
SaveFPRegsMode fp_mode); SaveFPRegsMode fp_mode);
void CallRecordWriteStubSaveRegisters( void CallRecordWriteStubSaveRegisters(
Register object, Register slot_address, Register object, Register slot_address, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode,
StubCallMode mode = StubCallMode::kCallBuiltinPointer); StubCallMode mode = StubCallMode::kCallBuiltinPointer);
void CallRecordWriteStub( void CallRecordWriteStub(
Register object, Register slot_address, Register object, Register slot_address, SaveFPRegsMode fp_mode,
RememberedSetAction remembered_set_action, SaveFPRegsMode fp_mode,
StubCallMode mode = StubCallMode::kCallBuiltinPointer); StubCallMode mode = StubCallMode::kCallBuiltinPointer);
// Push multiple registers on the stack. // Push multiple registers on the stack.
...@@ -1028,20 +1026,17 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler { ...@@ -1028,20 +1026,17 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
// stored. value and scratch registers are clobbered by the operation. // stored. value and scratch registers are clobbered by the operation.
// The offset is the offset from the start of the object, not the offset from // The offset is the offset from the start of the object, not the offset from
// the tagged HeapObject pointer. For use with FieldOperand(reg, off). // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
void RecordWriteField( void RecordWriteField(Register object, int offset, Register value,
Register object, int offset, Register value, Register scratch, Register scratch, RAStatus ra_status,
RAStatus ra_status, SaveFPRegsMode save_fp, SaveFPRegsMode save_fp,
RememberedSetAction remembered_set_action = RememberedSetAction::kEmit, SmiCheck smi_check = SmiCheck::kInline);
SmiCheck smi_check = SmiCheck::kInline);
// For a given |object| notify the garbage collector that the slot |address| // For a given |object| notify the garbage collector that the slot |address|
// has been written. |value| is the object being stored. The value and // has been written. |value| is the object being stored. The value and
// address registers are clobbered by the operation. // address registers are clobbered by the operation.
void RecordWrite( void RecordWrite(Register object, Register address, Register value,
Register object, Register address, Register value, RAStatus ra_status, RAStatus ra_status, SaveFPRegsMode save_fp,
SaveFPRegsMode save_fp, SmiCheck smi_check = SmiCheck::kInline);
RememberedSetAction remembered_set_action = RememberedSetAction::kEmit,
SmiCheck smi_check = SmiCheck::kInline);
void Pref(int32_t hint, const MemOperand& rs); void Pref(int32_t hint, const MemOperand& rs);
......
...@@ -164,11 +164,6 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -164,11 +164,6 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
void Generate() final { void Generate() final {
__ CheckPageFlag(value_, MemoryChunk::kPointersToHereAreInterestingMask, eq, __ CheckPageFlag(value_, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ||
FLAG_use_full_record_write_builtin
? RememberedSetAction::kEmit
: RememberedSetAction::kOmit;
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters() SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
? SaveFPRegsMode::kSave ? SaveFPRegsMode::kSave
: SaveFPRegsMode::kIgnore; : SaveFPRegsMode::kIgnore;
...@@ -183,13 +178,11 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -183,13 +178,11 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
// A direct call to a wasm runtime stub defined in this module. // A direct call to a wasm runtime stub defined in this module.
// Just encode the stub index. This will be patched when the code // Just encode the stub index. This will be patched when the code
// is added to the native module and copied into wasm code space. // is added to the native module and copied into wasm code space.
__ CallRecordWriteStubSaveRegisters(object_, offset_, __ CallRecordWriteStubSaveRegisters(object_, offset_, save_fp_mode,
remembered_set_action, save_fp_mode,
StubCallMode::kCallWasmRuntimeStub); StubCallMode::kCallWasmRuntimeStub);
#endif // V8_ENABLE_WEBASSEMBLY #endif // V8_ENABLE_WEBASSEMBLY
} else { } else {
__ CallRecordWriteStubSaveRegisters(object_, offset_, __ CallRecordWriteStubSaveRegisters(object_, offset_, save_fp_mode);
remembered_set_action, save_fp_mode);
} }
if (must_save_lr_) { if (must_save_lr_) {
__ Pop(ra); __ Pop(ra);
......
...@@ -169,11 +169,6 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -169,11 +169,6 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
exit()); exit());
__ Daddu(scratch1_, object_, index_); __ Daddu(scratch1_, object_, index_);
RememberedSetAction const remembered_set_action =
mode_ > RecordWriteMode::kValueIsMap ||
FLAG_use_full_record_write_builtin
? RememberedSetAction::kEmit
: RememberedSetAction::kOmit;
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters() SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
? SaveFPRegsMode::kSave ? SaveFPRegsMode::kSave
: SaveFPRegsMode::kIgnore; : SaveFPRegsMode::kIgnore;
...@@ -188,13 +183,11 @@ class OutOfLineRecordWrite final : public OutOfLineCode { ...@@ -188,13 +183,11 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
// A direct call to a wasm runtime stub defined in this module. // A direct call to a wasm runtime stub defined in this module.
// Just encode the stub index. This will be patched when the code // Just encode the stub index. This will be patched when the code
// is added to the native module and copied into wasm code space. // is added to the native module and copied into wasm code space.
__ CallRecordWriteStubSaveRegisters(object_, scratch1_, __ CallRecordWriteStubSaveRegisters(object_, scratch1_, save_fp_mode,
remembered_set_action, save_fp_mode,
StubCallMode::kCallWasmRuntimeStub); StubCallMode::kCallWasmRuntimeStub);
#endif // V8_ENABLE_WEBASSEMBLY #endif // V8_ENABLE_WEBASSEMBLY
} else { } else {
__ CallRecordWriteStubSaveRegisters(object_, scratch1_, __ CallRecordWriteStubSaveRegisters(object_, scratch1_, save_fp_mode);
remembered_set_action, save_fp_mode);
} }
if (must_save_lr_) { if (must_save_lr_) {
__ Pop(ra); __ Pop(ra);
......
...@@ -413,9 +413,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr, ...@@ -413,9 +413,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
JumpIfSmi(src.gp(), &exit); JumpIfSmi(src.gp(), &exit);
CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, eq, CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, eq,
&exit); &exit);
CallRecordWriteStubSaveRegisters( CallRecordWriteStubSaveRegisters(dst_addr, offset_op, SaveFPRegsMode::kSave,
dst_addr, offset_op, RememberedSetAction::kEmit, SaveFPRegsMode::kSave, StubCallMode::kCallWasmRuntimeStub);
StubCallMode::kCallWasmRuntimeStub);
bind(&exit); bind(&exit);
} }
......
...@@ -520,9 +520,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr, ...@@ -520,9 +520,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
MemoryChunk::kPointersToHereAreInterestingMask, eq, MemoryChunk::kPointersToHereAreInterestingMask, eq,
&exit); &exit);
Daddu(scratch, dst_op.rm(), dst_op.offset()); Daddu(scratch, dst_op.rm(), dst_op.offset());
CallRecordWriteStubSaveRegisters( CallRecordWriteStubSaveRegisters(dst_addr, scratch, SaveFPRegsMode::kSave,
dst_addr, scratch, RememberedSetAction::kEmit, SaveFPRegsMode::kSave, StubCallMode::kCallWasmRuntimeStub);
StubCallMode::kCallWasmRuntimeStub);
bind(&exit); bind(&exit);
} }
......
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