chromium/v8/src/heap/cppgc/visitor.cc

// 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.

#include "src/heap/cppgc/visitor.h"

#include "src/base/sanitizer/asan.h"
#include "src/base/sanitizer/msan.h"
#include "src/heap/cppgc/gc-info-table.h"
#include "src/heap/cppgc/heap-base.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/object-view.h"
#include "src/heap/cppgc/page-memory.h"

#if defined(CPPGC_CAGED_HEAP)
#include "src/heap/cppgc/caged-heap.h"
#endif  // defined(CPPGC_CAGED_HEAP)

namespace cppgc {

#ifdef V8_ENABLE_CHECKS
void Visitor::CheckObjectNotInConstruction(const void* address) {}
#endif  // V8_ENABLE_CHECKS

namespace internal {

ConservativeTracingVisitor::ConservativeTracingVisitor(
    HeapBase& heap, PageBackend& page_backend, cppgc::Visitor& visitor)
    :{}

// Conservative scanning of objects is not compatible with ASAN as we may scan
// over objects reading poisoned memory. One such example was added to libc++
// (June 2024) in the form of container annotations for short std::string.
DISABLE_ASAN
void ConservativeTracingVisitor::TraceConservatively(
    const HeapObjectHeader& header) {}

void ConservativeTracingVisitor::TryTracePointerConservatively(
    Address address) {}

void ConservativeTracingVisitor::TraceConservativelyIfNeeded(
    const void* address) {}

void ConservativeTracingVisitor::TraceConservativelyIfNeeded(
    HeapObjectHeader& header) {}

void ConservativeTracingVisitor::VisitFullyConstructedConservatively(
    HeapObjectHeader& header) {}

}  // namespace internal
}  // namespace cppgc