• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_OBJECTS_OBJECT_LIST_MACROS_H_
6 #define V8_OBJECTS_OBJECT_LIST_MACROS_H_
7 
8 #include "torque-generated/instance-types.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 class AbstractCode;
14 class AccessorPair;
15 class AccessCheckInfo;
16 class AllocationSite;
17 class ByteArray;
18 class CachedTemplateObject;
19 class Cell;
20 class ClosureFeedbackCellArray;
21 class ConsString;
22 class DependentCode;
23 class ElementsAccessor;
24 class EnumCache;
25 class FixedArrayBase;
26 class FixedDoubleArray;
27 class FreeSpace;
28 class FunctionLiteral;
29 class FunctionTemplateInfo;
30 class JSAsyncGeneratorObject;
31 class JSGlobalProxy;
32 class SourceTextModule;
33 class JSPromise;
34 class JSProxy;
35 class JSProxyRevocableResult;
36 class KeyAccumulator;
37 class LookupIterator;
38 class FieldType;
39 class Module;
40 class SourceTextModuleInfoEntry;
41 class HeapNumber;
42 class ObjectHashTable;
43 class ObjectTemplateInfo;
44 class ObjectVisitor;
45 class OSROptimizedCodeCache;
46 class PreparseData;
47 class PropertyArray;
48 class PropertyCell;
49 class PropertyDescriptor;
50 class PrototypeInfo;
51 class ReadOnlyRoots;
52 class RegExpMatchInfo;
53 class RootVisitor;
54 class SafepointEntry;
55 class ScriptContextTable;
56 class SharedFunctionInfo;
57 class StringStream;
58 class Symbol;
59 class SyntheticModule;
60 class FeedbackCell;
61 class FeedbackMetadata;
62 class FeedbackVector;
63 class UncompiledData;
64 class TemplateInfo;
65 class TransitionArray;
66 class TemplateList;
67 class WasmInstanceObject;
68 class WasmMemoryObject;
69 template <typename T>
70 class ZoneForwardList;
71 
72 #define OBJECT_TYPE_LIST(V) \
73   V(Primitive)              \
74   V(Number)                 \
75   V(Numeric)
76 
77 #define HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V)  \
78   V(AbstractCode)                               \
79   V(AccessCheckNeeded)                          \
80   V(AllocationSite)                             \
81   V(ArrayList)                                  \
82   V(BigInt)                                     \
83   V(BigIntBase)                                 \
84   V(BigIntWrapper)                              \
85   V(ObjectBoilerplateDescription)               \
86   V(Boolean)                                    \
87   V(BooleanWrapper)                             \
88   V(ByteArray)                                  \
89   V(BytecodeArray)                              \
90   V(CallHandlerInfo)                            \
91   V(Callable)                                   \
92   V(Cell)                                       \
93   V(ClassBoilerplate)                           \
94   V(Code)                                       \
95   V(CodeDataContainer)                          \
96   V(CompilationCacheTable)                      \
97   V(ConsString)                                 \
98   V(Constructor)                                \
99   V(Context)                                    \
100   V(CoverageInfo)                               \
101   V(ClosureFeedbackCellArray)                   \
102   V(DataHandler)                                \
103   V(DeoptimizationData)                         \
104   V(DependentCode)                              \
105   V(DescriptorArray)                            \
106   V(EmbedderDataArray)                          \
107   V(EphemeronHashTable)                         \
108   V(ExternalOneByteString)                      \
109   V(ExternalString)                             \
110   V(ExternalTwoByteString)                      \
111   V(FeedbackCell)                               \
112   V(FeedbackMetadata)                           \
113   V(FeedbackVector)                             \
114   V(Filler)                                     \
115   V(FixedArray)                                 \
116   V(FixedArrayBase)                             \
117   V(FixedArrayExact)                            \
118   V(FixedDoubleArray)                           \
119   V(Foreign)                                    \
120   V(FreeSpace)                                  \
121   V(Function)                                   \
122   V(GlobalDictionary)                           \
123   V(HandlerTable)                               \
124   V(HeapNumber)                                 \
125   V(InternalizedString)                         \
126   V(JSArgumentsObject)                          \
127   V(JSArray)                                    \
128   V(JSArrayBuffer)                              \
129   V(JSArrayBufferView)                          \
130   V(JSArrayIterator)                            \
131   V(JSAsyncFromSyncIterator)                    \
132   V(JSAsyncFunctionObject)                      \
133   V(JSAsyncGeneratorObject)                     \
134   V(JSBoundFunction)                            \
135   V(JSCollection)                               \
136   V(JSCollectionIterator)                       \
137   V(JSContextExtensionObject)                   \
138   V(JSCustomElementsObject)                     \
139   V(JSDataView)                                 \
140   V(JSDate)                                     \
141   V(JSError)                                    \
142   V(JSExternalObject)                           \
143   V(JSFinalizationRegistry)                     \
144   V(JSFunction)                                 \
145   V(JSFunctionOrBoundFunctionOrWrappedFunction) \
146   V(JSGeneratorObject)                          \
147   V(JSGlobalObject)                             \
148   V(JSGlobalProxy)                              \
149   V(JSMap)                                      \
150   V(JSMapIterator)                              \
151   V(JSMessageObject)                            \
152   V(JSModuleNamespace)                          \
153   V(JSObject)                                   \
154   V(JSObjectWithEmbedderSlots)                  \
155   V(JSPrimitiveWrapper)                         \
156   V(JSPromise)                                  \
157   V(JSProxy)                                    \
158   V(JSReceiver)                                 \
159   V(JSRegExp)                                   \
160   V(JSRegExpStringIterator)                     \
161   V(JSSet)                                      \
162   V(JSSetIterator)                              \
163   V(JSShadowRealm)                              \
164   V(JSSharedStruct)                             \
165   V(JSSpecialObject)                            \
166   V(JSStringIterator)                           \
167   V(JSTemporalCalendar)                         \
168   V(JSTemporalDuration)                         \
169   V(JSTemporalInstant)                          \
170   V(JSTemporalPlainDate)                        \
171   V(JSTemporalPlainTime)                        \
172   V(JSTemporalPlainDateTime)                    \
173   V(JSTemporalPlainMonthDay)                    \
174   V(JSTemporalPlainYearMonth)                   \
175   V(JSTemporalTimeZone)                         \
176   V(JSTemporalZonedDateTime)                    \
177   V(JSTypedArray)                               \
178   V(JSWeakCollection)                           \
179   V(JSWeakRef)                                  \
180   V(JSWeakMap)                                  \
181   V(JSWeakSet)                                  \
182   V(JSWrappedFunction)                          \
183   V(LoadHandler)                                \
184   V(Map)                                        \
185   V(MapCache)                                   \
186   V(MegaDomHandler)                             \
187   V(Module)                                     \
188   V(Microtask)                                  \
189   V(Name)                                       \
190   V(NameDictionary)                             \
191   V(NameToIndexHashTable)                       \
192   V(NativeContext)                              \
193   V(NormalizedMapCache)                         \
194   V(NumberDictionary)                           \
195   V(NumberWrapper)                              \
196   V(ObjectHashSet)                              \
197   V(ObjectHashTable)                            \
198   V(Oddball)                                    \
199   V(OrderedHashMap)                             \
200   V(OrderedHashSet)                             \
201   V(OrderedNameDictionary)                      \
202   V(OSROptimizedCodeCache)                      \
203   V(PreparseData)                               \
204   V(PrimitiveHeapObject)                        \
205   V(PromiseReactionJobTask)                     \
206   V(PropertyArray)                              \
207   V(PropertyCell)                               \
208   V(RegExpMatchInfo)                            \
209   V(ScopeInfo)                                  \
210   V(ScriptContextTable)                         \
211   V(ScriptWrapper)                              \
212   V(SeqOneByteString)                           \
213   V(SeqString)                                  \
214   V(SeqTwoByteString)                           \
215   V(SharedFunctionInfo)                         \
216   V(SimpleNumberDictionary)                     \
217   V(SlicedString)                               \
218   V(SmallOrderedHashMap)                        \
219   V(SmallOrderedHashSet)                        \
220   V(SmallOrderedNameDictionary)                 \
221   V(SourceTextModule)                           \
222   V(SourceTextModuleInfo)                       \
223   V(StoreHandler)                               \
224   V(String)                                     \
225   V(StringSet)                                  \
226   V(RegisteredSymbolTable)                      \
227   V(StringWrapper)                              \
228   V(Struct)                                     \
229   V(SwissNameDictionary)                        \
230   V(Symbol)                                     \
231   V(SymbolWrapper)                              \
232   V(SyntheticModule)                            \
233   V(TemplateInfo)                               \
234   V(TemplateList)                               \
235   V(ThinString)                                 \
236   V(TransitionArray)                            \
237   V(UncompiledData)                             \
238   V(UncompiledDataWithPreparseData)             \
239   V(UncompiledDataWithoutPreparseData)          \
240   V(UncompiledDataWithPreparseDataAndJob)       \
241   V(UncompiledDataWithoutPreparseDataWithJob)   \
242   V(Undetectable)                               \
243   V(UniqueName)                                 \
244   IF_WASM(V, WasmApiFunctionRef)                \
245   IF_WASM(V, WasmArray)                         \
246   IF_WASM(V, WasmCapiFunctionData)              \
247   IF_WASM(V, WasmTagObject)                     \
248   IF_WASM(V, WasmExceptionPackage)              \
249   IF_WASM(V, WasmExportedFunctionData)          \
250   IF_WASM(V, WasmFunctionData)                  \
251   IF_WASM(V, WasmGlobalObject)                  \
252   IF_WASM(V, WasmInternalFunction)              \
253   IF_WASM(V, WasmInstanceObject)                \
254   IF_WASM(V, WasmJSFunctionData)                \
255   IF_WASM(V, WasmMemoryObject)                  \
256   IF_WASM(V, WasmModuleObject)                  \
257   IF_WASM(V, WasmObject)                        \
258   IF_WASM(V, WasmOnFulfilledData)               \
259   IF_WASM(V, WasmStruct)                        \
260   IF_WASM(V, WasmTypeInfo)                      \
261   IF_WASM(V, WasmTableObject)                   \
262   IF_WASM(V, WasmValueObject)                   \
263   IF_WASM(V, WasmSuspenderObject)               \
264   V(WeakFixedArray)                             \
265   V(WeakArrayList)                              \
266   V(WeakCell)                                   \
267   TORQUE_DEFINED_CLASS_LIST(V)
268 
269 #ifdef V8_INTL_SUPPORT
270 #define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
271   HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V)  \
272   V(JSV8BreakIterator)                    \
273   V(JSCollator)                           \
274   V(JSDateTimeFormat)                     \
275   V(JSDisplayNames)                       \
276   V(JSListFormat)                         \
277   V(JSLocale)                             \
278   V(JSNumberFormat)                       \
279   V(JSPluralRules)                        \
280   V(JSRelativeTimeFormat)                 \
281   V(JSSegmentIterator)                    \
282   V(JSSegmenter)                          \
283   V(JSSegments)
284 #else
285 #define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V)
286 #endif  // V8_INTL_SUPPORT
287 
288 #define HEAP_OBJECT_TEMPLATE_TYPE_LIST(V) V(HashTable)
289 
290 // Logical sub-types of heap objects that don't correspond to a C++ class but
291 // represent some specialization in terms of additional constraints.
292 #define HEAP_OBJECT_SPECIALIZED_TYPE_LIST(V) \
293   V(AwaitContext)                            \
294   V(BlockContext)                            \
295   V(CallableApiObject)                       \
296   V(CallableJSProxy)                         \
297   V(CatchContext)                            \
298   V(DebugEvaluateContext)                    \
299   V(EvalContext)                             \
300   V(FreeSpaceOrFiller)                       \
301   V(FunctionContext)                         \
302   V(JSApiObject)                             \
303   V(JSClassConstructor)                      \
304   V(JSLastDummyApiObject)                    \
305   V(JSPromiseConstructor)                    \
306   V(JSArrayConstructor)                      \
307   V(JSRegExpConstructor)                     \
308   V(JSMapKeyIterator)                        \
309   V(JSMapKeyValueIterator)                   \
310   V(JSMapValueIterator)                      \
311   V(JSSetKeyValueIterator)                   \
312   V(JSSetValueIterator)                      \
313   V(JSSpecialApiObject)                      \
314   V(ModuleContext)                           \
315   V(NonNullForeign)                          \
316   V(ScriptContext)                           \
317   V(WithContext)                             \
318   V(JSPrototype)                             \
319   V(JSObjectPrototype)                       \
320   V(JSRegExpPrototype)                       \
321   V(JSPromisePrototype)                      \
322   V(JSSetPrototype)                          \
323   V(JSIteratorPrototype)                     \
324   V(JSArrayIteratorPrototype)                \
325   V(JSMapIteratorPrototype)                  \
326   V(JSTypedArrayPrototype)                   \
327   V(JSSetIteratorPrototype)                  \
328   V(JSStringIteratorPrototype)               \
329   V(TypedArrayConstructor)                   \
330   V(Uint8TypedArrayConstructor)              \
331   V(Int8TypedArrayConstructor)               \
332   V(Uint16TypedArrayConstructor)             \
333   V(Int16TypedArrayConstructor)              \
334   V(Uint32TypedArrayConstructor)             \
335   V(Int32TypedArrayConstructor)              \
336   V(Float32TypedArrayConstructor)            \
337   V(Float64TypedArrayConstructor)            \
338   V(Uint8ClampedTypedArrayConstructor)       \
339   V(Biguint64TypedArrayConstructor)          \
340   V(Bigint64TypedArrayConstructor)
341 
342 #define HEAP_OBJECT_TYPE_LIST(V)    \
343   HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
344   HEAP_OBJECT_TEMPLATE_TYPE_LIST(V) \
345   HEAP_OBJECT_SPECIALIZED_TYPE_LIST(V)
346 
347 #define ODDBALL_LIST(V)                 \
348   V(Undefined, undefined_value)         \
349   V(Null, null_value)                   \
350   V(TheHole, the_hole_value)            \
351   V(Exception, exception)               \
352   V(Uninitialized, uninitialized_value) \
353   V(True, true_value)                   \
354   V(False, false_value)                 \
355   V(ArgumentsMarker, arguments_marker)  \
356   V(OptimizedOut, optimized_out)        \
357   V(StaleRegister, stale_register)
358 
359 }  // namespace internal
360 }  // namespace v8
361 
362 #endif  // V8_OBJECTS_OBJECT_LIST_MACROS_H_
363