1 /* 2 * Copyright (c) 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 ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 17 #define ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 18 19 #include "abc_annotation_processor.h" 20 #include "abc_file_entity_processor.h" 21 #include "method_data_accessor-inl.h" 22 #include "common/abc_type_converter.h" 23 24 namespace panda::abc2program { 25 26 class AbcMethodProcessor : public AbcFileEntityProcessor { 27 public: 28 AbcMethodProcessor(panda_file::File::EntityId entity_id, Abc2ProgramEntityContainer &entity_container); 29 void FillProgramData() override; 30 31 private: 32 void FillFunctionData(); 33 void FillProto(); 34 uint32_t GetNumArgs() const; 35 void FillFunctionKind(); 36 void FillFunctionMetaData(); 37 void FillFunctionAttributes(); 38 void FillAccessFlags(); 39 void FillCodeData(); 40 void FillDebugInfo(); 41 void FillSourceFile(); 42 void FillSourceCode(); 43 void FillFuncAnnotation(); 44 void FillSlotsNum(); 45 void FillConcurrentModuleRequests(); 46 AbcTypeConverter type_converter_; 47 pandasm::Function function_; 48 std::unique_ptr<panda_file::MethodDataAccessor> method_data_accessor_; 49 const panda_file::DebugInfoExtractor &debug_info_extractor_; 50 }; 51 52 } // namespace panda::abc2program 53 54 #endif // ABC2PROGRAM_ABC_METHOD_PROCESSOR_H 55