1 // Copyright 2020 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_ 6 #define V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_ 7 8 #include "src/heap/base/stack.h" 9 #include "src/heap/memory-chunk.h" 10 11 namespace v8 { 12 namespace internal { 13 14 class ConservativeStackVisitor : public ::heap::base::StackVisitor { 15 public: 16 ConservativeStackVisitor(Isolate* isolate, RootVisitor* delegate); 17 18 void VisitPointer(const void* pointer) final; 19 20 private: 21 bool CheckPage(Address address, MemoryChunk* page); 22 23 void VisitConservativelyIfPointer(const void* pointer); 24 25 Isolate* isolate_ = nullptr; 26 RootVisitor* delegate_ = nullptr; 27 }; 28 29 } // namespace internal 30 } // namespace v8 31 32 #endif // V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_ 33