• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 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 panda::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 ASYNC                                = "Lets/coroutine/Async;";
30 static constexpr std::string_view EXCEPTION                            = "Lstd/core/Exception;";
31 static constexpr std::string_view CLASS                                = "Lstd/core/Class;";
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 VOID                                 = "Lstd/core/void;";
35 static constexpr std::string_view INTERNAL_UNDEFINED                   = "Lstd/core/__internal_undefined;";
36 static constexpr std::string_view STRING                               = "Lstd/core/String;";
37 static constexpr std::string_view WEAK_REF                             = "Lstd/core/WeakRef;";
38 static constexpr std::string_view TYPE                                 = "Lstd/core/Type;";
39 static constexpr std::string_view FIELD                                = "Lstd/core/Field;";
40 static constexpr std::string_view METHOD                               = "Lstd/core/Method;";
41 static constexpr std::string_view PARAMETER                            = "Lstd/core/Parameter;";
42 
43 // Box classes
44 static constexpr std::string_view BOX_BOOLEAN                          = "Lstd/core/Boolean;";
45 static constexpr std::string_view BOX_BYTE                             = "Lstd/core/Byte;";
46 static constexpr std::string_view BOX_CHAR                             = "Lstd/core/Char;";
47 static constexpr std::string_view BOX_SHORT                            = "Lstd/core/Short;";
48 static constexpr std::string_view BOX_INT                              = "Lstd/core/Int;";
49 static constexpr std::string_view BOX_LONG                             = "Lstd/core/Long;";
50 static constexpr std::string_view BOX_FLOAT                            = "Lstd/core/Float;";
51 static constexpr std::string_view BOX_DOUBLE                           = "Lstd/core/Double;";
52 
53 // Arrays of base classes
54 static constexpr std::string_view CLASS_ARRAY                          = "[Lstd/core/Class;";
55 static constexpr std::string_view STRING_ARRAY                         = "[Lstd/core/String;";
56 
57 // Exception classes
58 static constexpr std::string_view ARGUMENT_OUT_OF_RANGE_EXCEPTION      = "Lstd/core/ArgumentOutOfRangeException;";
59 static constexpr std::string_view ARITHMETIC_EXCEPTION                 = "Lstd/core/ArithmeticException;";
60 static constexpr std::string_view ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION  = "Lstd/core/ArrayIndexOutOfBoundsException;";
61 static constexpr std::string_view ARRAY_STORE_EXCEPTION                = "Lstd/core/ArrayStoreException;";
62 static constexpr std::string_view CLASS_CAST_EXCEPTION                 = "Lstd/core/ClassCastException;";
63 static constexpr std::string_view CLASS_NOT_FOUND_EXCEPTION            = "Lstd/core/ClassNotFoundException;";
64 static constexpr std::string_view FILE_NOT_FOUND_EXCEPTION             = "Lstd/core/FileNotFoundException;";
65 static constexpr std::string_view ILLEGAL_ACCESS_EXCEPTION             = "Lstd/core/IllegalAccessException;";
66 static constexpr std::string_view ILLEGAL_ARGUMENT_EXCEPTION           = "Lstd/core/IllegalArgumentException;";
67 static constexpr std::string_view ILLEGAL_MONITOR_STATE_EXCEPTION      = "Lstd/core/IllegalMonitorStateException;";
68 static constexpr std::string_view ILLEGAL_STATE_EXCEPTION              = "Lstd/core/IllegalStateException;";
69 static constexpr std::string_view INDEX_OUT_OF_BOUNDS_EXCEPTION        = "Lstd/core/IndexOutOfBoundsException;";
70 static constexpr std::string_view IO_EXCEPTION                         = "Lstd/core/IOException;";
71 static constexpr std::string_view NEGATIVE_ARRAY_SIZE_EXCEPTION        = "Lstd/core/NegativeArraySizeException;";
72 static constexpr std::string_view NULL_POINTER_EXCEPTION               = "Lstd/core/NullPointerException;";
73 static constexpr std::string_view RUNTIME_EXCEPTION                    = "Lstd/core/RuntimeException;";
74 static constexpr std::string_view STRING_INDEX_OUT_OF_BOUNDS_EXCEPTION = "Lstd/core/StringIndexOutOfBoundsException;";
75 static constexpr std::string_view UNSUPPORTED_OPERATION_EXCEPTION      = "Lstd/core/UnsupportedOperationException;";
76 
77 // Error classes
78 static constexpr std::string_view ABSTRACT_METHOD_ERROR                = "Lescompat/AbstractMethodError;";
79 static constexpr std::string_view CLASS_CIRCULARITY_ERROR              = "Lescompat/ClassCircularityError;";
80 static constexpr std::string_view EXCEPTION_IN_INITIALIZER_ERROR       = "Lstd/core/ExceptionInInitializerError;";
81 static constexpr std::string_view INCOMPATIBLE_CLASS_CHANGE_ERROR      = "Lescompat/IncompatibleClassChangeError;";
82 static constexpr std::string_view INSTANTIATION_ERROR                  = "Lescompat/InstantiationError;";
83 static constexpr std::string_view NO_CLASS_DEF_FOUND_ERROR             = "Lescompat/NoClassDefFoundError;";
84 static constexpr std::string_view NO_SUCH_FIELD_ERROR                  = "Lescompat/NoSuchFieldError;";
85 static constexpr std::string_view NO_SUCH_METHOD_ERROR                 = "Lescompat/NoSuchMethodError;";
86 static constexpr std::string_view OUT_OF_MEMORY_ERROR                  = "Lescompat/OutOfMemoryError;";
87 static constexpr std::string_view STACK_OVERFLOW_ERROR                 = "Lescompat/StackOverflowError;";
88 static constexpr std::string_view RANGE_ERROR                          = "Lescompat/RangeError;";
89 static constexpr std::string_view VERIFY_ERROR                         = "Lescompat/VerifyError;";
90 
91 // interop/js
92 static constexpr std::string_view JS_RUNTIME                           = "Lstd/interop/js/JSRuntime;";
93 static constexpr std::string_view JS_VALUE                             = "Lstd/interop/js/JSValue;";
94 static constexpr std::string_view JS_ERROR                             = "Lstd/interop/js/JSError;";
95 
96 static constexpr std::string_view ARRAY                                = "Lescompat/Array;";
97 
98 // escompat
99 static constexpr std::string_view SHARED_MEMORY                        = "Lescompat/SharedMemory;";
100 
101 }  // namespace class_descriptors
102 
103 static constexpr std::string_view CCTOR = "<cctor>";
104 static constexpr std::string_view CTOR  = "<ctor>";
105 // clang-format on
106 
107 }  // namespace panda::ets::panda_file_items
108 
109 #endif  // PANDA_PLUGINS_ETS_RUNTIME_ETS_PANDA_FILE_ITEMS_H
110