• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2023-2024 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 CLASS                                = "Lstd/core/Class;";
33 static constexpr std::string_view OBJECT                               = "Lstd/core/Object;";
34 static constexpr std::string_view PROMISE                              = "Lstd/core/Promise;";
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 INTERNAL_UNDEFINED                   = "Lstd/core/__internal_undefined;";
41 static constexpr std::string_view STRING                               = "Lstd/core/String;";
42 static constexpr std::string_view WEAK_REF                             = "Lstd/core/WeakRef;";
43 static constexpr std::string_view FINALIZABLE_WEAK_REF                 = "Lstd/core/FinalizableWeakRef;";
44 static constexpr std::string_view TYPE                                 = "Lstd/core/Type;";
45 static constexpr std::string_view FIELD                                = "Lstd/core/Field;";
46 static constexpr std::string_view METHOD                               = "Lstd/core/Method;";
47 static constexpr std::string_view PARAMETER                            = "Lstd/core/Parameter;";
48 static constexpr std::string_view STRING_BUILDER                       = "Lstd/core/StringBuilder;";
49 
50 // Runtime classes
51 static constexpr std::string_view STACK_TRACE_ELEMENT                  = "Lstd/core/StackTraceElement;";
52 
53 // Box classes
54 static constexpr std::string_view BOX_BOOLEAN                          = "Lstd/core/Boolean;";
55 static constexpr std::string_view BOX_BYTE                             = "Lstd/core/Byte;";
56 static constexpr std::string_view BOX_CHAR                             = "Lstd/core/Char;";
57 static constexpr std::string_view BOX_SHORT                            = "Lstd/core/Short;";
58 static constexpr std::string_view BOX_INT                              = "Lstd/core/Int;";
59 static constexpr std::string_view BOX_LONG                             = "Lstd/core/Long;";
60 static constexpr std::string_view BOX_FLOAT                            = "Lstd/core/Float;";
61 static constexpr std::string_view BOX_DOUBLE                           = "Lstd/core/Double;";
62 
63 // Arrays of base classes
64 static constexpr std::string_view CLASS_ARRAY                          = "[Lstd/core/Class;";
65 static constexpr std::string_view STRING_ARRAY                         = "[Lstd/core/String;";
66 
67 // Functional interfaces
68 static constexpr std::string_view FUNCTION                             = "Lstd/core/Function;";
69 static constexpr std::string_view FUNCTION0                            = "Lstd/core/Function0;";
70 static constexpr std::string_view FUNCTION1                            = "Lstd/core/Function1;";
71 static constexpr std::string_view FUNCTION2                            = "Lstd/core/Function2;";
72 static constexpr std::string_view FUNCTION3                            = "Lstd/core/Function3;";
73 static constexpr std::string_view FUNCTION4                            = "Lstd/core/Function4;";
74 static constexpr std::string_view FUNCTION5                            = "Lstd/core/Function5;";
75 static constexpr std::string_view FUNCTION6                            = "Lstd/core/Function6;";
76 static constexpr std::string_view FUNCTION7                            = "Lstd/core/Function7;";
77 static constexpr std::string_view FUNCTION8                            = "Lstd/core/Function8;";
78 static constexpr std::string_view FUNCTION9                            = "Lstd/core/Function9;";
79 static constexpr std::string_view FUNCTION10                           = "Lstd/core/Function10;";
80 static constexpr std::string_view FUNCTION11                           = "Lstd/core/Function11;";
81 static constexpr std::string_view FUNCTION12                           = "Lstd/core/Function12;";
82 static constexpr std::string_view FUNCTION13                           = "Lstd/core/Function13;";
83 static constexpr std::string_view FUNCTION14                           = "Lstd/core/Function14;";
84 static constexpr std::string_view FUNCTION15                           = "Lstd/core/Function15;";
85 static constexpr std::string_view FUNCTION16                           = "Lstd/core/Function16;";
86 static constexpr std::string_view FUNCTIONN                            = "Lstd/core/FunctionN;";
87 
88 // Exception classes
89 static constexpr std::string_view ARGUMENT_OUT_OF_RANGE_EXCEPTION      = "Lstd/core/ArgumentOutOfRangeException;";
90 static constexpr std::string_view CLASS_NOT_FOUND_EXCEPTION            = "Lstd/core/ClassNotFoundException;";
91 static constexpr std::string_view FILE_NOT_FOUND_EXCEPTION             = "Lstd/core/FileNotFoundException;";
92 static constexpr std::string_view ILLEGAL_ACCESS_EXCEPTION             = "Lstd/core/IllegalAccessException;";
93 static constexpr std::string_view ILLEGAL_ARGUMENT_EXCEPTION           = "Lstd/core/IllegalArgumentException;";
94 static constexpr std::string_view ILLEGAL_MONITOR_STATE_EXCEPTION      = "Lstd/core/IllegalMonitorStateException;";
95 static constexpr std::string_view ILLEGAL_STATE_EXCEPTION              = "Lstd/core/IllegalStateException;";
96 static constexpr std::string_view IO_EXCEPTION                         = "Lstd/core/IOException;";
97 static constexpr std::string_view RUNTIME_EXCEPTION                    = "Lstd/core/RuntimeException;";
98 static constexpr std::string_view UNSUPPORTED_OPERATION_EXCEPTION      = "Lstd/core/UnsupportedOperationException;";
99 
100 // Exceptions classes
101 // Due to dependecy of runtime architecture, have confusing name
102 static constexpr std::string_view ABSTRACT_METHOD_ERROR                = "Lstd/core/AbstractMethodError;";
103 static constexpr std::string_view ARITHMETIC_ERROR                     = "Lstd/core/ArithmeticError;";
104 static constexpr std::string_view ARRAY_STORE_ERROR                    = "Lstd/core/ArrayStoreError;";
105 static constexpr std::string_view CLASS_CAST_ERROR                     = "Lstd/core/ClassCastError;";
106 static constexpr std::string_view ARRAY_INDEX_OUT_OF_BOUNDS_ERROR      = "Lstd/core/ArrayIndexOutOfBoundsError;";
107 static constexpr std::string_view CLASS_CIRCULARITY_ERROR              = "Lstd/core/ClassCircularityError;";
108 static constexpr std::string_view EXCEPTION_IN_INITIALIZER_ERROR       = "Lstd/core/ExceptionInInitializerError;";
109 static constexpr std::string_view INCOMPATIBLE_CLASS_CHANGE_ERROR      = "Lstd/core/IncompatibleClassChangeError;";
110 static constexpr std::string_view INDEX_OUT_OF_BOUNDS_ERROR            = "Lstd/core/IndexOutOfBoundsError;";
111 static constexpr std::string_view INSTANTIATION_ERROR                  = "Lstd/core/InstantiationError;";
112 static constexpr std::string_view LINKAGE_ERROR                        = "Lstd/core/LinkageError;";
113 static constexpr std::string_view NEGATIVE_ARRAY_SIZE_ERROR            = "Lstd/core/NegativeArraySizeError;";
114 static constexpr std::string_view NO_CLASS_DEF_FOUND_ERROR             = "Lstd/core/NoClassDefFoundError;";
115 static constexpr std::string_view NO_SUCH_FIELD_ERROR                  = "Lstd/core/NoSuchFieldError;";
116 static constexpr std::string_view NO_SUCH_METHOD_ERROR                 = "Lstd/core/NoSuchMethodError;";
117 static constexpr std::string_view NULL_POINTER_ERROR                   = "Lstd/core/NullPointerError;";
118 static constexpr std::string_view OUT_OF_MEMORY_ERROR                  = "Lstd/core/OutOfMemoryError;";
119 static constexpr std::string_view STACK_OVERFLOW_ERROR                 = "Lstd/core/StackOverflowError;";
120 static constexpr std::string_view STRING_INDEX_OUT_OF_BOUNDS_ERROR     = "Lstd/core/StringIndexOutOfBoundsError;";
121 static constexpr std::string_view VERIFY_ERROR                         = "Lstd/core/VerifyError;";
122 
123 static constexpr std::string_view DOUBLE_TO_STRING_CACHE_ELEMENT       = "Lstd/core/DoubleToStringCacheElement;";
124 static constexpr std::string_view FLOAT_TO_STRING_CACHE_ELEMENT        = "Lstd/core/FloatToStringCacheElement;";
125 static constexpr std::string_view LONG_TO_STRING_CACHE_ELEMENT         = "Lstd/core/LongToStringCacheElement;";
126 
127 // Error classes
128 static constexpr std::string_view ERROR_OPTIONS                        = "Lescompat/ErrorOptions;";
129 static constexpr std::string_view RANGE_ERROR                          = "Lescompat/RangeError;";
130 
131 // interop/js
132 static constexpr std::string_view JS_RUNTIME                           = "Lstd/interop/js/JSRuntime;";
133 static constexpr std::string_view JS_VALUE                             = "Lstd/interop/js/JSValue;";
134 static constexpr std::string_view JS_ERROR                             = "Lstd/interop/js/JSError;";
135 
136 static constexpr std::string_view ARRAY                                = "Lescompat/Array;";
137 static constexpr std::string_view ARRAY_AS_LIST_INT                    = "Lstd/containers/ArrayAsListInt;";
138 
139 // escompat
140 static constexpr std::string_view SHARED_MEMORY                        = "Lescompat/SharedMemory;";
141 
142 }  // namespace class_descriptors
143 
144 static constexpr std::string_view CCTOR = "<cctor>";
145 static constexpr std::string_view CTOR  = "<ctor>";
146 // clang-format on
147 
148 }  // namespace ark::ets::panda_file_items
149 
150 #endif  // PANDA_PLUGINS_ETS_RUNTIME_ETS_PANDA_FILE_ITEMS_H_
151