v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap-object-inl.h
Go to the documentation of this file.
1// Copyright 2018 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_OBJECTS_HEAP_OBJECT_INL_H_
6#define V8_OBJECTS_HEAP_OBJECT_INL_H_
7
9// Include the non-inl header before the rest of the headers.
10
14
15// Has to be the last include (doesn't have include guards):
17
18namespace v8 {
19namespace internal {
20
21#define TYPE_CHECKER(type, ...) \
22 bool Is##type(Tagged<HeapObject> obj) { \
23 /* IsBlah() predicates needs to load the map and thus they require the */ \
24 /* main cage base. */ \
25 PtrComprCageBase cage_base = GetPtrComprCageBase(); \
26 return Is##type(obj, cage_base); \
27 } \
28 /* The cage_base passed here must be the base of the main pointer */ \
29 /* compression cage, i.e. the one where the Map space is allocated. */ \
30 bool Is##type(Tagged<HeapObject> obj, PtrComprCageBase cage_base) { \
31 Tagged<Map> map_object = obj->map(cage_base); \
32 return InstanceTypeChecker::Is##type(map_object); \
33 }
34
36#undef TYPE_CHECKER
37
38} // namespace internal
39} // namespace v8
40
42
43#endif // V8_OBJECTS_HEAP_OBJECT_INL_H_
#define TYPE_CHECKER(type,...)
#define INSTANCE_TYPE_CHECKERS(V)