v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
zapping.cc
Go to the documentation of this file.
1// Copyright 2023 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#include "src/heap/zapping.h"
6
7#include "src/base/memory.h"
8#include "src/heap/heap.h"
11
12namespace v8::internal::heap {
13
14void ZapCodeBlock(Address start, int size_in_bytes) {
15#ifdef DEBUG
17 CodePageMemoryModificationScopeForDebugging code_modification_scope(
20 for (int i = 0; i < size_in_bytes / kIntSize; i++) {
22 }
23#endif
24}
25
26void ZapBlock(Address start, size_t size, uintptr_t zap_value) {
31 Tagged<Object>(static_cast<Address>(zap_value)),
32 size >> kTaggedSizeLog2);
33}
34
35} // namespace v8::internal::heap
static V8_INLINE MemoryChunkMetadata * FromAddress(Address a)
int start
T & Memory(Address addr)
Definition memory.h:18
void ZapBlock(Address start, size_t size, uintptr_t zap_value)
Definition zapping.cc:26
void ZapCodeBlock(Address start, int size_in_bytes)
Definition zapping.cc:14
bool ShouldZapGarbage()
Definition zapping.h:18
constexpr int kIntSize
Definition globals.h:400
constexpr int kTaggedSize
Definition globals.h:542
SlotTraits::TObjectSlot ObjectSlot
Definition globals.h:1243
void MemsetTagged(Tagged_t *start, Tagged< MaybeObject > value, size_t counter)
Definition slots-inl.h:486
constexpr int kTaggedSizeLog2
Definition globals.h:543
constexpr int kCodeZapValue
Definition globals.h:1019
#define DCHECK(condition)
Definition logging.h:482
constexpr bool IsAligned(T value, U alignment)
Definition macros.h:403