1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ECMASCRIPT_GLOBAL_ENV_FIELDS_H 17 #define ECMASCRIPT_GLOBAL_ENV_FIELDS_H 18 19 #include <cstdint> 20 #include "ecmascript/property_detector.h" 21 22 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 23 #define GLOBAL_ENV_COMMON_FIELDS(V) \ 24 /* Function */ \ 25 V(JSTaggedValue, ObjectFunction, OBJECT_FUNCTION_INDEX) \ 26 V(JSTaggedValue, ObjectFunctionClass, OBJECT_FUNCTION_CLASS_INDEX) \ 27 V(JSTaggedValue, ObjectFunctionPrototype, OBJECT_FUNCTION_PROTOTYPE_INDEX) \ 28 V(JSTaggedValue, ObjectFunctionPrototypeClass, OBJECT_FUNCTION_PROTOTYPE_CLASS_INDEX) \ 29 V(JSTaggedValue, SObjectFunction, SHARED_OBJECT_FUNCTION_INDEX) \ 30 V(JSTaggedValue, SObjectFunctionPrototype, SHARED_OBJECT_FUNCTION_PROTOTYPE_INDEX) \ 31 V(JSTaggedValue, FunctionFunction, FUNCTION_FUNCTION_INDEX) \ 32 V(JSTaggedValue, FunctionPrototype, FUNCTION_PROTOTYPE_INDEX) \ 33 V(JSTaggedValue, SFunctionFunction, SHARED_FUNCTION_FUNCTION_INDEX) \ 34 V(JSTaggedValue, SFunctionPrototype, SHARED_FUNCTION_PROTOTYPE_INDEX) \ 35 V(JSTaggedValue, SConstructorClass, SHARED_CONSTRUCTOR_CLASS_INDEX) \ 36 V(JSTaggedValue, NumberFunction, NUMBER_FUNCTION_INDEX) \ 37 V(JSTaggedValue, NumberPrototype, NUMBER_PROTOTYPE_INDEX) \ 38 V(JSTaggedValue, BigIntFunction, BIGINT_FUNCTION_INDEX) \ 39 V(JSTaggedValue, DateFunction, DATE_FUNCTION_INDEX) \ 40 V(JSTaggedValue, DatePrototype, DATE_PROTOTYPE_INDEX) \ 41 V(JSTaggedValue, BooleanFunction, BOOLEAN_FUNCTION_INDEX) \ 42 V(JSTaggedValue, ErrorFunction, ERROR_FUNCTION_INDEX) \ 43 V(JSTaggedValue, ArrayFunction, ARRAY_FUNCTION_INDEX) \ 44 V(JSTaggedValue, ArrayPrototype, ARRAY_PROTOTYPE_INDEX) \ 45 V(JSTaggedValue, TypedArrayFunction, TYPED_ARRAY_FUNCTION_INDEX) \ 46 V(JSTaggedValue, TypedArrayPrototype, TYPED_ARRAY_PROTOTYPE_INDEX) \ 47 V(JSTaggedValue, Int8ArrayFunction, INT8_ARRAY_FUNCTION_INDEX) \ 48 V(JSTaggedValue, Uint8ArrayFunction, UINT8_ARRAY_FUNCTION_INDEX) \ 49 V(JSTaggedValue, Uint8ClampedArrayFunction, UINT8_CLAMPED_ARRAY_FUNCTION_INDEX) \ 50 V(JSTaggedValue, Int16ArrayFunction, INT16_ARRAY_FUNCTION_INDEX) \ 51 V(JSTaggedValue, Uint16ArrayFunction, UINT16_ARRAY_FUNCTION_INDEX) \ 52 V(JSTaggedValue, Int32ArrayFunction, INT32_ARRAY_FUNCTION_INDEX) \ 53 V(JSTaggedValue, Uint32ArrayFunction, UINT32_ARRAY_FUNCTION_INDEX) \ 54 V(JSTaggedValue, Float32ArrayFunction, FLOAT32_ARRAY_FUNCTION_INDEX) \ 55 V(JSTaggedValue, Float64ArrayFunction, FLOAT64_ARRAY_FUNCTION_INDEX) \ 56 V(JSTaggedValue, BigInt64ArrayFunction, BIGINT64_ARRAY_FUNCTION_INDEX) \ 57 V(JSTaggedValue, BigUint64ArrayFunction, BIGUINT64_ARRAY_FUNCTION_INDEX) \ 58 V(JSTaggedValue, Int8ArrayFunctionPrototype, INT8_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 59 V(JSTaggedValue, Uint8ArrayFunctionPrototype, UINT8_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 60 V(JSTaggedValue, Uint8ClampedArrayFunctionPrototype, UINT8_CLAMPED_ARRAY_FUNCTION_PROTO_INDEX) \ 61 V(JSTaggedValue, Int16ArrayFunctionPrototype, INT16_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 62 V(JSTaggedValue, Uint16ArrayFunctionPrototype, UINT16_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 63 V(JSTaggedValue, Int32ArrayFunctionPrototype, INT32_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 64 V(JSTaggedValue, Uint32ArrayFunctionPrototype, UINT32_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 65 V(JSTaggedValue, Float32ArrayFunctionPrototype, FLOAT32_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 66 V(JSTaggedValue, Float64ArrayFunctionPrototype, FLOAT64_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 67 V(JSTaggedValue, BigInt64ArrayFunctionPrototype, BIGINT64_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 68 V(JSTaggedValue, BigUint64ArrayFunctionPrototype, BIGUINT64_ARRAY_FUNCTION_PROTOTYPE_INDEX) \ 69 V(JSTaggedValue, Int8ArrayRootHclass, INT8_ARRAY_ROOT_HCLASS_INDEX) \ 70 V(JSTaggedValue, Uint8ArrayRootHclass, UINT8_ARRAY_ROOT_HCLASS_INDEX) \ 71 V(JSTaggedValue, Uint8ClampedArrayRootHclass, UINT8_CLAMPED_ARRAY_ROOT_HCLASS_INDEX) \ 72 V(JSTaggedValue, Int16ArrayRootHclass, INT16_ARRAY_ROOT_HCLASS_INDEX) \ 73 V(JSTaggedValue, Uint16ArrayRootHclass, UINT16_ARRAY_ROOT_HCLASS_INDEX) \ 74 V(JSTaggedValue, Int32ArrayRootHclass, INT32_ARRAY_ROOT_HCLASS_INDEX) \ 75 V(JSTaggedValue, Uint32ArrayRootHclass, UINT32_ARRAY_ROOT_HCLASS_INDEX) \ 76 V(JSTaggedValue, Float32ArrayRootHclass, FLOAT32_ARRAY_ROOT_HCLASS_INDEX) \ 77 V(JSTaggedValue, Float64ArrayRootHclass, FLOAT64_ARRAY_ROOT_HCLASS_INDEX) \ 78 V(JSTaggedValue, BigInt64ArrayRootHclass, BIGINT64_ARRAY_ROOT_HCLASS_INDEX) \ 79 V(JSTaggedValue, BigUint64ArrayRootHclass, BIGUINT64_ARRAY_ROOT_HCLASS_INDEX) \ 80 V(JSTaggedValue, Int8ArrayRootHclassOnHeap, INT8_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 81 V(JSTaggedValue, Uint8ArrayRootHclassOnHeap, UINT8_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 82 V(JSTaggedValue, Uint8ClampedArrayRootHclassOnHeap, UINT8_CLAMPED_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 83 V(JSTaggedValue, Int16ArrayRootHclassOnHeap, INT16_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 84 V(JSTaggedValue, Uint16ArrayRootHclassOnHeap, UINT16_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 85 V(JSTaggedValue, Int32ArrayRootHclassOnHeap, INT32_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 86 V(JSTaggedValue, Uint32ArrayRootHclassOnHeap, UINT32_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 87 V(JSTaggedValue, Float32ArrayRootHclassOnHeap, FLOAT32_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 88 V(JSTaggedValue, Float64ArrayRootHclassOnHeap, FLOAT64_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 89 V(JSTaggedValue, BigInt64ArrayRootHclassOnHeap, BIGINT64_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 90 V(JSTaggedValue, BigUint64ArrayRootHclassOnHeap, BIGUINT64_ARRAY_ROOT_HCLASS_ON_HEAP_INDEX) \ 91 V(JSTaggedValue, ArrayBufferFunction, ARRAY_BUFFER_FUNCTION_INDEX) \ 92 V(JSTaggedValue, SharedArrayBufferFunction, SHAREDARRAY_BUFFER_FUNCTION_INDEX) \ 93 V(JSTaggedValue, ArrayProtoValuesFunction, ARRAY_PROTO_VALUES_FUNCTION_INDEX) \ 94 V(JSTaggedValue, SetProtoValuesFunction, SET_PROTO_VALUES_FUNCTION_INDEX) \ 95 V(JSTaggedValue, MapProtoEntriesFunction, MAP_PROTO_ENTRIES_FUNCTION_INDEX) \ 96 V(JSTaggedValue, StringProtoIterFunction, STRING_PROTO_ITER_FUNCTION_INDEX) \ 97 V(JSTaggedValue, TypedArrayProtoValuesFunction, TYPED_ARRAY_PROTO_VALUES_FUNCTION_INDEX) \ 98 V(JSTaggedValue, DataViewFunction, DATA_VIEW_FUNCTION_INDEX) \ 99 V(JSTaggedValue, DataViewPrototype, DATA_VIEW_PROTOTYPE_INDEX) \ 100 V(JSTaggedValue, SymbolFunction, SYMBOL_FUNCTION_INDEX) \ 101 V(JSTaggedValue, RangeErrorFunction, RANGE_ERROR_FUNCTION_INDEX) \ 102 V(JSTaggedValue, ReferenceErrorFunction, REFERENCE_ERROR_FUNCTION_INDEX) \ 103 V(JSTaggedValue, TypeErrorFunction, TYPE_ERROR_FUNCTION_INDEX) \ 104 V(JSTaggedValue, AggregateErrorFunction, AGGREGATE_ERROR_FUNCTION_INDEX) \ 105 V(JSTaggedValue, URIErrorFunction, URI_ERROR_FUNCTION_INDEX) \ 106 V(JSTaggedValue, SyntaxErrorFunction, SYNTAX_ERROR_FUNCTION_INDEX) \ 107 V(JSTaggedValue, EvalErrorFunction, EVAL_ERROR_FUNCTION_INDEX) \ 108 V(JSTaggedValue, OOMErrorFunction, OOM_ERROR_FUNCTION_INDEX) \ 109 V(JSTaggedValue, OOMErrorObject, OOM_ERROR_Object_INDEX) \ 110 V(JSTaggedValue, TerminationErrorFunction, TERMINATION_ERROR_FUNCTION_INDEX) \ 111 V(JSTaggedValue, IntlFunction, INTL_FUNCTION_INDEX) \ 112 V(JSTaggedValue, LocaleFunction, LOCALE_FUNCTION_INDEX) \ 113 V(JSTaggedValue, DateTimeFormatFunction, DATE_TIME_FORMAT_FUNCTION_INDEX) \ 114 V(JSTaggedValue, RelativeTimeFormatFunction, RELATIVE_TIME_FORMAT_FUNCTION_INDEX) \ 115 V(JSTaggedValue, NumberFormatFunction, NUMBER_FORMAT_FUNCTION_INDEX) \ 116 V(JSTaggedValue, CollatorFunction, COLLATOR_FUNCTION_INDEX) \ 117 V(JSTaggedValue, PluralRulesFunction, PLURAL_RULES_FUNCTION_INDEX) \ 118 V(JSTaggedValue, DisplayNamesFunction, DISPLAY_NAMES_FUNCTION_INDEX) \ 119 V(JSTaggedValue, ListFormatFunction, LIST_FORMAT_FUNCTION_INDEX) \ 120 V(JSTaggedValue, RegExpFunction, REGEXP_FUNCTION_INDEX) \ 121 V(JSTaggedValue, RegExpExecFunction, REGEXP_EXEC_FUNCTION_INDEX) \ 122 V(JSTaggedValue, RegExpPrototype, REGEXP_PROTOTYPE_INDEX) \ 123 V(JSTaggedValue, RegExpPrototypeClass, REGEXP_PROTOTYPE_CLASS_INDEX) \ 124 V(JSTaggedValue, BuiltinsSetFunction, BUILTINS_SET_FUNCTION_INDEX) \ 125 V(JSTaggedValue, SetPrototype, SET_PROTOTYPE_INDEX) \ 126 V(JSTaggedValue, BuiltinsMapFunction, BUILTINS_MAP_FUNCTION_INDEX) \ 127 V(JSTaggedValue, BuiltinsWeakMapFunction, BUILTINS_WEAK_MAP_FUNCTION_INDEX) \ 128 V(JSTaggedValue, BuiltinsWeakSetFunction, BUILTINS_WEAK_SET_FUNCTION_INDEX) \ 129 V(JSTaggedValue, BuiltinsWeakRefFunction, BUILTINS_WEAK_REF_FUNCTION_INDEX) \ 130 V(JSTaggedValue, BuiltinsFinalizationRegistryFunction, \ 131 BUILTINS_FINALIZATION_REGISTRY_FUNCTION_INDEX) \ 132 V(JSTaggedValue, MapPrototype, MAP_PROTOTYPE_INDEX) \ 133 V(JSTaggedValue, MathFunction, MATH_FUNCTION_INDEX) \ 134 V(JSTaggedValue, AtomicsFunction, ATOMICS_FUNCTION_INDEX) \ 135 V(JSTaggedValue, JsonFunction, JSON_FUNCTION_INDEX) \ 136 V(JSTaggedValue, StringFunction, STRING_FUNCTION_INDEX) \ 137 V(JSTaggedValue, StringPrototype, STRING_PROTOTYPE_INDEX) \ 138 V(JSTaggedValue, ProxyFunction, PROXY_FUNCTION_INDEX) \ 139 V(JSTaggedValue, GeneratorFunctionFunction, GENERATOR_FUNCTION_OFFSET) \ 140 V(JSTaggedValue, GeneratorFunctionPrototype, GENERATOR_FUNCTION_PROTOTYPE_OFFSET) \ 141 V(JSTaggedValue, AsyncGeneratorFunctionFunction, ASYNC_GENERATOR_FUNCTION_OFFSET) \ 142 V(JSTaggedValue, AsyncGeneratorFunctionPrototype, ASYNC_GENERATOR_FUNCTION_PROTOTYPE_OFFSET) \ 143 V(JSTaggedValue, InitialGenerator, INITIAL_GENERATOR_OFFSET) \ 144 V(JSTaggedValue, InitialAsyncGenerator, INITIAL_ASYNC_GENERATOR_OFFSET) \ 145 V(JSTaggedValue, GeneratorPrototype, GENERATOR_PROTOTYPE_OFFSET) \ 146 V(JSTaggedValue, AsyncGeneratorPrototype, ASYNC_GENERATOR_PROTOTYPE_OFFSET) \ 147 V(JSTaggedValue, ReflectFunction, REFLECT_FUNCTION_INDEX) \ 148 V(JSTaggedValue, AsyncFunction, ASYNC_FUNCTION_INDEX) \ 149 V(JSTaggedValue, AsyncFunctionPrototype, ASYNC_FUNCTION_PROTOTYPE_INDEX) \ 150 V(JSTaggedValue, JSGlobalObject, JS_GLOBAL_OBJECT_INDEX) \ 151 V(JSTaggedValue, HasInstanceSymbol, HASINSTANCE_SYMBOL_INDEX) \ 152 V(JSTaggedValue, HasInstanceFunction, HASINSTANCE_FUNCTION_INDEX) \ 153 V(JSTaggedValue, IsConcatSpreadableSymbol, ISCONCAT_SYMBOL_INDEX) \ 154 V(JSTaggedValue, ToStringTagSymbol, TOSTRINGTAG_SYMBOL_INDEX) \ 155 V(JSTaggedValue, AsyncIteratorSymbol, ASYNC_ITERATOR_SYMBOL_INDEX) \ 156 V(JSTaggedValue, MatchSymbol, MATCH_SYMBOL_INDEX) \ 157 V(JSTaggedValue, MatchAllSymbol, MATCH_All_SYMBOL_INDEX) \ 158 V(JSTaggedValue, SearchSymbol, SEARCH_SYMBOL_INDEX) \ 159 V(JSTaggedValue, ToPrimitiveSymbol, TOPRIMITIVE_SYMBOL_INDEX) \ 160 V(JSTaggedValue, UnscopablesSymbol, UNSCOPABLES_SYMBOL_INDEX) \ 161 V(JSTaggedValue, HoleySymbol, HOLEY_SYMBOL_OFFSET) \ 162 V(JSTaggedValue, ElementICSymbol, ELEMENT_IC_SYMBOL_OFFSET) \ 163 V(JSTaggedValue, IteratorPrototype, ITERATOR_PROTOTYPE_INDEX) \ 164 V(JSTaggedValue, AsyncIteratorPrototype, ASYNC_ITERATOR_PROTOTYPE_INDEX) \ 165 V(JSTaggedValue, ForinIteratorPrototype, FORIN_ITERATOR_PROTOTYPE_INDEX) \ 166 V(JSTaggedValue, ForinIteratorClass, FOR_IN_ITERATOR_CLASS_INDEX) \ 167 V(JSTaggedValue, StringIterator, STRING_ITERATOR_INDEX) \ 168 V(JSTaggedValue, AsyncFromSyncIterator, ASYNC_FROM_SYNC_ITERATOR_INDEX) \ 169 V(JSTaggedValue, MapIteratorPrototype, MAP_ITERATOR_PROTOTYPE_INDEX) \ 170 V(JSTaggedValue, SetIteratorPrototype, SET_ITERATOR_PROTOTYPE_INDEX) \ 171 V(JSTaggedValue, RegExpIteratorPrototype, REGEXP_ITERATOR_PROTOTYPE_INDEX) \ 172 V(JSTaggedValue, ArrayIteratorPrototype, ARRAY_ITERATOR_PROTOTYPE_INDEX) \ 173 V(JSTaggedValue, StringIteratorPrototype, STRING_ITERATOR_PROTOTYPE_INDEX) \ 174 V(JSTaggedValue, AsyncFromSyncIteratorPrototype, ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_INDEX) \ 175 /* SymbolTable *RegisterSymbols */ \ 176 V(JSTaggedValue, RegisterSymbols, SYMBOLS_INDEX) \ 177 V(JSTaggedValue, ThrowTypeError, THROW_TYPE_ERROR_INDEX) \ 178 V(JSTaggedValue, PromiseFunction, PROMISE_FUNCTION_INDEX) \ 179 V(JSTaggedValue, PromiseReactionJob, PROMISE_REACTION_JOB_INDEX) \ 180 V(JSTaggedValue, PromiseResolveThenableJob, PROMISE_REACTION_THENABLE_JOB_INDEX) \ 181 V(JSTaggedValue, DynamicImportJob, DYNAMIC_IMPORT_JOB_INDEX) \ 182 V(JSTaggedValue, TemplateMap, TEMPLATE_MAP_INDEX) \ 183 V(JSTaggedValue, FunctionClassWithProto, FUNCTION_CLASS_WITH_PROTO) \ 184 V(JSTaggedValue, FunctionClassWithoutProto, FUNCTION_CLASS_WITHOUT_PROTO) \ 185 V(JSTaggedValue, FunctionClassWithoutName, FUNCTION_CLASS_WITHOUT_NAME) \ 186 V(JSTaggedValue, BoundFunctionClass, BOUND_FUNCTION_CLASS) \ 187 V(JSTaggedValue, SFunctionClassWithoutProto, SHARED_FUNCTION_CLASS_WITHOUT_PROTO) \ 188 V(JSTaggedValue, ArgumentsClass, ARGUMENTS_CLASS) \ 189 V(JSTaggedValue, ArgumentsCallerAccessor, ARGUMENTS_CALLER_ACCESSOR) \ 190 V(JSTaggedValue, ArgumentsCalleeAccessor, ARGUMENTS_CALLEE_ACCESSOR) \ 191 V(JSTaggedValue, AsyncFunctionClass, ASYNC_FUNCTION_CLASS) \ 192 V(JSTaggedValue, AsyncAwaitStatusFunctionClass, ASYNC_AWAIT_STATUS_FUNCTION_CLASS) \ 193 V(JSTaggedValue, PromiseReactionFunctionClass, PROMISE_REACTION_FUNCTION_CLASS) \ 194 V(JSTaggedValue, PromiseExecutorFunctionClass, PROMISE_EXECUTOR_FUNCTION_CLASS) \ 195 V(JSTaggedValue, AsyncModuleFulfilledFunctionClass, ASYNC_MODULE_FULFILLED_FUNCTION_CLASS) \ 196 V(JSTaggedValue, AsyncModuleRejectedFunctionClass, ASYNC_MODULE_REJECTED_FUNCTION_CLASS) \ 197 V(JSTaggedValue, GeneratorFunctionClass, GENERATOR_FUNCTION_CLASS) \ 198 V(JSTaggedValue, AsyncGeneratorFunctionClass, ASYNC_GENERATOR_FUNCTION_CLASS) \ 199 V(JSTaggedValue, PromiseAllResolveElementFunctionClass, PROMISE_ALL_RESOLVE_ELEMENT_FUNC_CLASS) \ 200 V(JSTaggedValue, PromiseAnyRejectElementFunctionClass, PROMISE_ANY_REJECT_ELEMENT_FUNC_CLASS) \ 201 V(JSTaggedValue, PromiseAllSettledElementFunctionClass, PROMISE_ALL_SETTLED_ELEMENT_FUNC_CLASS) \ 202 V(JSTaggedValue, PromiseFinallyFunctionClass, PROMISE_FINALLY_FUNC_CLASS) \ 203 V(JSTaggedValue, PromiseValueThunkOrThrowerFunctionClass, \ 204 PROMISE_VALUE_THUNK_OR_THROWER_FUNCTION_CLASS) \ 205 V(JSTaggedValue, AsyncGeneratorResNextRetProRstFtnClass, \ 206 ASYNC_GENERATOR_RESUME_NEXT_RETURN_PROCESSOR_RST_FTN_CLASS) \ 207 V(JSTaggedValue, AsyncFromSyncIterUnwarpClass, ASYNC_FROM_SYNC_ITER_UNWARP_CLASS) \ 208 V(JSTaggedValue, ProxyRevocFunctionClass, PROXY_REVOC_FUNCTION_CLASS) \ 209 V(JSTaggedValue, NativeErrorFunctionClass, NATIVE_ERROR_FUNCTION_CLASS) \ 210 V(JSTaggedValue, SpecificTypedArrayFunctionClass, SPERCIFIC_TYPED_ARRAY_FUNCTION_CLASS) \ 211 V(JSTaggedValue, ConstructorFunctionClass, CONSTRUCTOR_FUNCTION_CLASS) \ 212 V(JSTaggedValue, NormalFunctionClass, NORMAL_FUNCTION_CLASS) \ 213 V(JSTaggedValue, SNormalFunctionClass, SHARED_NORMAL_FUNCTION_CLASS) \ 214 V(JSTaggedValue, JSIntlBoundFunctionClass, JS_INTL_BOUND_FUNCTION_CLASS) \ 215 V(JSTaggedValue, NumberFormatLocales, NUMBER_FORMAT_LOCALES_INDEX) \ 216 V(JSTaggedValue, DateTimeFormatLocales, DATE_TIMEFORMAT_LOCALES_INDEX) \ 217 V(JSTaggedValue, ListFormatLocales, LIST_FORMAT_LOCALES_INDEX) \ 218 V(JSTaggedValue, GlobalRecord, GLOBAL_RECORD) \ 219 V(JSTaggedValue, ModuleNamespaceClass, MODULENAMESPACE_CLASS) \ 220 V(JSTaggedValue, ObjectLiteralHClassCache, OBJECT_LITERAL_HCLASS_CACHE) \ 221 V(JSTaggedValue, WeakRefKeepObjects, WEAK_REF_KEEP_OBJECTS) \ 222 V(JSTaggedValue, FinRegLists, FIN_REG_LISTS) \ 223 V(JSTaggedValue, NativeBindingSymbol, NATIVE_BINDING_SYMBOL_INDEX) \ 224 V(JSTaggedValue, CjsModuleFunction, CJS_MODULE_FUNCTION_INDEX) \ 225 V(JSTaggedValue, CjsExportsFunction, CJS_EXPORTS_FUNCTION_INDEX) \ 226 V(JSTaggedValue, CjsRequireFunction, CJS_REQUIRE_FUNCTION_INDEX) \ 227 V(JSTaggedValue, GlobalPatch, GLOBAL_PATCH) \ 228 V(JSTaggedValue, ExportOfScript, DEFAULT_EXPORT_OF_SCRIPT) \ 229 V(JSTaggedValue, JsonObjectHclassCache, JSON_OBJECT_HCLASS_CACHE) 230 231 // Maintain the same order with DETECTOR_SYMBOL_LIST 232 #define GLOBAL_ENV_DETECTOR_SYMBOL_FIELDS(V) \ 233 V(JSTaggedValue, ReplaceSymbol, REPLACE_SYMBOL_INDEX) \ 234 V(JSTaggedValue, SplitSymbol, SPLIT_SYMBOL_INDEX) \ 235 V(JSTaggedValue, IteratorSymbol, ITERATOR_SYMBOL_INDEX) \ 236 V(JSTaggedValue, SpeciesSymbol, SPECIES_SYMBOL_INDEX) 237 238 #define GLOBAL_ENV_FIELDS(V) \ 239 GLOBAL_ENV_COMMON_FIELDS(V) \ 240 GLOBAL_ENV_DETECTOR_SYMBOL_FIELDS(V) \ 241 GLOBAL_ENV_DETECTOR_FIELDS(V) 242 243 namespace panda::ecmascript { 244 #define GLOBAL_ENV_FIELD_ENUM_ITEM(Type, Name, INDEX) INDEX, 245 enum class GlobalEnvField: uint8_t { 246 GLOBAL_ENV_FIELDS(GLOBAL_ENV_FIELD_ENUM_ITEM) 247 FINAL_INDEX 248 }; 249 #undef GLOBAL_ENV_FIELD_ENUM_ITEM 250 } // namespace panda::ecmascript 251 #endif // ECMASCRIPT_GLOBAL_ENV_FIELDS_H 252