WriteBarrierKind::kSkippedWriteBarrier, store.offset,
Dominik InführWhat about
```
v8_flags.verify_write_barriers ? SkippedWB : NoWB
```
?
Done
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
LGTM % comments
case kArchStoreIndirectNoWriteBarrier: {
AddressingMode addressing_mode =
AddressingModeField::decode(instr->opcode());
Register object = i.InputRegister(0);
Operand offset(0);
if (addressing_mode == kMode_MRI) {
offset = Operand(i.InputInt64(1));
} else {
DCHECK_EQ(addressing_mode, kMode_MRR);
offset = Operand(i.InputRegister(1));
}
Register value = i.InputRegister(2);
#if DEBUG
IndirectPointerTag tag = static_cast<IndirectPointerTag>(i.InputInt64(3));
DCHECK(IsValidIndirectPointerTag(tag));
#endif // DEBUG
RecordTrapInfoIfNeeded(zone(), this, opcode, instr, __ pc_offset());
__ StoreIndirectPointerField(value, MemOperand(object, offset));
break;
}
Same here: you're not verifying that it's valid to skip the WB, so do you need this?
code |= RecordWriteModeField::encode(record_write_mode);
You could probably keep this here, since your NoWB stores ignore the RecordWriteModeField anyways.
V(ArchStoreNoWriteBarrier) \
V(ArchAtomicStoreNoWriteBarrier) \
V(ArchStoreIndirectNoWriteBarrier) \
I would name these `SkippedWB` rather than `NoWB`, to make it clearer that they aren't supposed to be called as soon as there is a store without WB, but rather as soon as there is an elided WB and the verify_write_barriers flag.
case kArchStoreIndirectNoWriteBarrier: {
size_t index = 0;
Operand operand = i.MemoryOperand(&index);
Register value = i.InputRegister(index++);
#if DEBUG
IndirectPointerTag tag =
static_cast<IndirectPointerTag>(i.InputInt64(index));
DCHECK(IsValidIndirectPointerTag(tag));
#endif // DEBUG
EmitTSANAwareStore<std::memory_order_relaxed>(
zone(), this, masm(), operand, value, i, DetermineStubCallMode(),
MachineRepresentation::kIndirectPointer, instr);
break;
}
You're not verifying anything here; is it by design?
const WriteBarrierKind write_barrier_kind =
v8_flags.verify_write_barriers
? WriteBarrierKind::kSkippedWriteBarrier
: WriteBarrierKind::kNoWriteBarrier;
Maybe make this a class variable to avoid re-checking v8_flags.verify_write_barriers for every elided WB.
kSkippedWriteBarrier,
Maybe add a comment at the end of the line explaining what this is.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
case kArchStoreIndirectNoWriteBarrier: {
AddressingMode addressing_mode =
AddressingModeField::decode(instr->opcode());
Register object = i.InputRegister(0);
Operand offset(0);
if (addressing_mode == kMode_MRI) {
offset = Operand(i.InputInt64(1));
} else {
DCHECK_EQ(addressing_mode, kMode_MRR);
offset = Operand(i.InputRegister(1));
}
Register value = i.InputRegister(2);
#if DEBUG
IndirectPointerTag tag = static_cast<IndirectPointerTag>(i.InputInt64(3));
DCHECK(IsValidIndirectPointerTag(tag));
#endif // DEBUG
RecordTrapInfoIfNeeded(zone(), this, opcode, instr, __ pc_offset());
__ StoreIndirectPointerField(value, MemOperand(object, offset));
break;
}
Same here: you're not verifying that it's valid to skip the WB, so do you need this?
As discussed offline, I will add verification for those stores as a follow-up CL.
code |= RecordWriteModeField::encode(record_write_mode);
You could probably keep this here, since your NoWB stores ignore the RecordWriteModeField anyways.
I changed this because `WriteBarrierKindToRecordWriteMode` does not expect `kSkippedWriteBarrier`. So I would need to at least assign to `record_write_mode` in the branches. And I would need to assign some value for kSkippedWriteBarrier as well.
Alternatively I could make `WriteBarrierKindToRecordWriteMode` aware of kSkippedWriteBarrier - but I wasn't too happy about this. Wdyt?
V(ArchStoreNoWriteBarrier) \
V(ArchAtomicStoreNoWriteBarrier) \
V(ArchStoreIndirectNoWriteBarrier) \
I would name these `SkippedWB` rather than `NoWB`, to make it clearer that they aren't supposed to be called as soon as there is a store without WB, but rather as soon as there is an elided WB and the verify_write_barriers flag.
I like it, thanks!
case kArchStoreIndirectNoWriteBarrier: {
size_t index = 0;
Operand operand = i.MemoryOperand(&index);
Register value = i.InputRegister(index++);
#if DEBUG
IndirectPointerTag tag =
static_cast<IndirectPointerTag>(i.InputInt64(index));
DCHECK(IsValidIndirectPointerTag(tag));
#endif // DEBUG
EmitTSANAwareStore<std::memory_order_relaxed>(
zone(), this, masm(), operand, value, i, DetermineStubCallMode(),
MachineRepresentation::kIndirectPointer, instr);
break;
}
You're not verifying anything here; is it by design?
As above.
const WriteBarrierKind write_barrier_kind =
v8_flags.verify_write_barriers
? WriteBarrierKind::kSkippedWriteBarrier
: WriteBarrierKind::kNoWriteBarrier;
Maybe make this a class variable to avoid re-checking v8_flags.verify_write_barriers for every elided WB.
Done
Maybe add a comment at the end of the line explaining what this is.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I believe I have addressed your feedback. PTALA
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Still LGTM, thanks :)
code |= RecordWriteModeField::encode(record_write_mode);
Dominik InführYou could probably keep this here, since your NoWB stores ignore the RecordWriteModeField anyways.
I changed this because `WriteBarrierKindToRecordWriteMode` does not expect `kSkippedWriteBarrier`. So I would need to at least assign to `record_write_mode` in the branches. And I would need to assign some value for kSkippedWriteBarrier as well.
Alternatively I could make `WriteBarrierKindToRecordWriteMode` aware of kSkippedWriteBarrier - but I wasn't too happy about this. Wdyt?
Ah right I see. Your current version looks good then :)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[compiler] Support skipped write barrier verification in Turbofan
This CL adds skipped write barrier verification support to
Turbofan. For this the compiler generates calls to
Heap::VerifySkippedWriteBarrier to all stores which got their
write barrier eliminated during compilation.
For this we need to add a new WriteBarrierKind kSkippedWriteBarrier
which is used by the compiler instead of kNoWriteBarrier when
eliminating write barriers. We need this additional state to different
stores with skipped write barriers from stores that cannot have a
write barrier (e.g. Float64).
Note that we only use kSkippedWriteBarrier when write barrier
verification is enabled, production code should not be affected.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
BlockTrampolinePoolScope block_trampoline_pool(this);
We were already in a block scope here, set up at the beginning of this method (`BranchShortHelper`).
// TODO(kas...@rivosinc.com): This probably has no effect, because the
This comment is the only change for the switch except for the indentation change.
EmitConstPoolWithoutJumpIfNeeded();
I'll do another pass where we clean up the constant pool handling. It is really hard to make sure we do it in all the right places. For now, I just want to unblock fixing the debug builds.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[riscv][compiler] Support skipped write barrier verification in Turbofan
Port commit 23635da6abc21671350eaed0a34ce75fb9ffe8fe.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |