v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
memory-measurement-inl.h
Go to the documentation of this file.
1// Copyright 2019 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_MEMORY_MEASUREMENT_INL_H_
6#define V8_HEAP_MEMORY_MEASUREMENT_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
15#include "src/objects/map-inl.h"
16#include "src/objects/map.h"
17
18namespace v8 {
19namespace internal {
20
22 Tagged<HeapObject> object,
24 Tagged<Object> maybe_native_context =
25 map->map()->raw_native_context_or_null();
26 *native_context = maybe_native_context.ptr();
27 // The value might be equal to Smi::uninitialized_deserialization_value()
28 // during NativeContext deserialization.
29 return !IsSmi(maybe_native_context) && !IsNull(maybe_native_context);
30}
31
33 InstanceType instance_type = map->instance_type();
34 return (instance_type == JS_ARRAY_BUFFER_TYPE ||
36}
37
39 Tagged<Map> map,
40 Tagged<HeapObject> object,
41 size_t size) {
43 if (HasExternalBytes(map)) {
44 IncrementExternalSize(context, map, object);
45 }
46}
47
48} // namespace internal
49} // namespace v8
50
51#endif // V8_HEAP_MEMORY_MEASUREMENT_INL_H_
V8_INLINE bool Infer(PtrComprCageBase cage_base, Tagged< Map > map, Tagged< HeapObject > object, Address *native_context)
V8_INLINE void IncrementSize(Address context, Tagged< Map > map, Tagged< HeapObject > object, size_t size)
std::unordered_map< Address, size_t > size_by_context_
void IncrementExternalSize(Address context, Tagged< Map > map, Tagged< HeapObject > object)
V8_INLINE bool HasExternalBytes(Tagged< Map > map)
V8_INLINE constexpr StorageType ptr() const
TNode< Context > context
V8_INLINE constexpr bool IsExternalString(InstanceType instance_type)
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
Definition objects.h:665
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
Definition map-inl.h:70
!IsContextMap !IsContextMap native_context
Definition map-inl.h:877
#define V8_INLINE
Definition v8config.h:500