diff --git a/static_core/assembler/assembly-literals.h b/static_core/assembler/assembly-literals.h index f74841b118fae42405fa817d9ac76544a89d0fbb..42ded45a35a128926a23762ed3b852a254afce19 100644 --- a/static_core/assembler/assembly-literals.h +++ b/static_core/assembler/assembly-literals.h @@ -18,8 +18,11 @@ #include #include +#include + +#include "libarkfile/literal_tag.h" +#include "libarkfile/include/type.h" -#include "libarkfile/literal_data_accessor-inl.h" namespace ark::pandasm { diff --git a/static_core/bytecode_optimizer/bytecodeopt_peepholes.h b/static_core/bytecode_optimizer/bytecodeopt_peepholes.h index c03ca9da6232f7a5c50e47ea5e0ce3a7305b6264..f353dc56f9cca5dc1e287689084eaf3e5231e08b 100644 --- a/static_core/bytecode_optimizer/bytecodeopt_peepholes.h +++ b/static_core/bytecode_optimizer/bytecodeopt_peepholes.h @@ -22,7 +22,6 @@ #include "compiler/optimizer/ir/graph.h" #include "compiler/optimizer/ir/graph_visitor.h" #include "compiler/optimizer/ir/inst.h" -#include "libarkbase/utils/arena_containers.h" #include "runtime_adapter.h" /* diff --git a/static_core/bytecode_optimizer/check_resolver.h b/static_core/bytecode_optimizer/check_resolver.h index 59d5ed18564dab47700a80a0d3a139338abb4901..9cb0451822e919bb0c7a82c7475aea635e728c76 100644 --- a/static_core/bytecode_optimizer/check_resolver.h +++ b/static_core/bytecode_optimizer/check_resolver.h @@ -19,7 +19,6 @@ #include "compiler/optimizer/ir/graph.h" #include "compiler/optimizer/ir/inst.h" #include "compiler/optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" /* * Check Resolver. diff --git a/static_core/bytecode_optimizer/reg_encoder.h b/static_core/bytecode_optimizer/reg_encoder.h index 3edac7c45414cebd7da1c4421e84796325ca91b8..ea60814ebd0ade601f6eaad208e39d8e1adb8621 100644 --- a/static_core/bytecode_optimizer/reg_encoder.h +++ b/static_core/bytecode_optimizer/reg_encoder.h @@ -20,6 +20,7 @@ #include "compiler/optimizer/pass.h" #include "compiler/optimizer/ir/inst.h" #include "compiler/optimizer/ir/graph_visitor.h" +#include "libarkbase/utils/arena_unordered_map.h" /* * Register Encoder. diff --git a/static_core/bytecode_optimizer/runtime_adapter.cpp b/static_core/bytecode_optimizer/runtime_adapter.cpp index 67c24427eb309303b3da463e0777032154b5ed45..2b2269ecf89bb23348d5a7e694720f8f2eb93a3f 100644 --- a/static_core/bytecode_optimizer/runtime_adapter.cpp +++ b/static_core/bytecode_optimizer/runtime_adapter.cpp @@ -15,6 +15,7 @@ #include "bytecode_optimizer/runtime_adapter.h" #include "runtime/include/method.h" +#include "libarkfile/method_data_accessor-inl.h" namespace ark { diff --git a/static_core/bytecode_optimizer/runtime_adapter.h b/static_core/bytecode_optimizer/runtime_adapter.h index 2100eae71e9861e6714fae685c2b60ea5aa20712..98c5a1fab13df178662ad9be194a4e3500a8d1b6 100644 --- a/static_core/bytecode_optimizer/runtime_adapter.h +++ b/static_core/bytecode_optimizer/runtime_adapter.h @@ -17,7 +17,7 @@ #include "compiler/optimizer/ir/runtime_interface.h" #include "libarkfile/bytecode_instruction.h" -#include "libarkfile/class_data_accessor-inl.h" +#include "libarkfile/class_data_accessor.h" #include "libarkfile/code_data_accessor.h" #include "libarkfile/field_data_accessor.h" #include "libarkfile/file.h" @@ -27,6 +27,8 @@ #include "libarkfile/proto_data_accessor-inl.h" #include "libarkfile/type_helper.h" +#include + namespace ark { using compiler::RuntimeInterface; diff --git a/static_core/bytecode_optimizer/tests/bytecodeopt_peepholes_runtime_test.cpp b/static_core/bytecode_optimizer/tests/bytecodeopt_peepholes_runtime_test.cpp index 9dfe97e3d047ee53ede7de153f0d4688293a3855..ded99b44aad7f44e3c43712d03338a5fb62567ef 100644 --- a/static_core/bytecode_optimizer/tests/bytecodeopt_peepholes_runtime_test.cpp +++ b/static_core/bytecode_optimizer/tests/bytecodeopt_peepholes_runtime_test.cpp @@ -19,6 +19,7 @@ #include "assembler/assembly-parser.h" #include "bytecode_optimizer/optimize_bytecode.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" #include "runtime/include/runtime.h" #include "mangling.h" diff --git a/static_core/compiler/aot/aot_builder/aot_builder.h b/static_core/compiler/aot/aot_builder/aot_builder.h index d40cf2f87dfc8bfc18b0a570824a39ad98ab8ffa..1c2d0ec087cdc710f73fc57f410ccf55af9eeab2 100644 --- a/static_core/compiler/aot/aot_builder/aot_builder.h +++ b/static_core/compiler/aot/aot_builder/aot_builder.h @@ -20,7 +20,6 @@ #include "aot/aot_file.h" #include "elf_builder.h" #include "libarkbase/utils/arch.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/bit_vector.h" #include "optimizer/ir/runtime_interface.h" #include diff --git a/static_core/compiler/aot/aot_manager.h b/static_core/compiler/aot/aot_manager.h index 39014c2bb21382f831be5412ed1df9b454fd7e22..640875438bec540e544b64af3c328643cb137e8e 100644 --- a/static_core/compiler/aot/aot_manager.h +++ b/static_core/compiler/aot/aot_manager.h @@ -18,8 +18,9 @@ #include "aot_file.h" #include "libarkfile/file.h" -#include "libarkbase/utils/arena_containers.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_unordered_set.h" +#include "runtime/include/mem/panda_unordered_map.h" +#include "runtime/include/mem/panda_list.h" #include "runtime/include/mem/panda_string.h" #include "runtime/include/method.h" #include "libarkbase/utils/expected.h" diff --git a/static_core/compiler/code_info/code_info_builder.h b/static_core/compiler/code_info/code_info_builder.h index 557d840d558053079d36a0438967946e0f682e53..74556792bdebde8f2a4fcaa5106b2f4fe1ced031 100644 --- a/static_core/compiler/code_info/code_info_builder.h +++ b/static_core/compiler/code_info/code_info_builder.h @@ -17,7 +17,7 @@ #define PANDA_CODE_INFO_BUILDER_H #include "code_info.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_vector.h" #include "libarkbase/utils/bit_vector.h" namespace ark::compiler { diff --git a/static_core/compiler/code_info/vreg_info.h b/static_core/compiler/code_info/vreg_info.h index bf44c3f42adc1131b2056fc617d46b5e2fe89747..4c346a74fd5d07270a9b4eee4894e6fc835f1a46 100644 --- a/static_core/compiler/code_info/vreg_info.h +++ b/static_core/compiler/code_info/vreg_info.h @@ -17,6 +17,8 @@ #define PANDA_COMPILER_CODE_INFO_VREG_INFO_H #include "libarkbase/utils/bit_field.h" +#include "libarkbase/utils/bit_utils.h" +#include "libarkbase/utils/type_helpers.h" namespace ark::compiler { diff --git a/static_core/compiler/compiler_options.cpp b/static_core/compiler/compiler_options.cpp index eb743e138696ae9b18e55b512d7d531735447ce2..42e75d05d0f008ee621bb9e4655061f1c4b36f26 100644 --- a/static_core/compiler/compiler_options.cpp +++ b/static_core/compiler/compiler_options.cpp @@ -15,7 +15,35 @@ #include "compiler_options.h" +#include + namespace ark::compiler { // NOLINTNEXTLINE(fuchsia-statically-constructed-objects) CompilerOptions g_options(""); +static std::regex g_regex; + +void CompilerOptions::SetCompilerRegex(const std::string &newRegexPattern) +{ + ASSERT(!WasSetCompilerRegexWithSignature()); + Options::SetCompilerRegex(newRegexPattern); + g_regex = newRegexPattern; +} + +bool CompilerOptions::MatchesRegex(std::string methodName) +{ + if (!WasSetCompilerRegex() && !WasSetCompilerRegexWithSignature()) { + return true; + } + if (!regexInitialized_) { + if (WasSetCompilerRegexWithSignature() && WasSetCompilerRegex()) { + LOG(FATAL, COMPILER) + << "'--compiler-regex' and '--compiler-regex-with-signature' cannot be used together."; + } + g_regex = WasSetCompilerRegex() ? GetCompilerRegex() : GetCompilerRegexWithSignature(); + regexInitialized_ = true; + } + return std::regex_match(methodName, g_regex); +} + + } // namespace ark::compiler diff --git a/static_core/compiler/compiler_options.h b/static_core/compiler/compiler_options.h index 7290b1b12c0b9a9b718badb291aaf2f36b6d6a51..225bfdc643ff7b40952336160bc5ca554b2b31b5 100644 --- a/static_core/compiler/compiler_options.h +++ b/static_core/compiler/compiler_options.h @@ -22,8 +22,6 @@ #include "libarkbase/cpu_features.h" #include "compiler_options_gen.h" -#include - namespace ark::compiler { #include "cpu_features.inc" @@ -63,29 +61,9 @@ public: LOG(FATAL, COMPILER) << "'SetCompilerRegexWithSignature()' is not supported."; } - void SetCompilerRegex(const std::string &newRegexPattern) - { - ASSERT(!WasSetCompilerRegexWithSignature()); - Options::SetCompilerRegex(newRegexPattern); - regex_ = newRegexPattern; - } + void SetCompilerRegex(const std::string &newRegexPattern); - template - bool MatchesRegex(const T &methodName) - { - if (!WasSetCompilerRegex() && !WasSetCompilerRegexWithSignature()) { - return true; - } - if (!regexInitialized_) { - if (WasSetCompilerRegexWithSignature() && WasSetCompilerRegex()) { - LOG(FATAL, COMPILER) - << "'--compiler-regex' and '--compiler-regex-with-signature' cannot be used together."; - } - regex_ = WasSetCompilerRegex() ? GetCompilerRegex() : GetCompilerRegexWithSignature(); - regexInitialized_ = true; - } - return std::regex_match(methodName, regex_); - } + bool MatchesRegex(std::string methodName); void AdjustCpuFeatures(bool crossCompilation) { @@ -149,8 +127,6 @@ private: } } - // `--compiler-regex`: - std::regex regex_; bool regexInitialized_ {false}; std::bitset features_; }; diff --git a/static_core/compiler/optimizer/analysis/alias_analysis.cpp b/static_core/compiler/optimizer/analysis/alias_analysis.cpp index 36fea9882de6ee082ac34913b124f78f992eb3c1..255e3a149acde83044391af770d3463cd2c58cd3 100644 --- a/static_core/compiler/optimizer/analysis/alias_analysis.cpp +++ b/static_core/compiler/optimizer/analysis/alias_analysis.cpp @@ -18,6 +18,7 @@ #include "optimizer/ir/graph.h" #include "optimizer/analysis/alias_analysis.h" #include "compiler_logger.h" +#include "libarkbase/utils/arena_queue.h" /** * See "Efficient Field-sensitive pointer analysis for C" by "David J. Pearce diff --git a/static_core/compiler/optimizer/analysis/alias_analysis.h b/static_core/compiler/optimizer/analysis/alias_analysis.h index 556e526889945dbe24645bdb2985714d010593af..47383024205bb471f2c4bd95a7fa5da1af00b9ae 100644 --- a/static_core/compiler/optimizer/analysis/alias_analysis.h +++ b/static_core/compiler/optimizer/analysis/alias_analysis.h @@ -19,7 +19,6 @@ #include "alias_visitor.h" #include "optimizer/ir/graph_visitor.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" namespace ark::compiler { class BasicBlock; diff --git a/static_core/compiler/optimizer/analysis/alias_visitor.h b/static_core/compiler/optimizer/analysis/alias_visitor.h index 8d944be5d73f35ae8cbc2ae4a671a23d25389b3e..f4d76d7d4dc6d9983aafd447edfc4539b3e82e8a 100644 --- a/static_core/compiler/optimizer/analysis/alias_visitor.h +++ b/static_core/compiler/optimizer/analysis/alias_visitor.h @@ -18,7 +18,8 @@ #include "optimizer/ir/graph.h" #include "optimizer/ir/graph_visitor.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_unordered_set.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/analysis/bounds_analysis.h b/static_core/compiler/optimizer/analysis/bounds_analysis.h index b6060faa3a517490ae484daa2f5d0540b9e4f315..6809d66bbaba700edfbf4c3144ce206ec265fa0e 100644 --- a/static_core/compiler/optimizer/analysis/bounds_analysis.h +++ b/static_core/compiler/optimizer/analysis/bounds_analysis.h @@ -21,7 +21,7 @@ #include "optimizer/ir/datatype.h" #include "optimizer/ir/inst.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { /** diff --git a/static_core/compiler/optimizer/analysis/dominators_tree.h b/static_core/compiler/optimizer/analysis/dominators_tree.h index 017f84511fd557d3db7e1486685a4ef582af38aa..e57f49cf58f90b00d28eef5e1a4646c5c00d042d 100644 --- a/static_core/compiler/optimizer/analysis/dominators_tree.h +++ b/static_core/compiler/optimizer/analysis/dominators_tree.h @@ -17,7 +17,7 @@ #define COMPILER_OPTIMIZER_ANALYSIS_DOMINATORS_TREE_H #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_vector.h" namespace ark::compiler { class BasicBlock; diff --git a/static_core/compiler/optimizer/analysis/linear_order.h b/static_core/compiler/optimizer/analysis/linear_order.h index 09a73bd8bea9fa84b2b5613edc9341afde34afdc..7f0483865d59525de7163560eb253b16ac6c3bef 100644 --- a/static_core/compiler/optimizer/analysis/linear_order.h +++ b/static_core/compiler/optimizer/analysis/linear_order.h @@ -18,7 +18,8 @@ #include "optimizer/ir/marker.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_vector.h" +#include "libarkbase/utils/arena_list.h" namespace ark::compiler { class BasicBlock; diff --git a/static_core/compiler/optimizer/analysis/live_registers.cpp b/static_core/compiler/optimizer/analysis/live_registers.cpp index f50c7147ac653724710d8f3c00440bd58c312a76..21f16b974c0121458c373945491de237aeef1147 100644 --- a/static_core/compiler/optimizer/analysis/live_registers.cpp +++ b/static_core/compiler/optimizer/analysis/live_registers.cpp @@ -16,6 +16,7 @@ #include #include "liveness_analyzer.h" #include "live_registers.h" +#include "libarkbase/utils/arena_queue.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/analysis/live_registers.h b/static_core/compiler/optimizer/analysis/live_registers.h index 070492772528c3d600c6a4722988a6b4dc4a73a4..c0fe04f16bb59dce16c464eeb76b3faaeb06d3e3 100644 --- a/static_core/compiler/optimizer/analysis/live_registers.h +++ b/static_core/compiler/optimizer/analysis/live_registers.h @@ -18,7 +18,6 @@ #include #include -#include "libarkbase/utils/arena_containers.h" #include "optimizer/pass.h" #include "optimizer/analysis/liveness_analyzer.h" diff --git a/static_core/compiler/optimizer/analysis/liveness_analyzer.cpp b/static_core/compiler/optimizer/analysis/liveness_analyzer.cpp index dce386649c847c94a33ad9916bd8a22c747cabbf..bcd00fb0167501c8037ebe7222d18e4a9c4cf345 100644 --- a/static_core/compiler/optimizer/analysis/liveness_analyzer.cpp +++ b/static_core/compiler/optimizer/analysis/liveness_analyzer.cpp @@ -23,6 +23,8 @@ #include "optimizer/optimizations/locations_builder.h" #include "optimizer/optimizations/regalloc/reg_type.h" +#include + namespace ark::compiler { LivenessAnalyzer::LivenessAnalyzer(Graph *graph) : Analysis(graph), diff --git a/static_core/compiler/optimizer/analysis/liveness_analyzer.h b/static_core/compiler/optimizer/analysis/liveness_analyzer.h index ec8287afa434aa54ae7dc294c689c28a505f8219..b27cbadf291b3e11b9baaed5211362c3e8dd367a 100644 --- a/static_core/compiler/optimizer/analysis/liveness_analyzer.h +++ b/static_core/compiler/optimizer/analysis/liveness_analyzer.h @@ -16,7 +16,6 @@ #ifndef COMPILER_OPTIMIZER_ANALYSIS_LIVENESS_ANALIZER_H #define COMPILER_OPTIMIZER_ANALYSIS_LIVENESS_ANALIZER_H -#include "libarkbase/utils/arena_containers.h" #include "optimizer/analysis/liveness_use_table.h" #include "optimizer/ir/constants.h" #include "optimizer/ir/inst.h" @@ -24,6 +23,7 @@ #include "optimizer/pass.h" #include "optimizer/ir/locations.h" #include "compiler_logger.h" +#include "libarkbase/utils/arena_list.h" namespace ark::compiler { class BasicBlock; diff --git a/static_core/compiler/optimizer/analysis/liveness_use_table.h b/static_core/compiler/optimizer/analysis/liveness_use_table.h index 7452a3069f4af3310bdd64d3e232b9060bddd215..1e3232ae29dd3510f8560baed727498aab673cd8 100644 --- a/static_core/compiler/optimizer/analysis/liveness_use_table.h +++ b/static_core/compiler/optimizer/analysis/liveness_use_table.h @@ -16,8 +16,9 @@ #ifndef COMPILER_OPTIMIZER_ANALYSIS_USE_TABLE_H #define COMPILER_OPTIMIZER_ANALYSIS_USE_TABLE_H -#include "libarkbase/utils/arena_containers.h" #include "optimizer/ir/inst.h" +#include "libarkbase/utils/arena_map.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { using FixedUses = ArenaMap; diff --git a/static_core/compiler/optimizer/analysis/rpo.h b/static_core/compiler/optimizer/analysis/rpo.h index 1e01ce2b5cf79efe02b91c4dbcf45dccd2cfe8ae..c3eb57aa188f934f6f3bb2abe9b42eeaef6a3b5e 100644 --- a/static_core/compiler/optimizer/analysis/rpo.h +++ b/static_core/compiler/optimizer/analysis/rpo.h @@ -16,7 +16,6 @@ #ifndef COMPILER_OPTIMIZER_ANALYSIS_RPO_H #define COMPILER_OPTIMIZER_ANALYSIS_RPO_H -#include "libarkbase/utils/arena_containers.h" #include "optimizer/ir/marker.h" #include "optimizer/pass.h" #include diff --git a/static_core/compiler/optimizer/code_generator/codegen.cpp b/static_core/compiler/optimizer/code_generator/codegen.cpp index c18adc140371a48a5029c9c1c30ffb68251eea3c..e38c68c62c891706652f70c7628273ee8b2e510c 100644 --- a/static_core/compiler/optimizer/code_generator/codegen.cpp +++ b/static_core/compiler/optimizer/code_generator/codegen.cpp @@ -20,6 +20,7 @@ Codegen Hi-Level implementation #include "codegen.h" #include "encode_visitor.h" #include "compiler_options.h" +#include "optimizer/ir/graph-inl.h" #include "optimizer/ir/inst.h" #include "relocations.h" #include "include/compiler_interface.h" @@ -32,7 +33,6 @@ Codegen Hi-Level implementation #include "libarkbase/events/events.h" #include "libarkbase/utils/tsan_interface.h" #include "libarkbase/utils/utils.h" -#include "libarkbase/utils/arena_containers.h" #include #include diff --git a/static_core/compiler/optimizer/code_generator/codegen.h b/static_core/compiler/optimizer/code_generator/codegen.h index 4153bf8b096c72b05fdc37f3e464694f9f8ede38..1ba51b385640d09fd74da888a3a0c0108f2a5303 100644 --- a/static_core/compiler/optimizer/code_generator/codegen.h +++ b/static_core/compiler/optimizer/code_generator/codegen.h @@ -39,7 +39,6 @@ Codegen interface for compiler #include "optimizer/ir/graph_visitor.h" #include "optimizer/optimizations/regalloc/spill_fills_resolver.h" #include "optimizer/pass_manager.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/cframe_layout.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/code_generator/encode.h b/static_core/compiler/optimizer/code_generator/encode.h index 274db4c579a47aaf7a151a95ebb4f24aade34b5a..ef435e6a1872ca86c7d708718aecb7784f84eb96 100644 --- a/static_core/compiler/optimizer/code_generator/encode.h +++ b/static_core/compiler/optimizer/code_generator/encode.h @@ -29,6 +29,7 @@ #include #include "operands.h" +#include "label_holder.h" #include "optimizer/select_transform_type.h" #include "registers_description.h" #include "libarkbase/utils/cframe_layout.h" @@ -79,34 +80,6 @@ namespace memory_order { enum Order { ACQUIRE, RELEASE, FULL }; } // namespace memory_order -class LabelHolder { -public: - using LabelId = uintptr_t; - static constexpr LabelId INVALID_LABEL = static_cast(-1); - - explicit LabelHolder(Encoder *enc) : enc_ {enc} {}; - virtual ~LabelHolder() = default; - - // NOTE (igorban) : hide all this methods in CallConv - virtual void CreateLabels(LabelId size) = 0; - virtual LabelId CreateLabel() = 0; - virtual LabelId Size() = 0; - - Encoder *GetEncoder() const - { - return enc_; - } - - NO_COPY_SEMANTIC(LabelHolder); - NO_MOVE_SEMANTIC(LabelHolder); - -protected: - virtual void BindLabel(LabelId) = 0; - -private: - Encoder *enc_ {nullptr}; - friend Encoder; -}; class Encoder { public: diff --git a/static_core/compiler/optimizer/code_generator/encode_visitor.cpp b/static_core/compiler/optimizer/code_generator/encode_visitor.cpp index 58e694e04750e4fc1de2e737b4c5bec7e519004b..56198b4dbaa4178fb8d035e7ad9fbd8a89667266 100644 --- a/static_core/compiler/optimizer/code_generator/encode_visitor.cpp +++ b/static_core/compiler/optimizer/code_generator/encode_visitor.cpp @@ -17,6 +17,7 @@ #include "optimizer/code_generator/operands.h" #include "optimizer/ir/datatype.h" #include "libarkbase/utils/regmask.h" +#include "libarkbase/events/events.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/code_generator/label_holder.h b/static_core/compiler/optimizer/code_generator/label_holder.h new file mode 100644 index 0000000000000000000000000000000000000000..b0154bde80f149c6bff154827ae7bc76bade2991 --- /dev/null +++ b/static_core/compiler/optimizer/code_generator/label_holder.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMPILER_OPTIMIZER_CODEGEN_LABEL_HOLDER_H +#define COMPILER_OPTIMIZER_CODEGEN_LABEL_HOLDER_H + +namespace ark::compiler { +class Encoder; + +class LabelHolder { +public: + using LabelId = uintptr_t; + static constexpr LabelId INVALID_LABEL = static_cast(-1); + + explicit LabelHolder(Encoder *enc) : enc_ {enc} {}; + virtual ~LabelHolder() = default; + + // NOTE (igorban) : hide all this methods in CallConv + virtual void CreateLabels(LabelId size) = 0; + virtual LabelId CreateLabel() = 0; + virtual LabelId Size() = 0; + + Encoder *GetEncoder() const + { + return enc_; + } + + NO_COPY_SEMANTIC(LabelHolder); + NO_MOVE_SEMANTIC(LabelHolder); + +protected: + virtual void BindLabel(LabelId) = 0; + +private: + Encoder *enc_ {nullptr}; + friend Encoder; +}; + +} // namespace ark::compiler + + +#endif // COMPILER_OPTIMIZER_CODEGEN_LABEL_HOLDER_H + diff --git a/static_core/compiler/optimizer/code_generator/operands.h b/static_core/compiler/optimizer/code_generator/operands.h index ec42a8316accc5d97f3193ec54f44cbb40e09f58..46241112eddb33699c61b4ff973f45fe548ffa00 100644 --- a/static_core/compiler/optimizer/code_generator/operands.h +++ b/static_core/compiler/optimizer/code_generator/operands.h @@ -25,7 +25,6 @@ Arch-feature definitions #include "type_info.h" #include "libarkbase/utils/arch.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/bit_field.h" #include "libarkbase/utils/bit_utils.h" #include "libarkbase/utils/regmask.h" diff --git a/static_core/compiler/optimizer/code_generator/registers_description.h b/static_core/compiler/optimizer/code_generator/registers_description.h index b0238e88fc1353118645a561c99cb02010409bba..f8a50a6e74985b78d9813a9e7dcc50b0b07b7b00 100644 --- a/static_core/compiler/optimizer/code_generator/registers_description.h +++ b/static_core/compiler/optimizer/code_generator/registers_description.h @@ -18,6 +18,7 @@ #include "operands.h" #include "libarkbase/utils/arch.h" +#include "libarkbase/utils/arena_vector.h" /* Register file wrapper used for get major data and for Regalloc diff --git a/static_core/compiler/optimizer/code_generator/type_info.h b/static_core/compiler/optimizer/code_generator/type_info.h index 0aee0b49a89cc7f0c94f481d35d6b4fee8825982..9ab1c24364a187d54a0ab9ff2640b69f499568aa 100644 --- a/static_core/compiler/optimizer/code_generator/type_info.h +++ b/static_core/compiler/optimizer/code_generator/type_info.h @@ -24,7 +24,6 @@ Arch-feature definitions #include #include "libarkbase/utils/arch.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/bit_field.h" #include "libarkbase/utils/bit_utils.h" #include "libarkbase/utils/regmask.h" diff --git a/static_core/compiler/optimizer/ir/basicblock.cpp b/static_core/compiler/optimizer/ir/basicblock.cpp index bb78d7a21ec9175ad4e618b3dd9bf4d18f6d9c06..51febb8018cf138ee0d5dcb40be12e2d513d410a 100644 --- a/static_core/compiler/optimizer/ir/basicblock.cpp +++ b/static_core/compiler/optimizer/ir/basicblock.cpp @@ -18,6 +18,7 @@ #include "inst.h" #include "optimizer/analysis/loop_analyzer.h" #include "optimizer/analysis/dominators_tree.h" +#include "optimizer/code_generator/encode.h" namespace ark::compiler { class Inst; diff --git a/static_core/compiler/optimizer/ir/dump.h b/static_core/compiler/optimizer/ir/dump.h index 5b79871712d66efef51c87d1ba336f159c0dc9e6..d05b4a98d7a4e13ed0054ce70be170a7e058fb06 100644 --- a/static_core/compiler/optimizer/ir/dump.h +++ b/static_core/compiler/optimizer/ir/dump.h @@ -15,7 +15,7 @@ #ifndef COMPILER_OPTIMIZER_IR_DUMP_H #define COMPILER_OPTIMIZER_IR_DUMP_H -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_string.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/ir/graph-inl.h b/static_core/compiler/optimizer/ir/graph-inl.h new file mode 100644 index 0000000000000000000000000000000000000000..54658ec06e123f179cd9c3a80fca99e96908fb81 --- /dev/null +++ b/static_core/compiler/optimizer/ir/graph-inl.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef COMPILER_OPTIMIZER_IR_GRAPH_INL_H +#define COMPILER_OPTIMIZER_IR_GRAPH_INL_H + +#include "optimizer/code_generator/encode.h" + +namespace ark::compiler { + +template +size_t Graph::EstimateCodeSize() +{ + if constexpr (GRAPH_ENCODED) { + return encoder_->BufferSize(); + } + auto maxIrInstsCount = GetCurrentInstructionId(); + auto encoder = GetEncoder(); + ASSERT(encoder != nullptr); + auto maxArchInstsPerIrInsts = encoder->MaxArchInstPerEncoded(); + auto maxBytesInArchInst = GetInstructionSizeBits(GetArch()); + return maxIrInstsCount * maxArchInstsPerIrInsts * maxBytesInArchInst; +} + +} // namespace ark::compiler + +#endif // COMPILER_OPTIMIZER_IR_GRAPH_INL_H diff --git a/static_core/compiler/optimizer/ir/graph.h b/static_core/compiler/optimizer/ir/graph.h index e2b0d02dd1d1c88271341b3197e5ffbb1b1e58d0..e95c30a5cceceb6480abe9e433b0a6d6d0dce683 100644 --- a/static_core/compiler/optimizer/ir/graph.h +++ b/static_core/compiler/optimizer/ir/graph.h @@ -23,7 +23,8 @@ #include "marker.h" #include "optimizer/code_generator/method_properties.h" #include "optimizer/pass_manager.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_map.h" +#include "libarkbase/utils/arena_set.h" #include #include @@ -1031,18 +1032,7 @@ public: SpillFillData GetDataForNativeParam(DataType::Type type); template - size_t EstimateCodeSize() - { - if constexpr (GRAPH_ENCODED) { - return encoder_->BufferSize(); - } - auto maxIrInstsCount = GetCurrentInstructionId(); - auto encoder = GetEncoder(); - ASSERT(encoder != nullptr); - auto maxArchInstsPerIrInsts = encoder->MaxArchInstPerEncoded(); - auto maxBytesInArchInst = GetInstructionSizeBits(GetArch()); - return maxIrInstsCount * maxArchInstsPerIrInsts * maxBytesInArchInst; - } + size_t EstimateCodeSize(); EventWriter &GetEventWriter() { diff --git a/static_core/compiler/optimizer/ir/graph_cloner.h b/static_core/compiler/optimizer/ir/graph_cloner.h index a4605a1e180c7891c1ee6b92944be37a16921aa0..8d3f8048a37a4dd1a64dc6b100afee11b9259170 100644 --- a/static_core/compiler/optimizer/ir/graph_cloner.h +++ b/static_core/compiler/optimizer/ir/graph_cloner.h @@ -22,7 +22,7 @@ #include "optimizer/ir/analysis.h" #include "optimizer/ir/basicblock.h" #include "optimizer/ir/graph.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_unordered_map.h" #include "libarkbase/utils/hash.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/ir/inst.h b/static_core/compiler/optimizer/ir/inst.h index 33b4e3306e71d500665bc022bfd56ce7a1acba1a..778280a0ec0e5da8bc9986e0cae65ee360233814 100644 --- a/static_core/compiler/optimizer/ir/inst.h +++ b/static_core/compiler/optimizer/ir/inst.h @@ -26,7 +26,6 @@ #include "ir-dyn-base-types.h" #include "marker.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/span.h" #include "libarkbase/utils/bit_field.h" #include "libarkbase/utils/bit_utils.h" @@ -3641,7 +3640,7 @@ public: inline bool IsEqualConst(double value, [[maybe_unused]] bool supportInt32 = false) { // Special compare for NaN - if (GetType() == DataType::FLOAT64 && std::isnan(value) && std::isnan(bit_cast(value_))) { + if (GetType() == DataType::FLOAT64 && IsNan(value) && IsNan(bit_cast(value_))) { return true; } return IsEqualConst(DataType::FLOAT64, bit_cast(value)); @@ -3649,7 +3648,7 @@ public: inline bool IsEqualConst(float value, [[maybe_unused]] bool supportInt32 = false) { // Special compare for NaN - if (GetType() == DataType::FLOAT32 && std::isnan(value) && std::isnan(bit_cast(value_))) { + if (GetType() == DataType::FLOAT32 && IsNan(value) && IsNan(bit_cast(value_))) { return true; } return IsEqualConst(DataType::FLOAT32, bit_cast(value)); @@ -3689,10 +3688,10 @@ public: { ASSERT(DataType::IsFloatType(GetType())); if (GetType() == DataType::FLOAT32) { - return std::isnan(GetFloatValue()); + return IsNan(GetFloatValue()); } // DataType::FLOAT64 - return std::isnan(GetDoubleValue()); + return IsNan(GetDoubleValue()); } void SetImmTableSlot(ImmTableSlot immSlot) diff --git a/static_core/compiler/optimizer/ir/locations.h b/static_core/compiler/optimizer/ir/locations.h index 9143d611de326d9d5cc71be34c75cddd81c48806..5ec16f541e4b6023ebd51de680a8fdbfff181c34 100644 --- a/static_core/compiler/optimizer/ir/locations.h +++ b/static_core/compiler/optimizer/ir/locations.h @@ -19,10 +19,11 @@ #include "compiler/optimizer/code_generator/target_info.h" #include "compiler/optimizer/ir/constants.h" #include "compiler/optimizer/ir/datatype.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/mem/arena_allocator.h" #include "libarkbase/utils/bit_field.h" #include "libarkbase/utils/arch.h" #include "libarkbase/utils/regmask.h" +#include "libarkbase/utils/span.h" #include diff --git a/static_core/compiler/optimizer/ir/runtime_interface.h b/static_core/compiler/optimizer/ir/runtime_interface.h index ad88a61810c46a388bc75031a78a1a5c1ec28c66..2f8213449b96ed7c449dd95ad17be6474be6d5ca 100644 --- a/static_core/compiler/optimizer/ir/runtime_interface.h +++ b/static_core/compiler/optimizer/ir/runtime_interface.h @@ -22,15 +22,19 @@ #include "ir-dyn-base-types.h" #include "libarkbase/mem/gc_barrier.h" #include "runtime/include/coretypes/tagged_value.h" +#include "runtime/include/object_header.h" #include "runtime/profiling/profiling.h" #include "source_languages.h" #include "libarkbase/utils/arch.h" #include "libarkbase/utils/span.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/mem/mem.h" +#include "libarkbase/utils/arena_vector.h" +#include "libarkfile/file_items.h" +#include "libarkfile/bytecode_instruction.h" namespace ark { class Thread; +class Field; } // namespace ark namespace ark::compiler { @@ -637,6 +641,11 @@ public: return nullptr; } + virtual bool IsInBootContext([[maybe_unused]] ClassPtr klass) const + { + return false; + } + // returns Class for Field virtual ClassPtr GetClassForField([[maybe_unused]] FieldPtr field) const { diff --git a/static_core/compiler/optimizer/ir/visualizer_printer.h b/static_core/compiler/optimizer/ir/visualizer_printer.h index 8b893d5c3cad4d9265a7e97b310d195547a01c34..654ee77f04e87cf5ae3fb08b171cb788a21134f3 100644 --- a/static_core/compiler/optimizer/ir/visualizer_printer.h +++ b/static_core/compiler/optimizer/ir/visualizer_printer.h @@ -16,7 +16,7 @@ #define COMPILER_OPTIMIZER_IR_VISUALIZER_PRINTER_H #include -#include +#include "libarkbase/utils/arena_string.h" namespace ark::compiler { // This class dump graph in C1Visualizer format diff --git a/static_core/compiler/optimizer/ir_builder/inst_builder.h b/static_core/compiler/optimizer/ir_builder/inst_builder.h index aba6e6694d5b87e1fb899217e3c75ffd8cfb6c5c..90d1b0183f0f291a367a8efc09e3610cadc9ee8f 100644 --- a/static_core/compiler/optimizer/ir_builder/inst_builder.h +++ b/static_core/compiler/optimizer/ir_builder/inst_builder.h @@ -23,9 +23,11 @@ #include "code_info/vreg_info.h" #include "libarkfile/code_data_accessor.h" #include "libarkfile/file_items.h" + #include "compiler_logger.h" #include "libarkfile/bytecode_instruction.h" +#include "libarkbase/utils/arena_unordered_set.h" namespace ark::compiler { constexpr int64_t INVALID_OFFSET = std::numeric_limits::max(); @@ -112,8 +114,7 @@ public: bool IsInBootContext() { - auto method = static_cast(GetGraph()->GetMethod()); - return method->GetClass()->GetLoadContext()->IsBootContext(); + return GetRuntime()->IsInBootContext(GetRuntime()->GetClass(GetGraph()->GetMethod())); } void AddCatchPhiInputs(const ArenaUnorderedSet &catchHandlers, const InstVector &defs, diff --git a/static_core/compiler/optimizer/optimizations/adjust_arefs.cpp b/static_core/compiler/optimizer/optimizations/adjust_arefs.cpp index 95db08f36c576a7bf308873a213e8f8077f75694..5cfca67d5aa6f3ca75ff5ccd0dc64471a29e9fd2 100644 --- a/static_core/compiler/optimizer/optimizations/adjust_arefs.cpp +++ b/static_core/compiler/optimizer/optimizations/adjust_arefs.cpp @@ -17,6 +17,7 @@ #include "optimizer/ir/basicblock.h" #include "optimizer/ir/graph.h" #include "optimizer/analysis/loop_analyzer.h" +#include "optimizer/code_generator/encode.h" namespace ark::compiler { AdjustRefs::AdjustRefs(Graph *graph) diff --git a/static_core/compiler/optimizer/optimizations/balance_expressions.h b/static_core/compiler/optimizer/optimizations/balance_expressions.h index 705cff8ea514b5ef92b0d92698b7f7062623fa93..44a0f94d8c533c080bab8c94d84377c449d54a8f 100644 --- a/static_core/compiler/optimizer/optimizations/balance_expressions.h +++ b/static_core/compiler/optimizer/optimizations/balance_expressions.h @@ -19,7 +19,6 @@ #include "optimizer/ir/basicblock.h" #include "optimizer/ir/graph.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" namespace ark::compiler { class BalanceExpressions : public Optimization { diff --git a/static_core/compiler/optimizer/optimizations/branch_elimination.h b/static_core/compiler/optimizer/optimizations/branch_elimination.h index 7e2cd8e100f639c4c29d6a235d0c852b9a99d29c..6fad935f2ae5a0cf5e7714381532e6d67bb72842 100644 --- a/static_core/compiler/optimizer/optimizations/branch_elimination.h +++ b/static_core/compiler/optimizer/optimizations/branch_elimination.h @@ -18,7 +18,7 @@ #include "optimizer/ir/graph.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { class PANDA_PUBLIC_API BranchElimination : public Optimization { diff --git a/static_core/compiler/optimizer/optimizations/cleanup.h b/static_core/compiler/optimizer/optimizations/cleanup.h index 35185276fa2407a6bb2d6740040e436d8718e5cc..98ddd88ee75323721313615f2548c65ac067c0e8 100644 --- a/static_core/compiler/optimizer/optimizations/cleanup.h +++ b/static_core/compiler/optimizer/optimizations/cleanup.h @@ -18,6 +18,7 @@ #include "optimizer/ir/graph.h" #include "optimizer/pass.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { class PANDA_PUBLIC_API Cleanup final : public Optimization { diff --git a/static_core/compiler/optimizer/optimizations/condition_chain_cache.h b/static_core/compiler/optimizer/optimizations/condition_chain_cache.h index 25ce0fb556c798955afd0e41c6a009781e22ab55..f8f4a244cfabd803dec98e8b3e05890f05e3f796 100644 --- a/static_core/compiler/optimizer/optimizations/condition_chain_cache.h +++ b/static_core/compiler/optimizer/optimizations/condition_chain_cache.h @@ -16,7 +16,6 @@ #ifndef COMPILER_OPTIMIZER_OPTIMIZATIONS_CONDITION_CHAIN_CACHE_H #define COMPILER_OPTIMIZER_OPTIMIZATIONS_CONDITION_CHAIN_CACHE_H -#include "libarkbase/utils/arena_containers.h" namespace ark::compiler { class ConditionChain; diff --git a/static_core/compiler/optimizer/optimizations/cse.h b/static_core/compiler/optimizer/optimizations/cse.h index 22c7b73636a324c86e672e8621477a47ca0d4bf7..abea870be374851aa9d70f864ac0cc1c1dbfa577 100644 --- a/static_core/compiler/optimizer/optimizations/cse.h +++ b/static_core/compiler/optimizer/optimizations/cse.h @@ -21,7 +21,6 @@ #include "optimizer/ir/basicblock.h" #include "optimizer/ir/inst.h" #include "optimizer/pass.h" -#include "libarkbase/utils/arena_containers.h" #include "vn.h" #include "compiler_logger.h" #include "libarkbase/utils/logger.h" diff --git a/static_core/compiler/optimizer/optimizations/escape.h b/static_core/compiler/optimizer/optimizations/escape.h index fe083a43b741e3da689bfe5d62a6239f80b1c595..ab371b42a6939a18b68bb51360e2e2ef97b08654 100644 --- a/static_core/compiler/optimizer/optimizations/escape.h +++ b/static_core/compiler/optimizer/optimizations/escape.h @@ -29,6 +29,7 @@ #include "optimizer/ir/runtime_interface.h" #include "libarkbase/mem/arena_allocator.h" #include "libarkbase/utils/bit_vector.h" +#include "libarkbase/utils/arena_unordered_map.h" #include "compiler_logger.h" #include "libarkbase/utils/logger.h" diff --git a/static_core/compiler/optimizer/optimizations/if_conversion.h b/static_core/compiler/optimizer/optimizations/if_conversion.h index 1d55175211f25a9240a82f787fcb8c934958acd7..345e6f42a05e48c5a905df9d587c8bccdce5b0e8 100644 --- a/static_core/compiler/optimizer/optimizations/if_conversion.h +++ b/static_core/compiler/optimizer/optimizations/if_conversion.h @@ -17,7 +17,8 @@ #define COMPILER_OPTIMIZER_ANALYSIS_IF_CONVERSION_H #include "optimizer/ir/graph.h" -#include "libarkbase/utils/arena_containers.h" +#include "optimizer/code_generator/encode.h" + namespace ark::compiler { class BasicBlock; diff --git a/static_core/compiler/optimizer/optimizations/inlining.h b/static_core/compiler/optimizer/optimizations/inlining.h index 4b747c391a6e3218fedd9b2ac0789aacbd9567df..96c2e3f8ab52891e63f6b20b7bf017a9dee11149 100644 --- a/static_core/compiler/optimizer/optimizations/inlining.h +++ b/static_core/compiler/optimizer/optimizations/inlining.h @@ -21,7 +21,7 @@ #include "optimizer/ir/inst.h" #include "optimizer/ir/runtime_interface.h" #include "compiler_options.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_unordered_set.h" // NOLINTNEXTLINE(cppcoreguidelines-macro-usage,-warnings-as-errors) #define LOG_INLINING(level) COMPILER_LOG(level, INLINING) << GetLogIndent() diff --git a/static_core/compiler/optimizer/optimizations/loop_unswitch.h b/static_core/compiler/optimizer/optimizations/loop_unswitch.h index c288944a4ce7bbf61e37c2821a8caef50ee390e0..d18d9b5c45bd912cb0ead8c75429c17d7c3b0960 100644 --- a/static_core/compiler/optimizer/optimizations/loop_unswitch.h +++ b/static_core/compiler/optimizer/optimizations/loop_unswitch.h @@ -18,6 +18,7 @@ #include "optimizer/optimizations/loop_transform.h" #include "compiler_options.h" +#include "libarkbase/utils/arena_queue.h" namespace ark::compiler { class LoopUnswitch : public LoopTransform { diff --git a/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.cpp b/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.cpp index a6703470e40fdb152bdc3bf2b736c919d496b304..f46d5cf5e8f7120ff5e3ce668bacfbc3aa284241 100644 --- a/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.cpp +++ b/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.cpp @@ -23,7 +23,6 @@ #include "optimizer/ir/graph.h" #include "optimizer/ir/graph_visitor.h" #include "optimizer/ir/inst.h" -#include "libarkbase/utils/arena_containers.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.h b/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.h index 8e714e68d881778bf344c078677e2ada967687c2..5295a78ba85ef5e26f3ad5d4f5c8c2305c264b27 100644 --- a/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.h +++ b/static_core/compiler/optimizer/optimizations/lower_boxed_boolean.h @@ -23,6 +23,7 @@ #include "optimizer/ir/inst.h" #include "optimizer/pass.h" #include "optimizer/ir/graph_visitor.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/lse.cpp b/static_core/compiler/optimizer/optimizations/lse.cpp index f64d9f6198d800a6c9a9efd922b3a1adf974f1b2..1845979c4185b458602cf496806fd16803cfa68b 100644 --- a/static_core/compiler/optimizer/optimizations/lse.cpp +++ b/static_core/compiler/optimizer/optimizations/lse.cpp @@ -22,6 +22,7 @@ #include "optimizer/analysis/rpo.h" #include "optimizer/analysis/loop_analyzer.h" #include "optimizer/optimizations/lse.h" +#include "libarkbase/utils/arena_queue.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/move_constants.h b/static_core/compiler/optimizer/optimizations/move_constants.h index da3954e9427f8010a21fccc58da4a05e746a1506..12932123d6b26f9154920d8d6cfade4e4b2b117b 100644 --- a/static_core/compiler/optimizer/optimizations/move_constants.h +++ b/static_core/compiler/optimizer/optimizations/move_constants.h @@ -19,6 +19,9 @@ #include "optimizer/pass.h" #include "optimizer/ir/basicblock.h" #include "compiler_options.h" +#include "libarkbase/utils/arena_unordered_map.h" + + namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/peepholes.cpp b/static_core/compiler/optimizer/optimizations/peepholes.cpp index 6ab9c997ecbc2d4acb11d3ad64ca87a6f79be334..79876f14a2aa8b5a0f95f7883d6cc8d67dc50b52 100644 --- a/static_core/compiler/optimizer/optimizations/peepholes.cpp +++ b/static_core/compiler/optimizer/optimizations/peepholes.cpp @@ -20,6 +20,8 @@ #include "optimizer/optimizations/const_folding.h" #include "optimizer/optimizations/object_type_check_elimination.h" +#include + namespace ark::compiler { void Peepholes::InvalidateAnalyses() diff --git a/static_core/compiler/optimizer/optimizations/peepholes.h b/static_core/compiler/optimizer/optimizations/peepholes.h index b57075a34146df61cfc561b64af369b7f6fa5413..35b76ce2dcaaf783b5e170e224764f7238907c16 100644 --- a/static_core/compiler/optimizer/optimizations/peepholes.h +++ b/static_core/compiler/optimizer/optimizations/peepholes.h @@ -23,7 +23,6 @@ #include "compiler_options.h" #include "optimizer/ir/analysis.h" #include "optimizer/ir/graph_visitor.h" -#include "libarkbase/utils/arena_containers.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/regalloc/interference_graph.h b/static_core/compiler/optimizer/optimizations/regalloc/interference_graph.h index 6aa52f5bb31383bf641bad080663c5c2cbac98b2..581539e4d0ad5ffdcdbcc77e21529f4099c214aa 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/interference_graph.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/interference_graph.h @@ -25,9 +25,8 @@ #include "libarkbase/macros.h" #include "libarkbase/utils/bit_utils.h" #include "optimizer/code_generator/operands.h" -#include -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/small_vector.h" +#include "libarkbase/utils/arena_unordered_set.h" namespace ark::compiler { class LifeIntervals; diff --git a/static_core/compiler/optimizer/optimizations/regalloc/location_mask.h b/static_core/compiler/optimizer/optimizations/regalloc/location_mask.h index bf14b6d9eb32766ce1898df116a14f50cd92fcec..55c42ef9bd3105f949463cb5ac2f6ef323cd8e42 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/location_mask.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/location_mask.h @@ -16,8 +16,9 @@ #define COMPILER_OPTIMIZER_OPTIMIZATIONS_LOCATION_MASK_H #include "libarkbase/mem/arena_allocator.h" -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_vector.h" #include +#include namespace ark::compiler { /// Helper-class to hold information about registers and stack slots usage. diff --git a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_base.h b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_base.h index 98e7eaae85b8fbd317e62293e91141186d4e3e8c..1acb2e9acf15095b90f01c5b55f9a6287df736c7 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_base.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_base.h @@ -18,7 +18,7 @@ #include "compiler/optimizer/ir/graph.h" #include "optimizer/analysis/liveness_analyzer.h" -#include "libarkbase/utils/arena_containers.h" + #include "location_mask.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_graph_coloring.h b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_graph_coloring.h index ca912bae69b2742454fe211f507bbb0156a48485..3ae6d06b14bfb7906425d925843375a5201c10f5 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_graph_coloring.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_graph_coloring.h @@ -23,7 +23,7 @@ #include "optimizer/code_generator/registers_description.h" #include "optimizer/optimizations/regalloc/working_ranges.h" #include "reg_map.h" -#include "libarkbase/utils/arena_containers.h" + #include "libarkbase/utils/small_vector.h" namespace ark::compiler { diff --git a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.h b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.h index a03bff558d2dd53e0d38fe0a15112ff31138d091..f568bc9c6e2d71d833af01d880fa8e0538a68b6b 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.h @@ -16,7 +16,7 @@ #ifndef COMPILER_OPTIMIZER_OPTIMIZATIONS_REG_ALLOC_LINEAR_SCAN_H #define COMPILER_OPTIMIZER_OPTIMIZATIONS_REG_ALLOC_LINEAR_SCAN_H -#include "libarkbase/utils/arena_containers.h" + #include "optimizer/analysis/liveness_analyzer.h" #include "optimizer/code_generator/registers_description.h" #include "reg_alloc_base.h" diff --git a/static_core/compiler/optimizer/optimizations/regalloc/reg_map.h b/static_core/compiler/optimizer/optimizations/regalloc/reg_map.h index c9854fc0d6d052c0f4d4e6c267d0410fc0ae7346..d82a322b29e2f2f178cf1e486e53dd13b8570db0 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/reg_map.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/reg_map.h @@ -16,7 +16,7 @@ #ifndef COMPILER_OPTIMIZER_OPTIMIZATIONS_REG_MAP_H #define COMPILER_OPTIMIZER_OPTIMIZATIONS_REG_MAP_H -#include "libarkbase/utils/arena_containers.h" + #include "location_mask.h" #include "optimizer/ir/constants.h" #include "libarkbase/utils/arch.h" diff --git a/static_core/compiler/optimizer/optimizations/regalloc/spill_fills_resolver.h b/static_core/compiler/optimizer/optimizations/regalloc/spill_fills_resolver.h index 47549d970a151ef1277222e88ecc2fb98299d47e..3b42892187e49084de164c91f9a93e99aa671391 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/spill_fills_resolver.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/spill_fills_resolver.h @@ -19,7 +19,7 @@ #include "compiler/optimizer/ir/graph_visitor.h" #include "optimizer/code_generator/registers_description.h" #include "optimizer/ir/inst.h" -#include "libarkbase/utils/arena_containers.h" + namespace ark::compiler { class RegAllocBase; diff --git a/static_core/compiler/optimizer/optimizations/regalloc/working_ranges.h b/static_core/compiler/optimizer/optimizations/regalloc/working_ranges.h index 827681ce0eb57113cacd127b04d000ce33eb3dd5..a2642202cfaca1643de012117fc5e45b4fd4f2fb 100644 --- a/static_core/compiler/optimizer/optimizations/regalloc/working_ranges.h +++ b/static_core/compiler/optimizer/optimizations/regalloc/working_ranges.h @@ -17,7 +17,7 @@ #define COMPILER_OPTIMIZER_OPTIMIZATIONS_WORKING_RANGES_H #include "compiler/optimizer/analysis/liveness_analyzer.h" -#include "libarkbase/utils/arena_containers.h" + namespace ark::compiler { using InstructionsRanges = ArenaDeque; diff --git a/static_core/compiler/optimizer/optimizations/scheduler.h b/static_core/compiler/optimizer/optimizations/scheduler.h index b580b07c1c34502e5db390effc4098d3d3fbdf25..bba6be5bc3f49c2a0c352a832f1a9427a9dd1ce0 100644 --- a/static_core/compiler/optimizer/optimizations/scheduler.h +++ b/static_core/compiler/optimizer/optimizations/scheduler.h @@ -18,6 +18,9 @@ #include "optimizer/ir/graph.h" #include "compiler_options.h" +#include "libarkbase/utils/arena_unordered_map.h" + +#include namespace ark::compiler { class Scheduler : public Optimization { diff --git a/static_core/compiler/optimizer/optimizations/vn.h b/static_core/compiler/optimizer/optimizations/vn.h index afadd5b2904268098557989308fd3efa1f6d46b6..2b05e9fd456de7d9a6c9fc90524352fffce9d718 100644 --- a/static_core/compiler/optimizer/optimizations/vn.h +++ b/static_core/compiler/optimizer/optimizations/vn.h @@ -21,6 +21,7 @@ #include #include #include "optimizer/ir/analysis.h" +#include "libarkbase/utils/arena_unordered_map.h" namespace ark::compiler { class Inst; diff --git a/static_core/compiler/optimizer/pass_manager.h b/static_core/compiler/optimizer/pass_manager.h index e81ad22f3dcf85d948a938bbe36890bd7c2315ff..d717f33de983549fa3e91245e1159c2dd0ca74cf 100644 --- a/static_core/compiler/optimizer/pass_manager.h +++ b/static_core/compiler/optimizer/pass_manager.h @@ -20,8 +20,8 @@ #include "compiler_options.h" #include "pass.h" #include "libarkbase/utils/bit_field.h" -#include "libarkbase/utils/arena_containers.h" #include "pass_manager_statistics.h" +#include "libarkbase/utils/arena_vector.h" namespace ark::compiler { class Graph; diff --git a/static_core/compiler/optimizer/pass_manager_statistics.h b/static_core/compiler/optimizer/pass_manager_statistics.h index 25c3aaa3cd5c38a5c6a2f5b234068925721195cf..a109914851b819d531d0316e503547521100823a 100644 --- a/static_core/compiler/optimizer/pass_manager_statistics.h +++ b/static_core/compiler/optimizer/pass_manager_statistics.h @@ -17,7 +17,8 @@ #define PANDA_PASS_STATISTICS_H #include -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_list.h" +#include "libarkbase/utils/arena_stack.h" namespace ark::compiler { class Graph; diff --git a/static_core/compiler/optimizer/pipeline.cpp b/static_core/compiler/optimizer/pipeline.cpp index 8edff74bf2759ef56a16b4657945015d22b09c6c..3d1d59f74cf8021a78b75580abda3fec093cdb91 100644 --- a/static_core/compiler/optimizer/pipeline.cpp +++ b/static_core/compiler/optimizer/pipeline.cpp @@ -23,6 +23,7 @@ #include "optimizer/code_generator/codegen_native.h" #include "optimizer/code_generator/method_properties.h" #include "optimizer/ir/graph.h" +#include "optimizer/ir/graph-inl.h" #include "optimizer/ir/visualizer_printer.h" #include "optimizer/analysis/alias_analysis.h" #include "optimizer/analysis/linear_order.h" diff --git a/static_core/compiler/optimizer/templates/ir-dyn-base-types.h.erb b/static_core/compiler/optimizer/templates/ir-dyn-base-types.h.erb index 5ed4340aaa99e7a06dc33682f0878787ea7eb7d3..23fa386144b1c00ae40349e9788f3a85cabd57be 100644 --- a/static_core/compiler/optimizer/templates/ir-dyn-base-types.h.erb +++ b/static_core/compiler/optimizer/templates/ir-dyn-base-types.h.erb @@ -17,10 +17,12 @@ #define COMPILER_OPTIMIZER_TEMPLATES_IR_DYN_BASE_TYPES_H #include "compiler/optimizer/ir/datatype.h" -#include "compiler/optimizer/code_generator/encode.h" +#include "compiler/optimizer/code_generator/label_holder.h" #include "profiling/profiling.h" #include "source_languages.h" +#include + <%= Common::include_plugin_files "compiler_base_types", "header_path_implementation_codegen" %> <%= Common::include_plugin_files "compiler_extensions", "main_header_path" %> diff --git a/static_core/compiler/tests/aarch64/codegen_test.cpp b/static_core/compiler/tests/aarch64/codegen_test.cpp index 0efc160c8078655bc3fb8772b4e7526f36eb5c67..93a90408bf529c182dc87a445db7a04165f54275 100644 --- a/static_core/compiler/tests/aarch64/codegen_test.cpp +++ b/static_core/compiler/tests/aarch64/codegen_test.cpp @@ -23,7 +23,7 @@ #include "optimizer/code_generator/codegen.h" #include "optimizer/code_generator/codegen_native.h" #include "optimizer/code_generator/method_properties.h" -#include "utils-vixl.h" +#include "libarkbase/utils/-vixl.h" #include "aarch64/decoder-aarch64.h" #include "aarch64/disasm-aarch64.h" #include "aarch64/operands-aarch64.h" diff --git a/static_core/compiler/tests/bounds_analysis_test.cpp b/static_core/compiler/tests/bounds_analysis_test.cpp index 01429272a4aca939b0f675c5a4c3952f5ae382a7..88ac78c3b3c435c209ab7911f2f65f4d9ccb6636 100644 --- a/static_core/compiler/tests/bounds_analysis_test.cpp +++ b/static_core/compiler/tests/bounds_analysis_test.cpp @@ -17,7 +17,7 @@ #include "optimizer/analysis/bounds_analysis.h" #include "optimizer/optimizations/cleanup.h" #include "optimizer/optimizations/peepholes.h" -#include "libarkbase/utils/arena_containers.h" + namespace ark::compiler { class BoundsAnalysisTest : public CommonTest { diff --git a/static_core/compiler/tests/profiling_merger_test.cpp b/static_core/compiler/tests/profiling_merger_test.cpp index 5c9a3ce2ddfce4d74f441df14c1176f2c2bc0d08..de102e914a10bc3d89533f4e325f247cf0dcefe5 100644 --- a/static_core/compiler/tests/profiling_merger_test.cpp +++ b/static_core/compiler/tests/profiling_merger_test.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "include/mem/panda_containers.h" + #include "include/method.h" #include "include/runtime.h" #include "jit/libprofile/aot_profiling_data.h" diff --git a/static_core/compiler/tests/unit_test.cpp b/static_core/compiler/tests/unit_test.cpp index 0de8de254bb4c4cc5f0515989d0271359b18786c..04c910f3bb7f4bad23d40b714e1ddafe18b37c4e 100644 --- a/static_core/compiler/tests/unit_test.cpp +++ b/static_core/compiler/tests/unit_test.cpp @@ -30,6 +30,7 @@ #include "compiler.h" #include "libarkbase/utils/expected.h" #include "compiler_options.h" +#include "runtime/include/class-inl.h" #include "libarkbase/utils/utf.h" diff --git a/static_core/compiler/tools/debug/jit_writer.h b/static_core/compiler/tools/debug/jit_writer.h index fb17669561b826f518c95c387c13821bfe359495..bc3f56ebd0744a2b3f5d2c38fd5697dce878a188 100644 --- a/static_core/compiler/tools/debug/jit_writer.h +++ b/static_core/compiler/tools/debug/jit_writer.h @@ -22,7 +22,7 @@ #include "aot/aot_file.h" #include "aot/aot_builder/elf_builder.h" #include "libarkbase/utils/arch.h" -#include "libarkbase/utils/arena_containers.h" + #include "libarkbase/utils/bit_vector.h" #include "optimizer/ir/runtime_interface.h" #include diff --git a/static_core/cross_values/cross_values_getters_generator.rb b/static_core/cross_values/cross_values_getters_generator.rb index a4d19c9b58b249d88b34ff9a3dda2b4ee627244a..9496d8b925cbe6ca58076b6a0172964c63380a0a 100755 --- a/static_core/cross_values/cross_values_getters_generator.rb +++ b/static_core/cross_values/cross_values_getters_generator.rb @@ -22,6 +22,8 @@ $header = %{ #ifndef CROSS_VALUES_CROSS_VALUES_H #define CROSS_VALUES_CROSS_VALUES_H +#include "libarkbase/utils/logger.h" + } Dir.glob("#{ARGV[1]}/*values_gen.h").each do |values_h| diff --git a/static_core/irtoc/backend/compilation.h b/static_core/irtoc/backend/compilation.h index ac9455ab9d21ac8e49a94618ebf3ac9f87740afe..21b491cf8bf5466e18a18fd48e79a230be0a92b6 100644 --- a/static_core/irtoc/backend/compilation.h +++ b/static_core/irtoc/backend/compilation.h @@ -17,6 +17,7 @@ #define PANDA_IRTOC_COMPILATION_H #include "function.h" +#include namespace ark::irtoc { using compiler::Graph; diff --git a/static_core/irtoc/backend/compiler/dangling_pointers_checker.h b/static_core/irtoc/backend/compiler/dangling_pointers_checker.h index eeb82cd0fd697764c603bdcf054214fd5e131a1a..5494861506f647cae3dfb326bf098cde83b7a95e 100644 --- a/static_core/irtoc/backend/compiler/dangling_pointers_checker.h +++ b/static_core/irtoc/backend/compiler/dangling_pointers_checker.h @@ -19,6 +19,7 @@ #include "compiler/optimizer/pass.h" #include "compiler/optimizer/ir/basicblock.h" #include "compiler/compiler_options.h" +#include "libarkbase/utils/arena_set.h" namespace ark::compiler { class DanglingPointersChecker : public Analysis { diff --git a/static_core/libarkbase/mem/arena_allocator.h b/static_core/libarkbase/mem/arena_allocator.h index 1edca77ad206c8a3b9dc5ecf4a321cf1db3c954b..a0b46866747d99458cd6678c9e87904b36f74e50 100644 --- a/static_core/libarkbase/mem/arena_allocator.h +++ b/static_core/libarkbase/mem/arena_allocator.h @@ -17,20 +17,15 @@ #define LIBPANDABASE_MEM_ARENA_ALLOCATOR_H #include -#include #include #include #include #include -#include #include "libarkbase/concepts.h" #include "libarkbase/mem/base_mem_stats.h" -#include "malloc_mem_pool-inl.h" -#include "mmap_mem_pool-inl.h" #include "mem.h" #include "mem_pool.h" -#include "arena-inl.h" #include "libarkbase/os/mutex.h" #define USE_MMAP_POOL_FOR_ARENAS diff --git a/static_core/libarkbase/mem/base_mem_stats.h b/static_core/libarkbase/mem/base_mem_stats.h index 08274fb2f95ea427509b063fa5f12889935c01db..d4c686af12f6feb5d5ae085aeeeef8746b06776a 100644 --- a/static_core/libarkbase/mem/base_mem_stats.h +++ b/static_core/libarkbase/mem/base_mem_stats.h @@ -16,7 +16,6 @@ #ifndef PANDA_BASE_MEM_STATS_H #define PANDA_BASE_MEM_STATS_H -#include "libarkbase/os/mutex.h" #include #include "libarkbase/macros.h" #include "space.h" diff --git a/static_core/libarkbase/mem/code_allocator.h b/static_core/libarkbase/mem/code_allocator.h index 001f8bd572bc98d8ca2179f77e4b456835ccbf9c..977c56c78c43f4bf4f778c698e40c7baa4730fbe 100644 --- a/static_core/libarkbase/mem/code_allocator.h +++ b/static_core/libarkbase/mem/code_allocator.h @@ -16,7 +16,7 @@ #ifndef PANDA_CODEALLOCATOR_H #define PANDA_CODEALLOCATOR_H -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/mem/arena_allocator.h" #include "libarkbase/os/mem.h" #include "libarkbase/os/mutex.h" diff --git a/static_core/libarkbase/mem/mem.h b/static_core/libarkbase/mem/mem.h index 77039b678d4ee01fbe53d7ec5d629b5741c182d2..2e361b18118860c95443b909bc24ae885189279d 100644 --- a/static_core/libarkbase/mem/mem.h +++ b/static_core/libarkbase/mem/mem.h @@ -21,7 +21,6 @@ #include #include -#include #include namespace ark { diff --git a/static_core/libarkbase/mem/weighted_adaptive_tlab_average.h b/static_core/libarkbase/mem/weighted_adaptive_tlab_average.h index 22ab11272d306b6363c9c91afb0f60f54d18daa8..fa630f84e725dca98499ffeb4a60aa3f92c9541d 100644 --- a/static_core/libarkbase/mem/weighted_adaptive_tlab_average.h +++ b/static_core/libarkbase/mem/weighted_adaptive_tlab_average.h @@ -18,7 +18,7 @@ #include #include "libarkbase/macros.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" namespace ark { class WeightedAdaptiveTlabAverage { diff --git a/static_core/libarkbase/os/mem.h b/static_core/libarkbase/os/mem.h index 945a05fd7177d3efad93071fceab6a0e54878cf9..a3cfb54b2506ce3106788f9aa63aa03787b375c6 100644 --- a/static_core/libarkbase/os/mem.h +++ b/static_core/libarkbase/os/mem.h @@ -17,6 +17,7 @@ #define PANDA_LIBPANDABASE_PBASE_OS_MEM_H_ #include "file.h" +#include "error.h" #include "libarkbase/macros.h" #include "libarkbase/utils/expected.h" #include "libarkbase/utils/span.h" @@ -31,7 +32,6 @@ #error "Unsupported target: please provide mmap API" #endif -#include #include #include #include diff --git a/static_core/libarkbase/tests/arena_allocator_test.cpp b/static_core/libarkbase/tests/arena_allocator_test.cpp index d56c20987481855d1594485cf33366b854ece7e4..3e9f1ac1df872572deba049b79afd51ca776bc33 100644 --- a/static_core/libarkbase/tests/arena_allocator_test.cpp +++ b/static_core/libarkbase/tests/arena_allocator_test.cpp @@ -20,7 +20,7 @@ #include "libarkbase/mem/mem.h" #include "libarkbase/mem/mem_config.h" -#include "libarkbase/utils/arena_containers.h" + #include "gtest/gtest.h" #include "libarkbase/utils/logger.h" diff --git a/static_core/libarkbase/tests/bit_vector_test.cpp b/static_core/libarkbase/tests/bit_vector_test.cpp index 7efcbb0390ad6eafc909eff4e6889d69be807c27..a2cc8743b66a298d62f73a7617666eb79eb86a80 100644 --- a/static_core/libarkbase/tests/bit_vector_test.cpp +++ b/static_core/libarkbase/tests/bit_vector_test.cpp @@ -15,7 +15,7 @@ #include "libarkbase/utils/bit_vector.h" #include "libarkbase/mem/pool_manager.h" -#include "libarkbase/utils/arena_containers.h" + #include diff --git a/static_core/libarkbase/tests/small_vector_test.cpp b/static_core/libarkbase/tests/small_vector_test.cpp index 7d2460b6f5774dd0d3f94b1d8e8d054639f6cf7c..1de6135472dad99beadf0b8a00687928f32c3def 100644 --- a/static_core/libarkbase/tests/small_vector_test.cpp +++ b/static_core/libarkbase/tests/small_vector_test.cpp @@ -14,7 +14,7 @@ */ #include "libarkbase/mem/pool_manager.h" -#include "libarkbase/utils/arena_containers.h" + #include "libarkbase/utils/small_vector.h" #include diff --git a/static_core/libarkbase/utils/arch.h b/static_core/libarkbase/utils/arch.h index fe7cffcc8b9a827f6f4a74eddd9995742ab89c6d..d333756ea5ec2449a37f7532768e2674c71794ad 100644 --- a/static_core/libarkbase/utils/arch.h +++ b/static_core/libarkbase/utils/arch.h @@ -17,7 +17,6 @@ #define PANDA_ARCH_H #include "libarkbase/macros.h" -#include "libarkbase/utils/math_helpers.h" #include "libarkbase/utils/regmask.h" #include "libarkbase/concepts.h" diff --git a/static_core/libarkbase/utils/arena_containers.h b/static_core/libarkbase/utils/arena_containers.h index 262ed52e957e43081fa9a9d3ebabcf6a55f00212..0dd32c7ca7f48e81c9b212f49d0dad9527bdd813 100644 --- a/static_core/libarkbase/utils/arena_containers.h +++ b/static_core/libarkbase/utils/arena_containers.h @@ -16,60 +16,16 @@ #ifndef LIBPANDABASE_UTILS_ARENA_CONTAINERS_H_ #define LIBPANDABASE_UTILS_ARENA_CONTAINERS_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libarkbase/mem/arena_allocator.h" -#include "libarkbase/mem/arena_allocator_stl_adapter.h" - -namespace ark { - -template -using ArenaVector = std::vector>; -template -using ArenaDeque = std::deque>; -template > -using ArenaStack = std::stack; -template > -using ArenaQueue = std::queue; -template -using ArenaList = std::list>; -template -using ArenaForwardList = std::forward_list>; -template , bool USE_OOM_HANDLER = false> -using ArenaSet = std::set>; -template , bool USE_OOM_HANDLER = false> -using ArenaMap = std::map, USE_OOM_HANDLER>>; -template , bool USE_OOM_HANDLER = false> -using ArenaMultiMap = std::multimap, USE_OOM_HANDLER>>; -template , class KeyEqual = std::equal_to, - bool USE_OOM_HANDLER = false> -using ArenaUnorderedMultiMap = - std::unordered_multimap, USE_OOM_HANDLER>>; -template , class KeyEqual = std::equal_to, - bool USE_OOM_HANDLER = false> -using ArenaUnorderedMap = - std::unordered_map, false>>; -template -using ArenaDoubleUnorderedMap = - ArenaUnorderedMap, std::equal_to, USE_OOM_HANDLER>, - std::hash, std::equal_to, USE_OOM_HANDLER>; -template , class KeyEqual = std::equal_to, bool USE_OOM_HANDLER = false> -using ArenaUnorderedSet = std::unordered_set>; -template -using ArenaStringT = std::basic_string, ArenaAllocatorAdapter>; -using ArenaString = ArenaStringT; - -} // namespace ark +#include "arena_deque.h" +#include "arena_list.h" +#include "arena_forward_list.h" +#include "arena_stack.h" +#include "arena_queue.h" +#include "arena_vector.h" +#include "arena_set.h" +#include "arena_string.h" +#include "arena_map.h" +#include "arena_unordered_map.h" +#include "arena_unordered_set.h" #endif // LIBPANDABASE_UTILS_ARENA_CONTAINERS_H_ diff --git a/static_core/libarkbase/utils/arena_deque.h b/static_core/libarkbase/utils/arena_deque.h new file mode 100644 index 0000000000000000000000000000000000000000..94928b016048f538574a398915b48d7d858d05e7 --- /dev/null +++ b/static_core/libarkbase/utils/arena_deque.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_DEQUE_H_ +#define LIBPANDABASE_UTILS_ARENA_DEQUE_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template +using ArenaDeque = std::deque>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_DEQUE_H_ diff --git a/static_core/libarkbase/utils/arena_forward_list.h b/static_core/libarkbase/utils/arena_forward_list.h new file mode 100644 index 0000000000000000000000000000000000000000..4c14982e52de96d18ba3445956ec49cfcd5c7d5d --- /dev/null +++ b/static_core/libarkbase/utils/arena_forward_list.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_FORWARD_LIST_H_ +#define LIBPANDABASE_UTILS_ARENA_FORWARD_LIST_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template +using ArenaForwardList = std::forward_list>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_FORWARD_LIST_H_ diff --git a/static_core/libarkbase/utils/arena_list.h b/static_core/libarkbase/utils/arena_list.h new file mode 100644 index 0000000000000000000000000000000000000000..04bf764a39e36c4797489e96db953d6b2ecb70c1 --- /dev/null +++ b/static_core/libarkbase/utils/arena_list.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_LIST_H_ +#define LIBPANDABASE_UTILS_ARENA_LIST_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template +using ArenaList = std::list>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_LIST_H_ diff --git a/static_core/libarkbase/utils/arena_map.h b/static_core/libarkbase/utils/arena_map.h new file mode 100644 index 0000000000000000000000000000000000000000..2a4fad9b2066f6c0f8581e7cc9946e7508764d00 --- /dev/null +++ b/static_core/libarkbase/utils/arena_map.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_MAP_H_ +#define LIBPANDABASE_UTILS_ARENA_MAP_H_ + + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template , bool USE_OOM_HANDLER = false> +using ArenaMap = std::map, USE_OOM_HANDLER>>; +template , bool USE_OOM_HANDLER = false> +using ArenaMultiMap = std::multimap, USE_OOM_HANDLER>>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_MAP_H_ diff --git a/static_core/libarkbase/utils/arena_queue.h b/static_core/libarkbase/utils/arena_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..8981d14116da54cbb6dc85856e5234b8f797b589 --- /dev/null +++ b/static_core/libarkbase/utils/arena_queue.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_QUEUE_H_ +#define LIBPANDABASE_UTILS_ARENA_QUEUE_H_ + +#include + +#include "arena_deque.h" +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template > +using ArenaQueue = std::queue; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_QUEUE_H_ diff --git a/static_core/libarkbase/utils/arena_set.h b/static_core/libarkbase/utils/arena_set.h new file mode 100644 index 0000000000000000000000000000000000000000..6ed6ce34b3ae30e4334e291f37eb6acd64a9a153 --- /dev/null +++ b/static_core/libarkbase/utils/arena_set.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_SET_H_ +#define LIBPANDABASE_UTILS_ARENA_SET_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template , bool USE_OOM_HANDLER = false> +using ArenaSet = std::set>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_SET_H_ diff --git a/static_core/libarkbase/utils/arena_stack.h b/static_core/libarkbase/utils/arena_stack.h new file mode 100644 index 0000000000000000000000000000000000000000..d9238b4ed1cb4418090e795d23220b9b5299dae6 --- /dev/null +++ b/static_core/libarkbase/utils/arena_stack.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_STACK_H_ +#define LIBPANDABASE_UTILS_ARENA_STACK_H_ + +#include + +#include "arena_deque.h" +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template > +using ArenaStack = std::stack; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_STACK_H_ diff --git a/static_core/libarkbase/utils/arena_string.h b/static_core/libarkbase/utils/arena_string.h new file mode 100644 index 0000000000000000000000000000000000000000..50a911d32dff96a33df488459d6e85c770f26a4d --- /dev/null +++ b/static_core/libarkbase/utils/arena_string.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_STRING_H_ +#define LIBPANDABASE_UTILS_ARENA_STRING_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template +using ArenaStringT = std::basic_string, ArenaAllocatorAdapter>; +using ArenaString = ArenaStringT; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_STRING_H_ diff --git a/static_core/libarkbase/utils/arena_unordered_map.h b/static_core/libarkbase/utils/arena_unordered_map.h new file mode 100644 index 0000000000000000000000000000000000000000..6e08f4a2271daeb28bc3832dfa0b1e70ae8aa10f --- /dev/null +++ b/static_core/libarkbase/utils/arena_unordered_map.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_UNORDERED_MAP_H_ +#define LIBPANDABASE_UTILS_ARENA_UNORDERED_MAP_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template , class KeyEqual = std::equal_to, + bool USE_OOM_HANDLER = false> +using ArenaUnorderedMap = + std::unordered_map, false>>; + +template +using ArenaDoubleUnorderedMap = + ArenaUnorderedMap, std::equal_to, USE_OOM_HANDLER>, + std::hash, std::equal_to, USE_OOM_HANDLER>; + +template , class KeyEqual = std::equal_to, + bool USE_OOM_HANDLER = false> +using ArenaUnorderedMultiMap = + std::unordered_multimap, USE_OOM_HANDLER>>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_UNORDERED_MAP_H_ diff --git a/static_core/libarkbase/utils/arena_unordered_set.h b/static_core/libarkbase/utils/arena_unordered_set.h new file mode 100644 index 0000000000000000000000000000000000000000..7d8b67ba70bc2c40bd5ef62d1bdc3e31e0219d93 --- /dev/null +++ b/static_core/libarkbase/utils/arena_unordered_set.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_UNORDERED_SET_H_ +#define LIBPANDABASE_UTILS_ARENA_UNORDERED_SET_H_ + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template , class KeyEqual = std::equal_to, bool USE_OOM_HANDLER = false> +using ArenaUnorderedSet = std::unordered_set>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_UNORDERED_SET_H_ diff --git a/static_core/libarkbase/utils/arena_vector.h b/static_core/libarkbase/utils/arena_vector.h new file mode 100644 index 0000000000000000000000000000000000000000..c45a2bb60ddb7618f7096f7e6c6040f5ca9a4a87 --- /dev/null +++ b/static_core/libarkbase/utils/arena_vector.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDABASE_UTILS_ARENA_VECTOR_H_ +#define LIBPANDABASE_UTILS_ARENA_VECTOR_H_ + + +#include + +#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator_stl_adapter.h" + +namespace ark { + +template +using ArenaVector = std::vector>; + +} // namespace ark + +#endif // LIBPANDABASE_UTILS_ARENA_VECTOR_H_ diff --git a/static_core/libarkbase/utils/bit_table.h b/static_core/libarkbase/utils/bit_table.h index fe56d465eec76655f7e7c3ba2bd9075a0cb8cef3..718e4f4c95af5c04834b645dee6618410b8ec46e 100644 --- a/static_core/libarkbase/utils/bit_table.h +++ b/static_core/libarkbase/utils/bit_table.h @@ -16,7 +16,8 @@ #ifndef PANDA_BITTABLE_H #define PANDA_BITTABLE_H -#include "libarkbase/utils/arena_containers.h" +#include "libarkbase/utils/arena_deque.h" +#include "libarkbase/utils/arena_unordered_map.h" #include "libarkbase/utils/bit_memory_region.h" #include "libarkbase/utils/bit_memory_stream.h" #include "libarkbase/utils/bit_vector.h" diff --git a/static_core/libarkbase/utils/bit_utils.h b/static_core/libarkbase/utils/bit_utils.h index a50c723625210f89aa2633db3cea16718c1bf85b..4b3cfbe6405b66941f7f63a58b9dd18f2fd7fc8d 100644 --- a/static_core/libarkbase/utils/bit_utils.h +++ b/static_core/libarkbase/utils/bit_utils.h @@ -19,9 +19,7 @@ #include "libarkbase/globals.h" #include "libarkbase/macros.h" -#include #include -#include #include #include @@ -372,6 +370,14 @@ inline constexpr uint32_t BitsNumInType() return sizeof(T) * ark::BITS_PER_BYTE; } +template +bool IsNan(T arg) +{ + static_assert(std::is_floating_point_v); + // Assuming 'fno-signaling-nans': + return __builtin_isnan(arg); +} + template constexpr To CastFloatToInt(From value) { @@ -389,7 +395,7 @@ constexpr To CastFloatToInt(From value) } else { res = MAX_INT; } - } else if (std::isnan(value)) { + } else if (IsNan(value)) { res = 0; } else { res = MIN_INT; diff --git a/static_core/libarkbase/utils/bit_vector.h b/static_core/libarkbase/utils/bit_vector.h index a2b06dd49ad1dfc7c5fd5724785407520ddcc1d5..24f95fe04af85c7d8e99f6537d155f33f5fb7ede 100644 --- a/static_core/libarkbase/utils/bit_vector.h +++ b/static_core/libarkbase/utils/bit_vector.h @@ -24,6 +24,8 @@ #include "libarkbase/utils/type_helpers.h" #include +#include + namespace ark { template diff --git a/static_core/libarkbase/utils/math_helpers.h b/static_core/libarkbase/utils/math_helpers.h index b5ac86ce6c1eacd5dcb75635c2bab3aa4c055779..6173db0124f70f5035c8ac77e183fd8d5a58b712 100644 --- a/static_core/libarkbase/utils/math_helpers.h +++ b/static_core/libarkbase/utils/math_helpers.h @@ -21,7 +21,6 @@ #include #include #include -#include namespace ark::helpers::math { @@ -117,10 +116,10 @@ template T Min(T a, T b) { static_assert(std::is_floating_point_v); - if (std::isnan(a)) { + if (IsNan(a)) { return a; } - if (a == 0.0 && b == 0.0 && std::signbit(b)) { + if (a == 0.0 && b == 0.0 && __builtin_signbit(b)) { return b; } return a <= b ? a : b; @@ -130,10 +129,10 @@ template T Max(T a, T b) { static_assert(std::is_floating_point_v); - if (std::isnan(a)) { + if (IsNan(a)) { return a; } - if (a == 0.0 && b == 0.0 && std::signbit(a)) { + if (a == 0.0 && b == 0.0 && __builtin_signbit(a)) { return b; } return a >= b ? a : b; diff --git a/static_core/libarkbase/utils/pandargs.h b/static_core/libarkbase/utils/pandargs.h index 4fad4cfe82128dc6ebfd3cef67407b3110c34973..a2ddff9a4108439cceda9fffffab754506ec4962 100644 --- a/static_core/libarkbase/utils/pandargs.h +++ b/static_core/libarkbase/utils/pandargs.h @@ -16,11 +16,8 @@ #ifndef LIBPANDABASE_UTILS_PANDARGS_H_ #define LIBPANDABASE_UTILS_PANDARGS_H_ -#include #include -#include #include -#include #include #include #include diff --git a/static_core/libarkbase/utils/utils.h b/static_core/libarkbase/utils/utils.h index 83422760f2b902c1b8a04865c6255cf8d584763e..3b2769559e5e56cfaecde6b8e293fca1db2cf425 100644 --- a/static_core/libarkbase/utils/utils.h +++ b/static_core/libarkbase/utils/utils.h @@ -19,7 +19,6 @@ #include "libarkbase/macros.h" #include -#include namespace ark { // ---------------------------------------------------------------------------- @@ -68,7 +67,7 @@ PANDA_PUBLIC_API uint32_t CountDigits(uint64_t v); ALWAYS_INLINE inline void MemcpyUnsafe(void *dest, const void *src, size_t length) { - std::copy_n(static_cast(src), length, static_cast(dest)); + __builtin_memcpy(dest, src, length); } } // namespace ark diff --git a/static_core/libarkfile/literal_data_accessor.h b/static_core/libarkfile/literal_data_accessor.h index dd2ed7c9bd3de23b0ded6b00417a9af914ee1c20..8fa8ca2c63b63f833904e0d5dd3c965266faafbd 100644 --- a/static_core/libarkfile/literal_data_accessor.h +++ b/static_core/libarkfile/literal_data_accessor.h @@ -16,6 +16,7 @@ #ifndef LIBPANDAFILE_LITERAL_DATA_ACCESSOR_H_ #define LIBPANDAFILE_LITERAL_DATA_ACCESSOR_H_ +#include "libarkfile/literal_tag.h" #include "libarkfile/file.h" #include "libarkfile/field_data_accessor.h" #include "libarkfile/helpers.h" @@ -25,40 +26,6 @@ namespace ark::panda_file { using StringData = File::StringData; -/* LiteralTag could be extended by different language -// For example, JAVA could use it to represent Array of Integer -// by adding `INTARRAY` in the future -*/ -enum class LiteralTag : uint8_t { - TAGVALUE = 0x00, - BOOL = 0x01, - INTEGER = 0x02, - FLOAT = 0x03, - DOUBLE = 0x04, - STRING = 0x05, - BIGINT = 0x06, - METHOD = 0x07, - GENERATORMETHOD = 0x08, - ACCESSOR = 0x09, - METHODAFFILIATE = 0x0a, - ARRAY_U1 = 0x0b, - ARRAY_U8 = 0x0c, - ARRAY_I8 = 0x0d, - ARRAY_U16 = 0x0e, - ARRAY_I16 = 0x0f, - ARRAY_U32 = 0x10, - ARRAY_I32 = 0x11, - ARRAY_U64 = 0x12, - ARRAY_I64 = 0x13, - ARRAY_F32 = 0x14, - ARRAY_F64 = 0x15, - ARRAY_STRING = 0x16, - ASYNCGENERATORMETHOD = 0x17, - ASYNCMETHOD = 0x18, - LITERALARRAY = 0x19, - NULLVALUE = 0xff -}; - class PANDA_PUBLIC_API LiteralDataAccessor { public: LiteralDataAccessor(const File &pandaFile, File::EntityId literalDataId); diff --git a/static_core/libarkfile/literal_tag.h b/static_core/libarkfile/literal_tag.h new file mode 100644 index 0000000000000000000000000000000000000000..4bf87d6d683864ab7554566f8dae7da9b6c8bf4d --- /dev/null +++ b/static_core/libarkfile/literal_tag.h @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBPANDAFILE_LITERAL_TAG_H_ +#define LIBPANDAFILE_LITERAL_TAG_H_ + +#include + +namespace ark::panda_file { + +/* LiteralTag could be extended by different language +// For example, JAVA could use it to represent Array of Integer +// by adding `INTARRAY` in the future +*/ +enum class LiteralTag : uint8_t { + TAGVALUE = 0x00, + BOOL = 0x01, + INTEGER = 0x02, + FLOAT = 0x03, + DOUBLE = 0x04, + STRING = 0x05, + BIGINT = 0x06, + METHOD = 0x07, + GENERATORMETHOD = 0x08, + ACCESSOR = 0x09, + METHODAFFILIATE = 0x0a, + ARRAY_U1 = 0x0b, + ARRAY_U8 = 0x0c, + ARRAY_I8 = 0x0d, + ARRAY_U16 = 0x0e, + ARRAY_I16 = 0x0f, + ARRAY_U32 = 0x10, + ARRAY_I32 = 0x11, + ARRAY_U64 = 0x12, + ARRAY_I64 = 0x13, + ARRAY_F32 = 0x14, + ARRAY_F64 = 0x15, + ARRAY_STRING = 0x16, + ASYNCGENERATORMETHOD = 0x17, + ASYNCMETHOD = 0x18, + LITERALARRAY = 0x19, + NULLVALUE = 0xff +}; + +} // namespace ark::panda_file + +#endif // LIBPANDAFILE_LITERAL_TAG_H_ diff --git a/static_core/patches/asmjit/0002-Add-Panda-Allocator.patch b/static_core/patches/asmjit/0002-Add-Panda-Allocator.patch index bc333a3d804d39e5c080f2c043ce24281ed4bf36..c5c89ac90dc604cf0b89f541dfe8d7856c4cd23d 100644 --- a/static_core/patches/asmjit/0002-Add-Panda-Allocator.patch +++ b/static_core/patches/asmjit/0002-Add-Panda-Allocator.patch @@ -115,7 +115,7 @@ index 9b3466d..3fb88dc 100644 #include "../core/zonetree.h" #include "../core/zonevector.h" -+#include "mem/arena_allocator.h" ++#include "libarkbase/mem/arena_allocator.h" + ASMJIT_BEGIN_NAMESPACE @@ -229,7 +229,7 @@ index 52e9f12..881771b 100644 #include "../core/support.h" -+#include "mem/arena_allocator.h" ++#include "libarkbase/mem/arena_allocator.h" + ASMJIT_BEGIN_NAMESPACE diff --git a/static_core/patches/asmjit/0007-Fixed-libarbase-include-path.patch b/static_core/patches/asmjit/0007-Fixed-libarbase-include-path.patch index c305925f6f980fafce99fe42ccf0e46641577f15..9ca62c52b61cdf75d22462dfbfc8ff40a48d15b6 100644 --- a/static_core/patches/asmjit/0007-Fixed-libarbase-include-path.patch +++ b/static_core/patches/asmjit/0007-Fixed-libarbase-include-path.patch @@ -45,7 +45,7 @@ index 81102a5..784ddcd 100644 #include "../core/zonetree.h" #include "../core/zonevector.h" --#include "mem/arena_allocator.h" +-#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator.h" ASMJIT_BEGIN_NAMESPACE @@ -58,7 +58,7 @@ index 04b2f7b..2110813 100644 #include "../core/support.h" --#include "mem/arena_allocator.h" +-#include "libarkbase/mem/arena_allocator.h" +#include "libarkbase/mem/arena_allocator.h" ASMJIT_BEGIN_NAMESPACE diff --git a/static_core/patches/vixl/0001-Fixed-libarbase-include-path.patch b/static_core/patches/vixl/0001-Fixed-libarbase-include-path.patch index 5bbb24eb9208dac31b5a940304d9d12c3a925c7f..110673173cb18bf7bc9e091d67388ff978175c46 100644 --- a/static_core/patches/vixl/0001-Fixed-libarbase-include-path.patch +++ b/static_core/patches/vixl/0001-Fixed-libarbase-include-path.patch @@ -25,5 +25,4 @@ index 12746635..cbed73c5 100644 #include #include -- -2.42.0-openssl - +2.42.0-openssl \ No newline at end of file diff --git a/static_core/patches/vixl/0002-split_arena_containers.patch b/static_core/patches/vixl/0002-split_arena_containers.patch new file mode 100644 index 0000000000000000000000000000000000000000..2247b7dbc47371e68cfb48392ecb2677a1fef7dd --- /dev/null +++ b/static_core/patches/vixl/0002-split_arena_containers.patch @@ -0,0 +1,22 @@ +diff --git a/src/utils-vixl.h b/src/utils-vixl.h +index 12746635..c18cd890 100644 +--- a/src/utils-vixl.h ++++ b/src/utils-vixl.h +@@ -42,9 +42,14 @@ + #endif + + #ifdef VIXL_USE_PANDA_ALLOC +-#include "libarkbase/mem/arena_allocator_stl_adapter.h" +-#include "libarkbase/mem/arena_allocator.h" +-#include "libarkbase/utils/arena_containers.h" ++#include "libarkbase/mem/arena_allocator_stl_adapter.h" ++#include "libarkbase/mem/arena_allocator.h" ++#include "libarkbase/utils/arena_list.h" ++#include "libarkbase/utils/arena_map.h" ++#include "libarkbase/utils/arena_string.h" ++#include "libarkbase/utils/arena_unordered_map.h" ++#include "libarkbase/utils/arena_unordered_set.h" ++#include "libarkbase/utils/arena_vector.h" + #else + #include + #include diff --git a/static_core/plugins/ets/runtime/ani/ani_interaction_api.cpp b/static_core/plugins/ets/runtime/ani/ani_interaction_api.cpp index badce1b04718918d2df38acf7c08d415e284284e..0a8b59af39c72512e2220d8836eca554ce803251 100644 --- a/static_core/plugins/ets/runtime/ani/ani_interaction_api.cpp +++ b/static_core/plugins/ets/runtime/ani/ani_interaction_api.cpp @@ -42,6 +42,7 @@ #include "plugins/ets/runtime/types/ets_namespace.h" #include "plugins/ets/runtime/types/ets_object.h" #include "runtime/coroutines/coroutine_scopes.h" +#include "runtime/include/class-inl.h" // NOLINTBEGIN(cppcoreguidelines-macro-usage) diff --git a/static_core/plugins/ets/runtime/ani/verify/ani_verifier.h b/static_core/plugins/ets/runtime/ani/verify/ani_verifier.h index c4726d1bb32af74f9f0476811e0f6f630b716de3..1ee6bd70b7e3307276c314ddc07a1fd509779413 100644 --- a/static_core/plugins/ets/runtime/ani/verify/ani_verifier.h +++ b/static_core/plugins/ets/runtime/ani/verify/ani_verifier.h @@ -18,7 +18,7 @@ #include "libarkbase/macros.h" #include "plugins/ets/runtime/ani/verify/types/vref.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_map.h" #include "runtime/include/mem/panda_smart_pointers.h" #include diff --git a/static_core/plugins/ets/runtime/ani/verify/env_ani_verifier.h b/static_core/plugins/ets/runtime/ani/verify/env_ani_verifier.h index f9ed76c6afe403502a90fdb2d89c240c9b8a63eb..dd063cb2e092bd913dd85a476ee377ada48ae80a 100644 --- a/static_core/plugins/ets/runtime/ani/verify/env_ani_verifier.h +++ b/static_core/plugins/ets/runtime/ani/verify/env_ani_verifier.h @@ -19,8 +19,9 @@ #include "libarkbase/macros.h" #include "plugins/ets/runtime/ani/ani.h" #include "plugins/ets/runtime/ani/verify/types/vref.h" -#include "runtime/include/mem/panda_containers.h" #include "runtime/include/mem/panda_smart_pointers.h" +#include "runtime/include/mem/panda_vector.h" +#include "runtime/include/mem/panda_set.h" #include "runtime/include/mem/panda_string.h" #include diff --git a/static_core/plugins/ets/runtime/ani/verify/verify_ani_checker.h b/static_core/plugins/ets/runtime/ani/verify/verify_ani_checker.h index b99f7ebd1f0a155b9b703f53e1cbd2e158d44930..ece1c025f64b67963edfa10a6faff3c787451173 100644 --- a/static_core/plugins/ets/runtime/ani/verify/verify_ani_checker.h +++ b/static_core/plugins/ets/runtime/ani/verify/verify_ani_checker.h @@ -17,7 +17,7 @@ #define PANDA_PLUGINS_ETS_RUNTIME_ANI_VERIFY_VERIFY_CHECKER_H #include "plugins/ets/runtime/ani/ani.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_small_vector.h" #include "runtime/include/mem/panda_string.h" // clang-format off diff --git a/static_core/plugins/ets/runtime/ani/verify/verify_ani_interaction_api.cpp b/static_core/plugins/ets/runtime/ani/verify/verify_ani_interaction_api.cpp index ebafa3fac072c5c15b10b346269c23e2b911b0e5..eec2bafd4b317ea14044e27f7c27db9f6cda1612 100644 --- a/static_core/plugins/ets/runtime/ani/verify/verify_ani_interaction_api.cpp +++ b/static_core/plugins/ets/runtime/ani/verify/verify_ani_interaction_api.cpp @@ -23,7 +23,7 @@ #include "plugins/ets/runtime/ani/verify/verify_ani_cast_api.h" #include "plugins/ets/runtime/ani/verify/verify_ani_checker.h" #include "plugins/ets/runtime/ets_napi_env.h" -#include "runtime/include/mem/panda_containers.h" + // NOLINTBEGIN(cppcoreguidelines-macro-usage) #define VERIFY_ANI_ARGS(...) \ diff --git a/static_core/plugins/ets/runtime/ets_class_linker.h b/static_core/plugins/ets/runtime/ets_class_linker.h index 682373a473472a708295248d9a5e16923f7dd9a7..4db0b503ab6cef3fe98a67bd711dc6d9f768c547 100644 --- a/static_core/plugins/ets/runtime/ets_class_linker.h +++ b/static_core/plugins/ets/runtime/ets_class_linker.h @@ -19,7 +19,7 @@ #include "plugins/ets/runtime/ets_class_root.h" #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark { class Method; diff --git a/static_core/plugins/ets/runtime/ets_class_linker_extension.cpp b/static_core/plugins/ets/runtime/ets_class_linker_extension.cpp index 67ab3941a23de5331deb73fdef4b897d5c582cca..23943eee6d7f5f165b4be710770135fbb75601e0 100644 --- a/static_core/plugins/ets/runtime/ets_class_linker_extension.cpp +++ b/static_core/plugins/ets/runtime/ets_class_linker_extension.cpp @@ -31,6 +31,7 @@ #include "runtime/class_linker_context.h" #include "runtime/include/class_linker_extension.h" #include "runtime/include/class_linker-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/include/language_context.h" #include "runtime/include/mem/panda_string.h" #include "runtime/include/panda_vm.h" diff --git a/static_core/plugins/ets/runtime/ets_exceptions.cpp b/static_core/plugins/ets/runtime/ets_exceptions.cpp index dca96adfa8360d2034c53236de93af3220ecc15a..fc0eb6995cd760a23e6c379eb601ee11b9b35331 100644 --- a/static_core/plugins/ets/runtime/ets_exceptions.cpp +++ b/static_core/plugins/ets/runtime/ets_exceptions.cpp @@ -24,6 +24,7 @@ #include "plugins/ets/runtime/types/ets_method.h" #include "plugins/ets/runtime/types/ets_string.h" #include "plugins/ets/runtime/types/ets_error_options.h" +#include "runtime/include/class-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/ets_itable_builder.cpp b/static_core/plugins/ets/runtime/ets_itable_builder.cpp index c6d14776bef046c31fad2d95de6a73436e01ab0e..4150214f845d709f9460b365489ab511e9afd06c 100644 --- a/static_core/plugins/ets/runtime/ets_itable_builder.cpp +++ b/static_core/plugins/ets/runtime/ets_itable_builder.cpp @@ -19,8 +19,9 @@ #include "plugins/ets/runtime/ets_vm.h" #include "plugins/ets/runtime/ets_vtable_builder.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" #include "runtime/include/exceptions.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/ets_native_library_provider.cpp b/static_core/plugins/ets/runtime/ets_native_library_provider.cpp index 728cf46ab8815ba9679e261d9b98f5cfba92efa5..f81952b7c5ed267f2101f420245571d4e17bea37 100644 --- a/static_core/plugins/ets/runtime/ets_native_library_provider.cpp +++ b/static_core/plugins/ets/runtime/ets_native_library_provider.cpp @@ -16,7 +16,7 @@ #include "plugins/ets/runtime/ets_native_library_provider.h" #include "ets_native_library.h" -#include "include/mem/panda_containers.h" + #include "include/mem/panda_string.h" #include "plugins/ets/runtime/ani/ani.h" #include "plugins/ets/runtime/ani/ani_interaction_api.h" diff --git a/static_core/plugins/ets/runtime/ets_native_library_provider.h b/static_core/plugins/ets/runtime/ets_native_library_provider.h index 63a7edb7d2ec36a15838b8c3234d37ac23a7f626..3e4bf0b17c83e2c84a4472c83afb5b88d2350fba 100644 --- a/static_core/plugins/ets/runtime/ets_native_library_provider.h +++ b/static_core/plugins/ets/runtime/ets_native_library_provider.h @@ -20,7 +20,8 @@ #include "libarkbase/os/mutex.h" #include "plugins/ets/runtime/ani/ani.h" #include "plugins/ets/runtime/ets_native_library.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" +#include "runtime/include/mem/panda_set.h" namespace ark::ets { class NativeLibraryProvider { diff --git a/static_core/plugins/ets/runtime/ets_object_state_table.h b/static_core/plugins/ets/runtime/ets_object_state_table.h index c6a18fcf4591ede404bad422e15b7f1ea1dce192..9b958c7b345db58bbd841658fed94eb656097305 100644 --- a/static_core/plugins/ets/runtime/ets_object_state_table.h +++ b/static_core/plugins/ets/runtime/ets_object_state_table.h @@ -21,7 +21,7 @@ #include "libarkbase/os/mutex.h" -#include "runtime/include/mem/panda_containers.h" + #include "plugins/ets/runtime/ets_coroutine.h" #include "plugins/ets/runtime/ets_mark_word.h" diff --git a/static_core/plugins/ets/runtime/ets_stubs.cpp b/static_core/plugins/ets/runtime/ets_stubs.cpp index 50a018d8a05ed54da880c77a97073d642b16bfa3..48cabdc8e44f41ada9181111399d0adf22404d7f 100644 --- a/static_core/plugins/ets/runtime/ets_stubs.cpp +++ b/static_core/plugins/ets/runtime/ets_stubs.cpp @@ -29,6 +29,8 @@ #include "plugins/ets/runtime/interop_js/xref_object_operator.h" #endif +#include "runtime/include/class-inl.h" + namespace ark::ets { #ifdef PANDA_ETS_INTEROP_JS using JSValue = interop::js::JSValue; diff --git a/static_core/plugins/ets/runtime/ets_vm.h b/static_core/plugins/ets/runtime/ets_vm.h index c2fe8a2330584e1807dca093c7a43b3513b2c40e..c9c9049eef48b2e76cc703fbf021a4cfd25bebba 100644 --- a/static_core/plugins/ets/runtime/ets_vm.h +++ b/static_core/plugins/ets/runtime/ets_vm.h @@ -36,7 +36,7 @@ #include "runtime/include/gc_task.h" #include "runtime/include/language_context.h" #include "runtime/include/managed_thread.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "runtime/include/method.h" #include "runtime/include/object_header.h" diff --git a/static_core/plugins/ets/runtime/ets_vm_api.cpp b/static_core/plugins/ets/runtime/ets_vm_api.cpp index d64a205649cc7dc319921ddaff36c7ef6e711ba7..a43fffcebe31e68fc26fc3cd029814148eca9a2b 100644 --- a/static_core/plugins/ets/runtime/ets_vm_api.cpp +++ b/static_core/plugins/ets/runtime/ets_vm_api.cpp @@ -16,7 +16,8 @@ #include #include "ets_vm_api.h" #include "ets_vm.h" -#include "libarkbase/panda_gen_options/generated/logger_options.h" +#include "generated/logger_options.h" +#include "runtime/include/class-inl.h" #ifdef PANDA_TARGET_OHOS #include diff --git a/static_core/plugins/ets/runtime/interop_js/call/call_ets.cpp b/static_core/plugins/ets/runtime/interop_js/call/call_ets.cpp index b485c4770a545e76d9b00e76e6a7d061a3ccbf48..103fb107fe656d7afb222815d3485b4be972d86c 100644 --- a/static_core/plugins/ets/runtime/interop_js/call/call_ets.cpp +++ b/static_core/plugins/ets/runtime/interop_js/call/call_ets.cpp @@ -17,6 +17,7 @@ #include "plugins/ets/runtime/interop_js/call/arg_convertors.h" #include "plugins/ets/runtime/interop_js/call/proto_reader.h" #include "plugins/ets/runtime/interop_js/code_scopes.h" +#include "runtime/include/class-inl.h" namespace ark::ets::interop::js { diff --git a/static_core/plugins/ets/runtime/interop_js/ets_proxy/ets_class_wrapper.cpp b/static_core/plugins/ets/runtime/interop_js/ets_proxy/ets_class_wrapper.cpp index ef787718cbe1d4244684a438655dd7e02828744d..3a24fa7fe249600956160aa9b3cd30a4cec35cd8 100644 --- a/static_core/plugins/ets/runtime/interop_js/ets_proxy/ets_class_wrapper.cpp +++ b/static_core/plugins/ets/runtime/interop_js/ets_proxy/ets_class_wrapper.cpp @@ -21,7 +21,7 @@ #include #include "plugins/ets/runtime/ets_coroutine.h" -#include "include/mem/panda_containers.h" + #include "interop_js/interop_common.h" #include "interop_js/js_proxy/js_proxy.h" #include "interop_js/js_refconvert.h" @@ -33,6 +33,7 @@ #include "plugins/ets/runtime/interop_js/code_scopes.h" #include "runtime/mem/local_object_handle.h" #include "plugins/ets/runtime/ets_platform_types.h" +#include "runtime/include/class-inl.h" // NOLINTBEGIN(readability-identifier-naming, readability-redundant-declaration) // CC-OFFNXT(G.FMT.10-CPP) project code style diff --git a/static_core/plugins/ets/runtime/interop_js/interop_context.cpp b/static_core/plugins/ets/runtime/interop_js/interop_context.cpp index 8592320e983912baba16232630503c2408208e75..96ea80f04b01ae1eec69a0af40ceb03391a27012 100644 --- a/static_core/plugins/ets/runtime/interop_js/interop_context.cpp +++ b/static_core/plugins/ets/runtime/interop_js/interop_context.cpp @@ -26,6 +26,7 @@ #include "plugins/ets/runtime/types/ets_abc_runtime_linker.h" #include "plugins/ets/runtime/types/ets_method.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" #include "runtime/mem/local_object_handle.h" #include "plugins/ets/runtime/interop_js/event_loop_module.h" diff --git a/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.cpp b/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.cpp index 3e61097a55c633d343816e3ffb501c2431a444a9..379dffc7234266efd784b2aa11a7688331db1d51 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.cpp +++ b/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.cpp @@ -14,7 +14,7 @@ */ #include "include/class.h" -#include "include/mem/panda_containers.h" + #include "include/method.h" #include "plugins/ets/runtime/interop_js/js_proxy/js_proxy.h" #include "plugins/ets/runtime/interop_js/interop_context.h" diff --git a/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.h b/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.h index 40100d3642e79efa861fe6cbddb0267f8cb47f2d..55b10097c65edb44978f21f93b3b92d1a0d5f7b1 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.h +++ b/static_core/plugins/ets/runtime/interop_js/js_proxy/js_proxy.h @@ -16,7 +16,7 @@ #ifndef PANDA_PLUGINS_ETS_RUNTIME_INTEROP_JS_JS_PROXY_JS_PROXY_H_ #define PANDA_PLUGINS_ETS_RUNTIME_INTEROP_JS_JS_PROXY_JS_PROXY_H_ -#include "include/mem/panda_containers.h" + #include "runtime/include/class.h" #include "runtime/include/method.h" diff --git a/static_core/plugins/ets/runtime/interop_js/js_refconvert.cpp b/static_core/plugins/ets/runtime/interop_js/js_refconvert.cpp index 1037c41a5cb79b8e5c30b50347051f4e53f6d377..d38fa999694c20691fa8bcfad2b5677f83b7458d 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_refconvert.cpp +++ b/static_core/plugins/ets/runtime/interop_js/js_refconvert.cpp @@ -23,6 +23,7 @@ #include "plugins/ets/runtime/interop_js/js_refconvert_record.h" #include "plugins/ets/runtime/interop_js/js_refconvert_tuple.h" #include "plugins/ets/runtime/interop_js/js_refconvert_union.h" +#include "runtime/include/class-inl.h" namespace ark::ets::interop::js { diff --git a/static_core/plugins/ets/runtime/interop_js/js_value.h b/static_core/plugins/ets/runtime/interop_js/js_value.h index 6f8f8057e48e6d3d424ad22a6565415ec9d977cd..e59056d81ba6b67785a2080c5b95c1d9a731e8cf 100644 --- a/static_core/plugins/ets/runtime/interop_js/js_value.h +++ b/static_core/plugins/ets/runtime/interop_js/js_value.h @@ -22,6 +22,7 @@ #include "plugins/ets/runtime/interop_js/ets_proxy/shared_reference.h" #include "plugins/ets/runtime/types/ets_object.h" #include "runtime/include/coretypes/class.h" +#include "runtime/include/object_accessor-inl.h" #include "libarkbase/utils/small_vector.h" #include diff --git a/static_core/plugins/ets/runtime/intrinsics/escompat_RegExp.cpp b/static_core/plugins/ets/runtime/intrinsics/escompat_RegExp.cpp index 81d29c2fdf8a4b9e9f752d234479f597698931af..38b9d2b0104cadf5f6f86b78e13b493822f3a617 100644 --- a/static_core/plugins/ets/runtime/intrinsics/escompat_RegExp.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/escompat_RegExp.cpp @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "include/mem/panda_containers.h" + #include "plugins/ets/runtime/types/ets_string.h" #include "runtime/regexp/ecmascript/regexp_parser.h" #include "runtime/include/mem/panda_string.h" diff --git a/static_core/plugins/ets/runtime/intrinsics/helpers/array_buffer_helper.h b/static_core/plugins/ets/runtime/intrinsics/helpers/array_buffer_helper.h index 893134d44868bbdcfd4c47754cee74cfba5aae14..49e3582ea5a4655b3a70c7303707c135f04ec4db 100644 --- a/static_core/plugins/ets/runtime/intrinsics/helpers/array_buffer_helper.h +++ b/static_core/plugins/ets/runtime/intrinsics/helpers/array_buffer_helper.h @@ -20,8 +20,8 @@ #include #include -#include "include/mem/panda_string.h" -#include "include/mem/panda_containers.h" +#include "runtime/include/mem/panda_string.h" +#include "runtime/include/mem/panda_vector.h" namespace ark::ets { class EtsEscompatArrayBuffer; diff --git a/static_core/plugins/ets/runtime/intrinsics/helpers/ets_to_string_cache.cpp b/static_core/plugins/ets/runtime/intrinsics/helpers/ets_to_string_cache.cpp index ee6c672f9aa4704b9eff9a70fe2a8a8b040e2612..08ce3a784398d95ff2c5948260fcf8f941b25493 100644 --- a/static_core/plugins/ets/runtime/intrinsics/helpers/ets_to_string_cache.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/helpers/ets_to_string_cache.cpp @@ -18,6 +18,8 @@ #include "ets_to_string_cache.h" #include "ets_intrinsics_helpers.h" #include "libarkbase/mem/mem.h" +#include "runtime/include/object_accessor-inl.h" + namespace ark::ets::detail { diff --git a/static_core/plugins/ets/runtime/intrinsics/std_core_Console.cpp b/static_core/plugins/ets/runtime/intrinsics/std_core_Console.cpp index b4d7ded751eb8cfd02f75de1df9c4b353892bdbe..5a892e1a573019e0e419dfe5cf4716bccb3edb4c 100644 --- a/static_core/plugins/ets/runtime/intrinsics/std_core_Console.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/std_core_Console.cpp @@ -18,7 +18,7 @@ #include "plugins/ets/runtime/ets_exceptions.h" #include "plugins/ets/runtime/types/ets_string.h" #include "runtime/include/mem/panda_string.h" -#include "runtime/include/mem/panda_containers.h" + #include "libarkbase/utils/utf.h" #include "intrinsics.h" #include "utility" diff --git a/static_core/plugins/ets/runtime/intrinsics/std_core_Method.cpp b/static_core/plugins/ets/runtime/intrinsics/std_core_Method.cpp index 7b38804c4c673790ba51cd45ec301ebd01c8e881..22b4313be643b43f9c25f2dfe5543a0572f7789a 100644 --- a/static_core/plugins/ets/runtime/intrinsics/std_core_Method.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/std_core_Method.cpp @@ -16,7 +16,7 @@ #include #include "ets_coroutine.h" #include "handle_scope.h" -#include "include/mem/panda_containers.h" + #include "libarkbase/macros.h" #include "libarkbase/mem/mem.h" #include "mem/vm_handle.h" diff --git a/static_core/plugins/ets/runtime/intrinsics/std_core_Promise.cpp b/static_core/plugins/ets/runtime/intrinsics/std_core_Promise.cpp index ea95e8c9a879735e3e20b4c596457767b4462cda..513bdd4793aadb7f41232fbeb744b76fb591d9c5 100644 --- a/static_core/plugins/ets/runtime/intrinsics/std_core_Promise.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/std_core_Promise.cpp @@ -26,7 +26,7 @@ #include "plugins/ets/runtime/job_queue.h" #include "runtime/coroutines/stackful_coroutine.h" #include "runtime/coroutines/coroutine_events.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark::ets::intrinsics { diff --git a/static_core/plugins/ets/runtime/intrinsics/std_core_StackTrace.cpp b/static_core/plugins/ets/runtime/intrinsics/std_core_StackTrace.cpp index 71b2e3270470d2bfd1cec02246c8dd6d4ebc1b6c..a188cd5251036e6e7fd9d2305d80c7d966528f32 100644 --- a/static_core/plugins/ets/runtime/intrinsics/std_core_StackTrace.cpp +++ b/static_core/plugins/ets/runtime/intrinsics/std_core_StackTrace.cpp @@ -14,7 +14,7 @@ */ #include "ets_handle.h" -#include "include/mem/panda_containers.h" + #include "runtime/runtime_helpers.h" #include "types/ets_method.h" #include "types/ets_stacktrace_element.h" diff --git a/static_core/plugins/ets/runtime/static_object_accessor.cpp b/static_core/plugins/ets/runtime/static_object_accessor.cpp index fc994daf62908429a1f9f3330443c6bfa43fbc65..b5b7e38ade0a59c44ca11b667048cb3850f0bb84 100644 --- a/static_core/plugins/ets/runtime/static_object_accessor.cpp +++ b/static_core/plugins/ets/runtime/static_object_accessor.cpp @@ -22,6 +22,7 @@ #include "plugins/ets/runtime/types/ets_method.h" #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_box_primitive-inl.h" +#include "runtime/include/class-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_abc_runtime_linker.h b/static_core/plugins/ets/runtime/types/ets_abc_runtime_linker.h index f614b4d414eb13d821c724111d51af073ef6a766..294853bcae76f58f977ffa3e73638b749af31b50 100644 --- a/static_core/plugins/ets/runtime/types/ets_abc_runtime_linker.h +++ b/static_core/plugins/ets/runtime/types/ets_abc_runtime_linker.h @@ -17,6 +17,7 @@ #define PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_ABC_RUNTIME_LINKER_H #include "include/object_accessor.h" +#include "include/object_accessor-inl.h" #include "include/object_header.h" #include "libarkbase/mem/object_pointer.h" #include "plugins/ets/runtime/types/ets_array.h" @@ -24,6 +25,7 @@ #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_runtime_linker.h" + namespace ark::ets { namespace test { diff --git a/static_core/plugins/ets/runtime/types/ets_arraybuffer-inl.h b/static_core/plugins/ets/runtime/types/ets_arraybuffer-inl.h index f53a49006cc47fab48e6bd0345b65b1b090af6e3..71c24acc4e5bc40e093571ed3c4eceed054cfbea 100644 --- a/static_core/plugins/ets/runtime/types/ets_arraybuffer-inl.h +++ b/static_core/plugins/ets/runtime/types/ets_arraybuffer-inl.h @@ -17,6 +17,8 @@ #define PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_ARRAYBUFFER_INL_H #include "runtime/include/thread_scopes.h" +#include "runtime/include/object_accessor-inl.h" + #include "plugins/ets/runtime/types/ets_arraybuffer.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_arraybuffer.h b/static_core/plugins/ets/runtime/types/ets_arraybuffer.h index 694099feecb0d3f535bf68b4ce18cc17111d6022..6e0f00f28ff4d0aa4c8f3cfeb89ec735c8de39a2 100644 --- a/static_core/plugins/ets/runtime/types/ets_arraybuffer.h +++ b/static_core/plugins/ets/runtime/types/ets_arraybuffer.h @@ -25,6 +25,7 @@ #include "plugins/ets/runtime/ets_exceptions.h" #include "plugins/ets/runtime/ets_platform_types.h" #include "runtime/include/thread_scopes.h" +#include "runtime/include/object_accessor-inl.h" #include diff --git a/static_core/plugins/ets/runtime/types/ets_class.cpp b/static_core/plugins/ets/runtime/types/ets_class.cpp index 1058a955cc3dec67230d977fcdb81306a55d1ee3..d366ab627303ee6239895104cab18d1df313b93a 100644 --- a/static_core/plugins/ets/runtime/types/ets_class.cpp +++ b/static_core/plugins/ets/runtime/types/ets_class.cpp @@ -15,7 +15,7 @@ #include "ets_panda_file_items.h" #include "include/language_context.h" -#include "include/mem/panda_containers.h" + #include "libarkbase/utils/utf.h" #include "libarkbase/macros.h" #include "plugins/ets/runtime/ets_class_linker_extension.h" @@ -30,6 +30,7 @@ #include "plugins/ets/runtime/types/ets_class.h" #include "runtime/include/runtime.h" #include "runtime/mem/local_object_handle.h" +#include "runtime/include/class-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_class.h b/static_core/plugins/ets/runtime/types/ets_class.h index 7c461ac0c97b3d6b3f33a627039947a6e7976ac8..cc6cc876a2c144bad02449ee789e258a89e669c2 100644 --- a/static_core/plugins/ets/runtime/types/ets_class.h +++ b/static_core/plugins/ets/runtime/types/ets_class.h @@ -17,7 +17,7 @@ #define PANDA_PLUGINS_ETS_RUNTIME_FFI_CLASSES_ETS_CLASS_H_ #include -#include "include/mem/panda_containers.h" + #include "include/mem/panda_string.h" #include "include/object_header.h" #include "include/runtime.h" diff --git a/static_core/plugins/ets/runtime/types/ets_escompat_array.h b/static_core/plugins/ets/runtime/types/ets_escompat_array.h index 8914e17f9ab34a069aededc46e5169a972f13461..b354e1d8a8d842afcc75f4825351a672975d6355 100644 --- a/static_core/plugins/ets/runtime/types/ets_escompat_array.h +++ b/static_core/plugins/ets/runtime/types/ets_escompat_array.h @@ -22,6 +22,7 @@ #include "libarkbase/mem/object_pointer.h" #include "runtime/include/thread.h" #include "runtime/include/managed_thread.h" +#include "runtime/include/object_accessor-inl.h" #include "runtime/coroutines/coroutine.h" #include "runtime/entrypoints/entrypoints.h" #include "plugins/ets/runtime/ets_class_linker_extension.h" diff --git a/static_core/plugins/ets/runtime/types/ets_finalizable_weak_ref.h b/static_core/plugins/ets/runtime/types/ets_finalizable_weak_ref.h index bc98d406a6b745f21e104b4797e14819a0172803..062eea4be5ec406fb666deb433c7348d0d619d81 100644 --- a/static_core/plugins/ets/runtime/types/ets_finalizable_weak_ref.h +++ b/static_core/plugins/ets/runtime/types/ets_finalizable_weak_ref.h @@ -18,6 +18,7 @@ #include "plugins/ets/runtime/types/ets_weak_reference.h" #include "plugins/ets/runtime/types/ets_primitives.h" #include "plugins/ets/runtime/ets_coroutine.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_job.h b/static_core/plugins/ets/runtime/types/ets_job.h index c7d0f47403d1fb60c94c46a8010166a975e4d1e2..c1cc0953beb91a01c2faae92050b0a353d8dd4ca 100644 --- a/static_core/plugins/ets/runtime/types/ets_job.h +++ b/static_core/plugins/ets/runtime/types/ets_job.h @@ -17,6 +17,7 @@ #define PANDA_RUNTIME_ETS_FFI_CLASSES_ETS_JOB_H_ #include "runtime/include/object_header.h" +#include "runtime/include/object_accessor-inl.h" #include "libarkbase/macros.h" #include "plugins/ets/runtime/ets_vm.h" #include "plugins/ets/runtime/types/ets_object.h" diff --git a/static_core/plugins/ets/runtime/types/ets_map.h b/static_core/plugins/ets/runtime/types/ets_map.h index e71af01b0d9df583ea2eca38c3e417f8a6e772de..21eb7af3613f86ed567109a2d80a8f9fc2616c5c 100644 --- a/static_core/plugins/ets/runtime/types/ets_map.h +++ b/static_core/plugins/ets/runtime/types/ets_map.h @@ -18,6 +18,7 @@ #include "ets_escompat_array.h" #include "ets_object.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_promise.h b/static_core/plugins/ets/runtime/types/ets_promise.h index 3487d80a49fa8886e880a5460be78068eec7bc7c..46f351aab561309a0480ed51276b79c0c456db9a 100644 --- a/static_core/plugins/ets/runtime/types/ets_promise.h +++ b/static_core/plugins/ets/runtime/types/ets_promise.h @@ -23,6 +23,7 @@ #include "plugins/ets/runtime/types/ets_sync_primitives.h" #include "plugins/ets/runtime/types/ets_primitives.h" #include "runtime/coroutines/coroutine_events.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_promise_ref.h b/static_core/plugins/ets/runtime/types/ets_promise_ref.h index 27e420f93dc3851d40c7df74df648a523a488080..152c521a205a5b16242b9f6c7113f0c2b35eaebb 100644 --- a/static_core/plugins/ets/runtime/types/ets_promise_ref.h +++ b/static_core/plugins/ets/runtime/types/ets_promise_ref.h @@ -17,6 +17,7 @@ #define PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_PROMISE_REF_H #include "plugins/ets/runtime/types/ets_object.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_string_builder.h b/static_core/plugins/ets/runtime/types/ets_string_builder.h index e539c95b952f6bb20affb8c257ba15ef7372b46c..f7fdeeeece66ad6b16e5b97eabb3b35874df58d2 100644 --- a/static_core/plugins/ets/runtime/types/ets_string_builder.h +++ b/static_core/plugins/ets/runtime/types/ets_string_builder.h @@ -17,6 +17,7 @@ #define PANDA_RUNTIME_ETS_ETS_STRING_BUILDER_H #include "runtime/include/object_header.h" +#include "runtime/include/object_accessor-inl.h" #include "plugins/ets/runtime/types/ets_string.h" #include "plugins/ets/runtime/types/ets_primitives.h" diff --git a/static_core/plugins/ets/runtime/types/ets_sync_primitives.h b/static_core/plugins/ets/runtime/types/ets_sync_primitives.h index bab5bfeb1d780df1c7549f37a9343769b4b701c9..e7b672d4b2e7234c42857b8603dde9a1bc158c5d 100644 --- a/static_core/plugins/ets/runtime/types/ets_sync_primitives.h +++ b/static_core/plugins/ets/runtime/types/ets_sync_primitives.h @@ -18,6 +18,7 @@ #include "libarkbase/mem/object_pointer.h" #include "libarkbase/macros.h" #include "runtime/include/thread_scopes.h" +#include "runtime/include/object_accessor-inl.h" #include "plugins/ets/runtime/ets_coroutine.h" #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_waiters_list.h" diff --git a/static_core/plugins/ets/runtime/types/ets_tuple.h b/static_core/plugins/ets/runtime/types/ets_tuple.h index 431bc964537cdff70e7a0b46dbf97dde4f328545..2d9700da76a92d7ebdcae00c0a9d6906ec0e44fb 100644 --- a/static_core/plugins/ets/runtime/types/ets_tuple.h +++ b/static_core/plugins/ets/runtime/types/ets_tuple.h @@ -23,6 +23,7 @@ #include "libarkbase/macros.h" #include "plugins/ets/runtime/ets_coroutine.h" #include "plugins/ets/runtime/types/ets_object.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_typeapi_type.h b/static_core/plugins/ets/runtime/types/ets_typeapi_type.h index f0d3ea397dac4f1030a57d0f94a6cbdcefed3e92..39dce6119eaff0c01a69b0a835204135faf8013e 100644 --- a/static_core/plugins/ets/runtime/types/ets_typeapi_type.h +++ b/static_core/plugins/ets/runtime/types/ets_typeapi_type.h @@ -20,6 +20,7 @@ #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_runtime_linker.h" #include "plugins/ets/runtime/types/ets_string.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_typed_arrays.h b/static_core/plugins/ets/runtime/types/ets_typed_arrays.h index 718939d4c52da7208c8c9fcc7a1227a15f96cb4e..f030c2d6ae5ad96d0c29a87449761a3042928fe6 100644 --- a/static_core/plugins/ets/runtime/types/ets_typed_arrays.h +++ b/static_core/plugins/ets/runtime/types/ets_typed_arrays.h @@ -18,6 +18,7 @@ #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_string.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_typed_unsigned_arrays.h b/static_core/plugins/ets/runtime/types/ets_typed_unsigned_arrays.h index 5d1bc3594eff015c05a24e7c8150ee44829efb19..1ca2701972649ea6d4bcb0a4c8117fa2ef0af3fb 100644 --- a/static_core/plugins/ets/runtime/types/ets_typed_unsigned_arrays.h +++ b/static_core/plugins/ets/runtime/types/ets_typed_unsigned_arrays.h @@ -18,6 +18,7 @@ #include "plugins/ets/runtime/types/ets_object.h" #include "plugins/ets/runtime/types/ets_string.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/runtime/types/ets_weak_reference.h b/static_core/plugins/ets/runtime/types/ets_weak_reference.h index 70525cde48e471c00eaac8a18a3a98a449175209..b195fcf9da00bfacecd04c7154711a60345dcff0 100644 --- a/static_core/plugins/ets/runtime/types/ets_weak_reference.h +++ b/static_core/plugins/ets/runtime/types/ets_weak_reference.h @@ -16,6 +16,7 @@ #define PANDA_PLUGINS_ETS_RUNTIME_TYPES_ETS_WEAK_REFERENCE_H #include "plugins/ets/runtime/types/ets_object.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::ets { diff --git a/static_core/plugins/ets/tests/runtime/types/ets_class_file_test.cpp b/static_core/plugins/ets/tests/runtime/types/ets_class_file_test.cpp index 1c772a35da767a3daef2f2fb39d0fc4ecd94d2d1..565347869d6fb15dedcd031a4f4d2856dbdb15ff 100644 --- a/static_core/plugins/ets/tests/runtime/types/ets_class_file_test.cpp +++ b/static_core/plugins/ets/tests/runtime/types/ets_class_file_test.cpp @@ -20,6 +20,7 @@ #include "types/ets_class.h" #include "types/ets_method.h" +#include "runtime/include/class-inl.h" // NOLINTBEGIN(readability-magic-numbers) diff --git a/static_core/runtime/arch/helpers.h b/static_core/runtime/arch/helpers.h index 0f1ac2da68b3bf25c9c6c9a4d8bee2fec05845ed..45698d62b5403fe22a8cb610c9fe9f7d694e8cdb 100644 --- a/static_core/runtime/arch/helpers.h +++ b/static_core/runtime/arch/helpers.h @@ -19,7 +19,7 @@ #include "libarkbase/utils/bit_utils.h" #include "libarkbase/utils/span.h" #include "runtime/include/value.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" namespace ark::arch { diff --git a/static_core/runtime/cha.cpp b/static_core/runtime/cha.cpp index 0e19bfdfccc4dc086fd6b84c777e0db607e318e2..f9bde33cfa881e918110b975dad1babbffdeb6c4 100644 --- a/static_core/runtime/cha.cpp +++ b/static_core/runtime/cha.cpp @@ -16,6 +16,7 @@ #include "runtime/cha.h" #include "libarkbase/events/events.h" +#include "runtime/include/class-inl.h" #include "runtime/include/locks.h" #include "runtime/include/runtime.h" #include "runtime/include/panda_vm.h" diff --git a/static_core/runtime/cha.h b/static_core/runtime/cha.h index fa19c55837f2d401a11121be5aa7f0f620d4269e..87946f24c03d7fc1d6163e26d49a789a36544ccd 100644 --- a/static_core/runtime/cha.h +++ b/static_core/runtime/cha.h @@ -16,6 +16,8 @@ #define PANDA_CHA_H #include "runtime/include/class.h" +#include "runtime/include/mem/panda_map.h" +#include "runtime/include/mem/panda_set.h" namespace ark { diff --git a/static_core/runtime/class_initializer.cpp b/static_core/runtime/class_initializer.cpp index 41a14add3fb7154353ac5ffe1ee376271ba16e0b..685b242c889d34d315ac2728aa990a58a2bdae13 100644 --- a/static_core/runtime/class_initializer.cpp +++ b/static_core/runtime/class_initializer.cpp @@ -19,7 +19,9 @@ #include "libarkfile/file_items.h" #include "libarkbase/macros.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" #include "runtime/include/coretypes/tagged_value.h" +#include "runtime/include/coretypes/string.h" #include "runtime/include/runtime.h" #include "runtime/handle_scope-inl.h" #include "runtime/monitor.h" @@ -30,6 +32,8 @@ #include "verification/util/is_system.h" #include "verify_app_install.h" +#include + namespace ark { template class ObjectLockConfig { diff --git a/static_core/runtime/class_initializer.h b/static_core/runtime/class_initializer.h index 6a8470dd58c9f00994ec9f4b4f99ad551c0d4398..e9b98b6cf4f7b652ad2605c4f8a0fabfc8c45c5b 100644 --- a/static_core/runtime/class_initializer.h +++ b/static_core/runtime/class_initializer.h @@ -15,12 +15,17 @@ #ifndef PANDA_RUNTIME_CLASS_INITIALIZER_H_ #define PANDA_RUNTIME_CLASS_INITIALIZER_H_ -#include "runtime/include/class-inl.h" -#include "runtime/include/language_config.h" +#include namespace ark { +class Class; class ClassLinker; +class ManagedThread; +enum MTModeT : uint8_t; +template +class VMHandle; +class ObjectHeader; template class ClassInitializer { diff --git a/static_core/runtime/class_linker.cpp b/static_core/runtime/class_linker.cpp index 6dfa9359e61db31f51ff07151a26839ffaf13682..e75dfa08c444632195b278d7b46732daa8114b53 100644 --- a/static_core/runtime/class_linker.cpp +++ b/static_core/runtime/class_linker.cpp @@ -21,6 +21,7 @@ #include "runtime/include/coretypes/line_string.h" #include "runtime/include/field.h" #include "runtime/include/itable_builder.h" +#include "runtime/include/class-inl.h" #include "runtime/include/method.h" #include "runtime/include/panda_vm.h" #include "runtime/include/runtime.h" diff --git a/static_core/runtime/class_linker_context.h b/static_core/runtime/class_linker_context.h index 9714e8dfa3ab488b5892be0ac11b9b78dfc079af..8df53d16e65142ed6c029640120b851abc44d129 100644 --- a/static_core/runtime/class_linker_context.h +++ b/static_core/runtime/class_linker_context.h @@ -22,7 +22,7 @@ #include "libarkbase/utils/bit_utils.h" #include "mem/refstorage/reference.h" #include "runtime/include/class.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/gc/gc.h" #include "runtime/mem/gc/gc_root.h" #include "runtime/mem/object_helpers.h" diff --git a/static_core/runtime/class_linker_extension.cpp b/static_core/runtime/class_linker_extension.cpp index f8c2ba4f378a74aff73b478674ca4a5b8af7a2a0..19fc23820376464505c1f331599017f5dbbf3e17 100644 --- a/static_core/runtime/class_linker_extension.cpp +++ b/static_core/runtime/class_linker_extension.cpp @@ -16,6 +16,7 @@ #include "runtime/include/class_linker_extension.h" #include "libarkbase/utils/utf.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/class_linker-inl.h" #include "runtime/include/class_linker.h" #include "runtime/include/coretypes/class.h" diff --git a/static_core/runtime/compiler.cpp b/static_core/runtime/compiler.cpp index d0c3e38568764ec16c541f2b4a5bbfb5b125e9b0..9325c0447c3a3f5794c9365682743a6faf7c9fe7 100644 --- a/static_core/runtime/compiler.cpp +++ b/static_core/runtime/compiler.cpp @@ -18,10 +18,12 @@ #include "intrinsics.h" #include "libarkfile/bytecode_instruction.h" #include "libarkfile/type_helper.h" +#include "libarkfile/literal_data_accessor-inl.h" #include "optimizer/ir/datatype.h" #include "optimizer/ir/runtime_interface.h" #include "runtime/cha.h" #include "runtime/jit/profiling_data.h" +#include "runtime/include/class-inl.h" #include "runtime/include/class_linker-inl.h" #include "runtime/include/exceptions.h" #include "runtime/include/field.h" diff --git a/static_core/runtime/compiler.h b/static_core/runtime/compiler.h index a38b3bd126c3775bd9f255129ffd1cb53751a3da..f9243d795159fd519d56a95f835b85a6106821fa 100644 --- a/static_core/runtime/compiler.h +++ b/static_core/runtime/compiler.h @@ -26,7 +26,7 @@ #include "runtime/include/coretypes/array.h" #include "runtime/include/coretypes/tagged_value.h" #include "runtime/include/locks.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/method.h" #include "runtime/include/runtime_options.h" #include "runtime/interpreter/frame.h" @@ -388,6 +388,11 @@ public: return reinterpret_cast(MethodCast(method)->GetClass()); } + bool IsInBootContext([[maybe_unused]] ClassPtr klass) const override + { + return ClassCast(klass)->GetLoadContext()->IsBootContext(); + } + std::string GetBytecodeString(MethodPtr method, uintptr_t pc) const override; ark::pandasm::LiteralArray GetLiteralArray(MethodPtr method, LiteralArrayId id) const override; diff --git a/static_core/runtime/compiler_queue_aged_counter_priority.h b/static_core/runtime/compiler_queue_aged_counter_priority.h index 3493c715c0ad0190933379e39d06628e6d1896da..1ba890e6f54cd0524617e6cf3f9811e8e196b363 100644 --- a/static_core/runtime/compiler_queue_aged_counter_priority.h +++ b/static_core/runtime/compiler_queue_aged_counter_priority.h @@ -16,7 +16,7 @@ #define PANDA_RUNTIME_COMPILER_QUEUE_AGED_COUNTER_PRIORITY_H_ #include "runtime/compiler_queue_counter_priority.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/method-inl.h" namespace ark { diff --git a/static_core/runtime/compiler_queue_counter_priority.h b/static_core/runtime/compiler_queue_counter_priority.h index a6fc516f5757f3e6892652b2f43996fcec0f8bd7..bc1f5167f71b99b6ae846eb8ad419cd9cfa40058 100644 --- a/static_core/runtime/compiler_queue_counter_priority.h +++ b/static_core/runtime/compiler_queue_counter_priority.h @@ -20,7 +20,7 @@ #include "libarkbase/utils/time.h" #include "runtime/compiler_queue_interface.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/method-inl.h" namespace ark { diff --git a/static_core/runtime/compiler_queue_simple.h b/static_core/runtime/compiler_queue_simple.h index cc03f4714392b8765be76960132ca0cdc43bca3b..77701e1ea3818b7308532c74d62028abdc6e20d2 100644 --- a/static_core/runtime/compiler_queue_simple.h +++ b/static_core/runtime/compiler_queue_simple.h @@ -16,7 +16,7 @@ #define PANDA_RUNTIME_COMPILER_QUEUE_SIMPLE_H_ #include "runtime/compiler_queue_interface.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark { diff --git a/static_core/runtime/compiler_task_manager_worker.h b/static_core/runtime/compiler_task_manager_worker.h index 1191028576e9e1484e32b79cec4f9c6341e4d795..78d35200ca34fae20a5cbc98df245e34ca9f5169 100644 --- a/static_core/runtime/compiler_task_manager_worker.h +++ b/static_core/runtime/compiler_task_manager_worker.h @@ -17,7 +17,7 @@ #include "runtime/compiler_worker.h" #include "runtime/include/runtime.h" -#include "runtime/include/mem/panda_containers.h" + #include "libarkbase/taskmanager/task.h" #include "libarkbase/taskmanager/task_queue.h" #include "libarkbase/taskmanager/task_manager.h" diff --git a/static_core/runtime/core/core_class_linker_extension.cpp b/static_core/runtime/core/core_class_linker_extension.cpp index 8fb5b2125286a574bf389a70a236f532757953d0..77a12cfdc5f32985fbd6e1ab4612258a27ed7fa9 100644 --- a/static_core/runtime/core/core_class_linker_extension.cpp +++ b/static_core/runtime/core/core_class_linker_extension.cpp @@ -16,7 +16,9 @@ #include "runtime/core/core_class_linker_extension.h" #include "include/class_root.h" +#include "runtime/include/class-inl.h" #include "runtime/include/coretypes/class.h" +#include "runtime/include/coretypes/string.h" #include "runtime/include/exceptions.h" #include "runtime/include/panda_vm.h" #include "libarkbase/utils/utf.h" diff --git a/static_core/runtime/core/core_language_context.cpp b/static_core/runtime/core/core_language_context.cpp index 3116a6a39dad22aaaf110276bc49d60100f99860..f9ee75b6a79fbee812565a8528fe59125264e49b 100644 --- a/static_core/runtime/core/core_language_context.cpp +++ b/static_core/runtime/core/core_language_context.cpp @@ -17,9 +17,12 @@ #include "runtime/core/core_itable_builder.h" #include "runtime/core/core_vtable_builder.h" +#include "runtime/include/coretypes/string.h" #include "runtime/include/vtable_builder_standard-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/handle_scope-inl.h" + namespace ark { static Class *GetExceptionClass(const uint8_t *mutf8Name, ManagedThread *thread, ClassLinker *classLinker) diff --git a/static_core/runtime/core/core_vm.h b/static_core/runtime/core/core_vm.h index c3c8eb0e321e869cbbc9a68f924a2ec44eb41272..be71cdf0baf9fec4d155ad947c3b7247e25daf15 100644 --- a/static_core/runtime/core/core_vm.h +++ b/static_core/runtime/core/core_vm.h @@ -19,7 +19,6 @@ #include "libarkbase/macros.h" #include "libarkbase/utils/expected.h" #include "runtime/include/compiler_interface.h" -#include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" #include "runtime/include/panda_vm.h" #include "runtime/mem/gc/gc_phase.h" diff --git a/static_core/runtime/coretypes/string.cpp b/static_core/runtime/coretypes/string.cpp index dc9b2e70281ae1f7f9507ae2ffe7a1e819e69a0a..490811017afed5f56cabbf5fa788f701bb45fd01 100644 --- a/static_core/runtime/coretypes/string.cpp +++ b/static_core/runtime/coretypes/string.cpp @@ -32,6 +32,7 @@ #include "runtime/include/runtime.h" #include "runtime/handle_base-inl.h" #include "runtime/include/panda_vm.h" +#include "runtime/include/object_accessor-inl.h" #include "runtime/include/coretypes/string.h" #include "runtime/include/coretypes/line_string.h" diff --git a/static_core/runtime/coroutines/coroutine_stats.h b/static_core/runtime/coroutines/coroutine_stats.h index db7ec5667d91ed37b41613238645114bad6e1d0e..5e23e9d610bf2d5f3108c6997e91f461889bc675 100644 --- a/static_core/runtime/coroutines/coroutine_stats.h +++ b/static_core/runtime/coroutines/coroutine_stats.h @@ -16,7 +16,7 @@ #define PANDA_RUNTIME_COROUTINES_COROUTINE_STATS_H #include "runtime/include/histogram-inl.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" #include "runtime/coroutines/utils.h" #include diff --git a/static_core/runtime/coroutines/priority_queue.h b/static_core/runtime/coroutines/priority_queue.h index 8a8bffd8ed478728c4688a7d514b222adc71b7c6..5d4d6a0e6013e6b4d305a2bb80fe10dd00531eae 100644 --- a/static_core/runtime/coroutines/priority_queue.h +++ b/static_core/runtime/coroutines/priority_queue.h @@ -16,7 +16,7 @@ #define PANDA_RUNTIME_COROUTINES_PRIORITY_QUEUE_H #include "libarkbase/macros.h" -#include "include/mem/panda_containers.h" + #include "runtime/coroutines/coroutine_worker.h" #include diff --git a/static_core/runtime/coroutines/stackful_coroutine_state_info.h b/static_core/runtime/coroutines/stackful_coroutine_state_info.h index 6d5030a4435c4a374953cd2aa92b988912c353c6..68238009dc6b7f625aa20867391d12bb456a63b1 100644 --- a/static_core/runtime/coroutines/stackful_coroutine_state_info.h +++ b/static_core/runtime/coroutines/stackful_coroutine_state_info.h @@ -20,7 +20,7 @@ #include "coroutines/coroutine.h" #include "runtime/coroutines/coroutine_context.h" #include "libarkbase/macros.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/stack_walker.h" namespace ark { diff --git a/static_core/runtime/coroutines/utils.h b/static_core/runtime/coroutines/utils.h index 84477dc4dc84864d6b812a98111675bd9023bfb4..d12d22976cbb425cba560655f558ed3a96884fa6 100644 --- a/static_core/runtime/coroutines/utils.h +++ b/static_core/runtime/coroutines/utils.h @@ -20,7 +20,7 @@ namespace ark { -// NOTE(konstanting): consider moving it to libpandabase +// NOTE(konstanting): consider moving it to libarkbase template constexpr size_t ToIndex(T idx) { diff --git a/static_core/runtime/deoptimization.h b/static_core/runtime/deoptimization.h index 08cfd1a48a5c020eadc3a8809d97a0512c3ef9dd..f100a5f63b5c1880a1172602638b51a04911c5b8 100644 --- a/static_core/runtime/deoptimization.h +++ b/static_core/runtime/deoptimization.h @@ -17,6 +17,7 @@ #include "runtime/include/exceptions.h" #include "runtime/include/stack_walker.h" +#include "runtime/include/mem/panda_set.h" namespace ark { diff --git a/static_core/runtime/dprofiler/dprofiler.h b/static_core/runtime/dprofiler/dprofiler.h index f432bba13ad5af523cde9f161f38dbda85769d31..4f29abaaede4092bc1e0b9e07e592bf6fc5b3fc6 100644 --- a/static_core/runtime/dprofiler/dprofiler.h +++ b/static_core/runtime/dprofiler/dprofiler.h @@ -21,7 +21,7 @@ #include "dprof/profiling_data.h" #include "libarkbase/macros.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_unordered_set.h" #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" diff --git a/static_core/runtime/entrypoints/entrypoints.h b/static_core/runtime/entrypoints/entrypoints.h index 8c5c4e4839689122ef33f8213083186bb608e65a..3fe0b2e9647ff9e2928d8e4fd68fb65fb5201212 100644 --- a/static_core/runtime/entrypoints/entrypoints.h +++ b/static_core/runtime/entrypoints/entrypoints.h @@ -16,11 +16,11 @@ #define PANDA_RUNTIME_ENTRYPOINTS_ENTRYPOINTS_H_ #include "entrypoints_gen.h" -#include "runtime/include/thread.h" namespace ark { class Frame; +class ManagedThread; extern "C" Frame *CreateFrameWithSize(uint32_t size, uint32_t nregs, Method *method, Frame *prev); diff --git a/static_core/runtime/entrypoints/entrypoints_gen.h.erb b/static_core/runtime/entrypoints/entrypoints_gen.h.erb index 3f43fe05517999a2e0bde532ae909b7f5c11093d..8dc118a55eaeb5789a22bca44c113f58281b5d52 100644 --- a/static_core/runtime/entrypoints/entrypoints_gen.h.erb +++ b/static_core/runtime/entrypoints/entrypoints_gen.h.erb @@ -20,7 +20,6 @@ #include "libarkbase/macros.h" #include -#include #include "plugins_entrypoints_gen.h" namespace ark { diff --git a/static_core/runtime/global_handle_storage.h b/static_core/runtime/global_handle_storage.h index b8c856bd4c9b85928d6de14facfb69c3708b1d6f..f22a04419dfcbc4b29c3902a1700b03a99ee65de 100644 --- a/static_core/runtime/global_handle_storage.h +++ b/static_core/runtime/global_handle_storage.h @@ -18,7 +18,7 @@ #include "runtime/include/coretypes/tagged_value.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" namespace ark { using InternalAllocatorPtr = mem::AllocatorPtr; diff --git a/static_core/runtime/handle_storage.h b/static_core/runtime/handle_storage.h index ee1f126c96ca5fef2505cfb29c8d5e0b87294f23..0919e3efee9dc2f30cca29172cb1bceef07b439d 100644 --- a/static_core/runtime/handle_storage.h +++ b/static_core/runtime/handle_storage.h @@ -18,7 +18,7 @@ #include "runtime/include/coretypes/tagged_value.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark { class LocalScope; diff --git a/static_core/runtime/hotreload/hotreload.cpp b/static_core/runtime/hotreload/hotreload.cpp index c42614b5b0ebbe0d9c981c012a1c1119aa2d3fd7..1def3e7ab2d081f98c6d0f7b2da7df50c9cffc16 100644 --- a/static_core/runtime/hotreload/hotreload.cpp +++ b/static_core/runtime/hotreload/hotreload.cpp @@ -15,8 +15,9 @@ #include "runtime/handle_scope-inl.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" +#include "runtime/include/class-inl.h" #include "runtime/include/thread_scopes.h" #include "runtime/monitor_object_lock.h" #include "runtime/monitor.h" diff --git a/static_core/runtime/hotreload/hotreload.h b/static_core/runtime/hotreload/hotreload.h index afd73fe8b94a62bee5f0a1c341f5ca1daac0019e..0c9c56bfd4df8444e42facfe665cd732fdccc165 100644 --- a/static_core/runtime/hotreload/hotreload.h +++ b/static_core/runtime/hotreload/hotreload.h @@ -19,7 +19,7 @@ #include "libarkfile/file.h" #include "runtime/include/class.h" #include "runtime/include/managed_thread.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/panda_vm.h" #include "runtime/include/runtime.h" #include "runtime/mem/rendezvous.h" diff --git a/static_core/runtime/imtable_builder.cpp b/static_core/runtime/imtable_builder.cpp index ef293465545ad0a710bc68f7524aae98f3b46205..3f6f4ff863ae1af3614e0019dd6f7f325d068cdc 100644 --- a/static_core/runtime/imtable_builder.cpp +++ b/static_core/runtime/imtable_builder.cpp @@ -16,6 +16,7 @@ #include "libarkbase/macros.h" #include "runtime/include/imtable_builder.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" namespace ark { void IMTableBuilder::Build(const panda_file::ClassDataAccessor *cda, ITable itable) diff --git a/static_core/runtime/include/cframe.h b/static_core/runtime/include/cframe.h index 08050f5a3cc7a074fc64e1d07abdc836be22ad89..d68fda1e89537b14e5f888399277da206d393f98 100644 --- a/static_core/runtime/include/cframe.h +++ b/static_core/runtime/include/cframe.h @@ -17,14 +17,16 @@ #define PANDA_CFRAME_H #include -#include "compiler/code_info/code_info.h" +#include "compiler/code_info/vreg_info.h" #include "libarkbase/utils/cframe_layout.h" #include "runtime/interpreter/frame.h" #include "libarkbase/macros.h" + namespace ark { namespace compiler { class CodeInfo; +class StackMap; } // namespace compiler class Method; diff --git a/static_core/runtime/include/cframe_iterators.h b/static_core/runtime/include/cframe_iterators.h index 13d557bd888cdef508e6f7de7fa38bae7851bd1e..17c2beed51c1dc47311a70871354881ef743e949 100644 --- a/static_core/runtime/include/cframe_iterators.h +++ b/static_core/runtime/include/cframe_iterators.h @@ -22,6 +22,7 @@ #include "runtime/arch/helpers.h" #include "runtime/include/cframe.h" #include "runtime/include/method.h" +#include "runtime/include/mem/panda_vector.h" #include "libarkbase/utils/bit_utils.h" namespace ark { diff --git a/static_core/runtime/include/class_linker.h b/static_core/runtime/include/class_linker.h index 1166e017849cec162a92f6b40921ea0478e7facf..187995aba7b08af1bc9de234f79cacec70e69ca8 100644 --- a/static_core/runtime/include/class_linker.h +++ b/static_core/runtime/include/class_linker.h @@ -30,11 +30,12 @@ #include "libarkfile/file_items.h" #include "runtime/class_linker_context.h" #include "runtime/include/class.h" +#include "runtime/include/class_linker_extension.h" #include "runtime/include/field.h" #include "runtime/include/itable_builder.h" #include "runtime/include/imtable_builder.h" #include "runtime/include/language_context.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" #include "runtime/include/method.h" diff --git a/static_core/runtime/include/class_linker_extension.h b/static_core/runtime/include/class_linker_extension.h index 643711fa859186e9decc010b50b230d1dcf9a357..1515f6c2edcaaa8e94d6ac3aa39c672fd116fc3b 100644 --- a/static_core/runtime/include/class_linker_extension.h +++ b/static_core/runtime/include/class_linker_extension.h @@ -21,7 +21,7 @@ #include "runtime/class_linker_context.h" #include "runtime/include/class_root.h" #include "runtime/include/class.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark { diff --git a/static_core/runtime/include/compiler_interface-inl.h b/static_core/runtime/include/compiler_interface-inl.h index a0f43029e29deb7b21f62e9293e2650f8a96626c..c91f1dcb043be5fdba765d9d0d8215304e1a993a 100644 --- a/static_core/runtime/include/compiler_interface-inl.h +++ b/static_core/runtime/include/compiler_interface-inl.h @@ -18,6 +18,7 @@ #include "runtime/include/compiler_interface.h" #include "runtime/include/panda_vm.h" +#include "runtime/interpreter/vregister.h" namespace ark { inline CompilerTask::~CompilerTask() @@ -26,6 +27,123 @@ inline CompilerTask::~CompilerTask() vm_->CleanUpTask(method_); } } + +class CompilerInterface::ExecState { +public: + ExecState(const uint8_t *pc, Frame *frame, Method *callee, size_t numArgs, const bool *spFlag) + : pc_(pc), frame_(frame), calleeMethod_(callee), numArgs_(numArgs), spFlag_(spFlag) + { + } + + const uint8_t *GetPc() const + { + return pc_; + } + + void SetPc(const uint8_t *pc) + { + pc_ = pc; + } + + Frame *GetFrame() const + { + return frame_; + } + + void SetFrame(Frame *frame) + { + frame_ = frame; + } + + size_t GetNumArgs() const + { + return numArgs_; + } + + const interpreter::VRegister &GetAcc() const + { + return acc_; + } + + interpreter::VRegister &GetAcc() + { + return acc_; + } + + void SetAcc(const interpreter::VRegister &acc) + { + acc_ = acc; + } + + interpreter::VRegister &GetArg(size_t i) + { + return args_[i]; + } + + void SetArg(size_t i, const interpreter::VRegister ®) + { + args_[i] = reg; + } + + const uint8_t *GetMethodInst() + { + return GetInstrOffset(frame_); + } + + const bool *GetSPFlag() const + { + return spFlag_; + } + + Method *GetCalleeMethod() + { + return calleeMethod_; + } + + static size_t GetSize(size_t nargs) + { + return sizeof(ExecState) + sizeof(interpreter::VRegister) * nargs; + } + + static constexpr uint32_t GetExecStateAccOffset() + { + return MEMBER_OFFSET(ExecState, acc_); + } + + static constexpr uint32_t GetExecStateArgsOffset() + { + return MEMBER_OFFSET(ExecState, args_); + } + + static constexpr uint32_t GetExecStatePcOffset() + { + return MEMBER_OFFSET(ExecState, pc_); + } + + static constexpr uint32_t GetExecStateFrameOffset() + { + return MEMBER_OFFSET(ExecState, frame_); + } + + static constexpr uint32_t GetExecStateSPFlagAddrOffset() + { + return MEMBER_OFFSET(ExecState, spFlag_); + } + + static constexpr uint32_t GetCalleeMethodOffset() + { + return MEMBER_OFFSET(ExecState, calleeMethod_); + } + +private: + const uint8_t *pc_; + Frame *frame_; + Method *calleeMethod_; + size_t numArgs_; + const bool *spFlag_; + interpreter::VRegister acc_; + __extension__ interpreter::VRegister args_[0]; // NOLINT(modernize-avoid-c-arrays) +}; } // namespace ark #endif // PANDA_RUNTIME_INCLUDE_COMPILER_INTERFACE_INL_H diff --git a/static_core/runtime/include/compiler_interface.h b/static_core/runtime/include/compiler_interface.h index f5277107e70caed652d0e154c17a16f91e3deaf2..cd1b9ec29fbf9e66e7f3f4c3231a3b8c2f5220d2 100644 --- a/static_core/runtime/include/compiler_interface.h +++ b/static_core/runtime/include/compiler_interface.h @@ -16,12 +16,8 @@ #define PANDA_RUNTIME_COMPILER_INTERFACE_H_ #include -#include #include "libarkbase/macros.h" -#include "libarkfile/file.h" -#include "runtime/include/coretypes/tagged_value.h" -#include "runtime/interpreter/frame.h" #include "runtime/thread_pool_queue.h" namespace ark { @@ -32,6 +28,9 @@ class TaggedValue; } // namespace coretypes class PandaVM; +class Method; +class Frame; +const uint8_t *GetInstrOffset(Frame *frame); class CompilerTask : public TaskInterface { NO_COPY_SEMANTIC(CompilerTask); @@ -85,127 +84,11 @@ private: PandaVM *vm_ {nullptr}; }; -class Method; class CompilerInterface { public: enum class ReturnReason { RET_OK = 0, RET_DEOPTIMIZATION = 1 }; - class ExecState { - public: - ExecState(const uint8_t *pc, Frame *frame, Method *callee, size_t numArgs, const bool *spFlag) - : pc_(pc), frame_(frame), calleeMethod_(callee), numArgs_(numArgs), spFlag_(spFlag) - { - } - - const uint8_t *GetPc() const - { - return pc_; - } - - void SetPc(const uint8_t *pc) - { - pc_ = pc; - } - - Frame *GetFrame() const - { - return frame_; - } - - void SetFrame(Frame *frame) - { - frame_ = frame; - } - - size_t GetNumArgs() const - { - return numArgs_; - } - - const interpreter::VRegister &GetAcc() const - { - return acc_; - } - - interpreter::VRegister &GetAcc() - { - return acc_; - } - - void SetAcc(const interpreter::VRegister &acc) - { - acc_ = acc; - } - - interpreter::VRegister &GetArg(size_t i) - { - return args_[i]; - } - - void SetArg(size_t i, const interpreter::VRegister ®) - { - args_[i] = reg; - } - - const uint8_t *GetMethodInst() - { - return frame_->GetInstrOffset(); - } - - const bool *GetSPFlag() const - { - return spFlag_; - } - - Method *GetCalleeMethod() - { - return calleeMethod_; - } - - static size_t GetSize(size_t nargs) - { - return sizeof(ExecState) + sizeof(interpreter::VRegister) * nargs; - } - - static constexpr uint32_t GetExecStateAccOffset() - { - return MEMBER_OFFSET(ExecState, acc_); - } - - static constexpr uint32_t GetExecStateArgsOffset() - { - return MEMBER_OFFSET(ExecState, args_); - } - - static constexpr uint32_t GetExecStatePcOffset() - { - return MEMBER_OFFSET(ExecState, pc_); - } - - static constexpr uint32_t GetExecStateFrameOffset() - { - return MEMBER_OFFSET(ExecState, frame_); - } - - static constexpr uint32_t GetExecStateSPFlagAddrOffset() - { - return MEMBER_OFFSET(ExecState, spFlag_); - } - - static constexpr uint32_t GetCalleeMethodOffset() - { - return MEMBER_OFFSET(ExecState, calleeMethod_); - } - - private: - const uint8_t *pc_; - Frame *frame_; - Method *calleeMethod_; - size_t numArgs_; - const bool *spFlag_; - interpreter::VRegister acc_; - __extension__ interpreter::VRegister args_[0]; // NOLINT(modernize-avoid-c-arrays) - }; + class ExecState; CompilerInterface() = default; diff --git a/static_core/runtime/include/coretypes/array.h b/static_core/runtime/include/coretypes/array.h index aa049c2e9d29d235ea1d6b386e021e354d99880e..8b5d0f5864fd78f37069925f8e81cb222c224e22 100644 --- a/static_core/runtime/include/coretypes/array.h +++ b/static_core/runtime/include/coretypes/array.h @@ -24,7 +24,7 @@ #include "libarkbase/mem/space.h" #include "libarkbase/utils/span.h" #include "libarkfile/bytecode_instruction-inl.h" -#include "runtime/include/class-inl.h" +#include "runtime/include/class.h" #include "runtime/include/language_context.h" #include "runtime/include/object_header.h" #include "runtime/mem/heap_manager.h" diff --git a/static_core/runtime/include/coretypes/dyn_objects.h b/static_core/runtime/include/coretypes/dyn_objects.h index 46035be0268671880625b863fdfbca0d496bb9df..15a39fb5dd5b9489fb8d093a2bab9f7835094d29 100644 --- a/static_core/runtime/include/coretypes/dyn_objects.h +++ b/static_core/runtime/include/coretypes/dyn_objects.h @@ -20,7 +20,7 @@ #include "runtime/include/coretypes/array.h" #include "runtime/include/coretypes/string.h" #include "runtime/include/coretypes/tagged_value.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/object_header.h" #include "runtime/mem/vm_handle.h" diff --git a/static_core/runtime/include/coretypes/string.h b/static_core/runtime/include/coretypes/string.h index c07df8ff55b2058c22f3cd18f8627844fdecb29f..3eff93dc0f21517ea78de9f9e2d6c04d3ea8b57e 100644 --- a/static_core/runtime/include/coretypes/string.h +++ b/static_core/runtime/include/coretypes/string.h @@ -17,14 +17,14 @@ #define PANDA_RUNTIME_CORETYPES_COMMON_STRING_H_ #include -#include "objects/string/base_string-inl.h" -#include "objects/string/line_string-inl.h" + #include "libarkbase/utils/utf.h" #include "objects/base_class.h" #include "runtime/include/language_context.h" #include "runtime/include/exceptions.h" #include "runtime/include/object_accessor.h" #include "runtime/include/coretypes/line_string.h" +#include "runtime/include/object_accessor-inl.h" namespace ark::coretypes { class String : public ObjectHeader { diff --git a/static_core/runtime/include/exceptions.h b/static_core/runtime/include/exceptions.h index c91b1fd72359ada758927f5709fe7fb50709e4a6..35a45ae6d1a1e29a145c1780fe81962844a79671 100644 --- a/static_core/runtime/include/exceptions.h +++ b/static_core/runtime/include/exceptions.h @@ -15,7 +15,6 @@ #ifndef PANDA_RUNTIME_EXCEPTIONS_H_ #define PANDA_RUNTIME_EXCEPTIONS_H_ -#include "runtime/include/class-inl.h" #include "runtime/include/coretypes/array.h" #include "runtime/include/language_context.h" #include "runtime/include/method.h" @@ -23,6 +22,8 @@ namespace ark { +class Class; + void ThrowException(const LanguageContext &ctx, ManagedThread *thread, const uint8_t *mutf8Name, const uint8_t *mutf8Msg); diff --git a/static_core/runtime/include/histogram-inl.h b/static_core/runtime/include/histogram-inl.h index 4ba992a9fe893ac160eaab6e715c987c720b455d..a390a156f7301bfe1e710a7b3b20a279ae368fb9 100644 --- a/static_core/runtime/include/histogram-inl.h +++ b/static_core/runtime/include/histogram-inl.h @@ -17,7 +17,6 @@ #define PANDA_RUNTIME_HISTOGRAM_INL_H_ #include "histogram.h" -#include "mem/panda_containers.h" #include "mem/panda_string.h" namespace ark { diff --git a/static_core/runtime/include/histogram.h b/static_core/runtime/include/histogram.h index 88e6a0cf15def67594922780906ba5fce72c6a08..18b94b7fb4be5d2108f4712a1851d42a23347f08 100644 --- a/static_core/runtime/include/histogram.h +++ b/static_core/runtime/include/histogram.h @@ -18,7 +18,7 @@ #include "libarkbase/utils/type_converter.h" #include "libarkbase/macros.h" -#include "mem/panda_containers.h" +#include "mem/panda_map.h" #include "mem/panda_string.h" namespace ark { diff --git a/static_core/runtime/include/imtable_builder.h b/static_core/runtime/include/imtable_builder.h index d187975ff48c79535e01552173ca8435c2d15c68..85c1713fdfd038df9250369ed03ffd3f56eb7a66 100644 --- a/static_core/runtime/include/imtable_builder.h +++ b/static_core/runtime/include/imtable_builder.h @@ -17,12 +17,12 @@ #include "libarkbase/macros.h" #include "libarkfile/class_data_accessor.h" -#include "runtime/include/class-inl.h" -#include "runtime/include/mem/panda_smart_pointers.h" +#include "runtime/include/itable.h" namespace ark { class ClassLinker; +class Class; class IMTableBuilder { public: diff --git a/static_core/runtime/include/itable_builder.h b/static_core/runtime/include/itable_builder.h index 479d8169255ff137685a94b9c68186251696a1e6..e42ae6f315193a1b2264d569eb59ee9a74734458 100644 --- a/static_core/runtime/include/itable_builder.h +++ b/static_core/runtime/include/itable_builder.h @@ -16,12 +16,10 @@ #define PANDA_RUNTIME_ITABLE_BUILDER_H_ #include "libarkbase/macros.h" -#include "libarkfile/class_data_accessor-inl.h" -#include "runtime/include/class-inl.h" -#include "runtime/include/mem/panda_smart_pointers.h" namespace ark { +class Class; class ClassLinker; class ITableBuilder { diff --git a/static_core/runtime/include/language_context.h b/static_core/runtime/include/language_context.h index 98c89c898b7c1e2b61aad615b3348227fa140997..c638e21d5eecbc74acf0fb77bc5ce35651437076 100644 --- a/static_core/runtime/include/language_context.h +++ b/static_core/runtime/include/language_context.h @@ -16,22 +16,22 @@ #define PANDA_RUNTIME_LANGUAGE_CONTEXT_H_ #include "libarkbase/utils/utf.h" -#include "libarkfile/class_data_accessor-inl.h" #include "libarkfile/file_items.h" #include "libarkbase/macros.h" #include "compiler/code_info/vreg_info.h" #include "runtime/class_initializer.h" -#include "runtime/include/class-inl.h" -#include "runtime/include/class_linker_extension.h" #include "runtime/include/coretypes/tagged_value.h" +#include "runtime/include/class_linker_extension.h" #include "runtime/include/imtable_builder.h" #include "runtime/include/itable_builder.h" #include "runtime/include/language_config.h" #include "runtime/include/vtable_builder_interface.h" #include "runtime/include/tooling/pt_lang_extension.h" #include "runtime/include/stack_walker.h" -#include "runtime/mem/gc/gc_types.h" + namespace ark { +class Class; +class ClassLinkerExtension; class Thread; class Trace; class Runtime; diff --git a/static_core/runtime/include/managed_thread.h b/static_core/runtime/include/managed_thread.h index 2278a385abd79c3b2c5b997e74be4db7dfeb65d0..ddb0af10f6b519ab273ef373d354c8a35c4e9a20 100644 --- a/static_core/runtime/include/managed_thread.h +++ b/static_core/runtime/include/managed_thread.h @@ -16,6 +16,8 @@ #define PANDA_RUNTIME_MANAGED_THREAD_H #include "thread.h" +#include "runtime/include/stack_walker.h" +#include "runtime/include/mem/panda_stack.h" // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define ASSERT_MANAGED_CODE() ASSERT(::ark::ManagedThread::GetCurrent()->IsManagedCode()) @@ -23,7 +25,10 @@ #define ASSERT_NATIVE_CODE() ASSERT(::ark::ManagedThread::GetCurrent()->IsInNativeCode()) namespace ark { +class WeightedAdaptiveTlabAverage; class MTThreadManager; +class LanguageContext; + /** * @brief Class represents managed thread * diff --git a/static_core/runtime/include/mem/allocator.h b/static_core/runtime/include/mem/allocator.h index 5574d22bc8f4aa9933201bfc8bb6fd616d19545c..e85eaba6e70f4aa1c78a4de742a6a2de600425e8 100644 --- a/static_core/runtime/include/mem/allocator.h +++ b/static_core/runtime/include/mem/allocator.h @@ -15,8 +15,6 @@ #ifndef RUNTIME_MEM_ALLOCATOR_H #define RUNTIME_MEM_ALLOCATOR_H -#include - #include "libarkbase/mem/code_allocator.h" #include "libarkbase/mem/mem.h" #include "libarkbase/mem/pool_map.h" @@ -24,7 +22,7 @@ #include "libarkbase/macros.h" #include "runtime/mem/bump-allocator.h" #include "runtime/mem/freelist_allocator.h" -#include "runtime/mem/gc/bitmap.h" +//#include "runtime/mem/gc/bitmap.h" #include "runtime/mem/gc/gc_types.h" #include "runtime/mem/humongous_obj_allocator.h" #include "runtime/mem/internal_allocator.h" diff --git a/static_core/runtime/include/mem/panda_containers.h b/static_core/runtime/include/mem/panda_containers.h deleted file mode 100644 index a74ebd9a2c40ef8e98d4b3b982484b479d6e2cf8..0000000000000000000000000000000000000000 --- a/static_core/runtime/include/mem/panda_containers.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Copyright (c) 2021-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef PANDA_RUNTIME_MEM_PANDA_CONTAINERS_H -#define PANDA_RUNTIME_MEM_PANDA_CONTAINERS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "libarkbase/utils/small_vector.h" -#include "runtime/mem/allocator_adapter.h" - -namespace ark { - -template -using PandaForwardList = std::forward_list>; -// Thread local version of PandaForwardList -template -using PandaForwardListTL = std::forward_list>; - -template -using PandaList = std::list>; -// Thread local version of PandaList -template -using PandaListTL = std::list>; - -template -using PandaDeque = std::deque>; -// Thread local version of PandaDeque -template -using PandaDequeTL = std::deque>; - -template > -using PandaQueue = std::queue; -// Thread local version of PandaQueue -template > -using PandaQueueTL = std::queue; - -template > -using PandaStack = std::stack; -// Thread local version of PandaStack -template > -using PandaStackTL = std::stack; - -template > -using PandaSet = std::set>; -// Thread local version of PandaSet -template > -using PandaSetTL = std::set>; - -template , class KeyEqual = std::equal_to> -using PandaUnorderedSet = std::unordered_set>; -// Thread local version of PandaUnorderedSet -template , class KeyEqual = std::equal_to> -using PandaUnorderedSetTL = std::unordered_set>; - -template -using PandaVector = std::vector>; -// Thread local version of PandaVector -template -using PandaVectorTL = std::vector>; - -// For small vector with static allocation support -static constexpr size_t STATIC_CAPACITY_DEFAULT = 8; -template -using PandaSmallVector = SmallVector>; -template -using PandaSmallVectorTL = SmallVector>; - -template , class Compare = std::less> -using PandaPriorityQueue = std::priority_queue; -// Thread local version of PandaPriorityQueue -template , class Compare = std::less> -using PandaPriorityQueueTL = std::priority_queue; - -template > -using PandaMap = std::map>>; -// Thread local version of PandaMap -template > -using PandaMapTL = std::map, mem::AllocScope::LOCAL>>; - -template > -using PandaMultiMap = std::multimap>>; -// Thread local version of PandaMultiMap -template > -using PandaMultiMapTL = - std::multimap, mem::AllocScope::LOCAL>>; - -template , class KeyEqual = std::equal_to> -using PandaUnorderedMap = std::unordered_map>>; -// Thread local version of PandaUnorderedMap -template , class KeyEqual = std::equal_to> -using PandaUnorderedMapTL = - std::unordered_map, mem::AllocScope::LOCAL>>; - -template , class KeyEqual = std::equal_to> -using PandaUnorderedMultiMap = - std::unordered_multimap>>; -// Thread local version of PandaUnorderedMultiMap -template , class KeyEqual = std::equal_to> -using PandaUnorderedMultiMapTL = - std::unordered_multimap, mem::AllocScope::LOCAL>>; -} // namespace ark - -#endif // PANDA_RUNTIME_MEM_PANDA_CONTAINERS_H diff --git a/static_core/runtime/include/mem/panda_deque.h b/static_core/runtime/include/mem/panda_deque.h new file mode 100644 index 0000000000000000000000000000000000000000..0011a1c2bd12a1436a5cead5efa8fbd67ef3e35f --- /dev/null +++ b/static_core/runtime/include/mem/panda_deque.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_DEQUE_H +#define PANDA_RUNTIME_MEM_PANDA_DEQUE_H + +#include + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template +using PandaDeque = std::deque>; +// Thread local version of PandaDeque +template +using PandaDequeTL = std::deque>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_DEQUE_H diff --git a/static_core/runtime/include/mem/panda_forward_list.h b/static_core/runtime/include/mem/panda_forward_list.h new file mode 100644 index 0000000000000000000000000000000000000000..1441437e5da531d9d3f86816b57fc60f480af452 --- /dev/null +++ b/static_core/runtime/include/mem/panda_forward_list.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_FORWARD_LIST_H +#define PANDA_RUNTIME_MEM_PANDA_FORWARD_LIST_H + +#include +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template +using PandaForwardList = std::forward_list>; +// Thread local version of PandaForwardList +template +using PandaForwardListTL = std::forward_list>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_FORWARD_LIST_H diff --git a/static_core/runtime/include/mem/panda_list.h b/static_core/runtime/include/mem/panda_list.h new file mode 100644 index 0000000000000000000000000000000000000000..464a3bfe76c0dc7ddf558063b84debb8b468fec7 --- /dev/null +++ b/static_core/runtime/include/mem/panda_list.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_LIST_H +#define PANDA_RUNTIME_MEM_PANDA_LIST_H + +#include + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template +using PandaList = std::list>; +// Thread local version of PandaList +template +using PandaListTL = std::list>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_LIST_H diff --git a/static_core/runtime/include/mem/panda_map.h b/static_core/runtime/include/mem/panda_map.h new file mode 100644 index 0000000000000000000000000000000000000000..a152b982bd5eaf5ed130070afff8df8cb6d39941 --- /dev/null +++ b/static_core/runtime/include/mem/panda_map.h @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_MAP_H +#define PANDA_RUNTIME_MEM_PANDA_MAP_H + +#include + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template > +using PandaMap = std::map>>; +// Thread local version of PandaMap +template > +using PandaMapTL = std::map, mem::AllocScope::LOCAL>>; + +template > +using PandaMultiMap = std::multimap>>; +// Thread local version of PandaMultiMap +template > +using PandaMultiMapTL = + std::multimap, mem::AllocScope::LOCAL>>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_MAP_H diff --git a/static_core/runtime/include/mem/panda_queue.h b/static_core/runtime/include/mem/panda_queue.h new file mode 100644 index 0000000000000000000000000000000000000000..22ea5ae352ec09cbf72ca649f66d4b03e63c31cd --- /dev/null +++ b/static_core/runtime/include/mem/panda_queue.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_QUEUE_H +#define PANDA_RUNTIME_MEM_PANDA_QUEUE_H + +#include +#include "panda_deque.h" +#include "panda_vector.h" + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template > +using PandaQueue = std::queue; +// Thread local version of PandaQueue +template > +using PandaQueueTL = std::queue; + +template , class Compare = std::less> +using PandaPriorityQueue = std::priority_queue; +// Thread local version of PandaPriorityQueue +template , class Compare = std::less> +using PandaPriorityQueueTL = std::priority_queue; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_QUEUE_H diff --git a/static_core/runtime/include/mem/panda_set.h b/static_core/runtime/include/mem/panda_set.h new file mode 100644 index 0000000000000000000000000000000000000000..0e555b2c4a3e46aceeb32c86ab94a8f2f5cb9f7d --- /dev/null +++ b/static_core/runtime/include/mem/panda_set.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_SET_H +#define PANDA_RUNTIME_MEM_PANDA_SET_H + +#include + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template > +using PandaSet = std::set>; +// Thread local version of PandaSet +template > +using PandaSetTL = std::set>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_SET_H diff --git a/static_core/runtime/include/mem/panda_small_vector.h b/static_core/runtime/include/mem/panda_small_vector.h new file mode 100644 index 0000000000000000000000000000000000000000..0c3f9d525dcdc9f8fab14a1954ec8f7aabf6d8d4 --- /dev/null +++ b/static_core/runtime/include/mem/panda_small_vector.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_SMALL_VECTOR_H +#define PANDA_RUNTIME_MEM_PANDA_SMALL_VECTOR_H + +#include "libarkbase/utils/small_vector.h" +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +// For small vector with static allocation support +static constexpr size_t STATIC_CAPACITY_DEFAULT = 8; +template +using PandaSmallVector = SmallVector>; +template +using PandaSmallVectorTL = SmallVector>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_SMALL_VECTOR_H diff --git a/static_core/runtime/include/mem/panda_stack.h b/static_core/runtime/include/mem/panda_stack.h new file mode 100644 index 0000000000000000000000000000000000000000..b240b1198dbe942f6134827a993a4c77d50371e2 --- /dev/null +++ b/static_core/runtime/include/mem/panda_stack.h @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_STACK_H +#define PANDA_RUNTIME_MEM_PANDA_STACK_H + +#include +#include "panda_deque.h" + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template > +using PandaStack = std::stack; +// Thread local version of PandaStack +template > +using PandaStackTL = std::stack; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_STACK_H diff --git a/static_core/runtime/include/mem/panda_unordered_map.h b/static_core/runtime/include/mem/panda_unordered_map.h new file mode 100644 index 0000000000000000000000000000000000000000..5e531515f8002a757fcfa69a1fdb7a2097504cab --- /dev/null +++ b/static_core/runtime/include/mem/panda_unordered_map.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_UNORDERED_MAP_H +#define PANDA_RUNTIME_MEM_PANDA_UNORDERED_MAP_H + +#include + +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template , class KeyEqual = std::equal_to> +using PandaUnorderedMap = std::unordered_map>>; +// Thread local version of PandaUnorderedMap +template , class KeyEqual = std::equal_to> +using PandaUnorderedMapTL = + std::unordered_map, mem::AllocScope::LOCAL>>; + +template , class KeyEqual = std::equal_to> +using PandaUnorderedMultiMap = + std::unordered_multimap>>; +// Thread local version of PandaUnorderedMultiMap +template , class KeyEqual = std::equal_to> +using PandaUnorderedMultiMapTL = + std::unordered_multimap, mem::AllocScope::LOCAL>>; + + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_UNORDERED_MAP_H diff --git a/static_core/runtime/include/mem/panda_unordered_set.h b/static_core/runtime/include/mem/panda_unordered_set.h new file mode 100644 index 0000000000000000000000000000000000000000..05a60795bb50cdb3fc52a69ee569715931d0da17 --- /dev/null +++ b/static_core/runtime/include/mem/panda_unordered_set.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_UNORDERED_SET_H +#define PANDA_RUNTIME_MEM_PANDA_UNORDERED_SET_H + +#include +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template , class KeyEqual = std::equal_to> +using PandaUnorderedSet = std::unordered_set>; +// Thread local version of PandaUnorderedSet +template , class KeyEqual = std::equal_to> +using PandaUnorderedSetTL = std::unordered_set>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_UNORDERED_SET_H diff --git a/static_core/runtime/include/mem/panda_vector.h b/static_core/runtime/include/mem/panda_vector.h new file mode 100644 index 0000000000000000000000000000000000000000..bfc58bb4ca6dfae6bb22ca82c1cab4c43d267fba --- /dev/null +++ b/static_core/runtime/include/mem/panda_vector.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef PANDA_RUNTIME_MEM_PANDA_VECTOR_H +#define PANDA_RUNTIME_MEM_PANDA_VECTOR_H + +#include +#include "runtime/mem/allocator_adapter.h" + +namespace ark { + +template +using PandaVector = std::vector>; +// Thread local version of PandaVector +template +using PandaVectorTL = std::vector>; + +} // namespace ark + +#endif // PANDA_RUNTIME_MEM_PANDA_VECTOR_H diff --git a/static_core/runtime/include/method.h b/static_core/runtime/include/method.h index 92234d545ed0bdba71487cd7caab75e5ffa1fbff..a1f4ba879a262dcf7d67ebe752477648eae0357d 100644 --- a/static_core/runtime/include/method.h +++ b/static_core/runtime/include/method.h @@ -31,7 +31,8 @@ #include "runtime/bridge/bridge.h" #include "runtime/include/compiler_interface.h" #include "runtime/include/class_helper.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_small_vector.h" +#include "runtime/include/mem/panda_vector.h" #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/interpreter/frame.h" #include "value.h" @@ -39,6 +40,7 @@ namespace ark { class Class; +class Frame; class ManagedThread; class ProfilingData; diff --git a/static_core/runtime/include/object_header.h b/static_core/runtime/include/object_header.h index 7ece31d8db3626f3ea07e92fcac0456737634ac5..9070ff6b10cd0adeb13840823b43960e197b0a5e 100644 --- a/static_core/runtime/include/object_header.h +++ b/static_core/runtime/include/object_header.h @@ -33,7 +33,7 @@ #include #include -#include "runtime/mem/lock_config_helper.h" +//#include "runtime/mem/lock_config_helper.h" #include "runtime/include/class_helper.h" #include "runtime/mark_word.h" diff --git a/static_core/runtime/include/panda_vm.h b/static_core/runtime/include/panda_vm.h index 95a9f0bc0a391b029831fdcbb0af98991451aec7..64a1234c00d1d0f8397a496e0bcb97c8cff3872a 100644 --- a/static_core/runtime/include/panda_vm.h +++ b/static_core/runtime/include/panda_vm.h @@ -15,11 +15,11 @@ #ifndef PANDA_RUNTIME_PANDA_VM_H #define PANDA_RUNTIME_PANDA_VM_H -#include "include/coretypes/line_string.h" +//#include "include/coretypes/line_string.h" #include "include/runtime_options.h" #include "jit/profile_saver_worker.h" #include "runtime/include/locks.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "runtime/include/method.h" #include "runtime/include/runtime.h" diff --git a/static_core/runtime/include/runtime.h b/static_core/runtime/include/runtime.h index 889be978b6dacc763aa71264288622877e72956b..7a37d101ed2b2578c88ebe151fa3279ecc2c3b92 100644 --- a/static_core/runtime/include/runtime.h +++ b/static_core/runtime/include/runtime.h @@ -30,7 +30,7 @@ #include "../libarkfile/file_items.h" #include "../libarkfile/literal_data_accessor.h" #include "runtime/include/class_linker.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" #include "runtime/include/method.h" diff --git a/static_core/runtime/include/runtime_notification.h b/static_core/runtime/include/runtime_notification.h index 2723d23feed248f9c674a9338b81b25b2a9af34d..2e5be863527f1a7b2951f00b6e145e82648f0537 100644 --- a/static_core/runtime/include/runtime_notification.h +++ b/static_core/runtime/include/runtime_notification.h @@ -23,7 +23,7 @@ #include "runtime/include/console_call_type.h" #include "runtime/include/coretypes/tagged_value.h" #include "runtime/include/locks.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "runtime/include/runtime.h" #include "runtime/handle_scope-inl.h" diff --git a/static_core/runtime/include/thread.h b/static_core/runtime/include/thread.h index faefbb3198da44847db6dfd263057b30edf7b907..ee506f36fea87ccbb676256c7d74161d967c6b75 100644 --- a/static_core/runtime/include/thread.h +++ b/static_core/runtime/include/thread.h @@ -25,18 +25,13 @@ #include "libarkbase/mem/gc_barrier.h" #include "libarkbase/mem/ringbuf/lock_free_ring_buffer.h" -#include "libarkbase/mem/weighted_adaptive_tlab_average.h" #include "libarkbase/os/mutex.h" #include "libarkbase/os/thread.h" #include "libarkbase/utils/arch.h" #include "libarkbase/utils/list.h" #include "libarkbase/utils/logger.h" #include "libarkbase/utils/tsan_interface.h" -#include "runtime/include/mem/panda_containers.h" -#include "runtime/include/mem/panda_smart_pointers.h" -#include "runtime/include/object_header-inl.h" -#include "runtime/include/stack_walker.h" -#include "runtime/include/language_context.h" + #include "runtime/include/thread_proxy.h" #include "runtime/include/locks.h" #include "runtime/include/thread_status.h" diff --git a/static_core/runtime/include/tooling/debug_interface.h b/static_core/runtime/include/tooling/debug_interface.h index d4830a33a427fc406a18904bac05a0ee1adc3539..a7ba70da678ae970afefaff61bdae72b4afc5af5 100644 --- a/static_core/runtime/include/tooling/debug_interface.h +++ b/static_core/runtime/include/tooling/debug_interface.h @@ -27,7 +27,7 @@ #include "libarkfile/file.h" #include "runtime/include/console_call_type.h" #include "runtime/include/coretypes/tagged_value.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/thread.h" #include "runtime/include/tooling/pt_location.h" #include "runtime/include/tooling/pt_macros.h" diff --git a/static_core/runtime/include/vtable_builder_base-inl.h b/static_core/runtime/include/vtable_builder_base-inl.h index 06f9c717771b0b3023bf982bd815c8970f66ad53..3c71e6965a2b0fc2f35ec1b4a9263cc34c954174 100644 --- a/static_core/runtime/include/vtable_builder_base-inl.h +++ b/static_core/runtime/include/vtable_builder_base-inl.h @@ -16,6 +16,7 @@ #define PANDA_RUNTIME_VTABLE_BUILDER_BASE_INL_H #include "runtime/include/vtable_builder_base.h" +#include "libarkbase/utils/arena_forward_list.h" namespace ark { diff --git a/static_core/runtime/include/vtable_builder_base.h b/static_core/runtime/include/vtable_builder_base.h index bb4b70a2b9294f4d822c00e9ed74e5f4ceeb86d9..ec1f54daaf4041e56a67ac4d7ba3084bc97a40f7 100644 --- a/static_core/runtime/include/vtable_builder_base.h +++ b/static_core/runtime/include/vtable_builder_base.h @@ -18,6 +18,7 @@ #include "libarkbase/macros.h" #include "libarkbase/utils/hash.h" #include "libarkbase/utils/utf.h" +#include "libarkbase/utils/arena_vector.h" #include "libarkfile/class_data_accessor-inl.h" #include "libarkfile/file-inl.h" #include "libarkfile/file_items.h" @@ -25,7 +26,7 @@ #include "runtime/class_linker_context.h" #include "runtime/include/class-inl.h" #include "runtime/include/class_linker.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/vtable_builder_interface.h" diff --git a/static_core/runtime/interpreter/frame.h b/static_core/runtime/interpreter/frame.h index 0778ce4818dfe43baf6a587be12878b3ff04bedc..9645c794faedf8e17d3c1d44b9c9f8e0e1601815 100644 --- a/static_core/runtime/interpreter/frame.h +++ b/static_core/runtime/interpreter/frame.h @@ -24,7 +24,7 @@ #include "libarkbase/utils/logger.h" #include "runtime/interpreter/acc_vregister.h" #include "runtime/mem/frame_allocator-inl.h" -#include "libarkfile/bytecode_instruction-inl.h" +#include "libarkfile/bytecode_instruction.h" namespace ark { diff --git a/static_core/runtime/interpreter/interpreter.cpp b/static_core/runtime/interpreter/interpreter.cpp index dcdc0aec6d8c4d91dcd23662d4083a112a262840..ceb78a0bb255ff5da7633019be486dd74e0b4bdd 100644 --- a/static_core/runtime/interpreter/interpreter.cpp +++ b/static_core/runtime/interpreter/interpreter.cpp @@ -33,6 +33,12 @@ void Execute(ManagedThread *thread, const uint8_t *pc, Frame *frame, bool jumpTo } // namespace ark::interpreter namespace ark { + +const uint8_t *GetInstrOffset(Frame *frame) +{ + return frame->GetInstrOffset(); +} + ALWAYS_INLINE inline const uint8_t *Frame::GetInstrOffset() { return (method_->GetInstructions()); diff --git a/static_core/runtime/interpreter/runtime_interface.h b/static_core/runtime/interpreter/runtime_interface.h index d5ec11d944a3d8f3980d7eb7de560471b33295af..37ac8ee79ab89873a6af8ad53f7fce94d6a5d7bb 100644 --- a/static_core/runtime/interpreter/runtime_interface.h +++ b/static_core/runtime/interpreter/runtime_interface.h @@ -22,6 +22,7 @@ #include "runtime/entrypoints/entrypoints.h" #include "runtime/include/class_linker-inl.h" #include "runtime/include/coretypes/array.h" +#include "runtime/include/coretypes/string.h" #include "runtime/include/coretypes/line_string.h" #include "runtime/include/exceptions.h" #include "runtime/include/field.h" diff --git a/static_core/runtime/jit/libprofile/aot_profiling_data.h b/static_core/runtime/jit/libprofile/aot_profiling_data.h index 94b584e636edf0d0cd3a01492814b576b5bb09ac..161eea8d53711cbc9df780054b8469d2ce1e2505 100644 --- a/static_core/runtime/jit/libprofile/aot_profiling_data.h +++ b/static_core/runtime/jit/libprofile/aot_profiling_data.h @@ -18,7 +18,7 @@ #include "libarkbase/utils/span.h" #include "runtime/include/mem/panda_string.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_map.h" #include "runtime/jit/profiling_data.h" #include diff --git a/static_core/runtime/jit/libprofile/pgo_file_builder.h b/static_core/runtime/jit/libprofile/pgo_file_builder.h index 07ab6f9dd4401e5677cff999bdc5afeca0335012..35cd4a6e0786ca0be598aa2d8b9fe34319400b3c 100644 --- a/static_core/runtime/jit/libprofile/pgo_file_builder.h +++ b/static_core/runtime/jit/libprofile/pgo_file_builder.h @@ -20,7 +20,7 @@ #include "aot_profiling_data.h" #include "libarkbase/utils/span.h" #include "runtime/include/mem/panda_string.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark::pgo { diff --git a/static_core/runtime/jit/profiling_data.h b/static_core/runtime/jit/profiling_data.h index 804ea458063b824bf8378637c280b8adca00350a..2f1a839d0ab6bafc1a785fbe3e8282daaff54959 100644 --- a/static_core/runtime/jit/profiling_data.h +++ b/static_core/runtime/jit/profiling_data.h @@ -23,7 +23,7 @@ #include -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" namespace ark { diff --git a/static_core/runtime/jit/profiling_saver.h b/static_core/runtime/jit/profiling_saver.h index 9b02c5b7eb67240aedf4234df12cd5e88466cee2..03ee30f02bf4f9a572e376051f4f4a887001abb9 100644 --- a/static_core/runtime/jit/profiling_saver.h +++ b/static_core/runtime/jit/profiling_saver.h @@ -20,7 +20,7 @@ #include #include #include "libprofile/aot_profiling_data.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/jit/profiling_data.h" #include "runtime/include/class.h" #include "runtime/include/class_linker.h" diff --git a/static_core/runtime/language_context.cpp b/static_core/runtime/language_context.cpp index d71ea6e37f71c86e1126155ef1c7c6d3f25c8f8d..02fe8a6244eec5f16260a1895b9ef2fe330079db 100644 --- a/static_core/runtime/language_context.cpp +++ b/static_core/runtime/language_context.cpp @@ -19,6 +19,7 @@ #include "runtime/core/core_vm.h" #include "runtime/core/core_vtable_builder.h" #include "runtime/handle_scope-inl.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/class_linker.h" #include "runtime/include/language_config.h" #include "runtime/include/method.h" diff --git a/static_core/runtime/lock_order_graph.h b/static_core/runtime/lock_order_graph.h index 551a953488f42f9810901ac6b27ef07d18e61e30..b169b7a23e68580eb10a7548327acfae11b80a7a 100644 --- a/static_core/runtime/lock_order_graph.h +++ b/static_core/runtime/lock_order_graph.h @@ -18,7 +18,7 @@ #include #include "libarkbase/os/mutex.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/thread.h" #include "runtime/include/thread_status.h" diff --git a/static_core/runtime/mem/allocator.cpp b/static_core/runtime/mem/allocator.cpp index 440de4ba70e06d760452dc3b20ee6718a155f515..cca382053f52de6a363f9b10fbc567f66a8b860e 100644 --- a/static_core/runtime/mem/allocator.cpp +++ b/static_core/runtime/mem/allocator.cpp @@ -20,6 +20,7 @@ #include "libarkbase/mem/mem_pool.h" #include "libarkbase/mem/mem_config.h" #include "libarkbase/mem/mem.h" +#include "libarkbase/mem/weighted_adaptive_tlab_average.h" #include "runtime/include/runtime.h" #include "runtime/include/panda_vm.h" #include "runtime/include/object_header.h" diff --git a/static_core/runtime/mem/bump-allocator.h b/static_core/runtime/mem/bump-allocator.h index 41a53e2e53952e2d0dcb6650e4127752edb59101..39fb861a7ca4a90e56df5555db3410f537500f24 100644 --- a/static_core/runtime/mem/bump-allocator.h +++ b/static_core/runtime/mem/bump-allocator.h @@ -20,7 +20,7 @@ #include "libarkbase/mem/mem_pool.h" #include "libarkbase/macros.h" -#include "libarkbase/mem/arena-inl.h" +#include "libarkbase/mem/arena.h" #include "libarkbase/mem/mem.h" #include "libarkbase/mem/mem_range.h" #include "runtime/mem/tlab.h" diff --git a/static_core/runtime/mem/gc/card_table-inl.h b/static_core/runtime/mem/gc/card_table-inl.h index 6dbf65572e1f43e72efe5351e43e985f040db3fc..a9d631da7e721906ca385b00f06139695bd2da8b 100644 --- a/static_core/runtime/mem/gc/card_table-inl.h +++ b/static_core/runtime/mem/gc/card_table-inl.h @@ -17,7 +17,7 @@ #define RUNTIME_MEM_GC_CARD_TABLE_INL_H #include "runtime/mem/gc/card_table.h" -#include "runtime/include/mem/panda_containers.h" + #include diff --git a/static_core/runtime/mem/gc/card_table.h b/static_core/runtime/mem/gc/card_table.h index fccba623cd366359c30e98c8f93ecd72143f80a2..f62e58475c3e9cb56c082d93384b895706f0ca25 100644 --- a/static_core/runtime/mem/gc/card_table.h +++ b/static_core/runtime/mem/gc/card_table.h @@ -21,7 +21,8 @@ #include #include -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" +#include "libarkbase/macros.h" namespace ark::mem { diff --git a/static_core/runtime/mem/gc/dynamic/gc_dynamic_data.h b/static_core/runtime/mem/gc/dynamic/gc_dynamic_data.h index 0cf5921775b6a84b18ac526310b05c0e3ad8f698..92c598ce6f41bbcbd892527099ae6fabe8fb0520 100644 --- a/static_core/runtime/mem/gc/dynamic/gc_dynamic_data.h +++ b/static_core/runtime/mem/gc/dynamic/gc_dynamic_data.h @@ -15,7 +15,7 @@ #ifndef PANDA_RUNTIME_MEM_GC_GC_DYNAMIC_DATA_H #define PANDA_RUNTIME_MEM_GC_GC_DYNAMIC_DATA_H -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/coretypes/tagged_value.h" #include "runtime/mem/gc/gc_extension_data.h" diff --git a/static_core/runtime/mem/gc/g1/collection_set.h b/static_core/runtime/mem/gc/g1/collection_set.h index 829bce79a01b49351832c427484561f42cfe7b90..76f80fad094fa6e588bf8a2876adc3c3cc879f5e 100644 --- a/static_core/runtime/mem/gc/g1/collection_set.h +++ b/static_core/runtime/mem/gc/g1/collection_set.h @@ -18,7 +18,7 @@ #include "libarkbase/macros.h" #include "libarkbase/utils/range.h" #include "runtime/mem/region_space.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark::mem { diff --git a/static_core/runtime/mem/gc/g1/g1-allocator.cpp b/static_core/runtime/mem/gc/g1/g1-allocator.cpp index 00bf9dcdccbbc3088cea071b958195d1d5758226..fd3db40e80baa3318d105b8a2ac199536dd471ac 100644 --- a/static_core/runtime/mem/gc/g1/g1-allocator.cpp +++ b/static_core/runtime/mem/gc/g1/g1-allocator.cpp @@ -21,6 +21,8 @@ #include "runtime/mem/rem_set-inl.h" #include "runtime/include/panda_vm.h" +#include "libarkbase/mem/weighted_adaptive_tlab_average.h" + namespace ark::mem { template diff --git a/static_core/runtime/mem/gc/g1/g1-evacuate-regions-worker-state.h b/static_core/runtime/mem/gc/g1/g1-evacuate-regions-worker-state.h index 2af9d6969a633f705e5412db34284a449390ae4b..1597cac16a741338ce2ef826ecd0fe3b3706fdd1 100644 --- a/static_core/runtime/mem/gc/g1/g1-evacuate-regions-worker-state.h +++ b/static_core/runtime/mem/gc/g1/g1-evacuate-regions-worker-state.h @@ -18,7 +18,7 @@ #include "runtime/mem/lock_config_helper.h" #include "runtime/include/coretypes/tagged_value.h" #include "runtime/mark_word.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/gc/g1/g1-object-pointer-handlers.h" #include "runtime/mem/gc/g1/gc_evacuate_regions_task_stack.h" diff --git a/static_core/runtime/mem/gc/g1/g1-gc.cpp b/static_core/runtime/mem/gc/g1/g1-gc.cpp index 457686a693c3257d7d00b63228a03b3ba4eef6d2..8271388bdf7796edd20186dfaf2a61901d9b2c8a 100644 --- a/static_core/runtime/mem/gc/g1/g1-gc.cpp +++ b/static_core/runtime/mem/gc/g1/g1-gc.cpp @@ -34,6 +34,7 @@ #include "runtime/mem/rem_set-inl.h" #include "runtime/include/thread-inl.h" #include "runtime/include/managed_thread.h" +#include "runtime/include/object_accessor-inl.h" #include "runtime/mem/gc/g1/ref_updater.h" #include "runtime/mem/region_space.h" #include "runtime/include/stack_walker-inl.h" @@ -41,6 +42,7 @@ #include "runtime/mem/gc/g1/g1-evacuate-regions-worker-state-inl.h" #include "runtime/mem/gc/g1/xgc-extension-data.h" + namespace ark::mem { void Unreachable([[maybe_unused]] ObjectHeader *obj) diff --git a/static_core/runtime/mem/gc/g1/hot_cards.h b/static_core/runtime/mem/gc/g1/hot_cards.h index 412242c7394bbf91d24e264f1fc5675709d2e1f2..c4a8f7982b982d669fc730f3de8190565b472a4a 100644 --- a/static_core/runtime/mem/gc/g1/hot_cards.h +++ b/static_core/runtime/mem/gc/g1/hot_cards.h @@ -16,7 +16,7 @@ #ifndef PANDA_RUNTIME_MEM_GC_G1_HOT_CARDS_H #define PANDA_RUNTIME_MEM_GC_G1_HOT_CARDS_H -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_unordered_set.h" #include "runtime/mem/gc/card_table-inl.h" #include "runtime/arch/memory_helpers.h" diff --git a/static_core/runtime/mem/gc/g1/update_remset_thread.h b/static_core/runtime/mem/gc/g1/update_remset_thread.h index 027012f159dbe793b68427ba58f97749ff0bbf9f..d35a5c8fbb5e1269093e94ec38aa873074a4ee79 100644 --- a/static_core/runtime/mem/gc/g1/update_remset_thread.h +++ b/static_core/runtime/mem/gc/g1/update_remset_thread.h @@ -20,7 +20,7 @@ #include "libarkbase/macros.h" #include "libarkbase/os/mutex.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark::mem { diff --git a/static_core/runtime/mem/gc/gc.cpp b/static_core/runtime/mem/gc/gc.cpp index aa6f932af0a3bac2743b0e7f5216fcb75904b210..4791c016dadcc18d7a0c20931facc1084293b122 100644 --- a/static_core/runtime/mem/gc/gc.cpp +++ b/static_core/runtime/mem/gc/gc.cpp @@ -22,6 +22,7 @@ #include "libarkbase/taskmanager/task_manager.h" #include "runtime/assert_gc_scope.h" #include "runtime/include/class.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/coretypes/dyn_objects.h" #include "runtime/include/locks.h" #include "runtime/include/runtime.h" diff --git a/static_core/runtime/mem/gc/gc.h b/static_core/runtime/mem/gc/gc.h index dee42157e2bc9ad010ad1ed35b60f8bfa2286511..0b14b135170c41dfe7338cd5daea20c67703b3eb 100644 --- a/static_core/runtime/mem/gc/gc.h +++ b/static_core/runtime/mem/gc/gc.h @@ -30,7 +30,7 @@ #include "runtime/include/object_header.h" #include "runtime/include/language_config.h" #include "runtime/include/locks.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_list.h" #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" #include "runtime/mem/allocator_adapter.h" diff --git a/static_core/runtime/mem/gc/gc_adaptive_marking_stack.h b/static_core/runtime/mem/gc/gc_adaptive_marking_stack.h index 37135d7ee484541c5de9c02dd6366cc78ec4b5cc..6e98773964e11ab6023c14405608b8cf961c108f 100644 --- a/static_core/runtime/mem/gc/gc_adaptive_marking_stack.h +++ b/static_core/runtime/mem/gc/gc_adaptive_marking_stack.h @@ -17,7 +17,7 @@ #include "runtime/mem/gc/gc_root_type.h" #include "runtime/mem/gc/workers/gc_workers_tasks.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/gc/gc_adaptive_stack.h" namespace ark::mem { diff --git a/static_core/runtime/mem/gc/gc_adaptive_stack.h b/static_core/runtime/mem/gc/gc_adaptive_stack.h index 0302d80ee24f3c56179eeb4ab6d6eaf95751291d..435f291944c96b6417c678479c2c2d30ef9c87d3 100644 --- a/static_core/runtime/mem/gc/gc_adaptive_stack.h +++ b/static_core/runtime/mem/gc/gc_adaptive_stack.h @@ -17,7 +17,7 @@ #include "runtime/mem/gc/gc_root_type.h" #include "runtime/mem/gc/workers/gc_workers_tasks.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/gc/g1/object_ref.h" namespace ark::mem { diff --git a/static_core/runtime/mem/gc/gc_barrier_set.h b/static_core/runtime/mem/gc/gc_barrier_set.h index 3c0a0927bf52301b00cc31ce5f939cac56e7f4b1..fea6400cce3553678633a3df1c743b781ab5306e 100644 --- a/static_core/runtime/mem/gc/gc_barrier_set.h +++ b/static_core/runtime/mem/gc/gc_barrier_set.h @@ -17,7 +17,8 @@ #include "libarkbase/mem/gc_barrier.h" #include "libarkbase/mem/ringbuf/lock_free_ring_buffer.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_map.h" +#include "runtime/include/mem/panda_vector.h" #include "runtime/include/mem/panda_string.h" #include "runtime/mem/gc/card_table.h" diff --git a/static_core/runtime/mem/gc/gc_queue.h b/static_core/runtime/mem/gc/gc_queue.h index 89cd597099c935ee096e348b8da3f329be902315..20f3ac0aafa36ee75216d724360bc32ca493ae33 100644 --- a/static_core/runtime/mem/gc/gc_queue.h +++ b/static_core/runtime/mem/gc/gc_queue.h @@ -19,8 +19,8 @@ #include #include "runtime/include/gc_task.h" -#include "runtime/include/mem/panda_containers.h" #include "runtime/include/mem/panda_smart_pointers.h" +#include "runtime/include/mem/panda_queue.h" namespace ark::mem { diff --git a/static_core/runtime/mem/gc/gc_root.h b/static_core/runtime/mem/gc/gc_root.h index 6058cebd46ff2febe97ebba6a47b0c37515db1ce..2de1c9844ccf86b1dcd6729e7c2991b2057f9aa9 100644 --- a/static_core/runtime/mem/gc/gc_root.h +++ b/static_core/runtime/mem/gc/gc_root.h @@ -21,9 +21,8 @@ #include "libarkbase/mem/mem.h" #include "libarkbase/mem/mem_range.h" -#include "runtime/include/class.h" #include "runtime/include/language_config.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/interpreter/frame.h" #include "runtime/mem/gc/card_table.h" #include "runtime/mem/gc/gc_root_type.h" diff --git a/static_core/runtime/mem/gc/gc_stats.h b/static_core/runtime/mem/gc/gc_stats.h index 26abf1ee7590b8c36a3c191e87bb9e0d5a3fff3a..3513d75a2ef88c425540257048873a0e10ad99a4 100644 --- a/static_core/runtime/mem/gc/gc_stats.h +++ b/static_core/runtime/mem/gc/gc_stats.h @@ -17,7 +17,7 @@ #include "libarkbase/os/mutex.h" #include "runtime/include/histogram-inl.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "runtime/include/time_utils.h" #include "runtime/mem/gc/gc_types.h" diff --git a/static_core/runtime/mem/gc/reference-processor/reference_processor.h b/static_core/runtime/mem/gc/reference-processor/reference_processor.h index fd6fb9193431f0e8c314a694d5a0b1f143b3c23e..53293475ef989b30aa45300efe7afd85fd71d4f4 100644 --- a/static_core/runtime/mem/gc/reference-processor/reference_processor.h +++ b/static_core/runtime/mem/gc/reference-processor/reference_processor.h @@ -18,7 +18,7 @@ #include "libarkbase/macros.h" #include "runtime/include/coretypes/tagged_value.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/gc/gc_root.h" #include "runtime/mem/gc/gc.h" diff --git a/static_core/runtime/mem/gc/static/gc_marker_static-inl.h b/static_core/runtime/mem/gc/static/gc_marker_static-inl.h index 6087804ceffd020931185da844d315b7bb7a6a5f..744d53fcd8f074fcc911b6b09e6e3668a63fa5ff 100644 --- a/static_core/runtime/mem/gc/static/gc_marker_static-inl.h +++ b/static_core/runtime/mem/gc/static/gc_marker_static-inl.h @@ -18,6 +18,7 @@ #include "runtime/mem/gc/gc_marker.h" #include "runtime/mem/gc/workers/gc_workers_task_pool.h" +#include "runtime/include/object_header-inl.h" namespace ark::mem { diff --git a/static_core/runtime/mem/gc/workers/gc_workers_tasks.h b/static_core/runtime/mem/gc/workers/gc_workers_tasks.h index 8846d7b84313e1e2fea7a7a5510e75a736e4dee9..f661b87b40edcf079095b544b859892aa4708a8f 100644 --- a/static_core/runtime/mem/gc/workers/gc_workers_tasks.h +++ b/static_core/runtime/mem/gc/workers/gc_workers_tasks.h @@ -19,6 +19,7 @@ #include "runtime/mem/gc/g1/ref_updater.h" #include "runtime/mem/gc/gc_root.h" #include "runtime/thread_pool_queue.h" +#include "runtime/include/mem/panda_deque.h" #include "libarkbase/utils/range.h" namespace ark::mem { diff --git a/static_core/runtime/mem/heap_manager.cpp b/static_core/runtime/mem/heap_manager.cpp index e523e079703a1272b39a06bea8bca6606ad78632..805d5f06f00b20f5cb10aca058e89c22599e3714 100644 --- a/static_core/runtime/mem/heap_manager.cpp +++ b/static_core/runtime/mem/heap_manager.cpp @@ -21,7 +21,9 @@ #include "libarkbase/mem/mmap_mem_pool-inl.h" #include "libarkbase/mem/pool_manager.h" +#include "libarkbase/mem/weighted_adaptive_tlab_average.h" #include "runtime/handle_base-inl.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/locks.h" #include "runtime/include/runtime_notification.h" #include "runtime/include/thread_scopes.h" diff --git a/static_core/runtime/mem/heap_manager.h b/static_core/runtime/mem/heap_manager.h index 94ea03db48b0ef9c4cac9d146c8873a3bf9eb91a..656d65ef0345066da1e593ad0bf83f902d5d6613 100644 --- a/static_core/runtime/mem/heap_manager.h +++ b/static_core/runtime/mem/heap_manager.h @@ -20,9 +20,8 @@ #include "libarkbase/utils/logger.h" #include "libarkbase/macros.h" -#include "runtime/include/class.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/object_header.h" #include "runtime/include/thread.h" #include "runtime/mem/frame_allocator-inl.h" @@ -33,6 +32,7 @@ namespace ark { // Forward declaration +class Class; class Runtime; class PandaVM; class RuntimeNotificationManager; diff --git a/static_core/runtime/mem/heap_verifier.cpp b/static_core/runtime/mem/heap_verifier.cpp index f14bd00f5ec9dca6ab72320934fd3480cccdc347..d0e99b11313b43673795a9db3943fbb91c8c8f90 100644 --- a/static_core/runtime/mem/heap_verifier.cpp +++ b/static_core/runtime/mem/heap_verifier.cpp @@ -15,6 +15,7 @@ #include "runtime/include/runtime.h" #include "runtime/include/panda_vm.h" +#include "runtime/include/class-inl.h" #include "runtime/mem/gc/gc_root.h" #include "runtime/mem/heap_verifier.h" diff --git a/static_core/runtime/mem/humongous_obj_allocator.h b/static_core/runtime/mem/humongous_obj_allocator.h index 4289305fbf8773569283d82f58e86901ee9d2980..1df640a418bddfbb00433240d918c08be3ff53a5 100644 --- a/static_core/runtime/mem/humongous_obj_allocator.h +++ b/static_core/runtime/mem/humongous_obj_allocator.h @@ -19,7 +19,6 @@ #include "libarkbase/macros.h" #include "libarkbase/mem/mem.h" -#include "libarkbase/mem/pool_manager.h" #include "libarkbase/mem/space.h" #include "libarkbase/utils/logger.h" #include "runtime/mem/runslots.h" diff --git a/static_core/runtime/mem/internal_allocator.h b/static_core/runtime/mem/internal_allocator.h index f3e4e92c5d7411899044a7b3786f178c67edaba4..dbc98f6e512d25afe1a7946406a3881bb7837cc3 100644 --- a/static_core/runtime/mem/internal_allocator.h +++ b/static_core/runtime/mem/internal_allocator.h @@ -18,7 +18,7 @@ #include #include "libarkbase/concepts.h" -#include "libarkbase/mem/mmap_mem_pool-inl.h" +//#include "libarkbase/mem/mmap_mem_pool-inl.h" #include "libarkbase/mem/pool_manager.h" #include "libarkbase/os/mutex.h" #include "runtime/mem/freelist_allocator.h" diff --git a/static_core/runtime/mem/lock_config_helper.h b/static_core/runtime/mem/lock_config_helper.h index a0cae60b5dbdc163a9cc70ac3682de17efee6f27..bbbff435b533571413becc5708ab374033433309 100644 --- a/static_core/runtime/mem/lock_config_helper.h +++ b/static_core/runtime/mem/lock_config_helper.h @@ -19,7 +19,7 @@ namespace ark { enum LangTypeT : bool { LANG_TYPE_STATIC, LANG_TYPE_DYNAMIC }; -enum MTModeT { MT_MODE_SINGLE, MT_MODE_MULTI, MT_MODE_TASK }; +enum MTModeT : uint8_t { MT_MODE_SINGLE, MT_MODE_MULTI, MT_MODE_TASK }; namespace mem { diff --git a/static_core/runtime/mem/mem_stats_additional_info.h b/static_core/runtime/mem/mem_stats_additional_info.h index 79cad50d8e0345b2f64b3b856d66046f3b52afb5..8e8a3a0d77197ce8e2e0b158337d941653cf823a 100644 --- a/static_core/runtime/mem/mem_stats_additional_info.h +++ b/static_core/runtime/mem/mem_stats_additional_info.h @@ -17,7 +17,7 @@ #include -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/mem_stats.h" namespace ark::mem { diff --git a/static_core/runtime/mem/memory_manager.h b/static_core/runtime/mem/memory_manager.h index cc89df60b67f61b4cc671a670a4053b6bf4f1b6b..27f1aa2127303abea3748b3eba3cd7068a85154d 100644 --- a/static_core/runtime/mem/memory_manager.h +++ b/static_core/runtime/mem/memory_manager.h @@ -23,6 +23,7 @@ #include "runtime/mem/lock_config_helper.h" namespace ark { +class LanguageContext; class RuntimeOptions; } // namespace ark namespace ark::mem { diff --git a/static_core/runtime/mem/object_helpers-inl.h b/static_core/runtime/mem/object_helpers-inl.h index 9a96ba3128dcedde1ec01fcf10a0ee796745a5af..3f5ad3cda5190f4c6b64bf87927c98000ffe012d 100644 --- a/static_core/runtime/mem/object_helpers-inl.h +++ b/static_core/runtime/mem/object_helpers-inl.h @@ -18,6 +18,7 @@ #include "runtime/mem/object_helpers.h" #include "runtime/include/class.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/coretypes/array-inl.h" #include "runtime/include/coretypes/dyn_objects.h" #include "runtime/include/coretypes/line_string.h" diff --git a/static_core/runtime/mem/object_helpers.cpp b/static_core/runtime/mem/object_helpers.cpp index 25caf5c6b91d78bd3c5452a03f451158c6c0ecdd..15b162728daa8028a6a9fb6fa09755815d64fa2a 100644 --- a/static_core/runtime/mem/object_helpers.cpp +++ b/static_core/runtime/mem/object_helpers.cpp @@ -20,6 +20,7 @@ #include "runtime/mem/object_helpers-inl.h" #include "libarkbase/utils/utf.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/thread.h" #include "runtime/include/panda_vm.h" #include "runtime/include/coretypes/string.h" diff --git a/static_core/runtime/mem/refstorage/global_object_storage.cpp b/static_core/runtime/mem/refstorage/global_object_storage.cpp index 002edc599795e241a62b76bde4d63d9ff3f132df..0fb70960f350341c06561cf20dff8ccd5d70cd51 100644 --- a/static_core/runtime/mem/refstorage/global_object_storage.cpp +++ b/static_core/runtime/mem/refstorage/global_object_storage.cpp @@ -16,7 +16,7 @@ #include #include "runtime/include/runtime.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/object_header.h" #include "runtime/mem/object_helpers.h" #include "runtime/mem/gc/gc.h" diff --git a/static_core/runtime/mem/refstorage/global_object_storage.h b/static_core/runtime/mem/refstorage/global_object_storage.h index 2b35fef2af41efb7ffe418a59c7e60b81044ac06..dedb0598163e7b6cfbac6127e9820be43afb0470 100644 --- a/static_core/runtime/mem/refstorage/global_object_storage.h +++ b/static_core/runtime/mem/refstorage/global_object_storage.h @@ -18,7 +18,7 @@ #include #include "runtime/include/runtime.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/object_header.h" #include "runtime/mem/object_helpers.h" #include "runtime/mem/gc/gc.h" diff --git a/static_core/runtime/mem/refstorage/reference_storage.cpp b/static_core/runtime/mem/refstorage/reference_storage.cpp index f51413b46fb8c9bcde435893a3545e0074b242aa..2b8fa80002721205bd47113be71465df536ea302 100644 --- a/static_core/runtime/mem/refstorage/reference_storage.cpp +++ b/static_core/runtime/mem/refstorage/reference_storage.cpp @@ -18,6 +18,7 @@ #include "libarkbase/mem/mem.h" #include "libarkbase/utils/dfx.h" #include "runtime/include/thread.h" +#include "runtime/include/class-inl.h" #include "runtime/mem/object_helpers.h" #include "runtime/mem/refstorage/global_object_storage.h" #include "runtime/mem/gc/gc_root.h" diff --git a/static_core/runtime/mem/region_allocator.h b/static_core/runtime/mem/region_allocator.h index 81500f5abba9968d9440b70c2a4bf2172aba3135..60d7ca9bcbe7a618cddc35b63ed046786a1ddab5 100644 --- a/static_core/runtime/mem/region_allocator.h +++ b/static_core/runtime/mem/region_allocator.h @@ -18,6 +18,8 @@ #include #include +#include "runtime/include/mem/panda_vector.h" +#include "runtime/include/mem/panda_map.h" #include "runtime/mem/region_space.h" namespace ark { diff --git a/static_core/runtime/mem/region_space.h b/static_core/runtime/mem/region_space.h index b6d3f394c2f90b76a41ff9faec717d92e62082c2..5c46ca828cdeebbd0aff91087ad1fe2479374c2f 100644 --- a/static_core/runtime/mem/region_space.h +++ b/static_core/runtime/mem/region_space.h @@ -19,7 +19,7 @@ #include #include "libarkbase/utils/list.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" #include "runtime/mem/object_helpers.h" #include "runtime/mem/tlab.h" #include "runtime/mem/rem_set.h" diff --git a/static_core/runtime/mem/rem_set.h b/static_core/runtime/mem/rem_set.h index 287677babd19c9326c8bc3dfeba5f66ea4728165..8f0f4becf6dc04e2c3f22bfffeab2a640d64b92e 100644 --- a/static_core/runtime/mem/rem_set.h +++ b/static_core/runtime/mem/rem_set.h @@ -17,7 +17,8 @@ #define PANDA_MEM_GC_G1_REM_SET_H #include -#include +#include "runtime/include/mem/panda_unordered_set.h" +#include "runtime/include/mem/panda_unordered_map.h" namespace ark::mem { diff --git a/static_core/runtime/method.cpp b/static_core/runtime/method.cpp index cd399085e6ce0fe146a9bf80fa7e9b97f5851266..69cda02782500e2ad56780b375370150960c60f1 100644 --- a/static_core/runtime/method.cpp +++ b/static_core/runtime/method.cpp @@ -18,6 +18,7 @@ #include "runtime/entrypoints/entrypoints.h" #include "runtime/jit/profiling_data.h" #include "runtime/include/class_linker-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/include/exceptions.h" #include "runtime/include/locks.h" #include "runtime/include/mem/panda_smart_pointers.h" diff --git a/static_core/runtime/methodtrace/trace.cpp b/static_core/runtime/methodtrace/trace.cpp index 7d952bee4e362fd22a02dbea316a894464727d1e..e84cc2737af9dad2a71be032519010ed8dfe36d7 100644 --- a/static_core/runtime/methodtrace/trace.cpp +++ b/static_core/runtime/methodtrace/trace.cpp @@ -36,7 +36,7 @@ static uint64_t SystemMicroSecond() { timespec current {}; clock_gettime(CLOCK_MONOTONIC, ¤t); - // NOTE(ht): Deleting OS-specific code, move to libpandabase, issue #3210 + // NOTE(ht): Deleting OS-specific code, move to libarkbase, issue #3210 return static_cast(current.tv_sec) * UINT64_C(1000000) + // 1000000 - time static_cast(current.tv_nsec) / UINT64_C(1000); // 1000 - time } @@ -45,7 +45,7 @@ static uint64_t RealTimeSecond() { timespec current {}; clock_gettime(CLOCK_REALTIME, ¤t); - // NOTE(ht): Deleting OS-specific code, move to libpandabase, issue #3210 + // NOTE(ht): Deleting OS-specific code, move to libarkbase, issue #3210 return static_cast(current.tv_sec); } @@ -60,7 +60,7 @@ static uint64_t GetCpuMicroSecond() ThreadCpuClock(threadSelf, &clockId); timespec current {}; clock_gettime(clockId, ¤t); - // NOTE(ht): Deleting OS-specific code, move to libpandabase, issue #3210 + // NOTE(ht): Deleting OS-specific code, move to libarkbase, issue #3210 return static_cast(current.tv_sec) * UINT64_C(1000000) + // 1000000 - time static_cast(current.tv_nsec) / UINT64_C(1000); // 1000 - time } diff --git a/static_core/runtime/methodtrace/trace.h b/static_core/runtime/methodtrace/trace.h index 0fb35b04852c859b07395e86f71feecb6bf0a701..2f856b8e4d339af562499614c4d62d8aa68b4c0b 100644 --- a/static_core/runtime/methodtrace/trace.h +++ b/static_core/runtime/methodtrace/trace.h @@ -17,7 +17,7 @@ #define PANDA_RUNTIME_DPROFILER_TRACE_H_ #include "libarkbase/macros.h" -#include "include/mem/panda_containers.h" + #include "include/mem/panda_string.h" #include "include/mem/panda_smart_pointers.h" #include "include/runtime.h" diff --git a/static_core/runtime/monitor_pool.h b/static_core/runtime/monitor_pool.h index d4c7e7444e3ea4cb882a31fd8c16ec764ff809fa..7e1d082331abb5ea38222b085bd74df5d2beede3 100644 --- a/static_core/runtime/monitor_pool.h +++ b/static_core/runtime/monitor_pool.h @@ -16,12 +16,13 @@ #define PANDA_RUNTIME_MONITOR_POOL_H_ #include "libarkbase/os/mutex.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/object_header.h" #include "runtime/mark_word.h" #include "runtime/mem/heap_manager.h" #include "runtime/mem/internal_allocator.h" #include "runtime/monitor.h" +#include "runtime/include/mem/panda_set.h" namespace ark { diff --git a/static_core/runtime/object_header.cpp b/static_core/runtime/object_header.cpp index 4167d203f1f975bc0fe83bfcd36aadb9aa266891..cf8607374b7abb9dbde96e639548c906cb437841 100644 --- a/static_core/runtime/object_header.cpp +++ b/static_core/runtime/object_header.cpp @@ -17,6 +17,7 @@ #include "libarkbase/mem/mem.h" #include "runtime/include/class.h" +#include "runtime/include/class-inl.h" #include "runtime/include/coretypes/array.h" #include "runtime/include/coretypes/class.h" #include "runtime/include/coretypes/string.h" diff --git a/static_core/runtime/osr.h b/static_core/runtime/osr.h index 88c8f522f298e8c86d402cc1fddb1e2c4b75fe4b..9305df9ed6a6553871c61cda169dfa303ed5954f 100644 --- a/static_core/runtime/osr.h +++ b/static_core/runtime/osr.h @@ -17,6 +17,7 @@ #include "libarkbase/macros.h" #include "runtime/include/cframe.h" +#include "runtime/include/mem/panda_map.h" #include "runtime/interpreter/frame.h" #include "libarkbase/os/mutex.h" #include "include/method.h" diff --git a/static_core/runtime/panda_vm.cpp b/static_core/runtime/panda_vm.cpp index e8142713353b660f04b6b24efe940c1c24935658..79fa7843ba3776c34b573df639c1f43a9b7a5712 100644 --- a/static_core/runtime/panda_vm.cpp +++ b/static_core/runtime/panda_vm.cpp @@ -17,6 +17,7 @@ #include "mem/lock_config_helper.h" #include "runtime/default_debugger_agent.h" +#include "runtime/include/coretypes/string.h" #include "runtime/include/runtime.h" #include "runtime/include/runtime_options.h" #include "runtime/include/runtime_notification.h" diff --git a/static_core/runtime/profilesaver/profile_dump_info.h b/static_core/runtime/profilesaver/profile_dump_info.h index 87f444c309b47a3e92f0a5cc78ee31e19ebcd63b..bba5c3df4050ae85fcff569df3e11b4f39e43819 100644 --- a/static_core/runtime/profilesaver/profile_dump_info.h +++ b/static_core/runtime/profilesaver/profile_dump_info.h @@ -23,7 +23,10 @@ #include "libarkbase/utils/logger.h" #include "libarkfile/file.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" +#include "runtime/include/mem/panda_unordered_set.h" +#include "runtime/include/mem/panda_set.h" +#include "runtime/include/mem/panda_map.h" #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mem/panda_string.h" diff --git a/static_core/runtime/profilesaver/profile_saver.h b/static_core/runtime/profilesaver/profile_saver.h index 143d430941a54d7d5449b436129b61b91560ab9d..39fd36ba545c329b9a33997d6956266a23cfef1f 100644 --- a/static_core/runtime/profilesaver/profile_saver.h +++ b/static_core/runtime/profilesaver/profile_saver.h @@ -26,7 +26,7 @@ #include "libarkbase/macros.h" #include "libarkbase/os/mutex.h" #include "libarkbase/utils/logger.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "runtime/profilesaver/profile_dump_info.h" diff --git a/static_core/runtime/profiling/profiling.h b/static_core/runtime/profiling/profiling.h index ca92a9a4c1b65223aad9c0ccfb481a80df109880..eb01d8209ae6df885423896533cbd1f346aebdd2 100644 --- a/static_core/runtime/profiling/profiling.h +++ b/static_core/runtime/profiling/profiling.h @@ -16,10 +16,9 @@ #ifndef PANDA_PROFILING_H #define PANDA_PROFILING_H -#include "libarkfile/bytecode_instruction.h" -#include +#include "libarkfile/include/source_lang_enum.h" #include "libarkbase/utils/expected.h" -#include "runtime/include/profiling_gen.h" + #include #include diff --git a/static_core/runtime/runtime.cpp b/static_core/runtime/runtime.cpp index b70ce03d4dfb70ebd070542b03885a7e8d721041..19933a03cfa043e2c64b3ced2b95f8a4a538486e 100644 --- a/static_core/runtime/runtime.cpp +++ b/static_core/runtime/runtime.cpp @@ -34,7 +34,6 @@ #include "libarkbase/os/mem_hooks.h" #include "libarkbase/os/native_stack.h" #include "libarkbase/os/thread.h" -#include "libarkbase/utils/arena_containers.h" #include "libarkbase/utils/logger.h" #include "libarkbase/utils/dfx.h" #include "libarkbase/utils/utf.h" @@ -48,6 +47,7 @@ #include "runtime/dprofiler/dprofiler.h" #include "runtime/entrypoints/entrypoints.h" #include "runtime/include/class_linker_extension.h" +#include "runtime/include/class-inl.h" #include "runtime/include/coretypes/array-inl.h" #include "runtime/include/coretypes/string.h" #include "runtime/include/language_context.h" diff --git a/static_core/runtime/runtime_controller.cpp b/static_core/runtime/runtime_controller.cpp index 4af90aa2d9d25548a2b84413357903e1ac6e2137..53d443bae3fb3eeaa59805683653b7e4892d3cff 100644 --- a/static_core/runtime/runtime_controller.cpp +++ b/static_core/runtime/runtime_controller.cpp @@ -22,7 +22,7 @@ #include #include "libarkbase/utils/logger.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" namespace ark { diff --git a/static_core/runtime/signal_handler.h b/static_core/runtime/signal_handler.h index 4482028681908bc462c47b657144a0e360f75f55..90eb510f683f6da24e3b48baabbe7b416d2e02f3 100644 --- a/static_core/runtime/signal_handler.h +++ b/static_core/runtime/signal_handler.h @@ -21,7 +21,7 @@ #include #include #include -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" #include "libarkbase/os/sighook.h" namespace ark { diff --git a/static_core/runtime/string_table.h b/static_core/runtime/string_table.h index 48ff5c7fab3a3a806e8707521a979491d30f213a..90b994c6a7e1e6977c374b137881f13faa87ceea 100644 --- a/static_core/runtime/string_table.h +++ b/static_core/runtime/string_table.h @@ -19,9 +19,8 @@ #include "libarkbase/mem/mem.h" #include "libarkbase/os/mutex.h" -#include "runtime/include/coretypes/string.h" #include "runtime/include/language_context.h" -#include "runtime/include/mem/panda_containers.h" + namespace ark { diff --git a/static_core/runtime/tests/c2i_bridge_test.cpp b/static_core/runtime/tests/c2i_bridge_test.cpp index 2c7c743292f926bb89fa00d7087d9c36765b4b0a..7d22700d0ef484245bfed1e5db2450f70b423a04 100644 --- a/static_core/runtime/tests/c2i_bridge_test.cpp +++ b/static_core/runtime/tests/c2i_bridge_test.cpp @@ -31,6 +31,7 @@ #include "runtime/include/method.h" #include "runtime/include/runtime.h" #include "runtime/include/thread.h" +#include "runtime/include/class-inl.h" #include "runtime/tests/interpreter/test_runtime_interface.h" #include "invokation_helper.h" diff --git a/static_core/runtime/tests/compilation_status_test.cpp b/static_core/runtime/tests/compilation_status_test.cpp index 89bcc80f610c377c3168a33b18e263ecd6d3294b..382ff8de3066b15a7f86b6ba0784ab4e91a14317 100644 --- a/static_core/runtime/tests/compilation_status_test.cpp +++ b/static_core/runtime/tests/compilation_status_test.cpp @@ -20,6 +20,7 @@ #include "assembly-parser.h" #include "runtime/include/method.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" #include "runtime/compiler.h" diff --git a/static_core/runtime/tests/compiler_thread_pool.cpp b/static_core/runtime/tests/compiler_thread_pool.cpp index da3e126d0fb098852de7f18a75c04ff55b7f39f1..efd69d026b16df9c3031c79e407e6f5e809b69f8 100644 --- a/static_core/runtime/tests/compiler_thread_pool.cpp +++ b/static_core/runtime/tests/compiler_thread_pool.cpp @@ -20,6 +20,7 @@ #include "assembly-parser.h" #include "runtime/include/method.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" #include "runtime/compiler.h" diff --git a/static_core/runtime/tests/exception_test.cpp b/static_core/runtime/tests/exception_test.cpp index 67b5274a187bac7201a599f4927144342c2512b0..8c6480b9ffa30cbf7474c13064e839179b82b18b 100644 --- a/static_core/runtime/tests/exception_test.cpp +++ b/static_core/runtime/tests/exception_test.cpp @@ -22,6 +22,7 @@ #include "runtime/entrypoints/entrypoints.h" #include "runtime/include/method.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" namespace ark::test { diff --git a/static_core/runtime/tests/interpreter_test_resolve_ctor_class.cpp b/static_core/runtime/tests/interpreter_test_resolve_ctor_class.cpp index 5d0b1ead6b71f1fac8a910e326520c3f06fefbd4..2276913dfb650a66f8a91e2171e2229d6b5ac31c 100644 --- a/static_core/runtime/tests/interpreter_test_resolve_ctor_class.cpp +++ b/static_core/runtime/tests/interpreter_test_resolve_ctor_class.cpp @@ -35,6 +35,7 @@ #include "libarkfile/value.h" #include "runtime/bridge/bridge.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" #include "runtime/include/compiler_interface.h" #include "runtime/include/mem/allocator.h" #include "runtime/include/method.h" diff --git a/static_core/runtime/tests/interpreter_test_resolve_field.cpp b/static_core/runtime/tests/interpreter_test_resolve_field.cpp index 643affad228c4d507b904f2b1525d3bc25c1df97..31e68cec4266cb82ab69a8d7171c47dcf436e32c 100644 --- a/static_core/runtime/tests/interpreter_test_resolve_field.cpp +++ b/static_core/runtime/tests/interpreter_test_resolve_field.cpp @@ -36,6 +36,7 @@ #include "libarkfile/value.h" #include "runtime/bridge/bridge.h" #include "runtime/include/class_linker.h" +#include "runtime/include/class-inl.h" #include "runtime/include/compiler_interface.h" #include "runtime/include/mem/allocator.h" #include "runtime/include/method.h" diff --git a/static_core/runtime/tests/interpreter_test_switch.cpp b/static_core/runtime/tests/interpreter_test_switch.cpp index ff26483379c8cb490ec30bd07d160cd7be770c54..a72c9206ba4c23c371217b2943f1a16e1eb76eb6 100644 --- a/static_core/runtime/tests/interpreter_test_switch.cpp +++ b/static_core/runtime/tests/interpreter_test_switch.cpp @@ -20,6 +20,7 @@ #include "libarkfile/bytecode_instruction.h" #include "include/thread_scopes.h" #include "libarkfile/bytecode_instruction-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/include/managed_thread.h" #include "runtime/include/runtime.h" #include "runtime/include/runtime_notification.h" diff --git a/static_core/runtime/tests/method_test.cpp b/static_core/runtime/tests/method_test.cpp index 15835efada1cf4753348146a201af51d6bfa9858..353936794ad167a546a76596c8bf56874f275d88 100644 --- a/static_core/runtime/tests/method_test.cpp +++ b/static_core/runtime/tests/method_test.cpp @@ -24,6 +24,7 @@ #include "runtime/entrypoints/entrypoints.h" #include "runtime/include/compiler_interface.h" #include "runtime/include/method-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/include/runtime.h" namespace ark::test { diff --git a/static_core/runtime/tests/object_helpers_test.cpp b/static_core/runtime/tests/object_helpers_test.cpp index 7b1a8459d047216a0ddba3e105d98be888264d4e..9c88ddb9559889d42eea9c9018b66d90dabb2dd5 100644 --- a/static_core/runtime/tests/object_helpers_test.cpp +++ b/static_core/runtime/tests/object_helpers_test.cpp @@ -20,6 +20,7 @@ #include "runtime/include/panda_vm.h" #include "runtime/include/class_linker.h" #include "runtime/include/thread_scopes.h" +#include "runtime/include/object_accessor-inl.h" #include "runtime/mem/vm_handle.h" #include "runtime/handle_scope-inl.h" #include "runtime/include/coretypes/array.h" diff --git a/static_core/runtime/tests/osr_code_test.cpp b/static_core/runtime/tests/osr_code_test.cpp index 6b4e848ea6f21abdcb839cb3fc4ec60b443f9611..57b64d280015f3258cb343c132283f43ec22b3aa 100644 --- a/static_core/runtime/tests/osr_code_test.cpp +++ b/static_core/runtime/tests/osr_code_test.cpp @@ -20,6 +20,7 @@ #include "assembly-parser.h" #include "runtime/include/method.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" #include "runtime/compiler.h" diff --git a/static_core/runtime/tests/panda_tl_containers_test.cpp b/static_core/runtime/tests/panda_tl_containers_test.cpp index e2753d5c60d4ab4b8673ac48a39c07c1c1dd9729..7867369f960dd1ffb61d58799088f3cdd0e37b19 100644 --- a/static_core/runtime/tests/panda_tl_containers_test.cpp +++ b/static_core/runtime/tests/panda_tl_containers_test.cpp @@ -15,7 +15,7 @@ #include "gtest/gtest.h" #include "runtime/include/runtime.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/mem/runslots_allocator-inl.h" namespace ark::mem::test { diff --git a/static_core/runtime/tests/stack_walker_test.cpp b/static_core/runtime/tests/stack_walker_test.cpp index 4d97c70200165ec8ee6d1dcc9ac45205f241ca93..6f59a145338b09ee780b29ddee953f81d3777048 100644 --- a/static_core/runtime/tests/stack_walker_test.cpp +++ b/static_core/runtime/tests/stack_walker_test.cpp @@ -27,6 +27,7 @@ #include "runtime/bridge/bridge.h" #include "runtime/include/runtime.h" #include "runtime/include/stack_walker-inl.h" +#include "runtime/include/class-inl.h" #include "runtime/include/thread_scopes.h" #include "runtime/mem/refstorage/global_object_storage.h" #include "runtime/tests/test_utils.h" diff --git a/static_core/runtime/tests/static_analyzer_test.cpp b/static_core/runtime/tests/static_analyzer_test.cpp index c9bebeba09904731be9e77557ee3326c80e4e6ce..a867c8ecac45f081d0c2e9d37393b478be31c64f 100644 --- a/static_core/runtime/tests/static_analyzer_test.cpp +++ b/static_core/runtime/tests/static_analyzer_test.cpp @@ -24,6 +24,7 @@ #include "runtime/handle_scope-inl.h" #include "runtime/include/coretypes/array.h" #include "runtime/include/coretypes/line_string.h" +#include "runtime/include/object_accessor-inl.h" #include "runtime/mem/object_helpers-inl.h" namespace ark::mem { diff --git a/static_core/runtime/thread.cpp b/static_core/runtime/thread.cpp index 36ececf10fdeb6bcd385353bb78c383e8d8a10f5..d989e9d6052cfc3f84549e5bca360899f3bd115e 100644 --- a/static_core/runtime/thread.cpp +++ b/static_core/runtime/thread.cpp @@ -19,6 +19,7 @@ #include "runtime/include/thread-inl.h" #include "libarkbase/os/stacktrace.h" +#include "libarkbase/mem/weighted_adaptive_tlab_average.h" #include "runtime/handle_base-inl.h" #include "runtime/include/locks.h" #include "runtime/include/object_header-inl.h" @@ -31,6 +32,7 @@ #include "runtime/handle_scope-inl.h" #include "runtime/mem/object_helpers.h" #include "tooling/pt_thread_info.h" + #include "runtime/mem/runslots_allocator-inl.h" #include diff --git a/static_core/runtime/thread_manager.h b/static_core/runtime/thread_manager.h index 144f76437841f60e8c6881f6c893f80559dc174f..4f131b932eedc9d5555be9e36543c2bf76b0add2 100644 --- a/static_core/runtime/thread_manager.h +++ b/static_core/runtime/thread_manager.h @@ -21,7 +21,7 @@ #include "libarkbase/utils/time.h" #include "libarkbase/os/time.h" #include "runtime/include/coretypes/array-inl.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #include "runtime/include/mtmanaged_thread.h" #include "runtime/include/thread_status.h" diff --git a/static_core/runtime/thread_pool.h b/static_core/runtime/thread_pool.h index e624d79d619c69fb0f7956e793eca62a976f63aa..1c1155e70ca1005859d6b336dc264006fbee5106 100644 --- a/static_core/runtime/thread_pool.h +++ b/static_core/runtime/thread_pool.h @@ -20,7 +20,7 @@ #include "libarkbase/os/mutex.h" #include "libarkbase/os/thread.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/thread_pool_queue.h" static constexpr uint64_t TASK_WAIT_TIMEOUT = 500U; diff --git a/static_core/runtime/timing.cpp b/static_core/runtime/timing.cpp index efedfcfb55a91ca012378e03ca2750d2a5eeedbf..de6a77cf2a37e08718a6c2319d3f19a6834d4db7 100644 --- a/static_core/runtime/timing.cpp +++ b/static_core/runtime/timing.cpp @@ -14,6 +14,8 @@ */ #include "runtime/timing.h" +#include "runtime/include/mem/panda_stack.h" +#include "runtime/include/mem/panda_vector.h" #include diff --git a/static_core/runtime/timing.h b/static_core/runtime/timing.h index 211fe8e66acca0c71790c09f20bca365b0f39c30..6208d83f0661f12f5668ac8373d018fb901d6632 100644 --- a/static_core/runtime/timing.h +++ b/static_core/runtime/timing.h @@ -22,7 +22,7 @@ #include "libarkbase/os/time.h" #include "libarkbase/utils/time.h" -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" #include "runtime/include/mem/panda_string.h" namespace ark { diff --git a/static_core/runtime/tooling/debugger.h b/static_core/runtime/tooling/debugger.h index e1ddf43eef108e8d59dcf91fc4bbff866a9a55fe..dbd0e62633240aaf50de1f110a77e6b63ba8e0ac 100644 --- a/static_core/runtime/tooling/debugger.h +++ b/static_core/runtime/tooling/debugger.h @@ -21,7 +21,7 @@ #include #include -#include "include/mem/panda_containers.h" + #include "include/mem/panda_smart_pointers.h" #include "include/method.h" #include "include/panda_vm.h" diff --git a/static_core/runtime/tooling/evaluation/expression_loader.cpp b/static_core/runtime/tooling/evaluation/expression_loader.cpp index f2e4d56b4aa944a073888f05024997a64b63a060..480691b4bf1d42963a5a8fb52b37ac86f3e51887 100644 --- a/static_core/runtime/tooling/evaluation/expression_loader.cpp +++ b/static_core/runtime/tooling/evaluation/expression_loader.cpp @@ -18,6 +18,7 @@ #include "libarkbase/utils/span.h" #include "libarkfile/class_data_accessor.h" #include "runtime/include/runtime.h" +#include "runtime/include/class-inl.h" namespace ark::tooling { diff --git a/static_core/runtime/tooling/memory_allocation_dumper.h b/static_core/runtime/tooling/memory_allocation_dumper.h index af577cdafa60aa36cb07d1bc9a9e81140b173420..91c59f9b754c7753895f15fbc4a91b5c8c36decd 100644 --- a/static_core/runtime/tooling/memory_allocation_dumper.h +++ b/static_core/runtime/tooling/memory_allocation_dumper.h @@ -21,12 +21,12 @@ #include "pt_hooks_wrapper.h" #include "include/mem/panda_smart_pointers.h" -#include "include/mem/panda_containers.h" + #include "include/runtime_notification.h" #include "include/tooling/debug_interface.h" #include "libarkbase/os/mutex.h" #include "libarkbase/utils/span.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/method.h" #include "runtime/include/runtime.h" #include "runtime/include/panda_vm.h" diff --git a/static_core/runtime/tooling/pt_default_lang_extension.cpp b/static_core/runtime/tooling/pt_default_lang_extension.cpp index 0f09fd832b09b85b991b58902faa5eb988581dc4..6cf4bbac22c8ab7a60d4556d62ce64f50bd77c90 100644 --- a/static_core/runtime/tooling/pt_default_lang_extension.cpp +++ b/static_core/runtime/tooling/pt_default_lang_extension.cpp @@ -21,6 +21,7 @@ #include "include/object_header.h" #include "include/hclass.h" #include "runtime/mem/object_helpers-inl.h" +#include "runtime/include/object_header-inl.h" #include "runtime/include/coretypes/string.h" #include "runtime/include/runtime.h" diff --git a/static_core/runtime/tooling/sampler/sampling_profiler.h b/static_core/runtime/tooling/sampler/sampling_profiler.h index ffc1163b1c6038fd042454283bdc2857d9eec4d9..9647cd7062807edea8f942e15d3dfd1147d4d50e 100644 --- a/static_core/runtime/tooling/sampler/sampling_profiler.h +++ b/static_core/runtime/tooling/sampler/sampling_profiler.h @@ -23,7 +23,7 @@ #include "libarkbase/os/pipe.h" #include "runtime/include/panda_vm.h" #include "runtime/include/runtime_notification.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/tooling/sampler/sample_info.h" #include "runtime/tooling/sampler/sample_writer.h" diff --git a/static_core/runtime/vtable_builder_base.cpp b/static_core/runtime/vtable_builder_base.cpp index 1fd4e3de02da80386b0970a668e8c1c6e5d84495..2f728764540e9da834ccb11ccc19954096a2827f 100644 --- a/static_core/runtime/vtable_builder_base.cpp +++ b/static_core/runtime/vtable_builder_base.cpp @@ -14,6 +14,7 @@ */ #include "runtime/include/vtable_builder_base-inl.h" +#include "runtime/include/class-inl.h" namespace ark { diff --git a/static_core/scripts/sdk/headers.txt b/static_core/scripts/sdk/headers.txt index c4a358560d3d15f933772608c1be109a1ceaab9f..8b30f29285e345949bbe1548fef0eacc2f9237bf 100644 --- a/static_core/scripts/sdk/headers.txt +++ b/static_core/scripts/sdk/headers.txt @@ -8,4 +8,5 @@ plugins/ets runtime third_party/utils_native/base/include verification/public.h +tools/es2panda/public/contextState.h tools/es2panda/public/es2panda_lib.h diff --git a/static_core/tools/ark_js_napi_cli/ark_hz/ark_js_runtime.cpp b/static_core/tools/ark_js_napi_cli/ark_hz/ark_js_runtime.cpp index 7c4182863f1801dd77758b58e4116dc2cc442b81..947ed7a14e2558f785650c0a5541fd4366c095ca 100644 --- a/static_core/tools/ark_js_napi_cli/ark_hz/ark_js_runtime.cpp +++ b/static_core/tools/ark_js_napi_cli/ark_hz/ark_js_runtime.cpp @@ -16,7 +16,7 @@ #include "ark_hz/ark_js_runtime.h" #include #include "ark_js_runtime.h" -#include "utils/utils.h" +#include "libarkbase/utils/utils.h" #include "ecmascript/base/string_helper.h" #include "ecmascript/napi/include/jsnapi.h" diff --git a/static_core/tools/ark_js_napi_cli/js_runtime.cpp b/static_core/tools/ark_js_napi_cli/js_runtime.cpp index 818e3199b3a05a51c2091ac5e740e9b1c0ea949f..3f57311b4a3ceba40884a9fe35f10c60b7251bb4 100755 --- a/static_core/tools/ark_js_napi_cli/js_runtime.cpp +++ b/static_core/tools/ark_js_napi_cli/js_runtime.cpp @@ -16,7 +16,7 @@ #include "js_runtime.h" #include "ark_hz/ark_js_runtime.h" -#include "utils/utils.h" +#include "libarkbase/utils/utils.h" #include diff --git a/static_core/tools/ark_js_napi_cli/js_runtime.h b/static_core/tools/ark_js_napi_cli/js_runtime.h index 8b29d448fc8910c12fa139db4515d270b9916c7e..1018ff53ff2d8a388e845460dc7b476a369f473f 100755 --- a/static_core/tools/ark_js_napi_cli/js_runtime.h +++ b/static_core/tools/ark_js_napi_cli/js_runtime.h @@ -21,7 +21,7 @@ #include #include -#include "libpandabase/utils/pandargs.h" +#include "libarkbase/utils/pandargs.h" #include "native_engine/native_engine.h" namespace panda { diff --git a/static_core/tools/ark_js_napi_cli/utils/utils.cpp b/static_core/tools/ark_js_napi_cli/utils/utils.cpp index 2878db2fc5f0dfb9854b32b92f30e2968f4d74ab..9366dc9b4aec49a082ae49cba6ce7a92155a4287 100644 --- a/static_core/tools/ark_js_napi_cli/utils/utils.cpp +++ b/static_core/tools/ark_js_napi_cli/utils/utils.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "utils/utils.h" +#include "libarkbase/utils/utils.h" #include #include diff --git a/static_core/verification/absint/abs_int_inl.h b/static_core/verification/absint/abs_int_inl.h index 6d35ed2525b846ead80fb5c79c0289519530e0e8..5ecc32e7c520086bd8ff243e40954f4f6843dac8 100644 --- a/static_core/verification/absint/abs_int_inl.h +++ b/static_core/verification/absint/abs_int_inl.h @@ -18,7 +18,7 @@ #include "abs_int_inl_compat_checks.h" #include "libarkfile/file_items.h" -#include "include/mem/panda_containers.h" + #include "include/method.h" #include "include/runtime.h" #include "libarkfile/type_helper.h" diff --git a/static_core/verification/absint/exec_context.h b/static_core/verification/absint/exec_context.h index 0ed762d0c54d3a1b34b4e74146727ee83f128c33..8c05a5945405bcc1d22d251644716313dde22e6e 100644 --- a/static_core/verification/absint/exec_context.h +++ b/static_core/verification/absint/exec_context.h @@ -21,7 +21,7 @@ #include "util/addr_map.h" #include "util/hash.h" -#include "include/mem/panda_containers.h" + namespace ark::verifier { diff --git a/static_core/verification/cache/file_entity_cache.h b/static_core/verification/cache/file_entity_cache.h index e3cd8101b95a967f9aa2f3a8af19e1b2fbe59cd0..1fac21c05c4c6bd1723098de2042482e2d6d6b2d 100644 --- a/static_core/verification/cache/file_entity_cache.h +++ b/static_core/verification/cache/file_entity_cache.h @@ -23,7 +23,7 @@ #include "libarkfile/file.h" -#include "runtime/include/mem/panda_containers.h" + #include #include diff --git a/static_core/verification/cache/results_cache.cpp b/static_core/verification/cache/results_cache.cpp index 7c68ce06644e56b633fce2398ba52319d35086d4..7de029bce2f4449d6ae2b841fb14dc6f53a1db3d 100644 --- a/static_core/verification/cache/results_cache.cpp +++ b/static_core/verification/cache/results_cache.cpp @@ -18,7 +18,7 @@ #include "runtime/include/runtime.h" #include "runtime/include/mem/allocator.h" -#include "runtime/include/mem/panda_containers.h" + #include "libarkbase/os/file.h" #include "libarkbase/utils/logger.h" diff --git a/static_core/verification/cflow/cflow_info.h b/static_core/verification/cflow/cflow_info.h index 249aa7b5028c0da3f9e58eb78a8d613a16d942f5..f2c9327ce258d394fe251e3eb99aac7721466f03 100644 --- a/static_core/verification/cflow/cflow_info.h +++ b/static_core/verification/cflow/cflow_info.h @@ -20,7 +20,7 @@ #include "verification/verification_status.h" #include "runtime/include/class.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #include diff --git a/static_core/verification/config/context/context.h b/static_core/verification/config/context/context.h index 36154ef38c4dbc892874b0874d7ee16649f7bdc3..3313a520fd29d6ebd72644da071f7084e574eac2 100644 --- a/static_core/verification/config/context/context.h +++ b/static_core/verification/config/context/context.h @@ -22,7 +22,7 @@ #include "verification/util/callable.h" #include "verification/util/synchronized.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include diff --git a/static_core/verification/config/handlers/config_handler_method_options.cpp b/static_core/verification/config/handlers/config_handler_method_options.cpp index cc7cdcea70843162a05231bacad906cf84c95d57..fe296a2a1a00f1b5653ec559ca1eafa942b54b97 100644 --- a/static_core/verification/config/handlers/config_handler_method_options.cpp +++ b/static_core/verification/config/handlers/config_handler_method_options.cpp @@ -27,7 +27,7 @@ #include "literal_parser.h" #include "runtime/include/mem/panda_string.h" -#include "runtime/include/mem/panda_containers.h" + #include "libarkbase/utils/logger.h" diff --git a/static_core/verification/config/handlers/config_handler_options.cpp b/static_core/verification/config/handlers/config_handler_options.cpp index a9e201534c62d7baa73af82e972603d3c8adbf7e..10724c3ad2d75038cd43f0a8dc44b700554505dc 100644 --- a/static_core/verification/config/handlers/config_handler_options.cpp +++ b/static_core/verification/config/handlers/config_handler_options.cpp @@ -25,7 +25,7 @@ #include "runtime/include/method.h" #include "runtime/include/runtime.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "libarkbase/utils/logger.h" diff --git a/static_core/verification/config/handlers/literal_parser.h b/static_core/verification/config/handlers/literal_parser.h index d193156f68a20a9e2d1da5165a4503660d50219c..8e9346eff884fc45025d9230096929dbfeebde1c 100644 --- a/static_core/verification/config/handlers/literal_parser.h +++ b/static_core/verification/config/handlers/literal_parser.h @@ -16,7 +16,7 @@ #ifndef PANDA_VERIFIER_DEBUG_LITERAL_PARSER_H_ #define PANDA_VERIFIER_DEBUG_LITERAL_PARSER_H_ -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "verification/util/parser/parser.h" diff --git a/static_core/verification/config/options/method_options.h b/static_core/verification/config/options/method_options.h index 58d96833fc8cd352bbcc5ca33651dd3ebfe92bd4..1b875fc67e59bfb1c7980e4dbaee6f85d1692b18 100644 --- a/static_core/verification/config/options/method_options.h +++ b/static_core/verification/config/options/method_options.h @@ -16,7 +16,8 @@ #ifndef PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_H_ #define PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_H_ -#include "runtime/include/mem/panda_containers.h" +#include "runtime/include/mem/panda_vector.h" +#include "runtime/include/mem/panda_unordered_map.h" #include "runtime/include/mem/panda_string.h" #include "verification/util/flags.h" #include "verification/util/saturated_enum.h" diff --git a/static_core/verification/config/options/msg_set_parser.h b/static_core/verification/config/options/msg_set_parser.h index 6b2a325ea4131e303001498c385e2816f4661eb2..5d02c9a8fdb4742b69a0337a4cecff4c8c33bf6d 100644 --- a/static_core/verification/config/options/msg_set_parser.h +++ b/static_core/verification/config/options/msg_set_parser.h @@ -16,7 +16,7 @@ #ifndef PANDA_VERIFIER_DEBUG_MSG_SET_PARSER_H_ #define PANDA_VERIFIER_DEBUG_MSG_SET_PARSER_H_ -#include "runtime/include/mem/panda_containers.h" + #include "verification/util/parser/parser.h" #include "verifier_messages.h" diff --git a/static_core/verification/jobs/service.h b/static_core/verification/jobs/service.h index dac6974e0f3522f4e943481cf4bd99ef2fba3fee..b51401cdd1212891dc1d507efcd04d29f5d6823b 100644 --- a/static_core/verification/jobs/service.h +++ b/static_core/verification/jobs/service.h @@ -17,7 +17,7 @@ #define PANDA_VERIFIER_JOBS_SERVICE_H #include "libarkfile/include/source_lang_enum.h" -#include "runtime/include/mem/panda_containers.h" + #include "verification/type/type_system.h" diff --git a/static_core/verification/type/type_system.h b/static_core/verification/type/type_system.h index d9ab2f63a3d7137b86fd79dba797b3841a1ba4f1..189c4d5688d6d2724527b5bff6d412c16a637ca7 100644 --- a/static_core/verification/type/type_system.h +++ b/static_core/verification/type/type_system.h @@ -20,7 +20,7 @@ #include "runtime/include/class.h" #include "runtime/include/language_context.h" #include "runtime/include/method.h" -#include "runtime/include/mem/panda_containers.h" + #include "verification/type/type_type.h" #include "verification/value/variables.h" diff --git a/static_core/verification/type/type_type.cpp b/static_core/verification/type/type_type.cpp index 59c9b3ab4f84716cdc928ebb0720292da3dc957c..f5d352073593c4d8ace088e5c2f01769dda3e09e 100644 --- a/static_core/verification/type/type_type.cpp +++ b/static_core/verification/type/type_type.cpp @@ -17,6 +17,8 @@ #include "verification/type/type_system.h" #include "verification/util/mem.h" +#include "runtime/include/class-inl.h" + namespace ark::verifier { using Builtin = Type::Builtin; diff --git a/static_core/verification/util/panda_or_std.h b/static_core/verification/util/panda_or_std.h index 7d3e8a54096aa3ff5fc0842b6f05f5c8f7f1b58a..a704815329007c60b8ac84d77b77698283408fed 100644 --- a/static_core/verification/util/panda_or_std.h +++ b/static_core/verification/util/panda_or_std.h @@ -19,7 +19,7 @@ #ifdef PANDA_RAPIDCHECK #include #else -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_smart_pointers.h" #endif diff --git a/static_core/verification/util/shifted_vector.h b/static_core/verification/util/shifted_vector.h index 68b047fe44a6e74359cadeafacfe0d2bccab3056..bfcb62db2a8db23889c36b7412faf2f4c825dc99 100644 --- a/static_core/verification/util/shifted_vector.h +++ b/static_core/verification/util/shifted_vector.h @@ -16,7 +16,7 @@ #ifndef PANDA_VERIFIER_UTIL_SHIFTED_VECTOR_H_ #define PANDA_VERIFIER_UTIL_SHIFTED_VECTOR_H_ -#include "runtime/include/mem/panda_containers.h" + namespace ark::verifier { diff --git a/static_core/verification/value/variables.h b/static_core/verification/value/variables.h index 463fe4f04c4dd1a3192ceed0cf1f9dfaf79a0b12..e6461f271fed63204f06a28653a4a64d80feb7d4 100644 --- a/static_core/verification/value/variables.h +++ b/static_core/verification/value/variables.h @@ -18,7 +18,7 @@ #include "verification/util/lazy.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "util/str.h" diff --git a/static_core/verification/verification_options.h b/static_core/verification/verification_options.h index 245d004447c83b9dfc768c33bb68eb70b3306423..74b2c970c44934b1800c51a61ae384081be3746a 100644 --- a/static_core/verification/verification_options.h +++ b/static_core/verification/verification_options.h @@ -17,7 +17,7 @@ #define PANDA_VERIFICATION_OPTIONS_H_ #include "verification/public.h" -#include "runtime/include/mem/panda_containers.h" + #include "runtime/include/mem/panda_string.h" #include "verification/config/options/method_options_config.h"