v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
object-poisoner.h
Go to the documentation of this file.
1
// Copyright 2021 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_CPPGC_OBJECT_POISONER_H_
6
#define V8_HEAP_CPPGC_OBJECT_POISONER_H_
7
8
#include "
src/base/sanitizer/asan.h
"
9
#include "
src/heap/cppgc/heap-object-header.h
"
10
#include "
src/heap/cppgc/heap-page.h
"
11
#include "
src/heap/cppgc/heap-visitor.h
"
12
#include "
src/heap/cppgc/object-view.h
"
13
14
namespace
cppgc
{
15
namespace
internal
{
16
17
#ifdef V8_USE_ADDRESS_SANITIZER
18
19
// Poisons the payload of unmarked objects.
20
class
UnmarkedObjectsPoisoner :
public
HeapVisitor<UnmarkedObjectsPoisoner> {
21
friend
class
HeapVisitor<UnmarkedObjectsPoisoner>;
22
23
private
:
24
bool
VisitHeapObjectHeader(HeapObjectHeader& header) {
25
if
(header.IsFree() || header.IsMarked())
return
true
;
26
27
ASAN_POISON_MEMORY_REGION
(header.ObjectStart(),
28
ObjectView<>(header).Size());
29
return
true
;
30
}
31
};
32
33
#endif
// V8_USE_ADDRESS_SANITIZER
34
35
}
// namespace internal
36
}
// namespace cppgc
37
38
#endif
// V8_HEAP_CPPGC_OBJECT_POISONER_H_
asan.h
ASAN_POISON_MEMORY_REGION
#define ASAN_POISON_MEMORY_REGION(start, size)
Definition
asan.h:64
heap-visitor.h
heap-object-header.h
heap-page.h
cppgc
Definition
cross-heap-remembered-set.h:14
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
object-view.h
src
heap
cppgc
object-poisoner.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0