v8/src/heap/conservative-stack-visitor.h
Jake Hughes 1a5ef0816b [heap] Add conservative stack scanning
When enabled with the v8_enable_conservative_stack_scanning flag, a
snapshot of the call stack upon entry to GC is used to determine part of
the root-set. When the collector walks the stack, it looks at each value
and determines whether it could be a potential on-heap object pointer.

This is very experimental. For conservative stack scanning to work,
direct handles must be implemented.

Bug: v8:10614
Change-Id: Id4209cfbe76ef02239c903fabcb7f677b32fc977
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2375201
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69644}
2020-09-01 12:21:29 +00:00

33 lines
853 B
C++

// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_
#define V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_
#include "src/heap/base/stack.h"
#include "src/heap/memory-chunk.h"
namespace v8 {
namespace internal {
class ConservativeStackVisitor : public ::heap::base::StackVisitor {
public:
ConservativeStackVisitor(Isolate* isolate, RootVisitor* delegate);
void VisitPointer(const void* pointer) final;
private:
bool CheckPage(Address address, MemoryChunk* page);
void VisitConservativelyIfPointer(const void* pointer);
Isolate* isolate_ = nullptr;
RootVisitor* delegate_ = nullptr;
};
} // namespace internal
} // namespace v8
#endif // V8_HEAP_CONSERVATIVE_STACK_VISITOR_H_