1 /**
2 * Copyright (c) 2021-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 #ifndef PANDA_PLUGINS_ETS_RUNTIME_ETS_CLASS_ROOT_H
16 #define PANDA_PLUGINS_ETS_RUNTIME_ETS_CLASS_ROOT_H
17
18 #include "libpandabase/utils/logger.h"
19 #include "libpandabase/utils/type_helpers.h"
20 #include "runtime/include/class_root.h"
21
22 namespace ark::ets {
23
24 enum class EtsClassRoot {
25 VOID = helpers::ToUnderlying(ClassRoot::V),
26 BOOLEAN = helpers::ToUnderlying(ClassRoot::U1),
27 BYTE = helpers::ToUnderlying(ClassRoot::I8),
28 CHAR = helpers::ToUnderlying(ClassRoot::U16),
29 SHORT = helpers::ToUnderlying(ClassRoot::I16),
30 INT = helpers::ToUnderlying(ClassRoot::I32),
31 LONG = helpers::ToUnderlying(ClassRoot::I64),
32 FLOAT = helpers::ToUnderlying(ClassRoot::F32),
33 DOUBLE = helpers::ToUnderlying(ClassRoot::F64),
34
35 BOOLEAN_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_U1),
36 BYTE_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_I8),
37 CHAR_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_U16),
38 SHORT_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_I16),
39 UINT_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_U32),
40 INT_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_I32),
41 ULONG_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_U64),
42 LONG_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_I64),
43 FLOAT_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_F32),
44 DOUBLE_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_F64),
45
46 CLASS = helpers::ToUnderlying(ClassRoot::CLASS),
47 OBJECT = helpers::ToUnderlying(ClassRoot::OBJECT),
48 STRING = helpers::ToUnderlying(ClassRoot::STRING),
49 STRING_ARRAY = helpers::ToUnderlying(ClassRoot::ARRAY_STRING),
50 };
51
ToCoreClassRoot(EtsClassRoot etsClassRoot)52 inline ClassRoot ToCoreClassRoot(EtsClassRoot etsClassRoot)
53 {
54 return static_cast<ClassRoot>(etsClassRoot);
55 }
56
57 EtsClassRoot ToEtsClassRoot(ClassRoot classRoot);
58
59 } // namespace ark::ets
60
61 #endif // PANDA_PLUGINS_ETS_RUNTIME_ETS_CLASS_ROOT_H
62