[heap] Remove unused code write barrier

Write barrier was only used in Factory::CopyCode for the
InterpreterEntryTrampolineForProfiling. This was removed in
in https://crrev.com/c/3811287.

Change-Id: I4cd0863fc2629d2d564af6a269e722d1a9e128f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3843141
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82609}
This commit is contained in:
Dominik Inführ 2022-08-20 19:32:57 +02:00 committed by V8 LUCI CQ
parent ddfc587402
commit f4424b700e
4 changed files with 0 additions and 54 deletions

View File

@ -27,7 +27,6 @@ V8_EXPORT_PRIVATE void Heap_CombinedGenerationalAndSharedBarrierSlow(
HeapObject object, Address slot, HeapObject value);
V8_EXPORT_PRIVATE void Heap_CombinedGenerationalAndSharedEphemeronBarrierSlow(
EphemeronHashTable table, Address slot, HeapObject value);
V8_EXPORT_PRIVATE void Heap_WriteBarrierForCodeSlow(Code host);
V8_EXPORT_PRIVATE void Heap_GenerationalBarrierForCodeSlow(Code host,
RelocInfo* rinfo,
@ -152,10 +151,6 @@ inline void WriteBarrierForCode(Code host, RelocInfo* rinfo, HeapObject value,
WriteBarrier::Marking(host, rinfo, value);
}
inline void WriteBarrierForCode(Code host) {
Heap_WriteBarrierForCodeSlow(host);
}
inline void CombinedWriteBarrier(HeapObject host, ObjectSlot slot, Object value,
WriteBarrierMode mode) {
if (mode == SKIP_WRITE_BARRIER) {

View File

@ -33,7 +33,6 @@ void WriteBarrierForCode(Code host, RelocInfo* rinfo, Object value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
void WriteBarrierForCode(Code host, RelocInfo* rinfo, HeapObject value,
WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
void WriteBarrierForCode(Code host);
void CombinedWriteBarrier(HeapObject object, ObjectSlot slot, Object value,
WriteBarrierMode mode);

View File

@ -146,10 +146,6 @@ void Heap_CombinedGenerationalAndSharedEphemeronBarrierSlow(
Heap::CombinedGenerationalAndSharedEphemeronBarrierSlow(table, slot, value);
}
void Heap_WriteBarrierForCodeSlow(Code host) {
Heap::WriteBarrierForCodeSlow(host);
}
void Heap_GenerationalBarrierForCodeSlow(Code host, RelocInfo* rinfo,
HeapObject object) {
Heap::GenerationalBarrierForCodeSlow(host, rinfo, object);
@ -7222,48 +7218,6 @@ CodeLookupResult Heap::GcSafeFindCodeForInnerPointerForPrinting(
return {};
}
class CodeObjectVisitor : public ObjectVisitorWithCageBases {
public:
explicit CodeObjectVisitor(Isolate* isolate)
: ObjectVisitorWithCageBases(isolate) {}
void VisitCodePointer(HeapObject host, CodeObjectSlot slot) override {
UNREACHABLE();
}
void VisitCodeTarget(Code host, RelocInfo* rinfo) override {
#ifdef ENABLE_SLOW_DCHECKS
DCHECK(RelocInfo::IsCodeTargetMode(rinfo->rmode()));
Code target_object =
Code::GetCodeFromTargetAddress(rinfo->target_address());
DCHECK(!WriteBarrier::IsRequired(host, target_object));
#endif
}
void VisitEmbeddedPointer(Code host, RelocInfo* rinfo) override {
HeapObject target_object = rinfo->target_object(cage_base());
WriteBarrierForCode(host, rinfo, target_object);
}
void VisitPointers(HeapObject host, MaybeObjectSlot start,
MaybeObjectSlot end) override {
UNREACHABLE();
}
void VisitPointers(HeapObject host, ObjectSlot start,
ObjectSlot end) override {
for (ObjectSlot slot = start; slot < end; ++slot) {
Object object = slot.Relaxed_Load(cage_base());
CombinedWriteBarrier(host, slot, object, UPDATE_WRITE_BARRIER);
}
}
};
void Heap::WriteBarrierForCodeSlow(Code code) {
Isolate* isolate = GetIsolateFromWritableObject(code);
CombinedWriteBarrier(code, code.map_slot(), code.map(isolate),
UPDATE_WRITE_BARRIER);
CodeObjectVisitor visitor(isolate);
Code::BodyDescriptor::IterateBody(code.map(isolate), code, &visitor);
}
void Heap::CombinedGenerationalAndSharedBarrierSlow(HeapObject object,
Address slot,
HeapObject value) {

View File

@ -498,8 +498,6 @@ class Heap {
V8_EXPORT_PRIVATE void WriteBarrierForRange(HeapObject object, TSlot start,
TSlot end);
V8_EXPORT_PRIVATE static void WriteBarrierForCodeSlow(Code host);
// Implements slow path of both generational & shared heap barrier.
V8_EXPORT_PRIVATE static void CombinedGenerationalAndSharedBarrierSlow(
HeapObject object, Address slot, HeapObject value);