Commit f1e800f0 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[heap] Move VerifySmisVisitor into heap-verifier.cc

This class is only used for heap verification and doesn't need to be
public.

Bug: v8:11708
Change-Id: I9d1750a6f701ed0d9a106f8d93ab3ff82bbf4f3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3862208Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82814}
parent d4697063
...@@ -29,6 +29,17 @@ ...@@ -29,6 +29,17 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
// Verify that all objects are Smis.
class VerifySmisVisitor final : public RootVisitor {
public:
void VisitRootPointers(Root root, const char* description,
FullObjectSlot start, FullObjectSlot end) override {
for (FullObjectSlot current = start; current < end; ++current) {
CHECK((*current).IsSmi());
}
}
};
class HeapVerification final { class HeapVerification final {
public: public:
explicit HeapVerification(Heap* heap) : heap_(heap) {} explicit HeapVerification(Heap* heap) : heap_(heap) {}
......
...@@ -6729,14 +6729,6 @@ void VerifyPointersVisitor::VisitEmbeddedPointer(Code host, RelocInfo* rinfo) { ...@@ -6729,14 +6729,6 @@ void VerifyPointersVisitor::VisitEmbeddedPointer(Code host, RelocInfo* rinfo) {
VerifyHeapObjectImpl(rinfo->target_object(cage_base())); VerifyHeapObjectImpl(rinfo->target_object(cage_base()));
} }
void VerifySmisVisitor::VisitRootPointers(Root root, const char* description,
FullObjectSlot start,
FullObjectSlot end) {
for (FullObjectSlot current = start; current < end; ++current) {
CHECK((*current).IsSmi());
}
}
bool Heap::AllowedToBeMigrated(Map map, HeapObject obj, AllocationSpace dst) { bool Heap::AllowedToBeMigrated(Map map, HeapObject obj, AllocationSpace dst) {
// Object migration is governed by the following rules: // Object migration is governed by the following rules:
// //
......
...@@ -2714,13 +2714,6 @@ class VerifyPointersVisitor : public ObjectVisitorWithCageBases, ...@@ -2714,13 +2714,6 @@ class VerifyPointersVisitor : public ObjectVisitorWithCageBases,
Heap* heap_; Heap* heap_;
}; };
// Verify that all objects are Smis.
class VerifySmisVisitor : public RootVisitor {
public:
void VisitRootPointers(Root root, const char* description,
FullObjectSlot start, FullObjectSlot end) override;
};
// Space iterator for iterating over all the paged spaces of the heap: Map // Space iterator for iterating over all the paged spaces of the heap: Map
// space, old space and code space. Returns each space in turn, and null when it // space, old space and code space. Returns each space in turn, and null when it
// is done. // is done.
......
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