• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef PANDA_PLUGINS_ETS_RUNTIME_ETS_ITABLE_BUILDER_H_
17 #define PANDA_PLUGINS_ETS_RUNTIME_ETS_ITABLE_BUILDER_H_
18 
19 #include "libpandabase/utils/span.h"
20 #include "runtime/include/class.h"
21 #include "runtime/include/itable_builder.h"
22 #include "runtime/include/itable.h"
23 
24 namespace ark {
25 
26 class ClassLinker;
27 
28 }  // namespace ark
29 
30 namespace ark::ets {
31 
32 class EtsITableBuilder : public ITableBuilder {
33 public:
EtsITableBuilder(ClassLinkerErrorHandler * errHandler)34     explicit EtsITableBuilder(ClassLinkerErrorHandler *errHandler) : errorHandler_(errHandler) {}
35 
36     bool Build(ClassLinker *classLinker, Class *base, Span<Class *> classInterfaces, bool isInterface) override;
37 
38     bool Resolve(Class *klass) override;
39 
40     void UpdateClass(Class *klass) override;
41 
42     void DumpITable([[maybe_unused]] Class *klass) override;
43 
GetITable()44     ITable GetITable() const override
45     {
46         return itable_;
47     };
48 
49 private:
50     ITable itable_;
51     ClassLinkerErrorHandler *errorHandler_;
52 };
53 
54 }  // namespace ark::ets
55 
56 #endif  // !PANDA_PLUGINS_ETS_RUNTIME_ETS_ITABLE_BUILDER_H_
57