object-list-macros.h 13.1 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_OBJECTS_OBJECT_LIST_MACROS_H_
#define V8_OBJECTS_OBJECT_LIST_MACROS_H_

8
#include "torque-generated/instance-types.h"
9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
namespace v8 {
namespace internal {

class AbstractCode;
class AccessorPair;
class AccessCheckInfo;
class AllocationSite;
class ByteArray;
class CachedTemplateObject;
class Cell;
class ClosureFeedbackCellArray;
class ConsString;
class DependentCode;
class ElementsAccessor;
class EnumCache;
class FixedArrayBase;
class FixedDoubleArray;
class FreeSpace;
class FunctionLiteral;
class FunctionTemplateInfo;
class JSAsyncGeneratorObject;
class JSGlobalProxy;
32
class SourceTextModule;
33 34 35 36 37 38 39
class JSPromise;
class JSProxy;
class JSProxyRevocableResult;
class KeyAccumulator;
class LookupIterator;
class FieldType;
class Module;
40
class SourceTextModuleInfoEntry;
41
class HeapNumber;
42 43 44
class ObjectHashTable;
class ObjectTemplateInfo;
class ObjectVisitor;
45
class OSROptimizedCodeCache;
46 47 48 49 50 51 52 53 54 55 56 57 58
class PreparseData;
class PropertyArray;
class PropertyCell;
class PropertyDescriptor;
class PrototypeInfo;
class ReadOnlyRoots;
class RegExpMatchInfo;
class RootVisitor;
class SafepointEntry;
class ScriptContextTable;
class SharedFunctionInfo;
class StringStream;
class Symbol;
59
class SyntheticModule;
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
class FeedbackCell;
class FeedbackMetadata;
class FeedbackVector;
class UncompiledData;
class TemplateInfo;
class TransitionArray;
class TemplateList;
class WasmInstanceObject;
class WasmMemoryObject;
template <typename T>
class ZoneForwardList;

#define OBJECT_TYPE_LIST(V) \
  V(Primitive)              \
  V(Number)                 \
  V(Numeric)

#define HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V) \
  V(AbstractCode)                              \
  V(AccessCheckNeeded)                         \
  V(AllocationSite)                            \
  V(ArrayList)                                 \
  V(BigInt)                                    \
83
  V(BigIntBase)                                \
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
  V(BigIntWrapper)                             \
  V(ObjectBoilerplateDescription)              \
  V(Boolean)                                   \
  V(BooleanWrapper)                            \
  V(ByteArray)                                 \
  V(BytecodeArray)                             \
  V(CallHandlerInfo)                           \
  V(Callable)                                  \
  V(Cell)                                      \
  V(ClassBoilerplate)                          \
  V(Code)                                      \
  V(CodeDataContainer)                         \
  V(CompilationCacheTable)                     \
  V(ConsString)                                \
  V(Constructor)                               \
  V(CoverageInfo)                              \
  V(ClosureFeedbackCellArray)                  \
  V(DataHandler)                               \
  V(DeoptimizationData)                        \
  V(DependentCode)                             \
  V(EmbedderDataArray)                         \
  V(EphemeronHashTable)                        \
  V(ExternalOneByteString)                     \
  V(ExternalString)                            \
  V(ExternalTwoByteString)                     \
  V(FeedbackCell)                              \
  V(FeedbackMetadata)                          \
  V(FeedbackVector)                            \
  V(Filler)                                    \
  V(FixedArray)                                \
  V(FixedArrayBase)                            \
  V(FixedArrayExact)                           \
  V(FixedDoubleArray)                          \
  V(Foreign)                                   \
  V(FreeSpace)                                 \
  V(Function)                                  \
  V(GlobalDictionary)                          \
  V(HandlerTable)                              \
  V(HeapNumber)                                \
  V(InternalizedString)                        \
  V(JSArgumentsObject)                         \
  V(JSArray)                                   \
  V(JSArrayBuffer)                             \
  V(JSArrayBufferView)                         \
  V(JSArrayIterator)                           \
  V(JSAsyncFromSyncIterator)                   \
  V(JSAsyncFunctionObject)                     \
  V(JSAsyncGeneratorObject)                    \
  V(JSBoundFunction)                           \
  V(JSCollection)                              \
134
  V(JSCollectionIterator)                      \
135
  V(JSContextExtensionObject)                  \
136
  V(JSCustomElementsObject)                    \
137 138 139
  V(JSDataView)                                \
  V(JSDate)                                    \
  V(JSError)                                   \
140
  V(JSFinalizationRegistry)                    \
141
  V(JSFunction)                                \
142
  V(JSFunctionOrBoundFunction)                 \
143 144 145 146 147 148 149 150
  V(JSGeneratorObject)                         \
  V(JSGlobalObject)                            \
  V(JSGlobalProxy)                             \
  V(JSMap)                                     \
  V(JSMapIterator)                             \
  V(JSMessageObject)                           \
  V(JSModuleNamespace)                         \
  V(JSObject)                                  \
151
  V(JSPrimitiveWrapper)                        \
152 153 154 155 156 157 158
  V(JSPromise)                                 \
  V(JSProxy)                                   \
  V(JSReceiver)                                \
  V(JSRegExp)                                  \
  V(JSRegExpStringIterator)                    \
  V(JSSet)                                     \
  V(JSSetIterator)                             \
159
  V(JSSpecialObject)                           \
160 161 162
  V(JSStringIterator)                          \
  V(JSTypedArray)                              \
  V(JSWeakCollection)                          \
163
  V(JSWeakRef)                                 \
164 165 166 167 168
  V(JSWeakMap)                                 \
  V(JSWeakSet)                                 \
  V(LoadHandler)                               \
  V(Map)                                       \
  V(MapCache)                                  \
169
  V(MegaDomHandler)                            \
170
  V(Module)                                    \
171 172 173 174 175 176 177 178 179 180 181 182
  V(Microtask)                                 \
  V(Name)                                      \
  V(NameDictionary)                            \
  V(NativeContext)                             \
  V(NormalizedMapCache)                        \
  V(NumberDictionary)                          \
  V(NumberWrapper)                             \
  V(ObjectHashSet)                             \
  V(ObjectHashTable)                           \
  V(OrderedHashMap)                            \
  V(OrderedHashSet)                            \
  V(OrderedNameDictionary)                     \
183
  V(OSROptimizedCodeCache)                     \
184
  V(PreparseData)                              \
185
  V(PrimitiveHeapObject)                       \
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
  V(PromiseReactionJobTask)                    \
  V(PropertyArray)                             \
  V(PropertyCell)                              \
  V(RegExpMatchInfo)                           \
  V(ScopeInfo)                                 \
  V(ScriptContextTable)                        \
  V(ScriptWrapper)                             \
  V(SeqOneByteString)                          \
  V(SeqString)                                 \
  V(SeqTwoByteString)                          \
  V(SimpleNumberDictionary)                    \
  V(SlicedString)                              \
  V(SmallOrderedHashMap)                       \
  V(SmallOrderedHashSet)                       \
  V(SmallOrderedNameDictionary)                \
201 202
  V(SourceTextModule)                          \
  V(SourceTextModuleInfo)                      \
203 204 205 206 207
  V(StoreHandler)                              \
  V(String)                                    \
  V(StringSet)                                 \
  V(StringWrapper)                             \
  V(Struct)                                    \
208
  V(SwissNameDictionary)                       \
209 210
  V(Symbol)                                    \
  V(SymbolWrapper)                             \
211
  V(SyntheticModule)                           \
212 213 214 215 216 217
  V(TemplateInfo)                              \
  V(TemplateList)                              \
  V(ThinString)                                \
  V(TransitionArray)                           \
  V(Undetectable)                              \
  V(UniqueName)                                \
218
  IF_WASM(V, WasmArray)                        \
219
  IF_WASM(V, WasmCapiFunctionData)             \
220
  IF_WASM(V, WasmTagObject)                    \
221
  IF_WASM(V, WasmExceptionPackage)             \
222 223
  IF_WASM(V, WasmExportedFunctionData)         \
  IF_WASM(V, WasmFunctionData)                 \
224 225
  IF_WASM(V, WasmGlobalObject)                 \
  IF_WASM(V, WasmInstanceObject)               \
226
  IF_WASM(V, WasmJSFunctionData)               \
227 228
  IF_WASM(V, WasmMemoryObject)                 \
  IF_WASM(V, WasmModuleObject)                 \
229
  IF_WASM(V, WasmObject)                       \
230 231 232
  IF_WASM(V, WasmStruct)                       \
  IF_WASM(V, WasmTypeInfo)                     \
  IF_WASM(V, WasmTableObject)                  \
233
  IF_WASM(V, WasmValueObject)                  \
234 235
  V(WeakFixedArray)                            \
  V(WeakArrayList)                             \
236
  V(WeakCell)                                  \
237
  TORQUE_DEFINED_CLASS_LIST(V)
238 239 240 241 242 243 244

#ifdef V8_INTL_SUPPORT
#define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
  HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V)  \
  V(JSV8BreakIterator)                    \
  V(JSCollator)                           \
  V(JSDateTimeFormat)                     \
245
  V(JSDisplayNames)                       \
246 247 248 249 250 251
  V(JSListFormat)                         \
  V(JSLocale)                             \
  V(JSNumberFormat)                       \
  V(JSPluralRules)                        \
  V(JSRelativeTimeFormat)                 \
  V(JSSegmentIterator)                    \
252 253
  V(JSSegmenter)                          \
  V(JSSegments)
254 255 256 257
#else
#define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) HEAP_OBJECT_ORDINARY_TYPE_LIST_BASE(V)
#endif  // V8_INTL_SUPPORT

258
#define HEAP_OBJECT_TEMPLATE_TYPE_LIST(V) V(HashTable)
259

260 261 262
// Logical sub-types of heap objects that don't correspond to a C++ class but
// represent some specialization in terms of additional constraints.
#define HEAP_OBJECT_SPECIALIZED_TYPE_LIST(V) \
263 264
  V(AwaitContext)                            \
  V(BlockContext)                            \
265
  V(CallableApiObject)                       \
266
  V(CallableJSProxy)                         \
267 268 269 270 271 272
  V(CatchContext)                            \
  V(DebugEvaluateContext)                    \
  V(EvalContext)                             \
  V(FreeSpaceOrFiller)                       \
  V(FunctionContext)                         \
  V(JSApiObject)                             \
273 274 275
  V(JSPromiseConstructor)                    \
  V(JSArrayConstructor)                      \
  V(JSRegExpConstructor)                     \
276 277 278 279 280 281 282 283 284
  V(JSMapKeyIterator)                        \
  V(JSMapKeyValueIterator)                   \
  V(JSMapValueIterator)                      \
  V(JSSetKeyValueIterator)                   \
  V(JSSetValueIterator)                      \
  V(JSSpecialApiObject)                      \
  V(ModuleContext)                           \
  V(NonNullForeign)                          \
  V(ScriptContext)                           \
285 286 287 288 289 290 291 292 293
  V(WithContext)                             \
  V(JSPrototype)                             \
  V(JSObjectPrototype)                       \
  V(JSRegExpPrototype)                       \
  V(JSPromisePrototype)                      \
  V(JSSetPrototype)                          \
  V(JSIteratorPrototype)                     \
  V(JSArrayIteratorPrototype)                \
  V(JSMapIteratorPrototype)                  \
294
  V(JSTypedArrayPrototype)                   \
295
  V(JSSetIteratorPrototype)                  \
296 297 298 299 300 301 302 303 304 305 306 307 308
  V(JSStringIteratorPrototype)               \
  V(TypedArrayConstructor)                   \
  V(Uint8TypedArrayConstructor)              \
  V(Int8TypedArrayConstructor)               \
  V(Uint16TypedArrayConstructor)             \
  V(Int16TypedArrayConstructor)              \
  V(Uint32TypedArrayConstructor)             \
  V(Int32TypedArrayConstructor)              \
  V(Float32TypedArrayConstructor)            \
  V(Float64TypedArrayConstructor)            \
  V(Uint8ClampedTypedArrayConstructor)       \
  V(Biguint64TypedArrayConstructor)          \
  V(Bigint64TypedArrayConstructor)
309

310 311
#define HEAP_OBJECT_TYPE_LIST(V)    \
  HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
312 313
  HEAP_OBJECT_TEMPLATE_TYPE_LIST(V) \
  HEAP_OBJECT_SPECIALIZED_TYPE_LIST(V)
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330

#define ODDBALL_LIST(V)                 \
  V(Undefined, undefined_value)         \
  V(Null, null_value)                   \
  V(TheHole, the_hole_value)            \
  V(Exception, exception)               \
  V(Uninitialized, uninitialized_value) \
  V(True, true_value)                   \
  V(False, false_value)                 \
  V(ArgumentsMarker, arguments_marker)  \
  V(OptimizedOut, optimized_out)        \
  V(StaleRegister, stale_register)

}  // namespace internal
}  // namespace v8

#endif  // V8_OBJECTS_OBJECT_LIST_MACROS_H_