1 /** 2 * Copyright (c) 2023-2025 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 PANDA_PLUGINS_ETS_RUNTIME_ETS_PANDA_FILE_ITEMS_H_ 17 #define PANDA_PLUGINS_ETS_RUNTIME_ETS_PANDA_FILE_ITEMS_H_ 18 19 #include <string_view> 20 21 namespace ark::ets::panda_file_items { 22 23 // clang-format off 24 namespace class_descriptors { 25 26 // Base classes 27 static constexpr std::string_view ERROR = "Lescompat/Error;"; 28 static constexpr std::string_view ARRAY_BUFFER = "Lescompat/ArrayBuffer;"; 29 static constexpr std::string_view BIG_INT = "Lescompat/BigInt;"; 30 static constexpr std::string_view ASYNC = "Lets/coroutine/Async;"; 31 static constexpr std::string_view EXCEPTION = "Lstd/core/Exception;"; 32 static constexpr std::string_view OBJECT = "Lstd/core/Object;"; 33 static constexpr std::string_view PROMISE = "Lstd/core/Promise;"; 34 static constexpr std::string_view JOB = "Lstd/core/Job;"; 35 static constexpr std::string_view PROMISE_REF = "Lstd/core/PromiseRef;"; 36 static constexpr std::string_view WAITERS_LIST = "Lstd/core/WaitersList;"; 37 static constexpr std::string_view MUTEX = "Lstd/core/Mutex;"; 38 static constexpr std::string_view EVENT = "Lstd/core/Event;"; 39 static constexpr std::string_view COND_VAR = "Lstd/core/CondVar;"; 40 static constexpr std::string_view QUEUE_SPINLOCK = "Lstd/core/QueueSpinlock;"; 41 static constexpr std::string_view NULL_VALUE = "Lstd/core/__NullValue;"; 42 static constexpr std::string_view STRING = "Lstd/core/String;"; 43 static constexpr std::string_view WEAK_REF = "Lstd/core/WeakRef;"; 44 static constexpr std::string_view FINALIZABLE_WEAK_REF = "Lstd/core/FinalizableWeakRef;"; 45 static constexpr std::string_view FINALIZATION_REGISTRY = "Lstd/core/FinalizationRegistry;"; 46 static constexpr std::string_view TYPE = "Lstd/core/Type;"; 47 static constexpr std::string_view FIELD = "Lstd/core/Field;"; 48 static constexpr std::string_view METHOD = "Lstd/core/Method;"; 49 static constexpr std::string_view PARAMETER = "Lstd/core/Parameter;"; 50 static constexpr std::string_view STRING_BUILDER = "Lstd/core/StringBuilder;"; 51 52 // Runtime classes 53 static constexpr std::string_view STACK_TRACE_ELEMENT = "Lstd/core/StackTraceElement;"; 54 static constexpr std::string_view ABC_FILE = "Lstd/core/AbcFile;"; 55 static constexpr std::string_view ABC_RUNTIME_LINKER = "Lstd/core/AbcRuntimeLinker;"; 56 static constexpr std::string_view MEMORY_RUNTIME_LINKER = "Lstd/core/MemoryRuntimeLinker;"; 57 static constexpr std::string_view BOOT_RUNTIME_LINKER = "Lstd/core/BootRuntimeLinker;"; 58 static constexpr std::string_view CLASS = "Lstd/core/Class;"; 59 static constexpr std::string_view RUNTIME_LINKER = "Lstd/core/RuntimeLinker;"; 60 61 // Box classes 62 static constexpr std::string_view BOX_BOOLEAN = "Lstd/core/Boolean;"; 63 static constexpr std::string_view BOX_BYTE = "Lstd/core/Byte;"; 64 static constexpr std::string_view BOX_CHAR = "Lstd/core/Char;"; 65 static constexpr std::string_view BOX_SHORT = "Lstd/core/Short;"; 66 static constexpr std::string_view BOX_INT = "Lstd/core/Int;"; 67 static constexpr std::string_view BOX_LONG = "Lstd/core/Long;"; 68 static constexpr std::string_view BOX_FLOAT = "Lstd/core/Float;"; 69 static constexpr std::string_view BOX_DOUBLE = "Lstd/core/Double;"; 70 71 // Arrays of base classes 72 static constexpr std::string_view CLASS_ARRAY = "[Lstd/core/Class;"; 73 static constexpr std::string_view STRING_ARRAY = "[Lstd/core/String;"; 74 75 // Functional interfaces 76 static constexpr std::string_view FUNCTION = "Lstd/core/Function;"; 77 static constexpr std::string_view FUNCTION0 = "Lstd/core/Function0;"; 78 static constexpr std::string_view FUNCTION1 = "Lstd/core/Function1;"; 79 static constexpr std::string_view FUNCTION2 = "Lstd/core/Function2;"; 80 static constexpr std::string_view FUNCTION3 = "Lstd/core/Function3;"; 81 static constexpr std::string_view FUNCTION4 = "Lstd/core/Function4;"; 82 static constexpr std::string_view FUNCTION5 = "Lstd/core/Function5;"; 83 static constexpr std::string_view FUNCTION6 = "Lstd/core/Function6;"; 84 static constexpr std::string_view FUNCTION7 = "Lstd/core/Function7;"; 85 static constexpr std::string_view FUNCTION8 = "Lstd/core/Function8;"; 86 static constexpr std::string_view FUNCTION9 = "Lstd/core/Function9;"; 87 static constexpr std::string_view FUNCTION10 = "Lstd/core/Function10;"; 88 static constexpr std::string_view FUNCTION11 = "Lstd/core/Function11;"; 89 static constexpr std::string_view FUNCTION12 = "Lstd/core/Function12;"; 90 static constexpr std::string_view FUNCTION13 = "Lstd/core/Function13;"; 91 static constexpr std::string_view FUNCTION14 = "Lstd/core/Function14;"; 92 static constexpr std::string_view FUNCTION15 = "Lstd/core/Function15;"; 93 static constexpr std::string_view FUNCTION16 = "Lstd/core/Function16;"; 94 static constexpr std::string_view FUNCTIONN = "Lstd/core/FunctionN;"; 95 96 // varargs Functional interfaces 97 static constexpr std::string_view FUNCTIONR0 = "Lstd/core/FunctionR0;"; 98 static constexpr std::string_view FUNCTIONR1 = "Lstd/core/FunctionR1;"; 99 static constexpr std::string_view FUNCTIONR2 = "Lstd/core/FunctionR2;"; 100 static constexpr std::string_view FUNCTIONR3 = "Lstd/core/FunctionR3;"; 101 static constexpr std::string_view FUNCTIONR4 = "Lstd/core/FunctionR4;"; 102 static constexpr std::string_view FUNCTIONR5 = "Lstd/core/FunctionR5;"; 103 static constexpr std::string_view FUNCTIONR6 = "Lstd/core/FunctionR6;"; 104 static constexpr std::string_view FUNCTIONR7 = "Lstd/core/FunctionR7;"; 105 static constexpr std::string_view FUNCTIONR8 = "Lstd/core/FunctionR8;"; 106 static constexpr std::string_view FUNCTIONR9 = "Lstd/core/FunctionR9;"; 107 static constexpr std::string_view FUNCTIONR10 = "Lstd/core/FunctionR10;"; 108 static constexpr std::string_view FUNCTIONR11 = "Lstd/core/FunctionR11;"; 109 static constexpr std::string_view FUNCTIONR12 = "Lstd/core/FunctionR12;"; 110 static constexpr std::string_view FUNCTIONR13 = "Lstd/core/FunctionR13;"; 111 static constexpr std::string_view FUNCTIONR14 = "Lstd/core/FunctionR14;"; 112 static constexpr std::string_view FUNCTIONR15 = "Lstd/core/FunctionR15;"; 113 static constexpr std::string_view FUNCTIONR16 = "Lstd/core/FunctionR16;"; 114 115 // Tuple classes 116 static constexpr std::string_view TUPLE = "Lstd/core/Tuple;"; 117 static constexpr std::string_view TUPLE0 = "Lstd/core/Tuple0;"; 118 static constexpr std::string_view TUPLE1 = "Lstd/core/Tuple1;"; 119 static constexpr std::string_view TUPLE2 = "Lstd/core/Tuple2;"; 120 static constexpr std::string_view TUPLE3 = "Lstd/core/Tuple3;"; 121 static constexpr std::string_view TUPLE4 = "Lstd/core/Tuple4;"; 122 static constexpr std::string_view TUPLE5 = "Lstd/core/Tuple5;"; 123 static constexpr std::string_view TUPLE6 = "Lstd/core/Tuple6;"; 124 static constexpr std::string_view TUPLE7 = "Lstd/core/Tuple7;"; 125 static constexpr std::string_view TUPLE8 = "Lstd/core/Tuple8;"; 126 static constexpr std::string_view TUPLE9 = "Lstd/core/Tuple9;"; 127 static constexpr std::string_view TUPLE10 = "Lstd/core/Tuple10;"; 128 static constexpr std::string_view TUPLE11 = "Lstd/core/Tuple11;"; 129 static constexpr std::string_view TUPLE12 = "Lstd/core/Tuple12;"; 130 static constexpr std::string_view TUPLE13 = "Lstd/core/Tuple13;"; 131 static constexpr std::string_view TUPLE14 = "Lstd/core/Tuple14;"; 132 static constexpr std::string_view TUPLE15 = "Lstd/core/Tuple15;"; 133 static constexpr std::string_view TUPLE16 = "Lstd/core/Tuple16;"; 134 static constexpr std::string_view TUPLEN = "Lstd/core/TupleN;"; 135 // Base type for all enums 136 static constexpr std::string_view BASE_ENUM = "Lstd/core/BaseEnum;"; 137 138 // core-defined error classes 139 static constexpr std::string_view ABC_FILE_NOT_FOUND_ERROR = "Lstd/core/AbcFileNotFoundError;"; 140 static constexpr std::string_view ARITHMETIC_ERROR = "Lstd/core/ArithmeticError;"; 141 static constexpr std::string_view ARRAY_INDEX_OUT_OF_BOUNDS_ERROR = "Lstd/core/ArrayIndexOutOfBoundsError;"; 142 static constexpr std::string_view ARRAY_STORE_ERROR = "Lstd/core/ArrayStoreError;"; 143 static constexpr std::string_view CLASS_CAST_ERROR = "Lstd/core/ClassCastError;"; 144 static constexpr std::string_view COROUTINES_LIMIT_EXCEED_ERROR = "Lstd/core/CoroutinesLimitExceedError;"; 145 static constexpr std::string_view EXCEPTION_IN_INITIALIZER_ERROR = "Lstd/core/ExceptionInInitializerError;"; 146 static constexpr std::string_view FILE_NOT_FOUND_ERROR = "Lstd/core/FileNotFoundError;"; 147 static constexpr std::string_view ILLEGAL_ACCESS_ERROR = "Lstd/core/IllegalAccessError;"; 148 // remove or make an Error 149 static constexpr std::string_view ILLEGAL_ARGUMENT_EXCEPTION = "Lstd/core/IllegalArgumentException;"; 150 static constexpr std::string_view ILLEGAL_MONITOR_STATE_ERROR = "Lstd/core/IllegalMonitorStateError;"; 151 // remove or make an Error 152 static constexpr std::string_view ILLEGAL_STATE_EXCEPTION = "Lstd/core/IllegalStateException;"; 153 static constexpr std::string_view INDEX_OUT_OF_BOUNDS_ERROR = "Lstd/core/IndexOutOfBoundsError;"; 154 static constexpr std::string_view INSTANTIATION_ERROR = "Lstd/core/InstantiationError;"; 155 // has no class defined 156 static constexpr std::string_view IO_ERROR = "Lstd/core/IOError;"; 157 static constexpr std::string_view NEGATIVE_ARRAY_SIZE_ERROR = "Lstd/core/NegativeArraySizeError;"; 158 static constexpr std::string_view LINKER_ABSTRACT_METHOD_ERROR = "Lstd/core/LinkerAbstractMethodError;"; 159 static constexpr std::string_view LINKER_TYPE_CIRCULARITY_ERROR = "Lstd/core/LinkerTypeCircularityError;"; 160 static constexpr std::string_view LINKER_CLASS_NOT_FOUND_ERROR = "Lstd/core/LinkerClassNotFoundError;"; 161 static constexpr std::string_view LINKER_BAD_SUPERTYPE_ERROR = "Lstd/core/LinkerBadSupertypeError;"; 162 static constexpr std::string_view LINKER_UNRESOLVED_CLASS_ERROR = "Lstd/core/LinkerUnresolvedClassError;"; 163 static constexpr std::string_view LINKER_UNRESOLVED_FIELD_ERROR = "Lstd/core/LinkerUnresolvedFieldError;"; 164 static constexpr std::string_view LINKER_UNRESOLVED_METHOD_ERROR = "Lstd/core/LinkerUnresolvedMethodError;"; 165 static constexpr std::string_view LINKER_METHOD_CONFLICT_ERROR = "Lstd/core/LinkerMethodConflictError;"; 166 static constexpr std::string_view LINKER_VERIFICATION_ERROR = "Lstd/core/LinkerVerificationError;"; 167 static constexpr std::string_view NULL_POINTER_ERROR = "Lstd/core/NullPointerError;"; 168 static constexpr std::string_view OUT_OF_MEMORY_ERROR = "Lstd/core/OutOfMemoryError;"; 169 static constexpr std::string_view RANGE_ERROR = "Lstd/core/RangeError;"; 170 static constexpr std::string_view SYNTAX_ERROR = "Lstd/core/SyntaxError;"; 171 static constexpr std::string_view REFERENCE_ERROR = "Lescompat/ReferenceError;"; 172 static constexpr std::string_view URI_ERROR = "Lescompat/URIError;"; 173 static constexpr std::string_view TYPE_ERROR = "Lescompat/TypeError;"; 174 // remove or make an Error 175 static constexpr std::string_view RUNTIME_EXCEPTION = "Lstd/core/RuntimeException;"; 176 static constexpr std::string_view STACK_OVERFLOW_ERROR = "Lstd/core/StackOverflowError;"; 177 static constexpr std::string_view STRING_INDEX_OUT_OF_BOUNDS_ERROR = "Lstd/core/StringIndexOutOfBoundsError;"; 178 // remove or make an Error 179 static constexpr std::string_view UNSUPPORTED_OPERATION_EXCEPTION = "Lstd/core/UnsupportedOperationException;"; 180 181 // coroutines 182 static constexpr std::string_view INVALID_COROUTINE_OPERATION_ERROR = "Lstd/core/InvalidCoroutineOperationError;"; 183 184 // stdlib Exception classes 185 static constexpr std::string_view ARGUMENT_OUT_OF_RANGE_EXCEPTION = "Lstd/core/ArgumentOutOfRangeException;"; 186 187 // stdlib Error classes 188 static constexpr std::string_view ERROR_OPTIONS = "Lescompat/ErrorOptions;"; 189 190 static constexpr std::string_view DOUBLE_TO_STRING_CACHE_ELEMENT = "Lstd/core/DoubleToStringCacheElement;"; 191 static constexpr std::string_view FLOAT_TO_STRING_CACHE_ELEMENT = "Lstd/core/FloatToStringCacheElement;"; 192 static constexpr std::string_view LONG_TO_STRING_CACHE_ELEMENT = "Lstd/core/LongToStringCacheElement;"; 193 194 // interop 195 static constexpr std::string_view NO_INTEROP_CONTEXT_ERROR = "Lstd/interop/js/NoInteropContextError;"; 196 197 // interop/js 198 static constexpr std::string_view JS_RUNTIME = "Lstd/interop/js/JSRuntime;"; 199 static constexpr std::string_view JS_VALUE = "Lstd/interop/js/JSValue;"; 200 static constexpr std::string_view ES_ERROR = "Lstd/interop/js/ESError;"; 201 202 static constexpr std::string_view ARRAY = "Lescompat/Array;"; 203 static constexpr std::string_view ARRAY_AS_LIST_INT = "Lstd/containers/ArrayAsListInt;"; 204 static constexpr std::string_view REG_EXP_EXEC_ARRAY = "Lescompat/RegExpExecArray;"; 205 static constexpr std::string_view JSON_REPLACER = "Lescompat/JsonReplacer;"; 206 207 // ANI annotation classes 208 static constexpr std::string_view ANI_UNSAFE_QUICK = "Lstd/annotations/ani/unsafe/Quick;"; 209 static constexpr std::string_view ANI_UNSAFE_DIRECT = "Lstd/annotations/ani/unsafe/Direct;"; 210 211 // Module annotation class 212 static constexpr std::string_view ANNOTATION_MODULE = "Lets/annotation/Module;"; 213 static constexpr std::string_view ANNOTATION_MODULE_EXPORTED = "exported"; 214 215 // Interface object literal annotation class 216 static constexpr std::string_view INTERFACE_OBJ_LITERAL = "Lstd/annotations/InterfaceObjectLiteral;"; 217 218 // escompat 219 static constexpr std::string_view DATE = "Lescompat/Date;"; 220 static constexpr std::string_view ARRAY_ENTRIES_ITERATOR_T = "Lescompat/ArrayEntriesIterator_T;"; 221 static constexpr std::string_view ITERATOR_RESULT = "Lescompat/IteratorResult;"; 222 static constexpr std::string_view ARRAY_KEYS_ITERATOR = "Lescompat/ArrayKeysIterator;"; 223 static constexpr std::string_view ARRAY_VALUES_ITERATOR_T = "Lescompat/ArrayValuesIterator_T;"; 224 static constexpr std::string_view MAP = "Lescompat/Map;"; 225 static constexpr std::string_view MAPENTRY = "Lescompat/MapEntry;"; 226 static constexpr std::string_view MAPITERATOR = "Lescompat/MapIterator;"; 227 static constexpr std::string_view EMPTYMAPITERATOR = "Lescompat/EmptyMapIterator;"; 228 static constexpr std::string_view SET = "Lescompat/Set;"; 229 static constexpr std::string_view RECORD = "Lescompat/Record;"; 230 static constexpr std::string_view PROCESS = "Lescompat/StdProcess;"; 231 232 // Json Annotations 233 static constexpr std::string_view JSON_STRINGIFY_IGNORE = "Lescompat/JSONStringifyIgnore;"; 234 static constexpr std::string_view JSON_PARSE_IGNORE = "Lescompat/JSONParseIgnore;"; 235 static constexpr std::string_view JSON_RENAME = "Lescompat/JSONRename;"; 236 237 // Annotation for optional parameters 238 static constexpr std::string_view OPTIONAL_PARAMETERS_ANNOTATION = 239 "Lstd/annotations/functions/OptionalParametersAnnotation;"; 240 241 // Annotation for function reference 242 static constexpr std::string_view ANNOTATION_FUNCTIONAL_REFERENCE = 243 "Lets/annotation/FunctionalReference;"; 244 245 } // namespace class_descriptors 246 247 static constexpr std::string_view CCTOR = "<cctor>"; 248 static constexpr std::string_view CTOR = "<ctor>"; 249 // clang-format on 250 251 } // namespace ark::ets::panda_file_items 252 253 #endif // PANDA_PLUGINS_ETS_RUNTIME_ETS_PANDA_FILE_ITEMS_H_ 254