diff --git a/bytecode_optimizer/bytecodeopt_options.h b/bytecode_optimizer/bytecodeopt_options.h index 69bd41a4b3d0a453ccb1bfd54a00c3c064220881..db24dc028bf2d4606b5630f8b49dce454a6a97f5 100644 --- a/bytecode_optimizer/bytecodeopt_options.h +++ b/bytecode_optimizer/bytecodeopt_options.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/canonicalization.cpp b/bytecode_optimizer/canonicalization.cpp index 690764ec678483cf34c763956c998397351408c8..a37b5d8bc89d1cd2a0eff06b3c04b325aaa5e75d 100644 --- a/bytecode_optimizer/canonicalization.cpp +++ b/bytecode_optimizer/canonicalization.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/codegen.cpp b/bytecode_optimizer/codegen.cpp index 890295126c86374e27b5c8181eb69947f05c734b..ae51dd26be58a2ca3d30d4926ca81ba1897c00fb 100644 --- a/bytecode_optimizer/codegen.cpp +++ b/bytecode_optimizer/codegen.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/reg_acc_alloc.cpp b/bytecode_optimizer/reg_acc_alloc.cpp index 4660fa464a6d2e8936f561633e64e2cafeb0acbc..3f9f0374394184016b0e88dd385a2357a7e7403a 100644 --- a/bytecode_optimizer/reg_acc_alloc.cpp +++ b/bytecode_optimizer/reg_acc_alloc.cpp @@ -20,9 +20,7 @@ namespace panda::bytecodeopt { -/** - * Decide if accumulator register gets dirty between two instructions. - */ +/// Decide if accumulator register gets dirty between two instructions. bool IsAccWriteBetween(compiler::Inst *src_inst, compiler::Inst *dst_inst) { ASSERT(src_inst != dst_inst); @@ -75,18 +73,14 @@ bool IsAccWriteBetween(compiler::Inst *src_inst, compiler::Inst *dst_inst) return false; } -/** - * Return true if Phi instruction is marked as optimizable. - */ +/// Return true if Phi instruction is marked as optimizable. inline bool RegAccAlloc::IsPhiOptimizable(compiler::Inst *phi) const { ASSERT(phi->GetOpcode() == compiler::Opcode::Phi); return phi->IsMarked(acc_marker_); } -/** - * Return true if instruction can read the accumulator. - */ +/// Return true if instruction can read the accumulator. bool RegAccAlloc::IsAccRead(compiler::Inst *inst) const { return UNLIKELY(inst->IsPhi()) ? IsPhiOptimizable(inst) : inst->IsAccRead(); @@ -109,9 +103,7 @@ bool UserNeedSwapInputs(compiler::Inst *inst, compiler::Inst *user) return user->GetInput(AccReadIndex(user)).GetInst() != inst; } -/** - * Return true if instruction can write the accumulator. - */ +/// Return true if instruction can write the accumulator. bool RegAccAlloc::IsAccWrite(compiler::Inst *inst) const { return UNLIKELY(inst->IsPhi()) ? IsPhiOptimizable(inst) : inst->IsAccWrite(); diff --git a/bytecode_optimizer/templates/codegen_intrinsics.cpp.erb b/bytecode_optimizer/templates/codegen_intrinsics.cpp.erb index 26d719b2f9140d66431e56992f9c5770d8bde8ba..d3b44741dd5519f535a73af05c20f33935ebde66 100644 --- a/bytecode_optimizer/templates/codegen_intrinsics.cpp.erb +++ b/bytecode_optimizer/templates/codegen_intrinsics.cpp.erb @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/templates/codegen_visitors.inc.erb b/bytecode_optimizer/templates/codegen_visitors.inc.erb index c7feddba479092314c7c110c374ac1fbb8ebac13..e8792266c6b2cca1ce093749e94bc99bcb5c89e8 100644 --- a/bytecode_optimizer/templates/codegen_visitors.inc.erb +++ b/bytecode_optimizer/templates/codegen_visitors.inc.erb @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/templates/insn_selection.cpp.erb b/bytecode_optimizer/templates/insn_selection.cpp.erb index 511668c2c627c0797a327c9afb5d2cb4d50f0de4..f69d24dc5b5bd74f4b395882ac0bcb04afdab1c9 100644 --- a/bytecode_optimizer/templates/insn_selection.cpp.erb +++ b/bytecode_optimizer/templates/insn_selection.cpp.erb @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/templates/reg_encoder_visitors.inc.erb b/bytecode_optimizer/templates/reg_encoder_visitors.inc.erb index 282ad4495d41d037e857ca6d3d491b5ba5cdd200..fe4335bc495a9ba4c2bfc2b0337859278791668a 100644 --- a/bytecode_optimizer/templates/reg_encoder_visitors.inc.erb +++ b/bytecode_optimizer/templates/reg_encoder_visitors.inc.erb @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/bytecode_optimizer/tests/irbuilder_test.cpp b/bytecode_optimizer/tests/irbuilder_test.cpp index 89ced3abe999d1d929bccd760dcf5c01a0957ec4..7a32ef9985797858fd958233873f9ac7f36eedd7 100644 --- a/bytecode_optimizer/tests/irbuilder_test.cpp +++ b/bytecode_optimizer/tests/irbuilder_test.cpp @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2023 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. + */ + #include "common.h" namespace panda::bytecodeopt::test { diff --git a/cmake/CodeStyle.cmake b/cmake/CodeStyle.cmake index 24503d969c484aa2a3c66fc6383251224fc9dc5f..6ed0888d541db728eedd672ca3654b4a0597f185 100644 --- a/cmake/CodeStyle.cmake +++ b/cmake/CodeStyle.cmake @@ -19,4 +19,9 @@ add_custom_target(code-style-check add_custom_target(clang-force-format COMMAND ${PANDA_ROOT}/scripts/code_style/code_style_check.py ${PANDA_ROOT} --reformat USES_TERMINAL - ) \ No newline at end of file + ) + +add_custom_target(doxygen-style-check + COMMAND ${PANDA_ROOT}/scripts/code_style/doxygen_style_check.py ${PANDA_ROOT} + USES_TERMINAL + ) diff --git a/compiler/aot/aot_builder/aot_builder.cpp b/compiler/aot/aot_builder/aot_builder.cpp index d481bc8c59af0d6104652166fb5ea66dc2eb2d18..da0547ba4ff1f577f8640a81a107c16499cd86f5 100644 --- a/compiler/aot/aot_builder/aot_builder.cpp +++ b/compiler/aot/aot_builder/aot_builder.cpp @@ -25,9 +25,7 @@ namespace panda::compiler { -/** - * Fills text section in the ELF builder by the code from the methods in AotBuilder. - */ +/// Fills text section in the ELF builder by the code from the methods in AotBuilder. class CodeDataProvider : public ElfSectionDataProvider { public: explicit CodeDataProvider(AotBuilder *aot_builder) : aot_builder_(aot_builder) {} @@ -286,9 +284,7 @@ void AotBuilder::EmitPlt(Span::WordType> ptr_view, siz } } -/** - * Add method names to the symbol table - */ +/// Add method names to the symbol table template void AotBuilder::GenerateSymbols(ElfBuilder &builder) { diff --git a/compiler/aot/aot_builder/llvm_aot_builder.h b/compiler/aot/aot_builder/llvm_aot_builder.h index 877a485476788c1cf0f726084f6002a809ed1ed0..bcad76d423a310ac586ca696aae1f0200cdb049d 100644 --- a/compiler/aot/aot_builder/llvm_aot_builder.h +++ b/compiler/aot/aot_builder/llvm_aot_builder.h @@ -49,9 +49,7 @@ public: current_bitmap_->SetBit(method_index); } - /** - * Adjust a method's header according to the supplied method - */ + /// Adjust a method's header according to the supplied method void AdjustMethodHeader(const CompiledMethod &method, size_t index) { MethodHeader &method_header = method_headers_[index]; @@ -61,9 +59,7 @@ public: current_code_size_ = RoundUp(current_code_size_, GetCodeAlignment(arch_)); } - /** - * Adjust a method stored in this aot builder according to the supplied method - */ + /// Adjust a method stored in this aot builder according to the supplied method void AdjustMethod(const CompiledMethod &method, size_t index) { ASSERT(methods_.at(index).GetMethod() == method.GetMethod()); diff --git a/compiler/optimizer/analysis/alias_analysis.cpp b/compiler/optimizer/analysis/alias_analysis.cpp index d923e391d3f61c791d3206cfa27dfca00627509a..096002234f7eef0c3d6ca9a64d7f49fd3c3a0ef5 100644 --- a/compiler/optimizer/analysis/alias_analysis.cpp +++ b/compiler/optimizer/analysis/alias_analysis.cpp @@ -395,9 +395,7 @@ AliasType AliasAnalysis::CheckMemAddress(const Pointer &p1, const Pointer &p2) c return MAY_ALIAS; } -/** - * Checks aliasing if P1 and P2 point to the one single object. - */ +/// Checks aliasing if P1 and P2 point to the one single object. /* static */ AliasType AliasAnalysis::SingleIntersectionAliasing(const Pointer &p1, const Pointer &p2, const Pointer *intersection) { @@ -545,9 +543,7 @@ void AliasAnalysis::SolveConstraints() } } -/** - * Selects the address from instruction that should be checked on alias - */ +/// Selects the address from instruction that should be checked on alias bool AliasAnalysis::ParseInstruction(Inst *inst, Pointer *pointer) { Pointer p {}; @@ -747,9 +743,7 @@ AliasAnalysis::Trilean AliasAnalysis::IsSameOffsets(const Inst *off1, const Inst return Trilean::UNKNOWN; } -/** - * Instructions that definitely are not an alias of anything. - */ +/// Instructions that definitely are not an alias of anything. void AliasAnalysis::VisitNullPtr(GraphVisitor *v, Inst *inst) { static_cast(v)->AddDirectEdge(Pointer::CreateObject(inst)); @@ -856,9 +850,7 @@ void AliasAnalysis::VisitResolveObjectFieldStatic(GraphVisitor *v, Inst *inst) } } -/** - * Instructions that introduce static fields (global variables). - */ +/// Instructions that introduce static fields (global variables). void AliasAnalysis::VisitLoadStatic(GraphVisitor *v, Inst *inst) { if (!inst->IsReferenceOrAny()) { @@ -939,9 +931,7 @@ void AliasAnalysis::VisitUnresolvedStoreStatic(GraphVisitor *v, Inst *inst) visitor->AddCopyEdge(Pointer::CreateObject(inst->GetDataFlowInput(0)), sfield); } -/** - * Instructions that introduce unique constant references (global constants). - */ +/// Instructions that introduce unique constant references (global constants). void AliasAnalysis::VisitLoadRuntimeClass(GraphVisitor *v, Inst *inst) { if (inst->IsReferenceOrAny()) { @@ -1014,9 +1004,7 @@ void AliasAnalysis::VisitLoadObjFromConst(GraphVisitor *v, Inst *inst) } } -/** - * Instructions that introduce aliases. - */ +/// Instructions that introduce aliases. void AliasAnalysis::VisitLoadArray(GraphVisitor *v, Inst *inst) { if (!inst->IsReferenceOrAny()) { diff --git a/compiler/optimizer/analysis/alias_analysis.h b/compiler/optimizer/analysis/alias_analysis.h index 9ebdff323f6ec1340b16235547cb6402dd0d71f2..d2a1c2945a5d54cec38687dba9037df3fd91771a 100644 --- a/compiler/optimizer/analysis/alias_analysis.h +++ b/compiler/optimizer/analysis/alias_analysis.h @@ -297,9 +297,7 @@ public: */ const ArenaVector &GetBlocksToVisit() const override; - /** - * Instructions that definitely are not an alias of anything. - */ + /// Instructions that definitely are not an alias of anything. static void VisitNullPtr(GraphVisitor *v, Inst *inst); static void VisitInitObject(GraphVisitor *v, Inst *inst); static void VisitNewObject(GraphVisitor *v, Inst *inst); @@ -324,18 +322,14 @@ public: static void VisitGetManagedClassObject(GraphVisitor *v, Inst *inst); static void VisitResolveObjectFieldStatic(GraphVisitor *v, Inst *inst); - /** - * Instructions that introduce static fields (global variables). - */ + /// Instructions that introduce static fields (global variables). static void VisitLoadStatic(GraphVisitor *v, Inst *inst); static void VisitLoadResolvedObjectFieldStatic(GraphVisitor *v, Inst *inst); static void VisitStoreStatic(GraphVisitor *v, Inst *inst); static void VisitStoreResolvedObjectFieldStatic(GraphVisitor *v, Inst *inst); static void VisitUnresolvedStoreStatic(GraphVisitor *v, Inst *inst); - /** - * Instructions that introduce unique constant references (global constants). - */ + /// Instructions that introduce unique constant references (global constants). static void VisitLoadRuntimeClass(GraphVisitor *v, Inst *inst); static void VisitLoadClass(GraphVisitor *v, Inst *inst); static void VisitLoadAndInitClass(GraphVisitor *v, Inst *inst); @@ -347,9 +341,7 @@ public: static void VisitUnresolvedLoadType(GraphVisitor *v, Inst *inst); static void VisitLoadObjFromConst(GraphVisitor *v, Inst *inst); - /** - * Instructions that introduce aliases. - */ + /// Instructions that introduce aliases. static void VisitLoadArray(GraphVisitor *v, Inst *inst); static void VisitStoreArray(GraphVisitor *v, Inst *inst); static void VisitLoadArrayI(GraphVisitor *v, Inst *inst); @@ -373,9 +365,7 @@ public: static void VisitLoadConstantPool(GraphVisitor *v, Inst *inst); static void VisitLoadLexicalEnv(GraphVisitor *v, Inst *inst); - /** - * Dynamic instructions - */ + /// Dynamic instructions static void VisitLoadObjectDynamic(GraphVisitor *v, Inst *inst); static void VisitStoreObjectDynamic(GraphVisitor *v, Inst *inst); static void VisitLoadFromConstantPool(GraphVisitor *v, Inst *inst); diff --git a/compiler/optimizer/analysis/bounds_analysis.cpp b/compiler/optimizer/analysis/bounds_analysis.cpp index 8ffe0122a3ccfdc07efa073343f7ebe6dd7e1ea4..f4259e382f52ad1e3d6adf13d66c6a0ab621a8f8 100644 --- a/compiler/optimizer/analysis/bounds_analysis.cpp +++ b/compiler/optimizer/analysis/bounds_analysis.cpp @@ -581,9 +581,7 @@ BoundsRange::RangePair BoundsRange::TryNarrowBoundsByCC(ConditionCode cc, Bounds return ranges; } -/** - * Return (left + right) or if overflows or underflows return max or min of range type. - */ +/// Return (left + right) or if overflows or underflows return max or min of range type. int64_t BoundsRange::AddWithOverflowCheck(int64_t left, int64_t right) { if (right == 0) { @@ -603,9 +601,7 @@ int64_t BoundsRange::AddWithOverflowCheck(int64_t left, int64_t right) return MIN_RANGE_VALUE; } -/** - * Return (left * right) or if overflows or underflows return max or min of range type. - */ +/// Return (left * right) or if overflows or underflows return max or min of range type. int64_t BoundsRange::MulWithOverflowCheck(int64_t left, int64_t right) { if (left == 0 || right == 0) { @@ -623,9 +619,7 @@ int64_t BoundsRange::MulWithOverflowCheck(int64_t left, int64_t right) return MIN_RANGE_VALUE; } -/** - * Return (left / right) or MIN_RANGE VALUE for MIN_RANGE_VALUE / -1. - */ +/// Return (left / right) or MIN_RANGE VALUE for MIN_RANGE_VALUE / -1. int64_t BoundsRange::DivWithOverflowCheck(int64_t left, int64_t right) { ASSERT(right != 0); diff --git a/compiler/optimizer/analysis/countable_loop_parser.h b/compiler/optimizer/analysis/countable_loop_parser.h index 1ebea8bbec471c4d7a9fada0521659d32a1298cd..7d211198b01f8da970e8cdd8b53d5dbdc563769a 100644 --- a/compiler/optimizer/analysis/countable_loop_parser.h +++ b/compiler/optimizer/analysis/countable_loop_parser.h @@ -36,9 +36,7 @@ struct CountableLoopInfo { bool is_inc; }; -/** - * Helper class to check if loop is countable and to get its parameters - */ +/// Helper class to check if loop is countable and to get its parameters class CountableLoopParser { public: explicit CountableLoopParser(const Loop &loop) : loop_(loop) {} diff --git a/compiler/optimizer/analysis/dominators_tree.h b/compiler/optimizer/analysis/dominators_tree.h index c8ef1a7eefeb48a2b2505ace7b5b8d11810a2c60..a1d4f0135ec85962d38aa423c41ed672585a04e8 100644 --- a/compiler/optimizer/analysis/dominators_tree.h +++ b/compiler/optimizer/analysis/dominators_tree.h @@ -23,9 +23,7 @@ namespace panda::compiler { class BasicBlock; class Graph; -/** - * This class builds dominators tree, using Lengauer-Tarjan algorithm - */ +/// This class builds dominators tree, using Lengauer-Tarjan algorithm class DominatorsTree : public Analysis { public: using BlocksVector = ArenaVector; diff --git a/compiler/optimizer/analysis/liveness_use_table.cpp b/compiler/optimizer/analysis/liveness_use_table.cpp index 4eee9763d18c380051cbe810b88a27fea5330331..921f2f2c346f07181cb889683bca5f07d993b3e8 100644 --- a/compiler/optimizer/analysis/liveness_use_table.cpp +++ b/compiler/optimizer/analysis/liveness_use_table.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/compiler/optimizer/analysis/liveness_use_table.h b/compiler/optimizer/analysis/liveness_use_table.h index ac70a13635281a64a075c682bc6c2a863c719eb2..3078aa4a09153165fda3d382c1b84bace380f30d 100644 --- a/compiler/optimizer/analysis/liveness_use_table.h +++ b/compiler/optimizer/analysis/liveness_use_table.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. @@ -22,9 +22,7 @@ namespace panda::compiler { using FixedUses = ArenaMap; -/** - * For each added instruction holds its uses on the fixed locations - */ +/// For each added instruction holds its uses on the fixed locations class UseTable { public: explicit UseTable(ArenaAllocator *allocator); diff --git a/compiler/optimizer/code_generator/callconv.h b/compiler/optimizer/code_generator/callconv.h index dd7c286440a5beb5f8c1b5558411fdd2ed29f25b..e7d16782fab566dfe40debf6bec89a3ef6ccbc31 100644 --- a/compiler/optimizer/code_generator/callconv.h +++ b/compiler/optimizer/code_generator/callconv.h @@ -90,9 +90,7 @@ struct CfiInfo { #define SET_CFI_CALLEE_VREGS(value) #endif -/** - * Specifies CallingConvention mode. - */ +/// Specifies CallingConvention mode. class CallConvMode final { public: explicit CallConvMode(uint32_t value) : value_(value) {} @@ -144,9 +142,7 @@ inline CallConvMode operator|(CallConvMode a, CallConvMode b) return CallConvMode(a.value_ | b.value_); } -/** - * Holds specific information about dynamic call mode - */ +/// Holds specific information about dynamic call mode class CallConvDynInfo { public: // Fixed parameter regs @@ -192,9 +188,7 @@ private: bool check_required_ {false}; }; -/** - * CallConv - just holds information about calling convention in current architecture. - */ +/// CallConv - just holds information about calling convention in current architecture. class CallingConvention { public: virtual ~CallingConvention() = default; diff --git a/compiler/optimizer/code_generator/codegen.h b/compiler/optimizer/code_generator/codegen.h index cceb8e618b9387c18fa5071196faa59dc5088304..b35ee353874935d91101366b901bd04570006b2a 100644 --- a/compiler/optimizer/code_generator/codegen.h +++ b/compiler/optimizer/code_generator/codegen.h @@ -201,9 +201,7 @@ public: void CreateVRegForRegister(const Location &location, Inst *inst, const VirtualRegister &vreg); - /** - * 'live_inputs' shows that inst's source registers should be added the the mask - */ + /// 'live_inputs' shows that inst's source registers should be added the the mask template std::pair GetLiveRegisters(Inst *inst) { diff --git a/compiler/optimizer/code_generator/codegen_native.h b/compiler/optimizer/code_generator/codegen_native.h index 4151e919337c35069cc20bc68e02386e948d2967..2e13ff9103ed8062f322cf6f3b9367bfa9f24ae1 100644 --- a/compiler/optimizer/code_generator/codegen_native.h +++ b/compiler/optimizer/code_generator/codegen_native.h @@ -19,9 +19,7 @@ #include "optimizer/code_generator/codegen.h" namespace panda::compiler { -/** - * CodegenNative provides support for 'Native' calling convention. - */ +/// CodegenNative provides support for 'Native' calling convention. class CodegenNative : public Codegen { public: explicit CodegenNative(Graph *graph) : Codegen(graph) {} diff --git a/compiler/optimizer/code_generator/encode.h b/compiler/optimizer/code_generator/encode.h index 20336d887d7e9b28c54ccd4d6b05527d8a089914..c1e664e82dafd67f6e20a601e80e63958deae338 100644 --- a/compiler/optimizer/code_generator/encode.h +++ b/compiler/optimizer/code_generator/encode.h @@ -854,9 +854,7 @@ public: virtual void Finalize() = 0; public: - /** - * Label-holder interfaces - */ + /// Label-holder interfaces LabelHolder::LabelId CreateLabel() { auto labels = GetLabels(); diff --git a/compiler/optimizer/code_generator/frame_info.h b/compiler/optimizer/code_generator/frame_info.h index 652c3a01aa51d20888029f3e83da30e86b36371b..422c0299ff3fac3c2647ce2a998210929a0b2e5a 100644 --- a/compiler/optimizer/code_generator/frame_info.h +++ b/compiler/optimizer/code_generator/frame_info.h @@ -25,9 +25,7 @@ namespace panda::compiler { class Encoder; class Graph; -/** - * This class describes layout of the frame being compiled. - */ +/// This class describes layout of the frame being compiled. class FrameInfo { public: explicit FrameInfo(uint32_t fields) : fields_(fields) {} diff --git a/compiler/optimizer/code_generator/operands.h b/compiler/optimizer/code_generator/operands.h index 51b0b168f872322473a5044cf2c508c543f456d4..65922064b506ba24224dc2eda28cc52b0538a3a1 100644 --- a/compiler/optimizer/code_generator/operands.h +++ b/compiler/optimizer/code_generator/operands.h @@ -120,9 +120,7 @@ class TypeInfo final { public: enum TypeId : uint8_t { INT8 = 0, INT16 = 1, INT32 = 2, INT64 = 3, FLOAT32 = 4, FLOAT64 = 5, INVALID = 6 }; - /** - * Template constructor - use template parameter for create object. - */ + /// Template constructor - use template parameter for create object. template constexpr explicit TypeInfo(T /* unused */) { @@ -160,22 +158,16 @@ public: DEFAULT_COPY_SEMANTIC(TypeInfo); ~TypeInfo() = default; - /** - * Constructor for create invalid TypeInfo - */ + /// Constructor for create invalid TypeInfo constexpr TypeInfo() = default; - /** - * Validation check - */ + /// Validation check constexpr bool IsValid() const { return type_id_ != INVALID; } - /** - * Type expected size - */ + /// Type expected size constexpr size_t GetSize() const { ASSERT(IsValid()); diff --git a/compiler/optimizer/code_generator/target/aarch32/target.h b/compiler/optimizer/code_generator/target/aarch32/target.h index ff54e20d0f67eb7d46d6325ae9fb6d828d807bc1..37329b3c010cbfcbf29ada40351ff050894de3b8 100644 --- a/compiler/optimizer/code_generator/target/aarch32/target.h +++ b/compiler/optimizer/code_generator/target/aarch32/target.h @@ -64,9 +64,7 @@ static inline bool IsConditionSigned(Condition cc) } } -/** - * Converters - */ +/// Converters static inline vixl::aarch32::Condition Convert(const Condition cc) { switch (cc) { @@ -107,9 +105,7 @@ static inline vixl::aarch32::Condition Convert(const Condition cc) } } -/** - * Converters - */ +/// Converters static inline vixl::aarch32::Condition ConvertTest(const Condition cc) { ASSERT(cc == Condition::TST_EQ || cc == Condition::TST_NE); diff --git a/compiler/optimizer/code_generator/target/aarch64/target.h b/compiler/optimizer/code_generator/target/aarch64/target.h index 3cddca5e731fc914db789ec966e68789c06fd716..90458224c00fc3d0cb2f43bd6c231107d7fd7fe6 100644 --- a/compiler/optimizer/code_generator/target/aarch64/target.h +++ b/compiler/optimizer/code_generator/target/aarch64/target.h @@ -51,9 +51,7 @@ static_assert(vixl::aarch64::kCallerSavedV.GetList() == CALLER_VREG_LIST.GetList const size_t MAX_SCALAR_PARAM_ID = 7; // r0-r7 const size_t MAX_VECTOR_PARAM_ID = 7; // v0-v7 -/** - * Converters - */ +/// Converters static inline vixl::aarch64::Condition Convert(const Condition cc) { switch (cc) { diff --git a/compiler/optimizer/code_generator/target/amd64/target.h b/compiler/optimizer/code_generator/target/amd64/target.h index b4e2457a9163328df134e09e22360a10903c8b50..b8206860039ebaaf3b5c4ff6a612793ca5e728e6 100644 --- a/compiler/optimizer/code_generator/target/amd64/target.h +++ b/compiler/optimizer/code_generator/target/amd64/target.h @@ -39,9 +39,7 @@ static inline bool IsConditionSigned(Condition cc) } } -/** - * Converters - */ +/// Converters static inline asmjit::x86::Condition::Code ArchCc(Condition cc, bool is_float = false) { switch (cc) { @@ -195,9 +193,7 @@ private: size_t count_ {0}; }; -/** - * Converters - */ +/// Converters static inline asmjit::x86::Gp ArchReg(Reg reg, uint8_t size = 0) { ASSERT(reg.IsValid()); diff --git a/compiler/optimizer/ir/analysis.h b/compiler/optimizer/ir/analysis.h index 18c00984da453a52ea7d4abdbbdd70fb18faf2db..1adbe4ec88077d4c387000048c42a1a1f5e31f49 100644 --- a/compiler/optimizer/ir/analysis.h +++ b/compiler/optimizer/ir/analysis.h @@ -22,9 +22,7 @@ namespace panda::compiler { -/** - * The file contains small analysis functions which can be used in different passes - */ +/// The file contains small analysis functions which can be used in different passes class Inst; // returns Store value, for StoreArrayPair and StoreArrayPairI saved not last store value in second_value Inst *InstStoredValue(Inst *inst, Inst **second_value); diff --git a/compiler/optimizer/ir/basicblock.cpp b/compiler/optimizer/ir/basicblock.cpp index 4b033fb2d7f3c3f3049778bb4b241b5d4bc092d3..76c587eff282d758450c1ca32ebb28af4e741219 100644 --- a/compiler/optimizer/ir/basicblock.cpp +++ b/compiler/optimizer/ir/basicblock.cpp @@ -434,8 +434,8 @@ void BasicBlock::JoinBlocksUsingSelect(BasicBlock *succ, BasicBlock *select_bb, auto other = succ->GetSuccessor(0); /** * Step 2. Generate Select(s). - We generate them in 'select_bb' if provided (another successor in Diamond case), - or in 'this' block otherwise (Triangle case). + * We generate them in 'select_bb' if provided (another successor in Diamond case), + * or in 'this' block otherwise (Triangle case). */ if (select_bb == nullptr) { select_bb = this; diff --git a/compiler/optimizer/ir/graph.cpp b/compiler/optimizer/ir/graph.cpp index a76cf1cb05c9df70b800d00a09679915e4ccc0f7..fc7cd82c1058e4ca29146e517431e32a659ee168 100644 --- a/compiler/optimizer/ir/graph.cpp +++ b/compiler/optimizer/ir/graph.cpp @@ -319,9 +319,7 @@ static void FinishBlockRemoval(BasicBlock *block) } } -/** - * @param block - a block which is disconnecting from the graph with clearing control-flow and data-flow - */ +/// @param block - a block which is disconnecting from the graph with clearing control-flow and data-flow void Graph::DisconnectBlock(BasicBlock *block, bool remove_last_inst, bool fix_dom_tree) { ASSERT(IsAnalysisValid() || !fix_dom_tree); @@ -386,9 +384,7 @@ void Graph::RestoreBlock(BasicBlock *block) InvalidateBlocksOrderAnalyzes(this); } -/** - * @param block - same for block without instructions at all - */ +/// @param block - same for block without instructions at all void Graph::RemoveEmptyBlock(BasicBlock *block) { ASSERT(IsAnalysisValid()); @@ -401,9 +397,7 @@ void Graph::RemoveEmptyBlock(BasicBlock *block) // NB! please do not forget to fix LoopAnalyzer or invalidate it after the end of the pass } -/** - * @param block - same for block without instructions, may have Phi(s) - */ +/// @param block - same for block without instructions, may have Phi(s) void Graph::RemoveEmptyBlockWithPhis(BasicBlock *block, bool irr_loop) { ASSERT(IsAnalysisValid()); diff --git a/compiler/optimizer/ir/graph.h b/compiler/optimizer/ir/graph.h index 948b27c0a944c01bde9a5bd7721fe7351ea71560..143a372aa76f8aa000065623d56ed0565739a52c 100644 --- a/compiler/optimizer/ir/graph.h +++ b/compiler/optimizer/ir/graph.h @@ -51,9 +51,7 @@ class RelocationHandler; enum AliasType : uint8_t; -/** - * Specifies graph compilation mode. - */ +/// Specifies graph compilation mode. class GraphMode { public: explicit GraphMode(uint32_t value) : value_(value) {} @@ -296,7 +294,7 @@ public: { return allocator_; } - /// Allocator for temproray usage, when allocated data is no longer needed after optimization/analysis finished. + /// Allocator for temporary usage, when allocated data is no longer needed after optimization/analysis finished. ArenaAllocator *GetLocalAllocator() const { return local_allocator_; @@ -940,9 +938,7 @@ public: // clang-format off - /** - * Create instruction by opcode - */ + /// Create instruction by opcode [[nodiscard]] Inst* CreateInst(Opcode opc) const { switch (opc) { @@ -960,9 +956,7 @@ public: return nullptr; } } - /** - * Define creation methods for all opcodes - */ + /// Define creation methods for all opcodes // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define INST_DEF(OPCODE, BASE, ...) \ template \ @@ -1136,9 +1130,7 @@ public: int64_t GetBranchCounter(const BasicBlock *block, bool true_succ); - /** - * This class provides methods for ranged-based `for` loop over all parameters in the graph. - */ + /// This class provides methods for ranged-based `for` loop over all parameters in the graph. class ParameterList { public: class Iterator { diff --git a/compiler/optimizer/ir/graph_checker.cpp b/compiler/optimizer/ir/graph_checker.cpp index 49fbfa0b5a1544cd699b19e6d3034c31009a1bd2..815867f93e50b2bd65474034c633a77d6bd42745 100644 --- a/compiler/optimizer/ir/graph_checker.cpp +++ b/compiler/optimizer/ir/graph_checker.cpp @@ -747,9 +747,7 @@ void GraphChecker::CheckLoopAnalysis() } } -/** - * Check that there is root's inner loop without exit-points - */ +/// Check that there is root's inner loop without exit-points bool GraphChecker::HasOuterInfiniteLoop() { const auto &loops = GetGraph()->GetRootLoop()->GetInnerLoops(); diff --git a/compiler/optimizer/ir/graph_cloner.cpp b/compiler/optimizer/ir/graph_cloner.cpp index bc92d632941f648612b90df6ea35265ccc6f4e40..a2c6daa1067ea7555aca768aec9d87f53637ec3b 100644 --- a/compiler/optimizer/ir/graph_cloner.cpp +++ b/compiler/optimizer/ir/graph_cloner.cpp @@ -30,9 +30,7 @@ GraphCloner::GraphCloner(Graph *graph, ArenaAllocator *allocator, ArenaAllocator { } -/** - * Clone the whole graph - */ +/// Clone the whole graph Graph *GraphCloner::CloneGraph() { auto new_graph = @@ -131,9 +129,7 @@ void GraphCloner::CloneLinearOrder([[maybe_unused]] Graph *new_graph) } } -/** - * Clone the whole graph control-flow - */ +/// Clone the whole graph control-flow void GraphCloner::BuildControlFlow() { for (const auto &block : GetGraph()->GetVectorBlocks()) { @@ -145,9 +141,7 @@ void GraphCloner::BuildControlFlow() } } -/** - * Clone the whole graph data-flow - */ +/// Clone the whole graph data-flow void GraphCloner::BuildDataFlow() { for (const auto &block : GetGraph()->GetVectorBlocks()) { @@ -295,9 +289,7 @@ GraphCloner::LoopUnrollData *GraphCloner::PrepareLoopToUnroll(Loop *loop, bool c return unroll_data; } -/** - * Update data-flow after unrolling without side-exits - */ +/// Update data-flow after unrolling without side-exits void GraphCloner::UpdateUsersAfterNoSideExitsUnroll(const LoopUnrollData *unroll_data) { auto loop = unroll_data->header->GetLoop(); @@ -862,9 +854,7 @@ GraphCloner::LoopClonerData *GraphCloner::PrepareLoopToClone(Loop *loop) return unroll_data; } -/** - * Create new loop, populate it with cloned blocks and build conrlow-flow - */ +/// Create new loop, populate it with cloned blocks and build conrlow-flow void GraphCloner::BuildLoopCloneControlFlow(LoopClonerData *unroll_data) { ASSERT(unroll_data != nullptr); @@ -892,9 +882,7 @@ void GraphCloner::BuildLoopCloneControlFlow(LoopClonerData *unroll_data) GetClone(unroll_data->header)->GetPredBlockIndex(pre_header_clone)); } -/** - * Insert cloned loop into loop-tree and populated with cloned blocks - */ +/// Insert cloned loop into loop-tree and populated with cloned blocks void GraphCloner::MakeLoopCloneInfo(LoopClonerData *unroll_data) { ASSERT(unroll_data != nullptr); @@ -922,9 +910,7 @@ void GraphCloner::MakeLoopCloneInfo(LoopClonerData *unroll_data) } } -/** - * Find or create phi in the outside_succ block with the same inputs as `check_phi` - */ +/// Find or create phi in the outside_succ block with the same inputs as `check_phi` Inst *GetPhiResolver(Inst *check_phi, BasicBlock *outside_succ, BasicBlock *pre_header) { [[maybe_unused]] constexpr auto MAX_PREDS_NUM = 2; @@ -952,9 +938,7 @@ Inst *GetPhiResolver(Inst *check_phi, BasicBlock *outside_succ, BasicBlock *pre_ return phi_resolver; } -/** - * Build data-flow for cloned instructions - */ +/// Build data-flow for cloned instructions void GraphCloner::BuildLoopCloneDataFlow(LoopClonerData *unroll_data) { ASSERT(unroll_data != nullptr); diff --git a/compiler/optimizer/ir/graph_cloner.h b/compiler/optimizer/ir/graph_cloner.h index 28dd6254208638eaf7c879771e3c4f18c90e9129..22b31dcd99b5a34f508296c5448bb655e4bfa807 100644 --- a/compiler/optimizer/ir/graph_cloner.h +++ b/compiler/optimizer/ir/graph_cloner.h @@ -305,9 +305,7 @@ private: return inst->IsMarked(clone_marker_) && (inst->GetCloneNumber() < clone_instructions_.size()); } - /** - * Clone block's instructions and append to the block's clone - */ + /// Clone block's instructions and append to the block's clone template void CloneInstructions(const BasicBlock *block, BasicBlock *clone, size_t *inst_count) { @@ -334,9 +332,7 @@ private: } } - /** - * Clone instruction and mark both: clone and cloned - */ + /// Clone instruction and mark both: clone and cloned Inst *CloneInstruction(Inst *inst, size_t *inst_count, Graph *target_graph) { inst->SetCloneNumber((*inst_count)++); diff --git a/compiler/optimizer/ir/graph_visitor.h b/compiler/optimizer/ir/graph_visitor.h index a086841bcd34ebc4b7b45b9db8927704dd038f6a..18d79f4fc25c27295408007da7f8d93d63b5aac2 100644 --- a/compiler/optimizer/ir/graph_visitor.h +++ b/compiler/optimizer/ir/graph_visitor.h @@ -80,9 +80,7 @@ public: protected: using VisitFunc = void (*)(GraphVisitor *, Inst *); - /** - * Method that will be called if derived class doesn't set handler for opcode - */ + /// Method that will be called if derived class doesn't set handler for opcode virtual void VisitDefault([[maybe_unused]] Inst *inst) {} // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) diff --git a/compiler/optimizer/ir/inst.h b/compiler/optimizer/ir/inst.h index a3f8948fe602943672b879ed9c4494f26aa35960..04f0017708983cc4cfb879a3a66d5922fb1e10a4 100644 --- a/compiler/optimizer/ir/inst.h +++ b/compiler/optimizer/ir/inst.h @@ -266,9 +266,7 @@ enum class Opcode { NUM_OPCODES }; -/** - * Convert opcode to its string representation - */ +/// Convert opcode to its string representation constexpr std::array(Opcode::NUM_OPCODES)> OPCODE_NAMES = { // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define INST_DEF(opcode, ...) #opcode, @@ -282,9 +280,7 @@ constexpr const char *GetOpcodeString(Opcode opc) return OPCODE_NAMES[static_cast(opc)]; } -/** - * Instruction flags. See `instrutions.yaml` section `flags` for more information. - */ +/// Instruction flags. See `instrutions.yaml` section `flags` for more information. namespace inst_flags { namespace internal { enum FlagsIndex { @@ -355,9 +351,7 @@ inline const char *GetShiftTypeStr(ShiftType type) return internal::SHIFT_TYPE_NAMES[type]; } -/** - * Describes type of the object produced by an instruction. - */ +/// Describes type of the object produced by an instruction. class ObjectTypeInfo { public: using ClassType = RuntimeInterface::ClassPtr; @@ -410,9 +404,7 @@ private: using VRegType = VRegInfo::VRegType; -/** - * Class for storing panda bytecode's virtual register - */ +/// Class for storing panda bytecode's virtual register class VirtualRegister final { public: using ValueType = uint16_t; @@ -484,9 +476,7 @@ constexpr size_t BITS_PER_INPUTS_NUM = 3; // Maximum number of static inputs constexpr size_t MAX_STATIC_INPUTS = (1U << BITS_PER_INPUTS_NUM) - 1; -/** - * Currently Input class is just a wrapper for the Inst class. - */ +/// Currently Input class is just a wrapper for the Inst class. class Input final { public: Input() = default; @@ -819,9 +809,7 @@ private: // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define DECLARE_INST(TYPE) void Accept(GraphVisitor *v) override -/** - * Base class for all instructions, should not be instantiated directly - */ +/// Base class for all instructions, should not be instantiated directly class InstBase { NO_COPY_SEMANTIC(InstBase); NO_MOVE_SEMANTIC(InstBase); @@ -848,9 +836,7 @@ protected: InstBase() = default; }; -/** - * Base instruction class - */ +/// Base instruction class class Inst : public MarkerSet, public InstBase { public: DECLARE_INST(Inst); @@ -1311,9 +1297,7 @@ public: bool IsReferenceOrAny() const; bool IsMovableObject() const; - /** - * Return instruction clone - */ + /// Return instruction clone virtual Inst *Clone(const Graph *target_graph) const; uintptr_t GetFlagsMask() const @@ -1361,9 +1345,7 @@ public: void InsertBefore(Inst *inst); void InsertAfter(Inst *inst); - /** - * Return true if instruction has dynamic operands storage. - */ + /// Return true if instruction has dynamic operands storage. bool IsOperandsDynamic() const { return GetField() == MAX_STATIC_INPUTS; @@ -1498,9 +1480,7 @@ public: operands->Remove(index); } - /** - * Remove all inputs - */ + /// Remove all inputs void RemoveInputs() { if (UNLIKELY(IsOperandsDynamic())) { @@ -1514,9 +1494,7 @@ public: } } - /** - * Remove all users - */ + /// Remove all users template void RemoveUsers() { @@ -2008,9 +1986,7 @@ inline const char *ObjectTypeToString(ObjectType obj_type) return OBJ_TYPE_NAMES[idx]; } -/** - * This mixin aims to implement type id accessors. - */ +/// This mixin aims to implement type id accessors. class TypeIdMixin { public: static constexpr uint32_t INVALID_ID = std::numeric_limits::max(); @@ -2056,9 +2032,7 @@ private: RuntimeInterface::MethodPtr method_ {nullptr}; }; -/** - * This mixin aims to implement type of klass. - */ +/// This mixin aims to implement type of klass. template class ClassTypeMixin : public T { public: @@ -2079,9 +2053,7 @@ protected: using LastField = ClassTypeField; }; -/** - * Mixin to check if null check inside CheckCast and IsInstance can be omitted. - */ +/// Mixin to check if null check inside CheckCast and IsInstance can be omitted. template class OmitNullCheckMixin : public T { public: @@ -2143,9 +2115,7 @@ protected: using LastField = ObjectTypeField; }; -/** - * This mixin aims to implement field accessors. - */ +/// This mixin aims to implement field accessors. class FieldMixin { public: FieldMixin() = default; @@ -2166,9 +2136,7 @@ private: RuntimeInterface::FieldPtr field_ {nullptr}; }; -/** - * This mixin aims to implement volatile accessors. - */ +/// This mixin aims to implement volatile accessors. template class VolatileMixin : public T { public: @@ -2187,9 +2155,7 @@ protected: using IsVolatileFlag = typename T::LastField::NextFlag; using LastField = IsVolatileFlag; }; -/** - * Mixin for Inlined calls/returns. - */ +/// Mixin for Inlined calls/returns. template class InlinedInstMixin : public T { public: @@ -2209,9 +2175,7 @@ protected: using LastField = IsInlinedFlag; }; -/** - * Mixin for Array/String instruction - */ +/// Mixin for Array/String instruction template class ArrayInstMixin : public T { public: @@ -2242,9 +2206,7 @@ protected: using LastField = IsStringFlag; }; -/** - * Mixin for instructions with immediate constant value - */ +/// Mixin for instructions with immediate constant value class ImmediateMixin { public: explicit ImmediateMixin(uint64_t immediate) : immediate_(immediate) {} @@ -2269,9 +2231,7 @@ private: uint64_t immediate_ {0}; }; -/** - * Mixin for instructions with ConditionCode - */ +/// Mixin for instructions with ConditionCode template class ConditionMixin : public T { public: @@ -2329,9 +2289,7 @@ protected: using LastField = PredictionFlag; }; -/** - * Mixin for instrucion with ShiftType - */ +/// Mixin for instrucion with ShiftType class ShiftTypeMixin { public: explicit ShiftTypeMixin(ShiftType shift_type) : shift_type_(shift_type) {} @@ -2356,9 +2314,7 @@ private: ShiftType shift_type_ {INVALID_SHIFT}; }; -/** - * Mixin for instructions with multiple return values - */ +/// Mixin for instructions with multiple return values template class MultipleOutputMixin : public T { public: @@ -2518,9 +2474,7 @@ public: using FixedInputsInst::FixedInputsInst; }; -/** - * Instruction with variable inputs count - */ +/// Instruction with variable inputs count class DynamicInputsInst : public Inst { public: DECLARE_INST(DynamicInputsInst); @@ -2589,9 +2543,7 @@ private: LocationsInfo *locations_ {nullptr}; }; -/** - * Unary operation instruction - */ +/// Unary operation instruction class UnaryOperation : public FixedInputsInst<1> { public: DECLARE_INST(UnaryOperation); @@ -2620,9 +2572,7 @@ public: Inst *Evaluate(); }; -/** - * Binary operation instruction - */ +/// Binary operation instruction class BinaryOperation : public FixedInputsInst<2U> { public: DECLARE_INST(BinaryOperation); @@ -2667,9 +2617,7 @@ public: } }; -/** - * Binary operation instruction with c immidiate - */ +/// Binary operation instruction with c immidiate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class BinaryImmOperation : public FixedInputsInst<1>, public ImmediateMixin { public: @@ -2720,9 +2668,7 @@ public: } }; -/** - * Unary operation that shifts its own operand prior the application. - */ +/// Unary operation that shifts its own operand prior the application. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class UnaryShiftedRegisterOperation : public FixedInputsInst<1>, public ImmediateMixin, public ShiftTypeMixin { public: @@ -2750,9 +2696,7 @@ public: Inst *Clone(const Graph *target_graph) const override; }; -/** - * Binary operation that shifts its second operand prior the application. - */ +/// Binary operation that shifts its second operand prior the application. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class BinaryShiftedRegisterOperation : public FixedInputsInst<2U>, public ImmediateMixin, public ShiftTypeMixin { public: @@ -2782,9 +2726,7 @@ public: class SpillFillInst; -/** - * Mixin to hold location data - */ +/// Mixin to hold location data class LocationDataMixin { public: void SetLocationData(SpillFillData location_data) @@ -2812,9 +2754,7 @@ private: SpillFillData location_data_ {}; }; -/** - * Mixin to hold input types of call instruction - */ +/// Mixin to hold input types of call instruction class InputTypesMixin { public: InputTypesMixin() = default; @@ -2856,9 +2796,7 @@ protected: ArenaVector *input_types_ {nullptr}; }; -/** - * Mixin to hold method data - */ +/// Mixin to hold method data class MethodDataMixin { public: static constexpr uint32_t INVALID_METHOD_ID = std::numeric_limits::max(); @@ -2900,9 +2838,7 @@ private: uintptr_t function_ {0}; }; -/** - * ResolveStatic - */ +/// ResolveStatic // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ResolveStaticInst : public FixedInputsInst1, public MethodDataMixin { public: @@ -2935,9 +2871,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * ResolveVirtual - */ +/// ResolveVirtual // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ResolveVirtualInst : public FixedInputsInst2, public MethodDataMixin { public: @@ -3030,9 +2964,7 @@ private: using LastField = StringCtorTypeField; }; -/** - * Call instruction - */ +/// Call instruction // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class CallInst : public InlinedInstMixin, public InputTypesMixin, public MethodDataMixin { public: @@ -3107,9 +3039,7 @@ public: Inst *Clone(const Graph *target_graph) const override; }; -/** - * Length methods instruction - */ +/// Length methods instruction class LengthMethodInst : public ArrayInstMixin { public: DECLARE_INST(LengthMethodInst); @@ -3139,9 +3069,7 @@ public: } }; -/** - * Compare instruction - */ +/// Compare instruction // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class CompareInst : public InstWithOperandsType> { public: @@ -3172,9 +3100,7 @@ public: } }; -/** - * Mixin for AnyTypeMixin instructions - */ +/// Mixin for AnyTypeMixin instructions template class AnyTypeMixin : public T { public: @@ -3238,9 +3164,7 @@ protected: using LastField = TypeWasProfiled; }; -/** - * CompareAnyTypeInst instruction - */ +/// CompareAnyTypeInst instruction class CompareAnyTypeInst : public AnyTypeMixin { public: DECLARE_INST(CompareAnyTypeInst); @@ -3269,9 +3193,7 @@ public: } }; -/** - * GetAnyTypeName instruction - */ +/// GetAnyTypeName instruction class GetAnyTypeNameInst : public AnyTypeMixin { public: DECLARE_INST(GetAnyTypeNameInst); @@ -3294,9 +3216,7 @@ public: } }; -/** - * CastAnyTypeValueInst instruction - */ +/// CastAnyTypeValueInst instruction class CastAnyTypeValueInst : public AnyTypeMixin { public: DECLARE_INST(CastAnyTypeValueInst); @@ -3331,9 +3251,7 @@ public: } }; -/** - * CastValueToAnyTypeInst instruction - */ +/// CastValueToAnyTypeInst instruction class CastValueToAnyTypeInst : public AnyTypeMixin { public: DECLARE_INST(CastValueToAnyTypeInst); @@ -3359,9 +3277,7 @@ public: } }; -/** - * AnyTypeCheckInst instruction - */ +/// AnyTypeCheckInst instruction class AnyTypeCheckInst : public AnyTypeMixin { public: DECLARE_INST(AnyTypeCheckInst); @@ -3391,9 +3307,7 @@ public: DeoptimizeType GetDeoptimizeType() const; }; -/** - * HclassCheck instruction - */ +/// HclassCheck instruction enum class HclassChecks { ALL_CHECKS = 0, IS_FUNCTION, @@ -3779,9 +3693,7 @@ inline bool IsZeroConstantOrNullPtr(const Inst *inst) return IsZeroConstant(inst) || inst->GetOpcode() == Opcode::NullPtr; } -/** - * Phi instruction - */ +/// Phi instruction class PhiInst : public AnyTypeMixin { public: DECLARE_INST(PhiInst); @@ -4023,9 +3935,7 @@ private: std::bitset roots_regs_mask_ {0}; }; -/** - * Load value from array or string - */ +/// Load value from array or string class LoadInst : public ArrayInstMixin> { public: DECLARE_INST(LoadInst); @@ -4150,9 +4060,7 @@ public: return OPTIONS.GetCompilerSchedLatencyLong(); } }; -/** - * Store value into array element - */ +/// Store value into array element class StoreInst : public NeedBarrierMixin { public: DECLARE_INST(StoreInst); @@ -4201,9 +4109,7 @@ public: } }; -/** - * Load value from array, using array index as immediate - */ +/// Load value from array, using array index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadInstI : public VolatileMixin>>, public ImmediateMixin { public: @@ -4256,9 +4162,7 @@ public: } }; -/** - * Load value from pointer with offset - */ +/// Load value from pointer with offset // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadMemInstI : public VolatileMixin>, public ImmediateMixin { public: @@ -4306,9 +4210,7 @@ public: } }; -/** - * Store value into array element, using array index as immediate - */ +/// Store value into array element, using array index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreInstI : public VolatileMixin>, public ImmediateMixin { public: @@ -4368,9 +4270,7 @@ public: } }; -/** - * Store value into pointer by offset - */ +/// Store value into pointer by offset // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreMemInstI : public VolatileMixin>, public ImmediateMixin { public: @@ -4424,9 +4324,7 @@ public: } }; -/** - * Bounds check, using array index as immediate - */ +/// Bounds check, using array index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class BoundsCheckInstI : public ArrayInstMixin>, public ImmediateMixin { public: @@ -4456,9 +4354,7 @@ public: } }; -/** - * Bounds check instruction - */ +/// Bounds check instruction // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class BoundsCheckInst : public ArrayInstMixin> { public: @@ -4521,9 +4417,7 @@ private: using LastField = IsImplicitFlag; }; -/** - * Return immediate - */ +/// Return immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ReturnInstI : public FixedInputsInst<0>, public ImmediateMixin { public: @@ -4566,9 +4460,7 @@ private: using LastField = IsExtendedLivenessFlag; }; -/** - * Monitor instruction - */ +/// Monitor instruction class MonitorInst : public FixedInputsInst2 { public: DECLARE_INST(MonitorInst); @@ -4755,9 +4647,7 @@ private: #include #include -/** - * Cast instruction - */ +/// Cast instruction class CastInst : public InstWithOperandsType { public: DECLARE_INST(CastInst); @@ -4785,9 +4675,7 @@ public: bool IsDynamicCast() const; }; -/** - * Cmp instruction - */ +/// Cmp instruction class CmpInst : public InstWithOperandsType { public: DECLARE_INST(CmpInst); @@ -4847,9 +4735,7 @@ protected: using LastField = Fcmpg; }; -/** - * Load value from instance field - */ +/// Load value from instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadObjectInst : public ObjectTypeMixin>>, public TypeIdMixin, @@ -4892,9 +4778,7 @@ public: } }; -/** - * Load value from memory by offset - */ +/// Load value from memory by offset // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadMemInst : public ScaleMixin>> { public: @@ -4939,9 +4823,7 @@ public: } }; -/** - * Load value from dynamic object - */ +/// Load value from dynamic object class LoadObjectDynamicInst : public DynObjectAccessMixin { public: DECLARE_INST(LoadObjectDynamicInst); @@ -4954,9 +4836,7 @@ public: } }; -/** - * Store value to dynamic object - */ +/// Store value to dynamic object class StoreObjectDynamicInst : public DynObjectAccessMixin> { public: DECLARE_INST(StoreObjectDynamicInst); @@ -4969,9 +4849,7 @@ public: } }; -/** - * Resolve instance field - */ +/// Resolve instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ResolveObjectFieldInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5003,9 +4881,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Load value from resolved instance field - */ +/// Load value from resolved instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadResolvedObjectFieldInst : public VolatileMixin>, public TypeIdMixin { public: @@ -5042,9 +4918,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Store value into instance field - */ +/// Store value into instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreObjectInst : public ObjectTypeMixin>>, public TypeIdMixin, @@ -5087,9 +4961,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Store value into resolved instance field - */ +/// Store value into resolved instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreResolvedObjectFieldInst : public VolatileMixin>, public TypeIdMixin { public: @@ -5135,9 +5007,7 @@ public: } }; -/** - * Store value in memory by offset - */ +/// Store value in memory by offset // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreMemInst : public ScaleMixin>> { public: @@ -5181,9 +5051,7 @@ public: } }; -/** - * Load static field from class. - */ +/// Load static field from class. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadStaticInst : public VolatileMixin>, public TypeIdMixin, public FieldMixin { public: @@ -5221,9 +5089,7 @@ public: } }; -/** - * Resolve static instance field - */ +/// Resolve static instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ResolveObjectFieldStaticInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5255,9 +5121,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Load value from resolved static instance field - */ +/// Load value from resolved static instance field // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadResolvedObjectFieldStaticInst : public VolatileMixin>, public TypeIdMixin { public: @@ -5294,9 +5158,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Store value into static field. - */ +/// Store value into static field. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreStaticInst : public VolatileMixin>, public TypeIdMixin, @@ -5340,9 +5202,7 @@ public: } }; -/** - * Store value into unresolved static field. - */ +/// Store value into unresolved static field. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class UnresolvedStoreStaticInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5377,9 +5237,7 @@ public: } }; -/** - * Store value into resolved static field. - */ +/// Store value into resolved static field. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreResolvedObjectFieldStaticInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5413,9 +5271,7 @@ public: void DumpOpcode(std::ostream *out) const override; }; -/** - * Create new object - */ +/// Create new object // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class NewObjectInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5447,9 +5303,7 @@ public: } }; -/** - * Create new array - */ +/// Create new array // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class NewArrayInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5552,9 +5406,7 @@ public: } }; -/** - * Checkcast - */ +/// Checkcast // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class CheckCastInst : public OmitNullCheckMixin>>, public TypeIdMixin { @@ -5591,9 +5443,7 @@ public: } }; -/** - * Is instance - */ +/// Is instance // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class IsInstanceInst : public OmitNullCheckMixin>>, public TypeIdMixin { @@ -5630,9 +5480,7 @@ public: } }; -/** - * Load data from constant pool. - */ +/// Load data from constant pool. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadFromPool : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5662,9 +5510,7 @@ public: } }; -/** - * Load data from dynamic constant pool. - */ +/// Load data from dynamic constant pool. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadFromPoolDynamic : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5705,9 +5551,7 @@ protected: using LastField = StringFlag; }; -/** - * Initialization or loading of the class. - */ +/// Initialization or loading of the class. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class ClassInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5750,9 +5594,7 @@ private: RuntimeInterface::ClassPtr klass_ {nullptr}; }; -/** - * Loading of the runtime class. - */ +/// Loading of the runtime class. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class RuntimeClassInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5792,9 +5634,7 @@ private: RuntimeInterface::ClassPtr klass_ {nullptr}; }; -/** - * Get global var address inst - */ +/// Get global var address inst // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class GlobalVarInst : public NeedBarrierMixin, public TypeIdMixin { public: @@ -5840,9 +5680,7 @@ private: uintptr_t address_ {0}; }; -/** - * Get object pointer from the specific source. - */ +/// Get object pointer from the specific source. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadImmediateInst : public Inst { public: @@ -5966,9 +5804,7 @@ private: using LastField = ObjectTypeField; }; -/** - * Get function from the specific source. - */ +/// Get function from the specific source. // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class FunctionImmediateInst : public Inst { public: @@ -6005,9 +5841,7 @@ private: uintptr_t function_ptr_ {0}; }; -/** - * Get object from the specific source(handle). - */ +/// Get object from the specific source(handle). // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadObjFromConstInst : public Inst { public: @@ -6044,9 +5878,7 @@ private: uintptr_t object_ptr_ {0}; }; -/** - * Select instruction - */ +/// Select instruction // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class SelectInst : public ConditionMixin>> { public: @@ -6086,9 +5918,7 @@ public: } }; -/** - * SelectImm with comparison with immediate - */ +/// SelectImm with comparison with immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class SelectImmInst : public InstWithOperandsType>, public ImmediateMixin { public: @@ -6129,9 +5959,7 @@ public: } }; -/** - * Conditional jump instruction - */ +/// Conditional jump instruction // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class IfInst : public InstWithOperandsType> { public: @@ -6177,9 +6005,7 @@ private: RuntimeInterface::MethodPtr method_ {nullptr}; }; -/** - * IfImm instruction with immediate - */ +/// IfImm instruction with immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class IfImmInst : public InstWithOperandsType>, public ImmediateMixin { public: @@ -6231,9 +6057,7 @@ private: RuntimeInterface::MethodPtr method_ {nullptr}; }; -/** - * Load element from a pair of values, using index as immediate - */ +/// Load element from a pair of values, using index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadPairPartInst : public FixedInputsInst1, public ImmediateMixin { public: @@ -6262,9 +6086,7 @@ public: } }; -/** - * Load a pair of consecutive values from array - */ +/// Load a pair of consecutive values from array // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadArrayPairInst : public NeedBarrierMixin> { public: @@ -6316,9 +6138,7 @@ public: } }; -/** - * Store a pair of consecutive values to array - */ +/// Store a pair of consecutive values to array // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreArrayPairInst : public NeedBarrierMixin> { public: @@ -6366,9 +6186,7 @@ public: } }; -/** - * Load a pair of consecutive values from array, using array index as immediate - */ +/// Load a pair of consecutive values from array, using array index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class LoadArrayPairInstI : public NeedBarrierMixin>, public ImmediateMixin { public: @@ -6416,9 +6234,7 @@ public: } }; -/** - * Store a pair of consecutive values to array, using array index as immediate - */ +/// Store a pair of consecutive values to array, using array index as immediate // NOLINTNEXTLINE(fuchsia-multiple-inheritance) class StoreArrayPairInstI : public NeedBarrierMixin, public ImmediateMixin { public: @@ -6475,9 +6291,7 @@ public: } }; -/** - * CatchPhiInst instruction - */ +/// CatchPhiInst instruction class CatchPhiInst : public DynamicInputsInst { public: DECLARE_INST(CatchPhiInst); @@ -6567,9 +6381,7 @@ private: TryInst *GetTryBeginInst(const BasicBlock *try_begin_bb); -/** - * Mixin for Deoptimize instructions - */ +/// Mixin for Deoptimize instructions template class DeoptimizeTypeMixin : public T { public: diff --git a/compiler/optimizer/ir/ir_constructor.h b/compiler/optimizer/ir/ir_constructor.h index bc0b0b4c6e671a73059fa2580b758481f0c0fde1..a0c1c32f1cc701f09e5a540a7ba0514c41295d2b 100644 --- a/compiler/optimizer/ir/ir_constructor.h +++ b/compiler/optimizer/ir/ir_constructor.h @@ -197,8 +197,10 @@ public: return *this; } - /// Define inputs for current instruction. - /// Input is an index of input instruction. + /** + * Define inputs for current instruction. + * Input is an index of input instruction. + */ template IrConstructor &Inputs(Args... inputs) { @@ -211,10 +213,12 @@ public: return *this; } - /// Define inputs for current call-, intrinsic-, or phi-instriction. - /// Input is defined by std::pair. - /// In case of phi: first is index of basic block, second is index of input instruction. - /// In case of call and intrinsic: first is Type of input, second is index of input instruction. + /** + * Define inputs for current call-, intrinsic-, or phi-instriction. + * Input is defined by std::pair. + * In case of phi: first is index of basic block, second is index of input instruction. + * In case of call and intrinsic: first is Type of input, second is index of input instruction. + */ IrConstructor &Inputs(std::initializer_list> inputs) { ASSERT(CurrentInst()->IsPhi() || CurrentInst()->IsCall() || CurrentInst()->IsInitObject() || @@ -256,8 +260,10 @@ public: return *this; } - /// Same as the default Inputs() method, but defines inputs' types with respect to call-instructions. - /// Copies types of inputs to the instruction's input_types_. + /** + * Same as the default Inputs() method, but defines inputs' types with respect to call-instructions. + * Copies types of inputs to the instruction's input_types_. + */ template IrConstructor &InputsAutoType(Args... inputs) { diff --git a/compiler/optimizer/ir/runtime_interface.h b/compiler/optimizer/ir/runtime_interface.h index 095abb124f891c21c747e62a63cc665736c208e8..733f69f8c473ba6da270d7025993041c24099030 100644 --- a/compiler/optimizer/ir/runtime_interface.h +++ b/compiler/optimizer/ir/runtime_interface.h @@ -144,9 +144,8 @@ public: return 0; } - /************************************************************************** - * Binary file information - */ + /**********************************************************************************/ + /// Binary file information virtual BinaryFilePtr GetBinaryFileForMethod([[maybe_unused]] MethodPtr method) const { return nullptr; @@ -158,9 +157,8 @@ public: return cross_values::GetFileBaseOffset(arch); } - /************************************************************************** - * Method information - */ + /**********************************************************************************/ + /// Method information virtual MethodPtr GetMethodById([[maybe_unused]] MethodPtr parent_method, [[maybe_unused]] MethodId id) const { return nullptr; @@ -502,9 +500,8 @@ public: return 0; } - /************************************************************************** - * Exec state information - */ + /**********************************************************************************/ + /// Exec state information size_t GetTlsFrameKindOffset(Arch arch) const { return panda::cross_values::GetManagedThreadFrameKindOffset(arch); @@ -568,9 +565,8 @@ public: return 0; } - /************************************************************************** - * Array information - */ + /**********************************************************************************/ + /// Array information uint32_t GetClassArraySize(Arch arch) const { return panda::cross_values::GetCoretypesArrayClassSize(arch); @@ -606,9 +602,8 @@ public: return panda::cross_values::GetCoretypesArrayLengthOffset(arch); } - /************************************************************************** - * String information - */ + /**********************************************************************************/ + /// String information virtual bool IsCompressedStringsEnabled() const { return true; @@ -643,18 +638,16 @@ public: return cross_values::GetManagedThreadStringClassPtrOffset(arch); } - /************************************************************************** - * managed Thread object information - */ + /**********************************************************************************/ + /// managed Thread object information uint32_t GetThreadObjectOffset(Arch arch) const { return panda::cross_values::GetManagedThreadObjectOffset(arch); } - /************************************************************************** - * TLAB information - */ + /**********************************************************************************/ + /// TLAB information virtual size_t GetTLABMaxSize() const { @@ -689,9 +682,8 @@ public: return panda::cross_values::GetTlabMemoryEndAddrOffset(arch); } - /************************************************************************** - * Object information - */ + /**********************************************************************************/ + /// Object information virtual ClassPtr GetClass([[maybe_unused]] MethodPtr method, [[maybe_unused]] IdType id) const { return nullptr; @@ -780,9 +772,8 @@ public: return StringCtorType::UNKNOWN; } - /************************************************************************** - * Class information - */ + /**********************************************************************************/ + /// Class information // Returns Class Id for Field. // We don't get class id directly from the field's class, because we need a class id regarding to the current @@ -870,9 +861,8 @@ public: return panda::cross_values::GetClassMethodsOffset(arch); } - /************************************************************************** - * Field information - */ + /**********************************************************************************/ + /// Field information /** * Try to resolve field. @@ -1010,9 +1000,8 @@ public: return 0; } - /************************************************************************** - * Type information - */ + /**********************************************************************************/ + /// Type information virtual ClassPtr ResolveType([[maybe_unused]] MethodPtr method, [[maybe_unused]] size_t unused) const { return nullptr; @@ -1048,9 +1037,8 @@ public: return 0; } - /************************************************************************** - * Entrypoints - */ + /**********************************************************************************/ + /// Entrypoints #include "compiler_interface_extensions.inl.h" #include #include @@ -1116,9 +1104,8 @@ public: UNREACHABLE(); } - /************************************************************************** - * Dynamic object information - */ + /**********************************************************************************/ + /// Dynamic object information virtual uint32_t GetFunctionTargetOffset([[maybe_unused]] Arch arch) const { @@ -1176,7 +1163,8 @@ public: return 0; } - /************************************************************************** + /**********************************************************************************/ + /** * Check if GC can be triggered during call. * This is possible when method A calling method B and waiting while B is compiling. */ @@ -1185,9 +1173,8 @@ public: return false; } - /************************************************************************** - * Bytecode profiling - */ + /**********************************************************************************/ + /// Bytecode profiling using BytecodeProfile = uintptr_t; using MethodProfile = profiling::ProfileType; diff --git a/compiler/optimizer/ir_builder/inst_builder.cpp b/compiler/optimizer/ir_builder/inst_builder.cpp index 849b3ea2a954a8c06d6ec1689bcacbb27be4d0d6..f377e27068c07242e731bfaf7062260540ef2e78 100644 --- a/compiler/optimizer/ir_builder/inst_builder.cpp +++ b/compiler/optimizer/ir_builder/inst_builder.cpp @@ -232,9 +232,7 @@ void InstBuilder::SetParamSpillFill(Graph *graph, ParameterInst *param_inst, siz } } -/** - * Set type of instruction, then recursively set type to its inputs. - */ +/// Set type of instruction, then recursively set type to its inputs. void InstBuilder::SetTypeRec(Inst *inst, DataType::Type type) { inst->SetType(type); @@ -282,9 +280,7 @@ void InstBuilder::RemoveNotDominateInputs(SaveStateInst *save_state) } } -/** - * Fix instructions that can't be fully completed in building process. - */ +/// Fix instructions that can't be fully completed in building process. void InstBuilder::FixInstructions() { // Remove dead Phi and set types to phi which have not type. diff --git a/compiler/optimizer/ir_builder/inst_builder.h b/compiler/optimizer/ir_builder/inst_builder.h index f2e1f2354abce6d763eac0e1d6a6b88f25106aa3..7f4416050433bf5c146c0a5d5e7938274497b8d6 100644 --- a/compiler/optimizer/ir_builder/inst_builder.h +++ b/compiler/optimizer/ir_builder/inst_builder.h @@ -115,9 +115,7 @@ public: return failed_; } - /** - * Return jump offset for instruction `inst`, 0 if it is not jump instruction. - */ + /// Return jump offset for instruction `inst`, 0 if it is not jump instruction. static int64_t GetInstructionJumpOffset(const BytecodeInstruction *inst); void SetCurrentBlock(BasicBlock *bb) diff --git a/compiler/optimizer/ir_builder/ir_builder.cpp b/compiler/optimizer/ir_builder/ir_builder.cpp index 0da773a2d5d843901e5959b786b692002989c4eb..8545f4d36742c137acc83af1dd47c8910120b29f 100644 --- a/compiler/optimizer/ir_builder/ir_builder.cpp +++ b/compiler/optimizer/ir_builder/ir_builder.cpp @@ -317,9 +317,7 @@ void IrBuilder::EnumerateTryBlocksCoveredPc(uint32_t pc, const Callback &callbac } } -/** - * Return `TryCodeBlock` and flag if was created a new one - */ +/// Return `TryCodeBlock` and flag if was created a new one IrBuilder::TryCodeBlock *IrBuilder::InsertTryBlockInfo(const Boundaries &try_boundaries) { auto try_id = static_cast(try_blocks_.size()); diff --git a/compiler/optimizer/ir_builder/ir_builder.h b/compiler/optimizer/ir_builder/ir_builder.h index a9812e6a52c3ee78ef6c8225b6c43b6b22c5ecd0..c752c34fc8e395f21aa93f819c6d0bbfc25ff1c0 100644 --- a/compiler/optimizer/ir_builder/ir_builder.h +++ b/compiler/optimizer/ir_builder/ir_builder.h @@ -28,9 +28,7 @@ class Method; } // namespace panda namespace panda::compiler { -/** - * Build IR from panda bytecode - */ +/// Build IR from panda bytecode class IrBuilder : public Optimization { struct Boundaries { uint32_t begin_pc; diff --git a/compiler/optimizer/optimizations/adjust_arefs.cpp b/compiler/optimizer/optimizations/adjust_arefs.cpp index 453e47d482351a77c4741d1a5f916d3d0343eda6..e81ca70b344e57bc9c77113477ff0a208b203fb2 100644 --- a/compiler/optimizer/optimizations/adjust_arefs.cpp +++ b/compiler/optimizer/optimizations/adjust_arefs.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/compiler/optimizer/optimizations/adjust_arefs.h b/compiler/optimizer/optimizations/adjust_arefs.h index b20c978862db30bfb46b7391684d73ec1cbcd860..647dcd7361e344fb1e37a54850b0a443e65c9a09 100644 --- a/compiler/optimizer/optimizations/adjust_arefs.h +++ b/compiler/optimizer/optimizations/adjust_arefs.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/compiler/optimizer/optimizations/branch_elimination.cpp b/compiler/optimizer/optimizations/branch_elimination.cpp index 5474f37f8d0b31196bae79aacb7f21195ec41446..419ec01767672ad7db7fe2475e5d78eb42e1a2d0 100644 --- a/compiler/optimizer/optimizations/branch_elimination.cpp +++ b/compiler/optimizer/optimizations/branch_elimination.cpp @@ -258,9 +258,7 @@ bool AllPredecessorsMarked(BasicBlock *block, Marker marker) return true; } -/** - * Disconnect selected blocks - */ +/// Disconnect selected blocks void BranchElimination::DisconnectBlocks() { for (auto block : GetGraph()->GetBlocksRPO()) { @@ -321,9 +319,7 @@ Inst *FindIfImmDominatesCondition(Inst *dom_compare, Inst *target_compare) return nullptr; } -/** - * Resolve condition result if there is a dominant equal condition - */ +/// Resolve condition result if there is a dominant equal condition std::optional BranchElimination::GetConditionResult(Inst *condition) { ConditionOps ops {condition->GetInput(0).GetInst(), condition->GetInput(1).GetInst()}; @@ -349,9 +345,7 @@ std::optional BranchElimination::GetConditionResult(Inst *condition) return std::nullopt; } -/** - * Resolve condition result if there is a dominant IfImmInst after CompareAnyTypeInst. - */ +/// Resolve condition result if there is a dominant IfImmInst after CompareAnyTypeInst. std::optional BranchElimination::GetCompareAnyTypeResult(IfImmInst *if_imm) { auto compare_any = if_imm->GetInput(0).GetInst()->CastToCompareAnyType(); @@ -388,7 +382,8 @@ std::optional BranchElimination::GetCompareAnyTypeResult(IfImmInst *if_imm } /** - * Try to resolve CompareAnyTypeInst result with the information about dominant CompareAnyTypeInst with the same inputs. + * Try to resolve CompareAnyTypeInst result with the information + * about dominant CompareAnyTypeInst with the same inputs. */ std::optional BranchElimination::TryResolveCompareAnyTypeResult(CompareAnyTypeInst *compare_any, CompareAnyTypeInst *dom_compare_any, diff --git a/compiler/optimizer/optimizations/code_sink.cpp b/compiler/optimizer/optimizations/code_sink.cpp index 9b0735f8db67981955455cbeca076209c1ecb957..65fe996efbc713d36b778573bd39ad936aaaf931 100644 --- a/compiler/optimizer/optimizations/code_sink.cpp +++ b/compiler/optimizer/optimizations/code_sink.cpp @@ -182,9 +182,7 @@ BasicBlock *CodeSink::SinkInstruction(Inst *inst, InstVector *stores, bool barri return nullptr; } -/** - * Check that candidate dominates all users of inst. - */ +/// Check that candidate dominates all users of inst. bool CodeSink::IsAcceptableTarget(Inst *inst, BasicBlock *candidate) { ASSERT(inst != nullptr); diff --git a/compiler/optimizer/optimizations/cse.cpp b/compiler/optimizer/optimizations/cse.cpp index e2168fa056f19bffb1cf377df8b5f80e74927ade..2255a9d04c06132269d5afb91ddb66a32efc139d 100644 --- a/compiler/optimizer/optimizations/cse.cpp +++ b/compiler/optimizer/optimizations/cse.cpp @@ -98,9 +98,7 @@ void Cse::CollectTreeForest() } } -/** - * Convert the tree-forest structure of replace_pair into star-forest structure - */ +/// Convert the tree-forest structure of replace_pair into star-forest structure void Cse::ConvertTreeForestToStarForest() { min_replace_star_.clear(); diff --git a/compiler/optimizer/optimizations/inlining.cpp b/compiler/optimizer/optimizations/inlining.cpp index e7a111af1fa080453dec8fdfcd979c0db3022d90..5b10a93aa43f85462c9914ec2cab4d17003a69f9 100644 --- a/compiler/optimizer/optimizations/inlining.cpp +++ b/compiler/optimizer/optimizations/inlining.cpp @@ -1284,9 +1284,7 @@ void RemoveReturnVoidInst(BasicBlock *end_block) } } -/** - * Embed inlined dataflow graph into the caller graph. - */ +/// Embed inlined dataflow graph into the caller graph. void Inlining::UpdateDataflow(Graph *graph_inl, Inst *call_inst, std::variant use, Inst *new_def) { @@ -1348,9 +1346,7 @@ void Inlining::UpdateDataflow(Graph *graph_inl, Inst *call_inst, std::variantGetHeader(); diff --git a/compiler/optimizer/optimizations/loop_unroll.cpp b/compiler/optimizer/optimizations/loop_unroll.cpp index 3ec5898f6faaac4300bc371807ae8ce2be1a2a5b..c9ae44cb36ce0d9a20cc8dbdc0d24b93b49398c2 100644 --- a/compiler/optimizer/optimizations/loop_unroll.cpp +++ b/compiler/optimizer/optimizations/loop_unroll.cpp @@ -59,9 +59,7 @@ bool ConditionOverFlowImpl(const CountableLoopInfo &loop_info, uint32_t unroll_f return (type_max - static_cast(imm_value)) < test_value; } -/** - * TODO(a.popov) Create pre-header compare if it doesn't exist - */ +/// TODO(a.popov) Create pre-header compare if it doesn't exist bool ConditionOverFlow(const CountableLoopInfo &loop_info, uint32_t unroll_factor) { @@ -239,9 +237,7 @@ Inst *GetOrCreateIfImmUniqueCompare(Inst *if_imm) return new_cmp; } -/** - * Normalize control-flow to the form: `if condition is true goto loop_header` - */ +/// Normalize control-flow to the form: `if condition is true goto loop_header` void NormalizeControlFlow(BasicBlock *edge, const BasicBlock *loop_header) { auto if_imm = edge->GetLastInst()->CastToIfImm(); diff --git a/compiler/optimizer/optimizations/lse.cpp b/compiler/optimizer/optimizations/lse.cpp index 5192b205d693eb57af1c12fc71cc366370baa892..92add34fb0f4b9c884876698d0f8b540ee1b5cbb 100644 --- a/compiler/optimizer/optimizations/lse.cpp +++ b/compiler/optimizer/optimizations/lse.cpp @@ -232,9 +232,7 @@ public: invs->clear(); } - /** - * Completely resets the accumulated state: heap and phi candidates. - */ + /// Completely resets the accumulated state: heap and phi candidates. void InvalidateHeap(BasicBlock *block) { for (int eq_class = Lse::EquivClass::EQ_ARRAY; eq_class != Lse::EquivClass::EQ_LAST; eq_class++) { @@ -248,9 +246,7 @@ public: disabled_objects_.clear(); } - /** - * Clears heap of local only values as we don't want them to affect analysis further - */ + /// Clears heap of local only values as we don't want them to affect analysis further void ClearLocalValuesFromHeap(BasicBlock *block) { for (int eq_class = Lse::EquivClass::EQ_ARRAY; eq_class != Lse::EquivClass::EQ_LAST; eq_class++) { @@ -267,9 +263,7 @@ public: } } - /** - * Release objects and reset Alias Analysis count - */ + /// Release objects and reset Alias Analysis count void ResetLimits() { disabled_objects_.clear(); @@ -281,9 +275,7 @@ public: return alias_calls_; } - /** - * Marks all values currently on heap as potentially read - */ + /// Marks all values currently on heap as potentially read void SetHeapAsRead(BasicBlock *block) { for (int eq_class = Lse::EquivClass::EQ_ARRAY; eq_class != Lse::EquivClass::EQ_LAST; eq_class++) { @@ -392,9 +384,7 @@ public: } } - /** - * Add eliminations inside loops if there is no overwrites on backedges. - */ + /// Add eliminations inside loops if there is no overwrites on backedges. void FinalizeLoops(Graph *graph) { InstVector insts_must_alias(graph->GetLocalAllocator()->Adapter()); @@ -556,9 +546,7 @@ public: } private: - /** - * Return a MUST_ALIASed heap entry, nullptr if not present. - */ + /// Return a MUST_ALIASed heap entry, nullptr if not present. const Lse::HeapValue *GetHeapValue(Inst *inst) { auto &block_heap = heaps_.at(GetEquivClass(inst)).first.at(inst->GetBasicBlock()); @@ -571,9 +559,7 @@ private: return nullptr; } - /** - * Update phi candidates with aliased accesses - */ + /// Update phi candidates with aliased accesses void UpdatePhis(Inst *inst) { Loop *loop = inst->GetBasicBlock()->GetLoop(); @@ -601,9 +587,7 @@ private: uint32_t alias_calls_ {0}; }; -/** - * Returns true if the instruction invalidates the whole heap - */ +/// Returns true if the instruction invalidates the whole heap static bool IsHeapInvalidatingInst(Inst *inst) { switch (inst->GetOpcode()) { @@ -636,9 +620,7 @@ static bool IsHeapInvalidatingInst(Inst *inst) } } -/** - * Returns true if the instruction reads from heap and we're not sure about its effects - */ +/// Returns true if the instruction reads from heap and we're not sure about its effects static bool IsHeapReadingInst(Inst *inst) { if (inst->CanThrow()) { @@ -726,9 +708,7 @@ void Lse::MergeHeapValuesForLoop(BasicBlock *block, HeapEqClasses *heaps) } } -/** - * Merge heap values for passed block from its direct predecessors. - */ +/// Merge heap values for passed block from its direct predecessors. int Lse::MergeHeapValuesForBlock(BasicBlock *block, HeapEqClasses *heaps, Marker phi_fixup_mrk) { int alias_calls = 0; diff --git a/compiler/optimizer/optimizations/memory_coalescing.cpp b/compiler/optimizer/optimizations/memory_coalescing.cpp index bf5b8630449dda0d6a849ee8e8ee3b1ce5a1e656..277807da81cd3792423bef580e2a30100ab051be 100644 --- a/compiler/optimizer/optimizations/memory_coalescing.cpp +++ b/compiler/optimizer/optimizations/memory_coalescing.cpp @@ -132,9 +132,7 @@ public: } private: - /** - * Add derived variables if we can deduce the change from INST - */ + /// Add derived variables if we can deduce the change from INST void AddUsers(Inst *inst) { auto acc = 0; @@ -417,9 +415,7 @@ private: return lower_after; } - /** - * Add a pair if a difference between indices equals to one. The first in pair is with lower index. - */ + /// Add a pair if a difference between indices equals to one. The first in pair is with lower index. bool TryAddCoalescedPair(Inst *inst, int64_t inst_idx, Inst *cand, int64_t cand_idx) { Inst *first = nullptr; diff --git a/compiler/optimizer/optimizations/memory_coalescing.h b/compiler/optimizer/optimizations/memory_coalescing.h index 6ec9cf3d6fa5af9b188b205fe89442a3e538563a..f1acd147080fb8450c63a2d82ce928585a84fca7 100644 --- a/compiler/optimizer/optimizations/memory_coalescing.h +++ b/compiler/optimizer/optimizations/memory_coalescing.h @@ -44,9 +44,7 @@ public: return "MemoryCoalescing"; } - /** - * Types of memory accesses that can be coalesced - */ + /// Types of memory accesses that can be coalesced static bool AcceptedType(DataType::Type type) { switch (type) { diff --git a/compiler/optimizer/optimizations/object_type_check_elimination.cpp b/compiler/optimizer/optimizations/object_type_check_elimination.cpp index 6754ce817c183fedf75ec0f969dc9a86ec411a58..78bc13e322c8ab08fcd6f58f5cf5e834ffe0ec6e 100644 --- a/compiler/optimizer/optimizations/object_type_check_elimination.cpp +++ b/compiler/optimizer/optimizations/object_type_check_elimination.cpp @@ -62,8 +62,10 @@ void ObjectTypeCheckElimination::ReplaceCheckMustThrowByUnconditionalDeoptimize( } } -/// This function try to replace IsInstance with a constant. -/// If input of IsInstance is Nullptr then it replaced by zero constant. +/** + * This function try to replace IsInstance with a constant. + * If input of IsInstance is Nullptr then it replaced by zero constant. + */ bool ObjectTypeCheckElimination::TryEliminateIsInstance(Inst *inst) { ASSERT(inst->GetOpcode() == Opcode::IsInstance); diff --git a/compiler/optimizer/optimizations/object_type_check_elimination.h b/compiler/optimizer/optimizations/object_type_check_elimination.h index 7e147ec98584632a63ba0214ee67b8d18a440117..c9b891c813e3a8698cd4a68b880f103af3675609 100644 --- a/compiler/optimizer/optimizations/object_type_check_elimination.h +++ b/compiler/optimizer/optimizations/object_type_check_elimination.h @@ -57,8 +57,10 @@ public: void InvalidateAnalyses() override; - /// This function try to replace IsInstance with a constant. - /// If input of IsInstance is Nullptr then it replaced by zero constant. + /** + * This function try to replace IsInstance with a constant. + * If input of IsInstance is Nullptr then it replaced by zero constant. + */ static bool TryEliminateIsInstance(Inst *inst); enum CheckCastEliminateType { REDUNDANT, MUST_THROW, INVALID }; diff --git a/compiler/optimizer/optimizations/regalloc/location_mask.h b/compiler/optimizer/optimizations/regalloc/location_mask.h index d710f2cebe6068510dbd4073efdd3b758c3a2844..efa9e7a8f1f969318484116a126433a489fda408 100644 --- a/compiler/optimizer/optimizations/regalloc/location_mask.h +++ b/compiler/optimizer/optimizations/regalloc/location_mask.h @@ -19,9 +19,7 @@ #include "utils/arena_containers.h" namespace panda::compiler { -/** - * Helper-class to hold information about registers and stack slots usage. - */ +/// Helper-class to hold information about registers and stack slots usage. class LocationMask { public: explicit LocationMask(ArenaAllocator *allocator) : mask_(allocator->Adapter()), usage_(allocator->Adapter()) {} diff --git a/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.cpp b/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.cpp index 671c1204450b0e28991853eb5565aa22d5228289..92a4e5577eed440d2206734808caee4c301aee5b 100644 --- a/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.cpp +++ b/compiler/optimizer/optimizations/regalloc/reg_alloc_linear_scan.cpp @@ -23,9 +23,7 @@ namespace panda::compiler { static constexpr auto MAX_LIFE_NUMBER = std::numeric_limits::max(); -/** - * Add interval in sorted order - */ +/// Add interval in sorted order static void AddInterval(LifeIntervals *interval, InstructionsIntervals *dest) { auto cmp = [](LifeIntervals *lhs, LifeIntervals *rhs) { return lhs->GetBegin() >= rhs->GetBegin(); }; @@ -50,9 +48,7 @@ static void AddInterval(LifeIntervals *interval, InstructionsIntervals *dest) } } -/** - * Use graph's registers masks and `MAX_NUM_STACK_SLOTS` stack slots - */ +/// Use graph's registers masks and `MAX_NUM_STACK_SLOTS` stack slots RegAllocLinearScan::RegAllocLinearScan(Graph *graph) : RegAllocBase(graph), working_intervals_(graph->GetLocalAllocator()), @@ -64,9 +60,7 @@ RegAllocLinearScan::RegAllocLinearScan(Graph *graph) { } -/** - * Use dynamic general registers mask (without vector regs) and zero stack slots - */ +/// Use dynamic general registers mask (without vector regs) and zero stack slots RegAllocLinearScan::RegAllocLinearScan(Graph *graph, [[maybe_unused]] EmptyRegMask mask) : RegAllocBase(graph, VIRTUAL_FRAME_SIZE), working_intervals_(graph->GetLocalAllocator()), @@ -78,9 +72,7 @@ RegAllocLinearScan::RegAllocLinearScan(Graph *graph, [[maybe_unused]] EmptyRegMa { } -/** - * Allocate registers - */ +/// Allocate registers bool RegAllocLinearScan::Allocate() { AssignLocations(); @@ -163,9 +155,7 @@ void RegAllocLinearScan::PreprocessPreassignedIntervals() } } -/** - * Free registers from expired intervals - */ +/// Free registers from expired intervals template void RegAllocLinearScan::ExpireIntervals(LifeNumber current_position) { @@ -200,9 +190,7 @@ void RegAllocLinearScan::ExpireIntervals(LifeNumber current_position) }); } -/** - * Working intervals processing - */ +/// Working intervals processing template void RegAllocLinearScan::WalkIntervals() { @@ -601,9 +589,7 @@ void RegAllocLinearScan::BlockOverlappedRegisters(const LifeIntervals *current_i }); } -/** - * Returns true if the interval corresponds to Constant instruction and it could not be spilled to a stack. - */ +/// Returns true if the interval corresponds to Constant instruction and it could not be spilled to a stack. bool RegAllocLinearScan::IsNonSpillableConstInterval(LifeIntervals *interval) { if (interval->IsSplitSibling() || interval->IsPhysical()) { diff --git a/compiler/optimizer/optimizations/try_catch_resolving.cpp b/compiler/optimizer/optimizations/try_catch_resolving.cpp index bfca467faa1aafe614b4347400a679b2d8b1c1b8..0e17883793951b91971740f7bb2650de60c3237f 100644 --- a/compiler/optimizer/optimizations/try_catch_resolving.cpp +++ b/compiler/optimizer/optimizations/try_catch_resolving.cpp @@ -119,9 +119,7 @@ BasicBlock *TryCatchResolving::TryFindResolvedCatchHandler(BasicBlock *try_begin return resolved_handler; } -/** - * Disconnect auxiliary `try_begin` and `try_end`. That means all related catch-handlers become unreachable - */ +/// Disconnect auxiliary `try_begin` and `try_end`. That means all related catch-handlers become unreachable void TryCatchResolving::DeleteTryCatchEdges(BasicBlock *try_begin, BasicBlock *try_end) { while (try_begin->GetSuccsBlocks().size() > 1U) { @@ -139,9 +137,7 @@ void TryCatchResolving::DeleteTryCatchEdges(BasicBlock *try_begin, BasicBlock *t } } -/** - * Add edge between catch-handler and `try_end` follows `throw` instruction - */ +/// Add edge between catch-handler and `try_end` follows `throw` instruction void TryCatchResolving::ConnectCatchHandlerAfterThrow(BasicBlock *try_end, BasicBlock *catch_block) { ASSERT(try_end != nullptr && try_end->IsTryEnd()); @@ -203,9 +199,7 @@ void TryCatchResolving::RemoveCatchPhis(BasicBlock *block, Inst *throw_inst) block->SetCatchBegin(false); } -/** - * Return object's id if `Throw` has `NewObject` input - */ +/// Return object's id if `Throw` has `NewObject` input std::optional TryCatchResolving::TryGetObjectId(const Inst *inst) { ASSERT(inst->GetOpcode() == Opcode::Throw); diff --git a/compiler/optimizer/pass.h b/compiler/optimizer/pass.h index 7d37405282353224a2c8f4f08bee4ccf33dfb24e..7f76c9587b639e017704eac02af529308daba0ed 100644 --- a/compiler/optimizer/pass.h +++ b/compiler/optimizer/pass.h @@ -114,9 +114,7 @@ public: NO_COPY_SEMANTIC(Analysis); ~Analysis() override = default; - /** - * Is the IR should be dumped after the pass finished. - */ + /// Is the IR should be dumped after the pass finished. bool ShouldDump() const override { return false; diff --git a/compiler/tests/alias_analysis_test.cpp b/compiler/tests/alias_analysis_test.cpp index c52818b3a21350dd781b5e0fbb08e7382c298ab3..ce4663a1b51ca83a9a25c0c8e6670648ee4c136c 100644 --- a/compiler/tests/alias_analysis_test.cpp +++ b/compiler/tests/alias_analysis_test.cpp @@ -1010,9 +1010,7 @@ TEST_F(AliasAnalysisTest, NestedArrays) ASSERT_EQ(alias.CheckInstAlias(&INS(12), &INS(12)), AliasType::MUST_ALIAS); } -/** - * Nested arrays with immediate indices. - */ +/// Nested arrays with immediate indices. TEST_F(AliasAnalysisTest, NestedArraysImm) { GRAPH(GetGraph()) @@ -1191,9 +1189,7 @@ TEST_F(AliasAnalysisTest, NullCheckPhiInput) ASSERT_EQ(alias.CheckInstAlias(&INS(11), &INS(12)), AliasType::MAY_ALIAS); } -/** - * Select instruction is very similar to Phi. - */ +/// Select instruction is very similar to Phi. TEST_F(AliasAnalysisTest, Select) { GRAPH(GetGraph()) @@ -1302,9 +1298,7 @@ TEST_F(AliasAnalysisTest, CatchPhi) ASSERT_EQ(alias.CheckRefAlias(&INS(10), &INS(5)), AliasType::MAY_ALIAS); } -/** - * Test the assert that NullCheck is bypassed through RefTypeCheck - */ +/// Test the assert that NullCheck is bypassed through RefTypeCheck TEST_F(AliasAnalysisTest, RefTypeCheck) { GRAPH(GetGraph()) @@ -1330,9 +1324,7 @@ TEST_F(AliasAnalysisTest, RefTypeCheck) ASSERT_EQ(alias.CheckInstAlias(&INS(15), &INS(15)), AliasType::MUST_ALIAS); } -/** - * The field access is determined by field reference (if present) rather than TypeId. - */ +/// The field access is determined by field reference (if present) rather than TypeId. TEST_F(AliasAnalysisTest, InheritedFields) { RuntimeInterface::FieldPtr field = reinterpret_cast(0xDEADBEEF); // NOLINT(modernize-use-auto) @@ -1381,9 +1373,7 @@ TEST_F(AliasAnalysisTest, PairedAccessesAliasing) ASSERT_EQ(alias.CheckInstAlias(&INS(17), &INS(17)), AliasType::MUST_ALIAS); } -/** - * Volatile load does not quarantee that the same value would be loaded next time. - */ +/// Volatile load does not quarantee that the same value would be loaded next time. TEST_F(AliasAnalysisTest, VolatileAliasing) { GRAPH(GetGraph()) @@ -1420,9 +1410,7 @@ TEST_F(AliasAnalysisTest, VolatileAliasing) ASSERT_EQ(alias.CheckInstAlias(&INS(13), &INS(21)), AliasType::MAY_ALIAS); } -/** - * LoadObject with ObjectType == MEM_STATIC is treatet the same as LoadStatic - */ +/// LoadObject with ObjectType == MEM_STATIC is treatet the same as LoadStatic TEST_F(AliasAnalysisTest, LoadObjectStatic) { diff --git a/compiler/tests/class_hash_table_test.cpp b/compiler/tests/class_hash_table_test.cpp index 9e2e409b0ed1182b23ac2d3ff5815d90dbe985bb..08ecea0403583ccdf31dd932a03e4add4efc4464 100644 --- a/compiler/tests/class_hash_table_test.cpp +++ b/compiler/tests/class_hash_table_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/compiler/tests/code_sink_test.cpp b/compiler/tests/code_sink_test.cpp index 95f28c2985348d8213913186edc4b67a25195223..c545f61301da4a3ec81ecefde6cc100a83ba8cda 100644 --- a/compiler/tests/code_sink_test.cpp +++ b/compiler/tests/code_sink_test.cpp @@ -134,9 +134,7 @@ TEST_F(CodeSinkTest, DISABLED_LoadWithOperationPropagation) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), sunk_graph)); } -/** - * Do not move anything - */ +/// Do not move anything TEST_F(CodeSinkTest, NoDomination) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -168,9 +166,7 @@ TEST_F(CodeSinkTest, NoDomination) ASSERT_TRUE(GraphComparator().Compare(equal_graphs[0], equal_graphs[1])); } -/** - * Do not sink loads that may alias further stores in the block - */ +/// Do not sink loads that may alias further stores in the block TEST_F(CodeSinkTest, LoadStoreAliasing) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -270,9 +266,7 @@ TEST_F(CodeSinkTest, LoopSinking) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), sunk_graph)); } -/** - * Sink instruction over critical edge - */ +/// Sink instruction over critical edge TEST_F(CodeSinkTest, CriticalEdgeSinking) { GRAPH(GetGraph()) @@ -328,9 +322,7 @@ TEST_F(CodeSinkTest, CriticalEdgeSinking) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), sunk_graph)); } -/** - * Do not sink loads over monitor - */ +/// Do not sink loads over monitor TEST_F(CodeSinkTest, LoadOverMonitor) { GRAPH(GetGraph()) @@ -402,9 +394,7 @@ TEST_F(CodeSinkTest, LoadOverMonitor) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), sunk_graph)); } -/** - * Reordering of Normal Load and subsequent Volatile Load is allowed - */ +/// Reordering of Normal Load and subsequent Volatile Load is allowed // TODO(Kudriashov Evgenii) enable the test after fixing CodeSink TEST_F(CodeSinkTest, DISABLED_LoadOverVolatileLoad) { @@ -540,9 +530,7 @@ TEST_F(CodeSinkTest, IntermediateSinking) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), sunk_graph)); } -/** - * Do not sink object allocations - */ +/// Do not sink object allocations TEST_F(CodeSinkTest, Allocations) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -581,9 +569,7 @@ TEST_F(CodeSinkTest, Allocations) ASSERT_TRUE(GraphComparator().Compare(equal_graphs[0], equal_graphs[1])); } -/** - * Do not sink over PHI statement - */ +/// Do not sink over PHI statement TEST_F(CodeSinkTest, PhiUsers) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -614,9 +600,7 @@ TEST_F(CodeSinkTest, PhiUsers) ASSERT_TRUE(GraphComparator().Compare(equal_graphs[0], equal_graphs[1])); } -/** - * Do not sink volatile loads because other paths might be broken because of it - */ +/// Do not sink volatile loads because other paths might be broken because of it TEST_F(CodeSinkTest, SinkableVolatileLoad) { GRAPH(GetGraph()) @@ -645,9 +629,7 @@ TEST_F(CodeSinkTest, SinkableVolatileLoad) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not sink loads over volatile store - */ +/// Do not sink loads over volatile store TEST_F(CodeSinkTest, LoadOverVolatileStore) { GRAPH(GetGraph()) @@ -680,9 +662,7 @@ TEST_F(CodeSinkTest, LoadOverVolatileStore) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not sink loads over GC barriered store. - */ +/// Do not sink loads over GC barriered store. TEST_F(CodeSinkTest, LoadOverRefStore) { GRAPH(GetGraph()) @@ -713,9 +693,7 @@ TEST_F(CodeSinkTest, LoadOverRefStore) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not sink into irreducible loops. - */ +/// Do not sink into irreducible loops. TEST_F(CodeSinkTest, SinkIntoIrreducible) { GRAPH(GetGraph()) @@ -762,9 +740,7 @@ TEST_F(CodeSinkTest, SinkIntoIrreducible) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not try to sink if an instruction has no uses. It's a waste of time. - */ +/// Do not try to sink if an instruction has no uses. It's a waste of time. TEST_F(CodeSinkTest, UselessSinking) { GRAPH(GetGraph()) diff --git a/compiler/tests/inst_test.cpp b/compiler/tests/inst_test.cpp index d3c377012c650f769f3698ce0f59d3c4e423ace6..4f528b48ab63553b3dd09668a2a2745ca4ce3caf 100644 --- a/compiler/tests/inst_test.cpp +++ b/compiler/tests/inst_test.cpp @@ -529,9 +529,7 @@ TEST_F(InstTest, RemovePhiInput) } } -/** - * Test creating instruction with huge dynamic inputs amount - */ +/// Test creating instruction with huge dynamic inputs amount TEST_F(InstTest, HugeDynamicOperandsAmount) { auto graph = CreateGraphStartEndBlocks(); diff --git a/compiler/tests/licm_conditions_test.cpp b/compiler/tests/licm_conditions_test.cpp index 4fe46c098c16d94804c091b4c7291ea9661cafd0..9b5408640750b1d8b9348d436368f36b9f61a7bc 100644 --- a/compiler/tests/licm_conditions_test.cpp +++ b/compiler/tests/licm_conditions_test.cpp @@ -21,9 +21,7 @@ class LicmConditionsTest : public GraphTest {}; // NOLINTBEGIN(readability-magic-numbers,readability-function-size) -/** - * Graph is similar to TestUpdatePhiCorrectPredOrder but 14p prevents hoisting - */ +/// Graph is similar to TestUpdatePhiCorrectPredOrder but 14p prevents hoisting TEST_F(LicmConditionsTest, TestPhiPreventsConditionHoisting) { GRAPH(GetGraph()) diff --git a/compiler/tests/lse_test.cpp b/compiler/tests/lse_test.cpp index 82028375c8b594fd28a248cb7f91bcf0f3aeae3d..624a340fa02a147d3176249632fb40f9a42cba62 100644 --- a/compiler/tests/lse_test.cpp +++ b/compiler/tests/lse_test.cpp @@ -23,9 +23,7 @@ namespace panda::compiler { class LSETest : public GraphTest {}; // NOLINTBEGIN(readability-magic-numbers) -/** - * Two consecutive loads of the same array element with leading store - */ +/// Two consecutive loads of the same array element with leading store TEST_F(LSETest, SimpleLoad) { GRAPH(GetGraph()) @@ -74,9 +72,7 @@ TEST_F(LSETest, SimpleLoad) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Two consecutive stores to the same array element - */ +/// Two consecutive stores to the same array element TEST_F(LSETest, SimpleStore) { GRAPH(GetGraph()) @@ -118,9 +114,7 @@ TEST_F(LSETest, SimpleStore) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Store comes from previous basic block - */ +/// Store comes from previous basic block TEST_F(LSETest, PreviousBlocks) { GRAPH(GetGraph()) @@ -175,9 +169,7 @@ TEST_F(LSETest, PreviousBlocks) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Loading unknown value twice - */ +/// Loading unknown value twice TEST_F(LSETest, LoadWithoutStore) { GRAPH(GetGraph()) @@ -209,9 +201,7 @@ TEST_F(LSETest, LoadWithoutStore) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Empty basic block after elimination - */ +/// Empty basic block after elimination TEST_F(LSETest, EmptyBB) { GRAPH(GetGraph()) @@ -257,9 +247,7 @@ TEST_F(LSETest, EmptyBB) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Do not load constant multiple times - */ +/// Do not load constant multiple times TEST_F(LSETest, DISABLED_PoolConstants) { GRAPH(GetGraph()) @@ -310,9 +298,7 @@ TEST_F(LSETest, DISABLED_PoolConstants) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Eliminate object field's operations. - */ +/// Eliminate object field's operations. TEST_F(LSETest, InstanceFields) { GRAPH(GetGraph()) @@ -348,9 +334,7 @@ TEST_F(LSETest, InstanceFields) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * A store before branch eliminates a load after branch - */ +/// A store before branch eliminates a load after branch TEST_F(LSETest, DominationHere) { GRAPH(GetGraph()) @@ -398,9 +382,7 @@ TEST_F(LSETest, DominationHere) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Infer the stored value through the heap - */ +/// Infer the stored value through the heap TEST_F(LSETest, TransitiveValues) { GRAPH(GetGraph()) @@ -523,9 +505,7 @@ TEST_F(LSETest, StoreReplacementDominatesStoreEliminable) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Load elimination in loop by means of a dominated load - */ +/// Load elimination in loop by means of a dominated load TEST_F(LSETest, LoopElimination) { GRAPH(GetGraph()) @@ -602,9 +582,7 @@ TEST_F(LSETest, LoopElimination) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Loop of multiple blocks - */ +/// Loop of multiple blocks TEST_F(LSETest, LoopBranches) { GRAPH(GetGraph()) @@ -715,9 +693,7 @@ TEST_F(LSETest, LoopBranches) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Nested loop elimination - */ +/// Nested loop elimination TEST_F(LSETest, NestedLoopElimination) { GRAPH(GetGraph()) @@ -836,9 +812,7 @@ TEST_F(LSETest, NestedLoopElimination) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Replace only MUST_ALIASed accesses - */ +/// Replace only MUST_ALIASed accesses TEST_F(LSETest, LoopWithMayAliases) { GRAPH(GetGraph()) @@ -914,9 +888,7 @@ TEST_F(LSETest, LoopWithMayAliases) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Loop elimination combined with regular elimination - */ +/// Loop elimination combined with regular elimination TEST_F(LSETest, CombinedWithLoop) { GRAPH(GetGraph()) @@ -990,9 +962,7 @@ TEST_F(LSETest, CombinedWithLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Phi candidates are the origins of values on the heap - */ +/// Phi candidates are the origins of values on the heap TEST_F(LSETest, OverwrittenPhiCandidates) { GRAPH(GetGraph()) @@ -1153,9 +1123,7 @@ TEST_F(LSETest, DeletedPhiCandidate) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Stored value might be casted therefore we should cast if types are different - */ +/// Stored value might be casted therefore we should cast if types are different TEST_F(LSETest, PrimitiveTypeCasting) { GRAPH(GetGraph()) @@ -1253,9 +1221,7 @@ TEST_F(LSETest, PrimitiveInt8TypeCasting) ASSERT_TRUE(GraphComparator().Compare(graph, graph_lsed)); } -/** - * Overwritten load in loop - */ +/// Overwritten load in loop TEST_F(LSETest, LoopWithOverwrite) { GRAPH(GetGraph()) @@ -1334,9 +1300,7 @@ TEST_F(LSETest, LoopWithOverwrite) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Eliminate loads saved in SaveState and SafePoint. - */ +/// Eliminate loads saved in SaveState and SafePoint. TEST_F(LSETest, SavedLoadInSafePoint) { GRAPH(GetGraph()) @@ -1374,9 +1338,7 @@ TEST_F(LSETest, SavedLoadInSafePoint) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * SafePoint may relocate collected references making them invalid - */ +/// SafePoint may relocate collected references making them invalid TEST_F(LSETest, LoopWithSafePoint) { GRAPH(GetGraph()) @@ -1427,9 +1389,7 @@ TEST_F(LSETest, LoopWithSafePoint) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Call generally invalidates all heap. - */ +/// Call generally invalidates all heap. TEST_F(LSETest, MemEscaping) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -1557,9 +1517,7 @@ TEST_F(LSETest, ReplaceByDominated) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Normal loads and stores can be eliminated after volatile store - */ +/// Normal loads and stores can be eliminated after volatile store TEST_F(LSETest, ReorderableVolatileStore) { GRAPH(GetGraph()) @@ -1638,9 +1596,7 @@ TEST_F(LSETest, ReorderableVolatileStoreWithOutBridge) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * v9 and v12 MAY_ALIAS each other. But after elimination of v11 they have NO_ALIAS. - */ +/// v9 and v12 MAY_ALIAS each other. But after elimination of v11 they have NO_ALIAS. TEST_F(LSETest, PhiCandidatesWithUpdatedAA) { GRAPH(GetGraph()) @@ -1946,9 +1902,7 @@ TEST_F(LSETest, EliminatedWithSafePointNeedBridge) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Not aliased array acceses, since array cannot overlap each other - */ +/// Not aliased array acceses, since array cannot overlap each other TEST_F(LSETest, SameArrayAccesses) { GRAPH(GetGraph()) @@ -2019,9 +1973,7 @@ TEST_F(LSETest, SameArrayAccesses) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Eliminate in case of inlined virtual calls - */ +/// Eliminate in case of inlined virtual calls TEST_F(LSETest, OverInlinedVirtualCall) { GRAPH(GetGraph()) @@ -2085,9 +2037,7 @@ TEST_F(LSETest, OverInlinedVirtualCall) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Counter case with aliased store - */ +/// Counter case with aliased store TEST_F(LSETest, SameArrayAccessesWithOverwrite) { GRAPH(GetGraph()) @@ -2123,9 +2073,7 @@ TEST_F(LSETest, SameArrayAccessesWithOverwrite) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Counter case with unknown index - */ +/// Counter case with unknown index TEST_F(LSETest, SameArrayAccessesWithUnknownIndices) { GRAPH(GetGraph()) @@ -2160,9 +2108,7 @@ TEST_F(LSETest, SameArrayAccessesWithUnknownIndices) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * A store does not dominate a load - */ +/// A store does not dominate a load TEST_F(LSETest, NoDominationHere) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -2288,9 +2234,7 @@ TEST_F(LSETest, EliminateMonitoredLoads) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Stores that cannot be eliminated due to monitors - */ +/// Stores that cannot be eliminated due to monitors TEST_F(LSETest, NotEliminableMonitoredStores) { std::vector equal_graphs = {GetGraph(), CreateEmptyGraph()}; @@ -2342,9 +2286,7 @@ TEST_F(LSETest, NotEliminableMonitoredLoadStore) ASSERT_TRUE(GraphComparator().Compare(equal_graphs[0], equal_graphs[1])); } -/** - * Inner loop overwrites outer loop reference. No elimination - */ +/// Inner loop overwrites outer loop reference. No elimination TEST_F(LSETest, InnerOverwrite) { GRAPH(GetGraph()) @@ -2407,9 +2349,7 @@ TEST_F(LSETest, InnerOverwrite) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Outer loop overwrites inner loop reference. - */ +/// Outer loop overwrites inner loop reference. TEST_F(LSETest, OuterOverwrite) { GRAPH(GetGraph()) @@ -2524,9 +2464,7 @@ TEST_F(LSETest, OuterOverwrite) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Invalidating phi candidates - */ +/// Invalidating phi candidates TEST_F(LSETest, PhiCandOverCall) { GRAPH(GetGraph()) @@ -2574,9 +2512,7 @@ TEST_F(LSETest, PhiCandOverCall) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Not dominated volatile load - */ +/// Not dominated volatile load TEST_F(LSETest, NotDominatedVolatileLoad) { GRAPH(GetGraph()) @@ -2612,9 +2548,7 @@ TEST_F(LSETest, NotDominatedVolatileLoad) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * If we eliminate load over safepoint, check that it is correctly bridged - */ +/// If we eliminate load over safepoint, check that it is correctly bridged TEST_F(LSETest, LoadsWithSafePoint) { GRAPH(GetGraph()) @@ -2657,9 +2591,7 @@ TEST_F(LSETest, LoadsWithSafePoint) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Pool constants can be relocated as well and should be bridged. - */ +/// Pool constants can be relocated as well and should be bridged. TEST_F(LSETest, RelocatablePoolConstants) { GRAPH(GetGraph()) @@ -2708,9 +2640,7 @@ TEST_F(LSETest, RelocatablePoolConstants) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * If we replace load in loop by value stored before loop, check that it's correctly bridged in any loop safepoints - */ +/// If we replace load in loop by value stored before loop, check that it's correctly bridged in any loop safepoints TEST_F(LSETest, StoreAndLoadLoopWithSafepoint) { GRAPH(GetGraph()) @@ -2757,9 +2687,7 @@ TEST_F(LSETest, StoreAndLoadLoopWithSafepoint) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * If we hoist load from loop, check that it's correctly bridged in any loop safepoints - */ +/// If we hoist load from loop, check that it's correctly bridged in any loop safepoints TEST_F(LSETest, HoistFromLoopWithSafepoint) { GRAPH(GetGraph()) @@ -2803,9 +2731,7 @@ TEST_F(LSETest, HoistFromLoopWithSafepoint) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Store that is not read, but overwritten on all paths is removed - */ +/// Store that is not read, but overwritten on all paths is removed TEST_F(LSETest, RemoveShadowedStore) { GRAPH(GetGraph()) @@ -2867,9 +2793,7 @@ TEST_F(LSETest, RemoveShadowedStore) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Store that is not read, but not overwritten on all paths is not removed - */ +/// Store that is not read, but not overwritten on all paths is not removed TEST_F(LSETest, DontRemoveStoreIfPathWithoutShadowExists) { GRAPH(GetGraph()) @@ -2967,9 +2891,7 @@ TEST_F(LSETest, DISABLED_ShadowInInnerLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Stores are not removed from loops, unless they're shadowed in the same loop - */ +/// Stores are not removed from loops, unless they're shadowed in the same loop TEST_F(LSETest, ShadowedStoresInLoop) { GRAPH(GetGraph()) @@ -3054,9 +2976,7 @@ TEST_F(LSETest, ShadowedStoresInLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Store that can be read is not removed - */ +/// Store that can be read is not removed TEST_F(LSETest, DontRemoveShadowedStoreIfRead) { GRAPH(GetGraph()) @@ -3080,9 +3000,7 @@ TEST_F(LSETest, DontRemoveShadowedStoreIfRead) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Check that shadows store search correctly handles irreducible loops - */ +/// Check that shadows store search correctly handles irreducible loops TEST_F(LSETest, ShadowStoreWithIrreducibleLoop) { GRAPH(GetGraph()) @@ -3133,9 +3051,7 @@ TEST_F(LSETest, ShadowStoreWithIrreducibleLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not eliminate loads over runtime calls due to GC relocations - */ +/// Do not eliminate loads over runtime calls due to GC relocations TEST_F(LSETest, LoadsWithRuntimeCalls) { GRAPH(GetGraph()) @@ -3165,9 +3081,7 @@ TEST_F(LSETest, LoadsWithRuntimeCalls) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Do not eliminate through static constructors - */ +/// Do not eliminate through static constructors TEST_F(LSETest, OverClassInitialization) { GRAPH(GetGraph()) @@ -3191,9 +3105,7 @@ TEST_F(LSETest, OverClassInitialization) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Don't hoist from irreducible loop - */ +/// Don't hoist from irreducible loop TEST_F(LSETest, DontHoistWithIrreducibleLoop) { GRAPH(GetGraph()) @@ -3245,9 +3157,7 @@ TEST_F(LSETest, DontHoistWithIrreducibleLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Don't hoist values not alive on backedge - */ +/// Don't hoist values not alive on backedge TEST_F(LSETest, DontHoistIfNotAlive) { GRAPH(GetGraph()) @@ -3294,9 +3204,7 @@ TEST_F(LSETest, DontHoistIfNotAlive) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Don't hoist values not alive on backedge - */ +/// Don't hoist values not alive on backedge TEST_F(LSETest, DontHoistIfNotAliveTriangle) { GRAPH(GetGraph()) @@ -3340,9 +3248,7 @@ TEST_F(LSETest, DontHoistIfNotAliveTriangle) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Double hoist - */ +/// Double hoist TEST_F(LSETest, HoistInnerLoop) { GRAPH(GetGraph()) @@ -3411,9 +3317,7 @@ TEST_F(LSETest, HoistInnerLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Single hoist - */ +/// Single hoist TEST_F(LSETest, HoistInnerLoop2) { GRAPH(GetGraph()) @@ -3490,9 +3394,7 @@ TEST_F(LSETest, HoistInnerLoop2) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Don't hoist due to inner store - */ +/// Don't hoist due to inner store TEST_F(LSETest, DontHoistOuterLoop) { GRAPH(GetGraph()) @@ -3532,9 +3434,7 @@ TEST_F(LSETest, DontHoistOuterLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Don't hoist from OSR loop - */ +/// Don't hoist from OSR loop TEST_F(LSETest, DontHoistFromOsrLoop) { GetGraph()->SetMode(GraphMode::Osr()); @@ -3736,9 +3636,7 @@ TEST_F(LSETest, AliveLoadInBackedgeInnerLoop) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Do not eliminate loads over runtime calls due to GC relocations - */ +/// Do not eliminate loads over runtime calls due to GC relocations TEST_F(LSETest, PhiOverSaveStates) { GRAPH(GetGraph()) @@ -3802,9 +3700,7 @@ TEST_F(LSETest, PhiOverSaveStates) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Simple condition phi - */ +/// Simple condition phi TEST_F(LSETest, SimpleConditionPhi) { GRAPH(GetGraph()) @@ -3859,9 +3755,7 @@ TEST_F(LSETest, SimpleConditionPhi) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * Simple condition phi - */ +/// Simple condition phi TEST_F(LSETest, SimpleConditionPhi2) { GRAPH(GetGraph()) @@ -3958,9 +3852,7 @@ TEST_F(LSETest, SimpleConditionPhiMayAlias) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), initial)); } -/** - * Simple condition phi, check bridges - */ +/// Simple condition phi, check bridges TEST_F(LSETest, SimpleConditionPhiWithRefInputs) { GRAPH(GetGraph()) @@ -4023,9 +3915,7 @@ TEST_F(LSETest, SimpleConditionPhiWithRefInputs) ASSERT_TRUE(GraphComparator().Compare(GetGraph(), graph_lsed)); } -/** - * SaveStateDeoptimize does not prevent elimination and does not need bridges - */ +/// SaveStateDeoptimize does not prevent elimination and does not need bridges TEST_F(LSETest, EliminateOverSaveStateDeoptimize) { GRAPH(GetGraph()) diff --git a/compiler/tests/reg_alloc_common_test.cpp b/compiler/tests/reg_alloc_common_test.cpp index aaab01c2cd5d59b4f02d4dd5f55aa81715674bf8..d81f05e2cce8a0ca0e9cfa03f15a9640b6ba0924 100644 --- a/compiler/tests/reg_alloc_common_test.cpp +++ b/compiler/tests/reg_alloc_common_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/compiler/tests/reg_alloc_linear_scan_test.cpp b/compiler/tests/reg_alloc_linear_scan_test.cpp index c745ce25de4067cfdcfd9119274cbc2d755fa49b..d5b7a98d18ff15f4220230f3e57de8ef41cd355b 100644 --- a/compiler/tests/reg_alloc_linear_scan_test.cpp +++ b/compiler/tests/reg_alloc_linear_scan_test.cpp @@ -820,9 +820,7 @@ TEST_F(RegAllocLinearScanTest, MultiDestInstruction) ASSERT_EQ(INS(7).GetSrcReg(1), load_pair->GetDstReg(1)); } -/** - * Create COUNT constants and assign COUNT registers for them - */ +/// Create COUNT constants and assign COUNT registers for them TEST_F(RegAllocLinearScanTest, DynamicRegsMask) { auto graph = CreateEmptyBytecodeGraph(); diff --git a/compiler/tools/paoc/paoc.cpp b/compiler/tools/paoc/paoc.cpp index f0b27c729c429302c21079e2ffa9b4f20e787a45..cb9301fffb1be26b7b21634066363dc0dc6da848 100644 --- a/compiler/tools/paoc/paoc.cpp +++ b/compiler/tools/paoc/paoc.cpp @@ -70,9 +70,7 @@ void Paoc::CompilingContext::DumpStatistics() const *stats << graph_local_allocator.GetAllocatedSize() << '\n'; } -/** - * A class that encloses paoc's initialization: - */ +/// A class that encloses paoc's initialization: class Paoc::PaocInitializer { public: explicit PaocInitializer(Paoc *paoc) : paoc_(paoc) {} diff --git a/disassembler/accumulators.h b/disassembler/accumulators.h index e4e476c65e3f6472d99af16e7fbf066060848ce8..96b7af1c277707a6ec482a5a3f0a5b9edd723e12 100644 --- a/disassembler/accumulators.h +++ b/disassembler/accumulators.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/disasm.cpp b/disassembler/disasm.cpp index 164a83e59b328a2fb9d14c37f6e0675ce79009e4..3a96e5bd462005d12081b0915d4dd7dc1ff98d20 100644 --- a/disassembler/disasm.cpp +++ b/disassembler/disasm.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/disassembler.cpp b/disassembler/disassembler.cpp index 242981c01f088c5b4104b939a7d46300b513f47b..f299e043f26867c2389defa9b66c0e18122bbe3d 100644 --- a/disassembler/disassembler.cpp +++ b/disassembler/disassembler.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. @@ -620,9 +620,7 @@ void Disassembler::GetMethods(const panda_file::File::EntityId &record_id) void Disassembler::GetParams(pandasm::Function *method, const panda_file::File::EntityId &proto_id) const { - /** - * frame size - 2^16 - 1 - */ + /// frame size - 2^16 - 1 static const uint32_t MAX_ARG_NUM = 0xFFFF; LOG(DEBUG, DISASSEMBLER) << "[getting params]\nproto id: " << proto_id << " (0x" << std::hex << proto_id << ")"; diff --git a/disassembler/disassembler.h b/disassembler/disassembler.h index 413e6f6a260c3cb162004a9fae071fd477ceab1e..a92380e1a49c724f51bd794c26cff91ed53dba9f 100644 --- a/disassembler/disassembler.h +++ b/disassembler/disassembler.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/extractor_test.cpp b/disassembler/tests/extractor_test.cpp index 40b753d1ae8581240f96da384ace88350a59a1cc..419381f05d7748315f86dadfc08cfa1376c88a6a 100644 --- a/disassembler/tests/extractor_test.cpp +++ b/disassembler/tests/extractor_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/disassembler/tests/functions_test.cpp b/disassembler/tests/functions_test.cpp index b3a25c02b6d98d500adc742e09d967eeaa9f3100..8aa6a8e212084673aa2f4f1d3ed0d9a49118f7c1 100644 --- a/disassembler/tests/functions_test.cpp +++ b/disassembler/tests/functions_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/disassembler/tests/instructions_test.cpp b/disassembler/tests/instructions_test.cpp index 7cf283c58a50aaea56b6b67245db59b7393e8856..37e85ca00e15aec002ec2269a742038acc232bf7 100644 --- a/disassembler/tests/instructions_test.cpp +++ b/disassembler/tests/instructions_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/labels_test.cpp b/disassembler/tests/labels_test.cpp index 08ce335974c31c39caa880aab3ab3421b7df2916..c8eab1c7347eef2c0963104e3650286c19c21e07 100644 --- a/disassembler/tests/labels_test.cpp +++ b/disassembler/tests/labels_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/literals_test.cpp b/disassembler/tests/literals_test.cpp index 28a41ff8a05cf93fa05695a821c2859bef981f26..67aa4cab8d2220fea985274907e180bd1c79b878 100644 --- a/disassembler/tests/literals_test.cpp +++ b/disassembler/tests/literals_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/metadata_test.cpp b/disassembler/tests/metadata_test.cpp index 5c5a39640b3b0f6a4e4e2c0a17212de6660e5ae6..b0fb77d4162535219f70902913201bd3eff9e543 100644 --- a/disassembler/tests/metadata_test.cpp +++ b/disassembler/tests/metadata_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/records_test.cpp b/disassembler/tests/records_test.cpp index b76f864d3a080d425efd0b09d7d49a8f1fa0f627..2ff372a5ed4ca78f43e2eb81629c434d86b09b63 100644 --- a/disassembler/tests/records_test.cpp +++ b/disassembler/tests/records_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/disassembler/tests/test_debug_info.cpp b/disassembler/tests/test_debug_info.cpp index 39652e4e460c706b6cea612596f648db27bb835b..579980aa2dc7142c2135ed7e5a57c2ae508030e5 100644 --- a/disassembler/tests/test_debug_info.cpp +++ b/disassembler/tests/test_debug_info.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/docs/doxygen.config b/docs/doxygen.config index 21d08ae67fa0ced81c9fe10095ad8dc37b4fbdf9..5c3f8e2a55f14007d701843b4665294cb0678b4d 100644 --- a/docs/doxygen.config +++ b/docs/doxygen.config @@ -187,7 +187,7 @@ SHORT_NAMES = NO # description.) # The default value is: NO. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If @@ -195,7 +195,7 @@ JAVADOC_AUTOBRIEF = NO # requiring an explicit \brief command for a brief description.) # The default value is: NO. -QT_AUTOBRIEF = NO +QT_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as diff --git a/irtoc/backend/compiler/codegen_boundary.h b/irtoc/backend/compiler/codegen_boundary.h index 68a8c354fad243f9905c680ab1c3d053da618db7..50baede446265acbff9ef7ba887411ec26a4e2b8 100644 --- a/irtoc/backend/compiler/codegen_boundary.h +++ b/irtoc/backend/compiler/codegen_boundary.h @@ -20,9 +20,7 @@ namespace panda::compiler { -/** - * Code generation for code living within Boundary Frame - */ +/// Code generation for code living within Boundary Frame class CodegenBoundary : public Codegen { public: using Codegen::Codegen; diff --git a/libpandabase/arch/aarch64/cpu_features.cpp b/libpandabase/arch/aarch64/cpu_features.cpp index b20898ec5a4031f6581fc1490294b559f50bb344..0c617c6b07b7de223f5427753527739dec3631d3 100644 --- a/libpandabase/arch/aarch64/cpu_features.cpp +++ b/libpandabase/arch/aarch64/cpu_features.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/arch/default/cpu_features.cpp b/libpandabase/arch/default/cpu_features.cpp index bd0bc818d04d5a57a13ffbd3c559834b7617e37e..80d5380880cfde1b0160c802e8c0fa3331d34091 100644 --- a/libpandabase/arch/default/cpu_features.cpp +++ b/libpandabase/arch/default/cpu_features.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/concepts.h b/libpandabase/concepts.h index 6fbea2768b1b47f3bc17656f53f3c30f01d45b20..05ab92b38c6aa38af2a5139e297229a422a2cb31 100644 --- a/libpandabase/concepts.h +++ b/libpandabase/concepts.h @@ -114,10 +114,9 @@ constexpr bool is_hash_mappable_v = is_hash_mappable::value; /** * Added in C++20 + * Checks whether T is an array type of unknown bound */ -/// Checks whether T is an array type of unknown bound - template struct is_unbounded_array : public std::false_type { }; diff --git a/libpandabase/cpu_features.h b/libpandabase/cpu_features.h index ef7fb89c8fe3535ef32a5599fb347e5b68b97a43..e6760683bdf4d039bd638588e525569825101b60 100644 --- a/libpandabase/cpu_features.h +++ b/libpandabase/cpu_features.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/mem/arena-inl.h b/libpandabase/mem/arena-inl.h index 00bc2263d63b2186e5915589b2c68669956ab61c..8e5764b0f633a32e07eb34002fa05bce578468f5 100644 --- a/libpandabase/mem/arena-inl.h +++ b/libpandabase/mem/arena-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/libpandabase/mem/arena.h b/libpandabase/mem/arena.h index c6cd1cff963b7c5bb4c0a89a2698e4ca5463e3b1..2d877971f1887195e0af23d914af3a87bffdea5d 100644 --- a/libpandabase/mem/arena.h +++ b/libpandabase/mem/arena.h @@ -33,7 +33,7 @@ public: DEFAULT_COPY_SEMANTIC(Arena); /** - * \brief Allocates memory with size \param size and aligned with \param alignment + * @brief Allocates memory with size @param size and aligned with @param alignment * @param size - size of the allocated memory * @param alignment - alignment of the allocated memory * @return pointer to the allocated memory on success, or nullptr on fail @@ -41,50 +41,36 @@ public: void *Alloc(size_t size, Alignment alignment = ARENA_DEFAULT_ALIGNMENT); /** - * \brief Links this Arena to the \param arena + * @brief Links this Arena to the @param arena * @param arena - Arena which will be linked as next to the current */ void LinkTo(Arena *arena); - /** - * \brief Clear link to the next arena - */ + /// @brief Clear link to the next arena void ClearNextLink(); /** - * \brief Returns next linked Arena + * @brief Returns next linked Arena * @return next linked Arena or nullptr */ Arena *GetNextArena() const; - /** - * @return Size of free area in the arena - */ + /// @return Size of free area in the arena size_t GetFreeSize() const; - /** - * @return Size of an occupied area in the arena - */ + /// @return Size of an occupied area in the arena size_t GetOccupiedSize() const; - /** - * @return A pointer to the first byte not in the arena - */ + /// @return A pointer to the first byte not in the arena void *GetArenaEnd() const; - /** - * @return A pointer to the first not allocated byte - */ + /// @return A pointer to the first not allocated byte void *GetAllocatedEnd() const; - /** - * @return A pointer to the first allocated byte - */ + /// @return A pointer to the first allocated byte void *GetAllocatedStart() const; - /** - * @return A pointer to the raw memory inside arena - */ + /// @return A pointer to the raw memory inside arena void *GetMem() const { return buff_; @@ -101,28 +87,22 @@ public: } /** - * \brief Check that \param mem is stored inside this Arena + * @brief Check that @param mem is stored inside this Arena * @return true on success, or false on fail */ bool InArena(const void *mem) const; - /** - * \brief Mark all memory after \param mem as free. Check that \param mem is stored inside this arena. - */ + /// @brief Mark all memory after @param mem as free. Check that @param mem is stored inside this arena. void Free(void *mem); - /** - * \brief Set occupied memory size to \param new_size. - */ + /// @brief Set occupied memory size to @param new_size. void Resize(size_t new_size); - /* - * \brief empties arena - */ + /// @brief empties arena void Reset(); - /* - * \brief Expand arena. The new memory must be located just after the current buffer. + /** + * @brief Expand arena. The new memory must be located just after the current buffer. * @param extra_buff - pointer to the extra buffer located just after the current. * @param size - the size of the extra buffer */ @@ -131,8 +111,8 @@ public: protected: Arena(size_t buff_size, void *buff, Alignment start_alignment); /** - * \brief Fast allocates memory with size \param size - * @param size - size of the allocated memory, must be \param alignment aligned + * @brief Fast allocates memory with size @param size + * @param size - size of the allocated memory, must be @param alignment aligned * @param alignment - alignment of the allocated memory, used only for debug * @return pointer to the allocated memory on success, or nullptr on fail */ @@ -174,7 +154,7 @@ public: DoubleLinkedAlignedArena(size_t buff_size, void *buff) : AlignedArena(buff_size, buff) {} /** - * \brief Links this Arena to the next \param arena + * @brief Links this Arena to the next @param arena * @param arena - Arena which will be linked as next to the current */ void LinkNext(DoubleLinkedAlignedArena *arena) @@ -183,7 +163,7 @@ public: } /** - * \brief Links this Arena to the prev \param arena + * @brief Links this Arena to the prev @param arena * @param arena - Arena which will be linked as prev to the current */ void LinkPrev(DoubleLinkedAlignedArena *arena) @@ -193,7 +173,7 @@ public: } /** - * \brief Returns next linked Arena + * @brief Returns next linked Arena * @return next linked Arena or nullptr */ DoubleLinkedAlignedArena *GetNextArena() const @@ -202,7 +182,7 @@ public: } /** - * \brief Returns prev linked Arena + * @brief Returns prev linked Arena * @return prev linked Arena or nullptr */ DoubleLinkedAlignedArena *GetPrevArena() const @@ -210,9 +190,7 @@ public: return prev_; } - /** - * \brief Clear link to the prev arena - */ + /// @brief Clear link to the prev arena void ClearPrevLink() { prev_ = nullptr; diff --git a/libpandabase/mem/arena_allocator.h b/libpandabase/mem/arena_allocator.h index 37ae2e02f23ea8ddb83575071aa2bc9ba3033ed8..e5f75c3944cbc28e3f979922c7f071251824fa8d 100644 --- a/libpandabase/mem/arena_allocator.h +++ b/libpandabase/mem/arena_allocator.h @@ -111,8 +111,8 @@ public: PANDA_PUBLIC_API size_t GetAllocatedSize() const; /** - * \brief Set the size of allocated memory to \param new_size. - * Free all memory that exceeds \param new_size bytes in the allocator. + * @brief Set the size of allocated memory to @param new_size. + * Free all memory that exceeds @param new_size bytes in the allocator. */ PANDA_PUBLIC_API void Resize(size_t new_size); @@ -180,13 +180,13 @@ private: }; /** - * \brief Adds Arena from MallocMemPool and links it to active + * @brief Adds Arena from MallocMemPool and links it to active * @param pool_size size of new pool */ bool AddArenaFromPool(size_t pool_size); /** - * \brief Allocate new element. + * @brief Allocate new element. * Try to allocate new element at current arena or try to add new pool to this allocator and allocate element at new * pool * @param size new element size diff --git a/libpandabase/mem/code_allocator.h b/libpandabase/mem/code_allocator.h index 7b355396586c7843f9a806a75c5d9916c30916cd..e6bf6a2c8d6a0d85f4052b1f10c8f1f2bfac8e0b 100644 --- a/libpandabase/mem/code_allocator.h +++ b/libpandabase/mem/code_allocator.h @@ -32,7 +32,7 @@ public: NO_MOVE_SEMANTIC(CodeAllocator); /** - * \brief Allocates \param size bytes, copies \param codeBuff to allocated memory and make this memory executable + * @brief Allocates @param size bytes, copies @param codeBuff to allocated memory and make this memory executable * @param size * @param codeBuff * @return @@ -40,7 +40,7 @@ public: [[nodiscard]] PANDA_PUBLIC_API void *AllocateCode(size_t size, const void *code_buff); /** - * \brief Allocates \param size bytes of non-protected memory + * @brief Allocates @param size bytes of non-protected memory * @param size to be allocated * @return MapRange of the allocated code */ @@ -52,9 +52,7 @@ public: */ PANDA_PUBLIC_API static void ProtectCode(os::mem::MapRange mem_range); - /** - * Fast check if the given program counter belongs to JIT code - */ + /// Fast check if the given program counter belongs to JIT code PANDA_PUBLIC_API bool InAllocatedCodeRange(const void *pc); private: diff --git a/libpandabase/mem/gc_barrier.h b/libpandabase/mem/gc_barrier.h index 43ced046d8d5d150e6bda5fa892c475fbaa0f513..f5c2cd8bb9a9b0961fbc03a05ebe3398d498efb5 100644 --- a/libpandabase/mem/gc_barrier.h +++ b/libpandabase/mem/gc_barrier.h @@ -25,17 +25,13 @@ namespace panda::mem { -/** - * Represents Pre and Post barrier - */ +/// Represents Pre and Post barrier enum BarrierPosition : uint8_t { BARRIER_POSITION_PRE = 0x1, // Should be inserted before each store/load when reference stored/loaded BARRIER_POSITION_POST = 0x0, // Should be inserted after each store/load when reference stored/loaded }; -/** - * Indicates if barrier for store or load - */ +/// Indicates if barrier for store or load enum BarrierActionType : uint8_t { WRITE_BARRIER = 0x1, // Should be used around store READ_BARRIER = 0x0, // Should be used around load diff --git a/libpandabase/mem/mem.h b/libpandabase/mem/mem.h index c358949b55719505ab1f316e2c3ebfb664644efd..9ccfdb2a916347f1e7bdef12e49c53e499900d23 100644 --- a/libpandabase/mem/mem.h +++ b/libpandabase/mem/mem.h @@ -50,9 +50,7 @@ using ObjectPointerType = uintptr_t; constexpr size_t OBJECT_POINTER_SIZE = sizeof(ObjectPointerType); -/** - * \brief Logarithmic/bit alignment - */ +/// @brief Logarithmic/bit alignment enum Alignment { LOG_ALIGN_2 = 2, LOG_ALIGN_3 = 3, @@ -80,7 +78,7 @@ constexpr size_t GetAlignmentInBytes(const Alignment log_alignment) } /** - * \brief returns log2 for alignment in bytes + * @brief returns log2 for alignment in bytes * @param ALIGNMENT_IN_BYTES - should be power of 2 * @return alignment in bits */ @@ -278,9 +276,7 @@ using MemVisitor = std::function; using GCObjectVisitor = std::function; using ObjectMoveVisitor = std::add_pointer::type; using ObjectVisitor = std::function; -/** - * from_object is object from which we found to_object by reference. - */ +/// from_object is object from which we found to_object by reference. using ObjectVisitorEx = std::function; using ObjectChecker = std::function; using GCRootVisitor = std::function; diff --git a/libpandabase/mem/mem_config.h b/libpandabase/mem/mem_config.h index 740f250bac2d57e0351752b0ca7b71c51f5a00c7..4d7ef7564cee1c670b19588af68482c63673320a 100644 --- a/libpandabase/mem/mem_config.h +++ b/libpandabase/mem/mem_config.h @@ -24,9 +24,7 @@ namespace panda::mem { -/** - * class for global memory parameters - */ +/// class for global memory parameters class MemConfig { public: static void Initialize(size_t object_pool_size, size_t internal_size, size_t compiler_size, size_t code_size, diff --git a/libpandabase/mem/mem_range.h b/libpandabase/mem/mem_range.h index 0a7cac9e80fa16c1b85c678e4976dd1fbc07ad72..9bd0e771453dfea3806da102fb05436e772c1c4e 100644 --- a/libpandabase/mem/mem_range.h +++ b/libpandabase/mem/mem_range.h @@ -20,9 +20,7 @@ namespace panda::mem { -/** - * Represents range of bytes [start_address, end_address] - */ +/// Represents range of bytes [start_address, end_address] class MemRange final { public: MemRange(uintptr_t start_address, uintptr_t end_address) : start_address_(start_address), end_address_(end_address) @@ -73,8 +71,8 @@ public: DEFAULT_MOVE_SEMANTIC(MemRange); private: - uintptr_t start_address_; /// < address of the first byte in memory range - uintptr_t end_address_; /// < address of the last byte in memory range + uintptr_t start_address_; ///< Address of the first byte in memory range + uintptr_t end_address_; ///< Address of the last byte in memory range }; } // namespace panda::mem diff --git a/libpandabase/mem/mmap_mem_pool.h b/libpandabase/mem/mmap_mem_pool.h index 8dc72e1a02b936665c358c71426dcc7036736910..254b88b0c88d9698aa17b679225238e9b8edaea7 100644 --- a/libpandabase/mem/mmap_mem_pool.h +++ b/libpandabase/mem/mmap_mem_pool.h @@ -188,14 +188,10 @@ public: // To check if we can alloc enough pools in object space bool HaveEnoughPoolsInObjectSpace(size_t pools_num, size_t pool_size) const; - /** - * Release pages in all cached free pools - */ + /// Release pages in all cached free pools void ReleasePagesInFreePools(); - /** - * @return used bytes count in object space (so exclude bytes in free pools) - */ + /// @return used bytes count in object space (so exclude bytes in free pools) size_t GetObjectUsedBytes() const; private: @@ -306,19 +302,19 @@ private: } private: - uintptr_t min_address_ {0U}; /// < Min address for the space - size_t max_size_ {0U}; /// < Max size in bytes for the space - size_t cur_alloc_offset_ {0U}; /// < A value of occupied memory from the min_address_ - size_t unreturned_to_os_size_ { - 0U}; /// < A value of unreturned memory from the min_address_ + cur_alloc_offset_ + uintptr_t min_address_ {0U}; ///< Min address for the space + size_t max_size_ {0U}; ///< Max size in bytes for the space + size_t cur_alloc_offset_ {0U}; ///< A value of occupied memory from the min_address_ + size_t unreturned_to_os_size_ {0U}; ///< A value of unreturned memory from the min_address_ + cur_alloc_offset_ }; - uintptr_t min_object_memory_addr_ {0U}; // < Minimal address of the mmaped object memory - size_t mmaped_object_memory_size_ {0U}; // < Size of whole the mmaped object memory + uintptr_t min_object_memory_addr_ {0U}; ///< Minimal address of the mmaped object memory + size_t mmaped_object_memory_size_ {0U}; ///< Size of whole the mmaped object memory SpaceMemory common_space_; - PoolMap pool_map_; /// < Pool map for object pools with all required information for quick search + /// Pool map for object pools with all required information for quick search + PoolMap pool_map_; MmapPoolMap common_space_pools_; @@ -326,7 +322,7 @@ private: std::array non_object_spaces_max_size_; - // Map for non object pools allocated via mmap + /// Map for non object pools allocated via mmap std::map> non_object_mmaped_pools_; // AllocRawMem is called both from alloc and externally mutable os::memory::RecursiveMutex lock_; diff --git a/libpandabase/mem/object_pointer.h b/libpandabase/mem/object_pointer.h index c92d840a15332d80cb0296c8152ac3b571b18680..195798f3350658d8caaff2b0f2fa105fffeb155f 100644 --- a/libpandabase/mem/object_pointer.h +++ b/libpandabase/mem/object_pointer.h @@ -23,7 +23,7 @@ namespace panda { /** * @class ObjectPointer * - * \brief This class is wrapper for object types. + * @brief This class is wrapper for object types. * * Wraps pointer Object * into class ObjectPointer and provides interfaces to work with it as a pointer. * This is needed to use object pointers of size 32 bits in 64-bit architectures. diff --git a/libpandabase/mem/ringbuf/lock_free_ring_buffer.h b/libpandabase/mem/ringbuf/lock_free_ring_buffer.h index 27803c5354a48093086d2d1678fc399d66f68b97..75b9840c314230825b71c7973bdc1eeec1391ff1 100644 --- a/libpandabase/mem/ringbuf/lock_free_ring_buffer.h +++ b/libpandabase/mem/ringbuf/lock_free_ring_buffer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. @@ -23,9 +23,7 @@ #include "libpandabase/utils/math_helpers.h" namespace panda::mem { -/** - * Lock-free single-producer single-consumer ring-buffer. Push can take infinite amount of time if buffer is full. - */ +/// Lock-free single-producer single-consumer ring-buffer. Push can take infinite amount of time if buffer is full. template class LockFreeBuffer { public: diff --git a/libpandabase/mem/space.h b/libpandabase/mem/space.h index 7b0005d91f13955a8135d52955574e5965ce6269..0b91ba1f0728273e723b04f3f06dd1359d278c0d 100644 --- a/libpandabase/mem/space.h +++ b/libpandabase/mem/space.h @@ -20,9 +20,7 @@ namespace panda { -/** - * SpaceType and GCCollectMode provide info when we should collect from some allocator or not - */ +/// SpaceType and GCCollectMode provide info when we should collect from some allocator or not enum class SpaceType : uint16_t { SPACE_TYPE_UNDEFINED = 0, SPACE_TYPE_OBJECT, // Space for objects (all non-humongous sizes) diff --git a/libpandabase/mem/stack_like_allocator-inl.h b/libpandabase/mem/stack_like_allocator-inl.h index f11be521e2239d1db54d44f01106f7e466b212da..d08d092453f3bd149018da74aeae6da6bfc1625e 100644 --- a/libpandabase/mem/stack_like_allocator-inl.h +++ b/libpandabase/mem/stack_like_allocator-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/libpandabase/mem/stack_like_allocator.h b/libpandabase/mem/stack_like_allocator.h index 2aa63487d866f6c95c991c628101f58771705bcb..a77b5c0f50d78800eb4b00edb809b75a612475e1 100644 --- a/libpandabase/mem/stack_like_allocator.h +++ b/libpandabase/mem/stack_like_allocator.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. @@ -40,9 +40,7 @@ public: void Free(void *mem); - /** - * \brief Returns true if address inside current allocator. - */ + /// @brief Returns true if address inside current allocator. bool Contains(void *mem); static constexpr AllocatorType GetAllocatorType() diff --git a/libpandabase/os/cpu_affinity.h b/libpandabase/os/cpu_affinity.h index 0c7b6f312a5094d966a72eafec548a93db9a77eb..7c36b94143e9f35884dff08b11ed80ed2c369e12 100644 --- a/libpandabase/os/cpu_affinity.h +++ b/libpandabase/os/cpu_affinity.h @@ -46,9 +46,7 @@ public: */ void Set(int cpu); - /** - * Full clear the cpu-set - */ + /// Full clear the cpu-set PANDA_PUBLIC_API void Clear(); /** @@ -57,9 +55,7 @@ public: */ void Remove(int cpu); - /** - * @return CPUs count in the cpu-set - */ + /// @return CPUs count in the cpu-set [[nodiscard]] PANDA_PUBLIC_API size_t Count() const; /** @@ -68,9 +64,7 @@ public: */ [[nodiscard]] bool IsSet(int cpu) const; - /** - * @return true if cpu-set has not any cpu - */ + /// @return true if cpu-set has not any cpu [[nodiscard]] PANDA_PUBLIC_API bool IsEmpty() const; ~CpuSet() = default; @@ -111,14 +105,10 @@ public: NO_MOVE_SEMANTIC(CpuAffinityManager); ~CpuAffinityManager() = default; - /** - * Initialize Cpu Affinity Manager: load CPUs info, indicate CPUs power - */ + /// Initialize Cpu Affinity Manager: load CPUs info, indicate CPUs power PANDA_PUBLIC_API static void Initialize(); - /** - * @return true if Cpu Affinity Manager was enabled correctly - */ + /// @return true if Cpu Affinity Manager was enabled correctly [[nodiscard]] static bool IsCpuAffinityEnabled(); /** @@ -153,9 +143,7 @@ public: */ PANDA_PUBLIC_API static bool SetAffinityForCurrentThread(const CpuSet &cpuset); - /** - * @return const reference on best + middle cpu-set in system - */ + /// @return const reference on best + middle cpu-set in system PANDA_PUBLIC_API static const CpuSet &GetBestAndMiddleCpuSet() { return best_and_middle_cpu_set_; @@ -194,15 +182,11 @@ public: return mask; } - /** - * Finalize Cpu Affinity Manager - */ + /// Finalize Cpu Affinity Manager PANDA_PUBLIC_API static void Finalize(); private: - /** - * Load cpu frequency info from system - */ + /// Load cpu frequency info from system static void LoadCpuFreq(); static size_t cpu_count_; diff --git a/libpandabase/os/mem.h b/libpandabase/os/mem.h index 48d58e61f073442e2776f130abbda8cda61f00de..0fca3393334c2524ceb472302b7f68bb2446002f 100644 --- a/libpandabase/os/mem.h +++ b/libpandabase/os/mem.h @@ -43,7 +43,7 @@ static constexpr uint64_t HIGH_BOUND_32BIT_ADDRESS = 4_GB; PANDA_PUBLIC_API void MmapDeleter(std::byte *ptr, size_t size) noexcept; /** - * \brief Make memory region \param mem with size \param size with protection flags \param prot + * @brief Make memory region @param mem with size @param size with protection flags @param prot * @param mem Pointer to memory region (should be aligned to page size) * @param size Size of memory region * @param prot Memory protection flags, a combination of MMAP_PROT_XXX values @@ -52,7 +52,7 @@ PANDA_PUBLIC_API void MmapDeleter(std::byte *ptr, size_t size) noexcept; std::optional MakeMemWithProtFlag(void *mem, size_t size, int prot); /** - * \brief Make memory region \param mem with size \param size readable and executable + * @brief Make memory region @param mem with size @param size readable and executable * @param mem Pointer to memory region (should be aligned to page size) * @param size Size of memory region * @return Error object if any errors occur @@ -60,7 +60,7 @@ std::optional MakeMemWithProtFlag(void *mem, size_t size, int prot); std::optional MakeMemReadExec(void *mem, size_t size); /** - * \brief Make memory region \param mem with size \param size readable and writable + * @brief Make memory region @param mem with size @param size readable and writable * @param mem Pointer to memory region (should be aligned to page size) * @param size Size of memory region * @return Error object if any errors occur @@ -68,7 +68,7 @@ std::optional MakeMemReadExec(void *mem, size_t size); PANDA_PUBLIC_API std::optional MakeMemReadWrite(void *mem, size_t size); /** - * \brief Make memory region \param mem with size \param size readable + * @brief Make memory region @param mem with size @param size readable * @param mem Pointer to memory region (should be aligned to page size) * @param size Size of memory region * @return Error object if any errors occur @@ -76,7 +76,7 @@ PANDA_PUBLIC_API std::optional MakeMemReadWrite(void *mem, size_t size); std::optional MakeMemReadOnly(void *mem, size_t size); /** - * \brief Make memory region \param mem with size \param size protected + * @brief Make memory region @param mem with size @param size protected * @param mem Pointer to memory region (should be aligned to page size) * @param size Size of memory region * @return Error object if any errors occur @@ -84,15 +84,15 @@ std::optional MakeMemReadOnly(void *mem, size_t size); PANDA_PUBLIC_API std::optional MakeMemProtected(void *mem, size_t size); /** - * \brief Align addr \param addr to page size to pass it to MakeMem functions + * @brief Align addr @param addr to page size to pass it to MakeMem functions * @param addr Address to align * @return Aligned address */ PANDA_PUBLIC_API uintptr_t AlignDownToPageSize(uintptr_t addr); /** - * \brief Allocated aligned memory with alignment \param alignment_in_bytes and - * with size \param size. Use AlignedFree to free this memory. + * @brief Allocated aligned memory with alignment @param alignment_in_bytes and + * with size @param size. Use AlignedFree to free this memory. * @param alignment_in_bytes - alignment in bytes * @param size - min required size in bytes * @return @@ -100,7 +100,7 @@ PANDA_PUBLIC_API uintptr_t AlignDownToPageSize(uintptr_t addr); PANDA_PUBLIC_API void *AlignedAlloc(size_t alignment_in_bytes, size_t size); /** - * \brief Free memory, allocated by AlignedAlloc. + * @brief Free memory, allocated by AlignedAlloc. * @param mem - Pointer to memory, allocated by AlignedAlloc */ PANDA_PUBLIC_API void AlignedFree(void *mem); @@ -301,7 +301,7 @@ PANDA_PUBLIC_API BytePtr MapFile(file::File file, uint32_t prot, uint32_t flags, void *hint = nullptr); /** - * \brief allocates executed memory of size \param size + * @brief allocates executed memory of size @param size * @param size * @return */ @@ -319,7 +319,7 @@ PANDA_PUBLIC_API void *MapRWAnonymousRaw(size_t size, bool force_poison = true); /** * Anonymous mmap with READ | WRITE protection for pages. - * Returned address will be aligned as \param aligment_in_bytes. + * Returned address will be aligned as @param aligment_in_bytes. * Note: returned memory will be poisoned in ASAN targets, * if you need other behavior - consider to change interface, or use manual unpoisoning. * @param size - size in bytes, should be multiple of PAGE_SIZE @@ -390,13 +390,13 @@ PANDA_PUBLIC_API std::optional UnmapRaw(void *mem, size_t size); std::optional PartiallyUnmapRaw(void *mem, size_t size); /** - * \brief returns page size for the system + * @brief returns page size for the system * @return */ PANDA_PUBLIC_API uint32_t GetPageSize(); /** - * \brief returns cache line size for the system + * @brief returns cache line size for the system * @return */ PANDA_PUBLIC_API size_t GetCacheLineSize(); diff --git a/libpandabase/os/mem_hooks.h b/libpandabase/os/mem_hooks.h index af487df3d51cb6f5634d3d25ad43e35113231ea8..3f4ac5a66fa424a9acf99f05601734bbe12d8855 100644 --- a/libpandabase/os/mem_hooks.h +++ b/libpandabase/os/mem_hooks.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/os/sighook.h b/libpandabase/os/sighook.h index 85acc4ab7a8e751022b132d10df9bdc15960a2f9..4bcaebd16137fa5dae38a080fe2da45051a159bf 100644 --- a/libpandabase/os/sighook.h +++ b/libpandabase/os/sighook.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/os/time.cpp b/libpandabase/os/time.cpp index 6245959eef07a91b4586bc5ef726d06e369dca81..ba5749950a022e50f993f63262e7ead209e532db 100644 --- a/libpandabase/os/time.cpp +++ b/libpandabase/os/time.cpp @@ -17,25 +17,19 @@ namespace panda::os::time { -/** - * Return current time in nanoseconds - */ +/// Return current time in nanoseconds uint64_t GetClockTimeInMicro() { return GetClockTime(CLOCK_MONOTONIC); } -/** - * Return current time in milliseconds - */ +/// Return current time in milliseconds uint64_t GetClockTimeInMilli() { return GetClockTime(CLOCK_MONOTONIC); } -/** - * Return thread CPU time in nanoseconds - */ +/// Return thread CPU time in nanoseconds uint64_t GetClockTimeInThreadCpuTime() { return GetClockTime(CLOCK_THREAD_CPUTIME_ID); diff --git a/libpandabase/tests/base_thread_test.cpp b/libpandabase/tests/base_thread_test.cpp index f8fb019acc1a1d5d9823e4fdcdf3e355dfe7bf15..cd4f1200f32f15af27cf3bc3a49bb307a61b3882 100644 --- a/libpandabase/tests/base_thread_test.cpp +++ b/libpandabase/tests/base_thread_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/libpandabase/tests/ringbuf/lock_free_ring_buffer_test.cpp b/libpandabase/tests/ringbuf/lock_free_ring_buffer_test.cpp index 7d608a1a7f16ae1a1372935d475ba748b9bddecb..a5a46d469ab3186651057e52ea1eae0c7cfa32b2 100644 --- a/libpandabase/tests/ringbuf/lock_free_ring_buffer_test.cpp +++ b/libpandabase/tests/ringbuf/lock_free_ring_buffer_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/libpandabase/utils/hash.h b/libpandabase/utils/hash.h index f0503f9f42b0f1460f8c5ada82839874f36b91bf..4710247df2e59231c83b8c040c80a9fd83aa7231 100644 --- a/libpandabase/utils/hash.h +++ b/libpandabase/utils/hash.h @@ -32,7 +32,7 @@ static constexpr uint32_t DEFAULT_SEED = 0x12345678U; using Hash = DefaultHash; /** - * \brief Create 32 bits Hash from \param key via \param seed. + * @brief Create 32 bits Hash from @param key via @param seed. * @param key - a key which should be hashed * @param len - length of the key in bytes * @param seed - seed which is used to calculate hash @@ -44,7 +44,7 @@ inline uint32_t GetHash32WithSeed(const uint8_t *key, size_t len, uint32_t seed) } /** - * \brief Create 32 bits Hash from \param key. + * @brief Create 32 bits Hash from @param key. * @param key - a key which should be hashed * @param len - length of the key in bytes * @return 32 bits hash @@ -55,7 +55,7 @@ inline uint32_t GetHash32(const uint8_t *key, size_t len) } /** - * \brief Create 32 bits Hash from MUTF8 \param string. + * @brief Create 32 bits Hash from MUTF8 @param string. * @param string - a pointer to the MUTF8 string * @return 32 bits hash */ @@ -65,7 +65,7 @@ inline uint32_t GetHash32String(const uint8_t *mutf8_string) } /** - * \brief Create 32 bits Hash from MUTF8 \param string. + * @brief Create 32 bits Hash from MUTF8 @param string. * @param string - a pointer to the MUTF8 string * @param seed - seed which is used to calculate hash * @return 32 bits hash @@ -134,9 +134,7 @@ uint32_t FnvHash(const Container &data, uint32_t hash = FNV_INITIAL_SEED) return hash; } -/** - * Combine lhash and rhash - */ +/// Combine lhash and rhash inline size_t MergeHashes(size_t lhash, size_t rhash) { constexpr const size_t MAGIC_CONSTANT = 0x9e3779b9; @@ -145,9 +143,7 @@ inline size_t MergeHashes(size_t lhash, size_t rhash) return lhash ^ (rhash + MAGIC_CONSTANT + shl + shr); } -/** - * Combine lhash and rhash - */ +/// Combine lhash and rhash // this overload is only enabled when it can't conflict with the size_t one template = 0> inline uint32_t MergeHashes(uint32_t lhash, uint32_t rhash) diff --git a/libpandabase/utils/hash_base.h b/libpandabase/utils/hash_base.h index bcc21f79a8d88b5a525d7f8815b55301895de296..34ae50336db281a1a779b1a46a1176a2dde44e5f 100644 --- a/libpandabase/utils/hash_base.h +++ b/libpandabase/utils/hash_base.h @@ -27,7 +27,7 @@ template class HashBase { public: /** - * \brief Create 32 bits Hash from \param key via \param seed. + * @brief Create 32 bits Hash from @param key via @param seed. * @param key - a key which should be hashed * @param len - length of the key in bytes * @param seed - seed which is used to calculate hash @@ -38,7 +38,7 @@ public: return HashImpl::GetHash32WithSeedImpl(key, len, seed); } /** - * \brief Create 32 bits Hash from \param key. + * @brief Create 32 bits Hash from @param key. * @param key - a key which should be hashed * @param len - length of the key in bytes * @return 32 bits hash @@ -48,7 +48,7 @@ public: return HashImpl::GetHash32Impl(key, len); } /** - * \brief Create 32 bits Hash from MUTF8 \param string. + * @brief Create 32 bits Hash from MUTF8 @param string. * @param string - a pointer to the MUTF8 string * @return 32 bits hash */ @@ -57,7 +57,7 @@ public: return HashImpl::GetHash32StringImpl(mutf8_string); } /** - * \brief Create 32 bits Hash from MUTF8 \param string. + * @brief Create 32 bits Hash from MUTF8 @param string. * @param string - a pointer to the MUTF8 string * @param seed - seed which is used to calculate hash * @return 32 bits hash diff --git a/libpandabase/utils/list.h b/libpandabase/utils/list.h index 7e2e5a59661b3d56b6a75e107cdc3cb2f964c66a..7bb64d6536f1c0ead03dc4e55764dbe08e61149e 100644 --- a/libpandabase/utils/list.h +++ b/libpandabase/utils/list.h @@ -25,9 +25,7 @@ class List; template class ListIterator; -/** - * Intrusive forward list node, which shall be inherited by list element class. - */ +/// Intrusive forward list node, which shall be inherited by list element class. class ListNode { public: ListNode() = default; @@ -55,9 +53,7 @@ private: friend class ListIterator; }; -/** - * Intrusive forward list iterator - */ +/// Intrusive forward list iterator template class ListIterator { public: @@ -131,9 +127,7 @@ private: const ListIterator &lhs, const ListIterator &rhs); }; -/** - * Intrusive forward list - */ +/// Intrusive forward list template class List { public: @@ -257,9 +251,7 @@ public: return EraseAfter(position, last); } - /** - * Erase elements in range (position, last) - */ + /// Erase elements in range (position, last) Iterator EraseAfter(ConstIterator position, ConstIterator last) { ASSERT(position != last); @@ -297,26 +289,20 @@ public: head_.next_ = nullptr; } - /** - * Transfers all elements from other list into place after position. - */ + /// Transfers all elements from other list into place after position. void Splice(ConstIterator position, List &other) { Splice(position, other, other.before_begin(), other.end()); } - /** - * Transfers single element first+1 into place after position. - */ + /// Transfers single element first+1 into place after position. void Splice(ConstIterator position, List &other, ConstIterator first) { constexpr size_t SHIFT = 2; Splice(position, other, first, first + SHIFT); } - /** - * Transfers the elements in the range (first,last) into place after position. - */ + /// Transfers the elements in the range (first,last) into place after position. void Splice(ConstIterator position, List &src_list, ConstIterator first, ConstIterator last) { ASSERT(position != end()); @@ -360,17 +346,13 @@ typename std::enable_if::value, bool>::type return !(lhs == rhs); } -/** - * Intrusive doubly list node - */ +/// Intrusive doubly list node struct DListNode { DListNode *prev = nullptr; DListNode *next = nullptr; }; -/** - * Intrusive doubly list iterator - */ +/// Intrusive doubly list iterator template class DListIterator { public: @@ -424,9 +406,7 @@ private: friend class DList; }; -/** - * Intrusive doubly list reverse iterator - */ +/// Intrusive doubly list reverse iterator template class DListReverseIterator { public: @@ -486,9 +466,7 @@ private: friend class DList; }; -/** - * Intrusive doubly list - */ +/// Intrusive doubly list class DList { public: using Iterator = DListIterator; diff --git a/libpandabase/utils/logger.cpp b/libpandabase/utils/logger.cpp index 631fbd8ff6e206e9485284687dc4275dd47ed12c..faab9ac7b538899a4d331eb85558d062bf75bdf7 100644 --- a/libpandabase/utils/logger.cpp +++ b/libpandabase/utils/logger.cpp @@ -82,9 +82,7 @@ void Logger::Initialize(const base_options::Options &options) } #ifndef NDEBUG -/** - * In debug builds this function allowes or disallowes proceeding with actual logging (i.e. creating Message{}) - */ +/// In debug builds this function allowes or disallowes proceeding with actual logging (i.e. creating Message{}) /* static */ bool Logger::IsMessageSuppressed([[maybe_unused]] Level level, [[maybe_unused]] Component component) { @@ -92,18 +90,14 @@ bool Logger::IsMessageSuppressed([[maybe_unused]] Level level, [[maybe_unused]] return level >= Logger::logger_->nested_allowed_level_ && nesting_ > 0; } -/** - * Increases log nesting (i.e. depth, or how many instances of Message{} is active atm) in a given thread - */ +/// Increases log nesting (i.e. depth, or how many instances of Message{} is active atm) in a given thread /* static */ void Logger::LogNestingInc() { nesting_++; } -/** - * Decreases log nesting (i.e. depth, or how many instances of Message{} is active atm) in a given thread - */ +/// Decreases log nesting (i.e. depth, or how many instances of Message{} is active atm) in a given thread /* static */ void Logger::LogNestingDec() { diff --git a/libpandabase/utils/math_helpers.h b/libpandabase/utils/math_helpers.h index 36dacc02cb26b3b46fdf44a9e51349fecb1a27cf..10eef41f9d912347d8ff0fcbd36881e44057b7fc 100644 --- a/libpandabase/utils/math_helpers.h +++ b/libpandabase/utils/math_helpers.h @@ -26,7 +26,7 @@ namespace panda::helpers::math { /** - * \brief returns log2 for argument + * @brief returns log2 for argument * @param X - should be power of 2 * @return log2(X) or undefined if X 0 */ @@ -37,7 +37,7 @@ constexpr uint32_t GetIntLog2(const uint32_t x) } /** - * \brief returns log2 for argument + * @brief returns log2 for argument * @param X - of type uint64_t, should be power of 2 * @return log2(X) or undefined if X 0 */ @@ -47,9 +47,7 @@ constexpr uint64_t GetIntLog2(const uint64_t x) return static_cast(panda_bit_utils_ctzll(x)); } -/** - * return value is power of two - */ +/// return value is power of two template constexpr bool IsPowerOfTwo(T value) { @@ -58,9 +56,7 @@ constexpr bool IsPowerOfTwo(T value) return (value & (value - 1)) == 0; } -/** - * returns an integer power of two but not greater than value. - */ +/// returns an integer power of two but not greater than value. constexpr uint32_t GetPowerOfTwoValue32(uint32_t value) { ASSERT(value < (1UL << 31UL)); @@ -74,9 +70,7 @@ constexpr uint32_t GetPowerOfTwoValue32(uint32_t value) return 1UL << (BIT - Clz(static_cast(value))); } -/** - * Count trailing zeroes - */ +/// Count trailing zeroes constexpr unsigned int Ctz(uint32_t value) { constexpr std::array MULTIPLY_DE_BRUIJN_BIT_POSITION = {0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, @@ -88,9 +82,7 @@ constexpr unsigned int Ctz(uint32_t value) SHIFT]; } -/** - * Count leading zeroes - */ +/// Count leading zeroes constexpr uint32_t Clz(uint32_t value) { constexpr std::array MULTIPLY_DE_BRUIJN_BIT_POSITION = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, @@ -132,9 +124,7 @@ T Max(T a, T b) return a >= b ? a : b; } -/** - * Combine lhash and rhash - */ +/// Combine lhash and rhash inline size_t MergeHashes(size_t lhash, size_t rhash) { constexpr const size_t MAGIC_CONSTANT = 0x9e3779b9; diff --git a/libpandabase/utils/pandargs.h b/libpandabase/utils/pandargs.h index 288118cd891795c3318ffb8f55215c93296c17c4..e3ad74def10c8872e99de1add7f743f2fb507ed7 100644 --- a/libpandabase/utils/pandargs.h +++ b/libpandabase/utils/pandargs.h @@ -278,9 +278,7 @@ public: return ParseArgs(); } - /** - * Parses a string to the option's value. - */ + /// Parses a string to the option's value. bool ParseSingleArg(PandArgBase *option, const std::string_view &option_value) { ASSERT(option != nullptr); @@ -290,9 +288,7 @@ public: return errstr_.empty(); } - /** - * Parses option's name and returns corresponding pointer. - */ + /// Parses option's name and returns corresponding pointer. PandArgBase *GetPandArg(const std::string_view &arg_name) { auto arg_it = args_.find(arg_name); diff --git a/libpandabase/utils/ring_buffer.h b/libpandabase/utils/ring_buffer.h index 9bc63a9ecbd2a202e83e33490daa1223689a142b..14910280ad02eca8ac0ea9738edef05a9074c333 100644 --- a/libpandabase/utils/ring_buffer.h +++ b/libpandabase/utils/ring_buffer.h @@ -213,9 +213,7 @@ public: return buffer_[head_]; } - /** - * Removes the last element of the ring buffer - */ + /// Removes the last element of the ring buffer constexpr void pop_back() // NOLINT(readability-identifier-naming) { if constexpr (std::is_class_v) { // NOLINT(readability-braces-around-statements) @@ -225,9 +223,7 @@ public: --current_size_; } - /** - * Removes the first element of the ring buffer - */ + /// Removes the first element of the ring buffer constexpr void pop_front() // NOLINT(readability-identifier-naming) { if constexpr (std::is_class_v) { // NOLINT(readability-braces-around-statements) @@ -237,57 +233,43 @@ public: --current_size_; } - /** - * @return iterator to the first element - */ + /// @return iterator to the first element constexpr iterator begin() noexcept // NOLINT(readability-identifier-naming) { return iterator(&buffer_, head_); } - /** - * @return a reverse iterator to the first element of the revesred ring buffer - */ + /// @return a reverse iterator to the first element of the revesred ring buffer constexpr reverse_iterator rbegin() noexcept // NOLINT(readability-identifier-naming) { return std::make_reverse_iterator(end()); } - /** - * @return const context iterator to the first element - */ + /// @return const context iterator to the first element constexpr const_iterator begin() const noexcept // NOLINT(readability-identifier-naming) { return const_iterator(&buffer_, head_); } - /** - * @return a const context reverse iterator to the first element of the reversed ring buffer - */ + /// @return a const context reverse iterator to the first element of the reversed ring buffer constexpr const_reverse_iterator rbegin() const noexcept // NOLINT(readability-identifier-naming) { return std::make_reverse_iterator(end()); } - /** - * @return const iterator to the first element - */ + /// @return const iterator to the first element constexpr const_iterator cbegin() const noexcept // NOLINT(readability-identifier-naming) { return begin(); } - /** - * @return a const reverse iterator to the first element of the reversed ring buffer - */ + /// @return a const reverse iterator to the first element of the reversed ring buffer constexpr const_reverse_iterator crbegin() const noexcept // NOLINT(readability-identifier-naming) { return rbegin(); } - /** - * @return iterator to the element following the last element - */ + /// @return iterator to the element following the last element constexpr iterator end() noexcept // NOLINT(readability-identifier-naming) { auto tmp = tail_; @@ -295,17 +277,13 @@ public: return iterator(&buffer_, tmp); } - /** - * @return a reverse iterator to the element following the last element of the reversed ring buffer - */ + /// @return a reverse iterator to the element following the last element of the reversed ring buffer constexpr reverse_iterator rend() noexcept // NOLINT(readability-identifier-naming) { return std::make_reverse_iterator(begin()); } - /** - * @return const context iterator to the element following the last element - */ + /// @return const context iterator to the element following the last element constexpr const_iterator end() const noexcept // NOLINT(readability-identifier-naming) { auto tmp = tail_; @@ -313,57 +291,43 @@ public: return const_iterator(&buffer_, tmp); } - /** - * @return a const context iterator to the element following the last element of the reversed ring buffer - */ + /// @return a const context iterator to the element following the last element of the reversed ring buffer constexpr const_reverse_iterator rend() const noexcept // NOLINT(readability-identifier-naming) { return std::make_reverse_iterator(begin()); } - /** - * @return const iterator to the element following the last element - */ + /// @return const iterator to the element following the last element constexpr const_iterator cend() const noexcept // NOLINT(readability-identifier-naming) { return end(); } - /** - * @return const iterator to the element following the last element of the reversed ring buffer - */ + /// @return const iterator to the element following the last element of the reversed ring buffer constexpr const_reverse_iterator crend() const noexcept // NOLINT(readability-identifier-naming) { return rend(); } - /** - * @return reference to first element in ring buffer - */ + /// @return reference to first element in ring buffer constexpr reference front() noexcept // NOLINT(readability-identifier-naming) { return buffer_[head_]; } - /** - * @return const reference to first element in ring buffer - */ + /// @return const reference to first element in ring buffer constexpr const_reference front() const noexcept // NOLINT(readability-identifier-naming) { return buffer_[head_]; } - /** - * @return reference to last element in ring buffer - */ + /// @return reference to last element in ring buffer constexpr reference back() noexcept // NOLINT(readability-identifier-naming) { return buffer_[tail_]; } - /** - * @return const reference to last element in ring buffer - */ + /// @return const reference to last element in ring buffer constexpr const_reference back() const noexcept // NOLINT(readability-identifier-naming) { return buffer_[tail_]; @@ -379,41 +343,31 @@ public: return buffer_[(head_ + index) % buffer_.size()]; } - /** - * @return true if buffer is empty and false otherwise - */ + /// @return true if buffer is empty and false otherwise [[nodiscard]] constexpr bool empty() const noexcept // NOLINT(readability-identifier-naming) { return size() == 0; } - /** - * @return true if buffer is full (all buffer space is used) - */ + /// @return true if buffer is full (all buffer space is used) [[nodiscard]] constexpr bool full() const noexcept // NOLINT(readability-identifier-naming) { return size() == capacity(); } - /** - * @return current ring buffer size - */ + /// @return current ring buffer size constexpr size_type size() const noexcept // NOLINT(readability-identifier-naming) { return current_size_; } - /** - * @return maximum ring buffer size - */ + /// @return maximum ring buffer size constexpr size_type capacity() const noexcept // NOLINT(readability-identifier-naming) { return N; } - /** - * Erases all elements from the ring buffer. After this call, size() returns zero. - */ + /// Erases all elements from the ring buffer. After this call, size() returns zero. constexpr void clear() noexcept // NOLINT(readability-identifier-naming) { if constexpr (std::is_class_v) { // NOLINT(readability-braces-around-statements) diff --git a/libpandabase/utils/small_vector.h b/libpandabase/utils/small_vector.h index a6fa50e9db985b4732e6091373aa4eb291d9c82a..364c0e07d4579365e67c8e0c17f2ab984bab5a7a 100644 --- a/libpandabase/utils/small_vector.h +++ b/libpandabase/utils/small_vector.h @@ -23,9 +23,7 @@ namespace panda { -/** - * Helper class that provides main Panda's allocator interface: AdapterType, Adapter(), GetInstance(). - */ +/// Helper class that provides main Panda's allocator interface: AdapterType, Adapter(), GetInstance(). class StdAllocatorStub { public: template diff --git a/libpandabase/utils/span.h b/libpandabase/utils/span.h index 81e5f5f8cbd170b05e7653da184e2b4875df42f1..ae52d2e3b0e79c814020ff8d2e3dab5eb6ca63fe 100644 --- a/libpandabase/utils/span.h +++ b/libpandabase/utils/span.h @@ -23,9 +23,7 @@ namespace panda { -/** - * Similar to std::span that will come in C++20. - */ +/// Similar to std::span that will come in C++20. template class Span { public: diff --git a/libpandabase/utils/time.cpp b/libpandabase/utils/time.cpp index 5c58c26895c498fa77aaefcbd91f6d6c42fad4ae..86d01294abdbf1110cc669a93aa9800e0db75351 100644 --- a/libpandabase/utils/time.cpp +++ b/libpandabase/utils/time.cpp @@ -28,25 +28,19 @@ static uint64_t GetCurrentTime(bool need_system) return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); } -/** - * Return current time in milliseconds - */ +/// Return current time in milliseconds uint64_t GetCurrentTimeInMillis(bool need_system) { return GetCurrentTime(need_system); } -/** - * Return current time in microseconds - */ +/// Return current time in microseconds uint64_t GetCurrentTimeInMicros(bool need_system) { return GetCurrentTime(need_system); } -/** - * Return current time in nanoseconds - */ +/// Return current time in nanoseconds uint64_t GetCurrentTimeInNanos(bool need_system) { return GetCurrentTime(need_system); diff --git a/libpandabase/utils/time.h b/libpandabase/utils/time.h index 5c010bf87b04cd79d8396609d26f7816c6a41982..f2bb15d901757ae2e4d206e3e53698e4691e7ff5 100644 --- a/libpandabase/utils/time.h +++ b/libpandabase/utils/time.h @@ -24,19 +24,13 @@ WEAK_FOR_LTO_START namespace panda::time { -/** - * Return current time in milliseconds - */ +/// Return current time in milliseconds PANDA_PUBLIC_API uint64_t GetCurrentTimeInMillis(bool need_system = false); -/** - * Return current time in microseconds - */ +/// Return current time in microseconds PANDA_PUBLIC_API uint64_t GetCurrentTimeInMicros(bool need_system = false); -/** - * Return current time in nanoseconds - */ +/// Return current time in nanoseconds PANDA_PUBLIC_API uint64_t GetCurrentTimeInNanos(bool need_system = false); } // namespace panda::time diff --git a/libpandabase/utils/type_converter.h b/libpandabase/utils/type_converter.h index 8a235ae9e528183184b8548419ddb46dd92c782e..a10921f111aaf056a283487c9eb7058c3dea8a8f 100644 --- a/libpandabase/utils/type_converter.h +++ b/libpandabase/utils/type_converter.h @@ -30,8 +30,8 @@ WEAK_FOR_LTO_START namespace panda::helpers { /** - * \brief Class for presentation \param value_ in a readable format. - * Presented as two fields: \param value_ and its \param literal_ + * @brief Class for presentation @param value_ in a readable format. + * Presented as two fields: @param value_ and its @param literal_ * @param value_ - double number of value * @param literal_ - string designations of the unit * @param precision_ - precision for output @@ -43,7 +43,7 @@ public: ValueUnit(double value, std::string_view literal); /** - * \brief Set new \param precision for output + * @brief Set new @param precision for output * @param precision */ void SetPrecision(size_t precision); diff --git a/libpandafile/bytecode_emitter.h b/libpandafile/bytecode_emitter.h index 5ded40233ea5aa88179e3a574acc80f17ba9f85d..8a608d33e41ec6ad91df6653da0b4ce2cbba1778 100644 --- a/libpandafile/bytecode_emitter.h +++ b/libpandafile/bytecode_emitter.h @@ -36,7 +36,7 @@ class BytecodeEmitter; * It is not allowed to share labels between different instancies * of BytecodeEmitter. * Lifetime of a label must match lifetime of the emitter. - **/ + */ class Label { private: explicit Label(std::list::iterator pc) : pc_(pc) {} @@ -83,9 +83,7 @@ public: return Label(pc_list_.begin()); } - /** - * Bind the label with the current place in the final bytecode. - */ + /// Bind the label with the current place in the final bytecode. void Bind(const Label &label); /** diff --git a/libpandafile/bytecode_instruction.h b/libpandafile/bytecode_instruction.h index 931e4eb81e7f2303e9cc922c49b602ced3574a81..7857aa79b3912aa658bd5226a4bdf88374836431 100644 --- a/libpandafile/bytecode_instruction.h +++ b/libpandafile/bytecode_instruction.h @@ -263,9 +263,7 @@ public: template ::Opcode> auto GetImm64(size_t idx = 0) const; - /** - * Return profile id if instruction supports profiling, otherwise return -1. - */ + /// Return profile id if instruction supports profiling, otherwise return -1. int GetProfileId() const; /** diff --git a/platforms/common/libpandabase/coherency_line_size.h b/platforms/common/libpandabase/coherency_line_size.h index c51fa4db16622835fc09d26a1dc619fe42f50069..71fc501aa7c0913e96e19b3536dca769ecec174f 100644 --- a/platforms/common/libpandabase/coherency_line_size.h +++ b/platforms/common/libpandabase/coherency_line_size.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/common/runtime/thread.cpp b/platforms/common/runtime/thread.cpp index 545889f541d5679ab875a7c12d2f0c9a307d9282..917f4617463976111efa1d4e41abbf5a71a9e768 100644 --- a/platforms/common/runtime/thread.cpp +++ b/platforms/common/runtime/thread.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/platforms/common/runtime/verify_app_install.cpp b/platforms/common/runtime/verify_app_install.cpp index 2137b57c413f6ba865b695319c94dd43f08c512a..e25277482352e6110e6347986cf7bdea95e37317 100644 --- a/platforms/common/runtime/verify_app_install.cpp +++ b/platforms/common/runtime/verify_app_install.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/platforms/unix/libpandabase/thread.cpp b/platforms/unix/libpandabase/thread.cpp index 65d7a9b5d6d0d98159a9a50e238f4ebcfe826867..ed44f756f3aa6eaa5f3ba86cf3ec03818cec5b9b 100644 --- a/platforms/unix/libpandabase/thread.cpp +++ b/platforms/unix/libpandabase/thread.cpp @@ -132,7 +132,8 @@ int ThreadGetStackInfo(NativeHandleType thread, void **stack_addr, size_t *stack s += pthread_attr_getstack(&attr, stack_addr, stack_size); #if defined(PANDA_TARGET_OHOS) && !defined(NDEBUG) if (getpid() == gettid()) { - /** konstanting: + /** + * konstanting: * main thread's stack can automatically grow up to the RLIMIT_STACK by means of the OS, * but MUSL does not care about that and returns the current (already mmap-ped) stack size. * This can lead to complicated errors, so let's adjust the stack size manually. diff --git a/platforms/unix/libpandabase/thread.h b/platforms/unix/libpandabase/thread.h index 700284e0751451cc053bae43c294843287afbc46..573d116b3bf889f60705f14616026f16f0d12782 100644 --- a/platforms/unix/libpandabase/thread.h +++ b/platforms/unix/libpandabase/thread.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/unix/libpandabase/time.h b/platforms/unix/libpandabase/time.h index 01fc68c0667a7d26a9307e495000cf3291765a42..693988da0591a84aee617aa265fb1fde3a286728 100644 --- a/platforms/unix/libpandabase/time.h +++ b/platforms/unix/libpandabase/time.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/unix/libpandabase/unique_fd.h b/platforms/unix/libpandabase/unique_fd.h index 977054b9a8055eb7222360ce8797d6326879ff13..9dbd25e41e2cacf4c66ce921cbe6d8812f2c4696 100644 --- a/platforms/unix/libpandabase/unique_fd.h +++ b/platforms/unix/libpandabase/unique_fd.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/filesystem.cpp b/platforms/windows/libpandabase/filesystem.cpp index 456f1b43532e9c19dc7a82cbf3727f988e0b6792..181e959f3f286c30fc2f83059b828a4b94c0f2bd 100644 --- a/platforms/windows/libpandabase/filesystem.cpp +++ b/platforms/windows/libpandabase/filesystem.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/platforms/windows/libpandabase/library_loader.cpp b/platforms/windows/libpandabase/library_loader.cpp index f2a7ecd286ee20cff68f7f3d62acf03f830da6e9..e0a44e1f083eeed43da8debc18b4a210806c74fb 100644 --- a/platforms/windows/libpandabase/library_loader.cpp +++ b/platforms/windows/libpandabase/library_loader.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/mem_hooks.cpp b/platforms/windows/libpandabase/mem_hooks.cpp index e879eae44abc36c23778c1dde0b29efcbd14bbf7..d26666f6722a29f4f879cfb41b3e9ad31f4f75a6 100644 --- a/platforms/windows/libpandabase/mem_hooks.cpp +++ b/platforms/windows/libpandabase/mem_hooks.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/mem_hooks.h b/platforms/windows/libpandabase/mem_hooks.h index 3eadd94bb4ed4f69bf69bf9c1750a28f54e27bda..1a8a42429c5f806f7e46af54eb4d4dbf5e991ad8 100644 --- a/platforms/windows/libpandabase/mem_hooks.h +++ b/platforms/windows/libpandabase/mem_hooks.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/thread.h b/platforms/windows/libpandabase/thread.h index 2c669c23be7bec6cc63d110c38e798e831403931..355f6eaae5d4cac43910a718a12e8af7504aa82c 100644 --- a/platforms/windows/libpandabase/thread.h +++ b/platforms/windows/libpandabase/thread.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/time.h b/platforms/windows/libpandabase/time.h index 5e63a42ce50cb38aa28da6413290fc75abbe0415..0419d746b1dd0af8d78dab7620f9ce316066e187 100644 --- a/platforms/windows/libpandabase/time.h +++ b/platforms/windows/libpandabase/time.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/platforms/windows/libpandabase/unique_fd.h b/platforms/windows/libpandabase/unique_fd.h index d88bffda29e979dba00818694c20951fe154361c..ce462d570066f5c06a3da2f0e3e5a91e225dafcf 100644 --- a/platforms/windows/libpandabase/unique_fd.h +++ b/platforms/windows/libpandabase/unique_fd.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/plugins/ets/compiler/optimizer/ets_codegen_extensions.cpp b/plugins/ets/compiler/optimizer/ets_codegen_extensions.cpp index 749f52a6d3c27c61a985eff7ebede73acd8d6d32..b0f06b512baa359ac0e29dec526159982c7cd2e1 100644 --- a/plugins/ets/compiler/optimizer/ets_codegen_extensions.cpp +++ b/plugins/ets/compiler/optimizer/ets_codegen_extensions.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.cpp b/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.cpp index f6e0af5071c6e0754006b93197ac5ffaadd7aad5..c725013ee827209a44ff9469faebe30f32deba4e 100644 --- a/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.cpp +++ b/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.h b/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.h index 4b451554949ea221276d0a76a757ca42b3a6d23a..beb7120fd6d5c40ae31a7d6a35ed7a17be351786 100644 --- a/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.h +++ b/plugins/ets/compiler/optimizer/ir_builder/ets_inst_builder.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/disassembler/disasm_ets_plugin.cpp b/plugins/ets/disassembler/disasm_ets_plugin.cpp index 93615fb6b4cd73198d97e0d35662c49983bc4cee..fac5be90a6f9591f0207963a3230fc297d6e31fd 100644 --- a/plugins/ets/disassembler/disasm_ets_plugin.cpp +++ b/plugins/ets/disassembler/disasm_ets_plugin.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/asm_defines/defines.h b/plugins/ets/runtime/asm_defines/defines.h index a00efb69141536db65b1bec99cbbedece982287a..eb913cc31484dc831138c8f168adce484b4f440b 100644 --- a/plugins/ets/runtime/asm_defines/defines.h +++ b/plugins/ets/runtime/asm_defines/defines.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/ets_coroutine.h b/plugins/ets/runtime/ets_coroutine.h index 778d8445d54da1ed355c224af28de9634565d7c4..aa61f9b1eedf7b0048f1fadcab8b29af2e3a8e27 100644 --- a/plugins/ets/runtime/ets_coroutine.h +++ b/plugins/ets/runtime/ets_coroutine.h @@ -22,17 +22,14 @@ namespace panda::ets { class PandaEtsVM; -/** - * \brief The eTS coroutine. It is aware of the native interface and reference storage existance. - * - */ +/// @brief The eTS coroutine. It is aware of the native interface and reference storage existance. class EtsCoroutine : public Coroutine { public: NO_COPY_SEMANTIC(EtsCoroutine); NO_MOVE_SEMANTIC(EtsCoroutine); /** - * \brief EtsCoroutine factory: the preferrable way to create a coroutine. See CoroutineManager::CoroutineFactory + * @brief EtsCoroutine factory: the preferrable way to create a coroutine. See CoroutineManager::CoroutineFactory * for details. * * Since C++ requires function type to exactly match the formal parameter type, we have to make this factory a diff --git a/plugins/ets/runtime/ets_entrypoints.h b/plugins/ets/runtime/ets_entrypoints.h index e8ee7a225c1bc277ce600441c44547f01da33959..4f86af46160515c9a965bb7176e01ccf233a942f 100644 --- a/plugins/ets/runtime/ets_entrypoints.h +++ b/plugins/ets/runtime/ets_entrypoints.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/ets_itable_builder.cpp b/plugins/ets/runtime/ets_itable_builder.cpp index 1d78948c9eb32348ed41c9d519dda9a1b41494ef..a4fbcd79cfb0526c3a2004725c607d1d46ed373a 100644 --- a/plugins/ets/runtime/ets_itable_builder.cpp +++ b/plugins/ets/runtime/ets_itable_builder.cpp @@ -1,17 +1,3 @@ -/* - * Copyright (c) 2021-2022 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. - */ /** * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/plugins/ets/runtime/ets_itable_builder.h b/plugins/ets/runtime/ets_itable_builder.h index 10c97decaec6ed3a99b566f079cbf6b3264de0ea..b5057919137d217f6286e1f575238de58db42aca 100644 --- a/plugins/ets/runtime/ets_itable_builder.h +++ b/plugins/ets/runtime/ets_itable_builder.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/ets_runtime_interface.cpp b/plugins/ets/runtime/ets_runtime_interface.cpp index e49f924a80cfd5158cea2a294f55eea6544ea9f3..bd08c1abebf51e3c4d8bc6f109dade6a7d3bc495 100644 --- a/plugins/ets/runtime/ets_runtime_interface.cpp +++ b/plugins/ets/runtime/ets_runtime_interface.cpp @@ -1,5 +1,4 @@ - -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/ets_runtime_interface.h b/plugins/ets/runtime/ets_runtime_interface.h index a8df982711a54e4d1bf1dfc83d020da304feb190..e97c76ee3d4d7674e57ee6f1a9ba46acbcf86539 100644 --- a/plugins/ets/runtime/ets_runtime_interface.h +++ b/plugins/ets/runtime/ets_runtime_interface.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. @@ -22,9 +22,8 @@ namespace panda::ets { class EtsRuntimeInterface : public PandaRuntimeInterface { public: - /************************************************************************** - * Object information - */ + /**********************************************************************************/ + /// Object information ClassPtr GetClass(MethodPtr method, IdType id) const override; size_t GetTlsPromiseClassPointerOffset(Arch arch) const override { diff --git a/plugins/ets/runtime/ets_vtable_builder.h b/plugins/ets/runtime/ets_vtable_builder.h index 168639d12975351c7ae0ef4953db79b0836873ba..acd769ef0b63b82861c7ab40dc25c01f56db6561 100644 --- a/plugins/ets/runtime/ets_vtable_builder.h +++ b/plugins/ets/runtime/ets_vtable_builder.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.cpp b/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.cpp index 7b46d4e4575a584774402da85d0b1f4d86911fc4..b8e7cab88d1656ff02e7f27b1d105fc7a09ff9ce 100644 --- a/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.cpp +++ b/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.h b/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.h index 9e550717c965f477be30cf83059f3d502105e3ee..5ddbe0e99aee0e67aca50df46d01e2db608e0906 100644 --- a/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.h +++ b/plugins/ets/runtime/interop_js/intrinsics/std_js_jsruntime.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/plugins/ets/runtime/interop_js/intrinsics_api_impl.cpp b/plugins/ets/runtime/interop_js/intrinsics_api_impl.cpp index e29d065d44aefbf1b98682cde2d10f15e12a9b91..dfaae132f7f6b84e333caab83e780ec14fb2718e 100644 --- a/plugins/ets/runtime/interop_js/intrinsics_api_impl.cpp +++ b/plugins/ets/runtime/interop_js/intrinsics_api_impl.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/plugins/ets/runtime/interop_js/intrinsics_declaration.h b/plugins/ets/runtime/interop_js/intrinsics_declaration.h index 0bcb4cc6517a3a1e02777e3e9c5e534a56337b04..928372be8e6cd3ff3a791367f1366db0fd9b46e8 100644 --- a/plugins/ets/runtime/interop_js/intrinsics_declaration.h +++ b/plugins/ets/runtime/interop_js/intrinsics_declaration.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/plugins/ets/runtime/interpreter/interpreter-inl.h b/plugins/ets/runtime/interpreter/interpreter-inl.h index 4f89b043064c6c83f49f7008b8bb205e9ce00a51..02d77804256cee560c91d5e92e5c14a43dd0e028 100644 --- a/plugins/ets/runtime/interpreter/interpreter-inl.h +++ b/plugins/ets/runtime/interpreter/interpreter-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2023 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. diff --git a/plugins/ets/runtime/intrinsics/helpers/ets_intrinsics_helpers.h b/plugins/ets/runtime/intrinsics/helpers/ets_intrinsics_helpers.h index e842988ad5ab835f93b34c6607f2df87fbab09f9..5bcd80fe389f1b215b17064c205ea414984a636e 100644 --- a/plugins/ets/runtime/intrinsics/helpers/ets_intrinsics_helpers.h +++ b/plugins/ets/runtime/intrinsics/helpers/ets_intrinsics_helpers.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/intrinsics/std_core_Promise.cpp b/plugins/ets/runtime/intrinsics/std_core_Promise.cpp index 360b660cd85d171e56f5fd82f1ae522db27cf17a..07071575a5e87698f07329c1c2cde40a974a6fc3 100644 --- a/plugins/ets/runtime/intrinsics/std_core_Promise.cpp +++ b/plugins/ets/runtime/intrinsics/std_core_Promise.cpp @@ -115,7 +115,7 @@ EtsObject *EtsAwaitPromise(EtsPromise *promise) [[maybe_unused]] EtsHandleScope scope(current_coro); EtsHandle promise_handle(current_coro, promise); - /*** CASE 1. This is a converted JS promise ***/ + /* CASE 1. This is a converted JS promise */ if (promise_handle->IsProxy()) { /** @@ -155,7 +155,7 @@ EtsObject *EtsAwaitPromise(EtsPromise *promise) return nullptr; } - /*** CASE 2. This is a native STS promise ***/ + /* CASE 2. This is a native STS promise */ if (!promise_handle->IsPending()) { /** diff --git a/plugins/ets/runtime/intrinsics_declaration.h b/plugins/ets/runtime/intrinsics_declaration.h index 2b57fe39c0d71f24732831f22ce93324bd7df76a..ee07552f8bd5e7433109ec2d63335468c7ab6b33 100644 --- a/plugins/ets/runtime/intrinsics_declaration.h +++ b/plugins/ets/runtime/intrinsics_declaration.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/job_queue.h b/plugins/ets/runtime/job_queue.h index 1e4ee14f766f25ebdab5502152374b0dd891794c..c713a12e723d23f6c882fe808b310bbef82e0c7c 100644 --- a/plugins/ets/runtime/job_queue.h +++ b/plugins/ets/runtime/job_queue.h @@ -25,10 +25,10 @@ public: virtual ~JobQueue() = default; - /// \brief Adds a callback (in a form of lambda function) to the JobQueue + /// @brief Adds a callback (in a form of lambda function) to the JobQueue virtual void AddJob(EtsObject *callback) = 0; /** - * \brief Creates a link between objects, so target's state changes synchronously to source's + * @brief Creates a link between objects, so target's state changes synchronously to source's * * Example: JS promise --> ETS promise */ diff --git a/plugins/ets/runtime/mem/ets_reference_processor.h b/plugins/ets/runtime/mem/ets_reference_processor.h index f44539c6531fdef8e728a9837a6ff41020e4c16f..9ec2901c043f146cf3541015cde906287a6db311 100644 --- a/plugins/ets/runtime/mem/ets_reference_processor.h +++ b/plugins/ets/runtime/mem/ets_reference_processor.h @@ -51,9 +51,7 @@ public: UNREACHABLE(); } - /** - * @return size of the queue of weak references - */ + /// @return size of the queue of weak references size_t GetReferenceQueueSize() const final; private: diff --git a/plugins/ets/runtime/regexp/regexp_executor.cpp b/plugins/ets/runtime/regexp/regexp_executor.cpp index 459b69d7beb8450a887da57c5163a4c51cca5232..efed24d217a6c0a88074be7c289d4eb1316cd8b5 100644 --- a/plugins/ets/runtime/regexp/regexp_executor.cpp +++ b/plugins/ets/runtime/regexp/regexp_executor.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/plugins/ets/runtime/regexp/regexp_executor.h b/plugins/ets/runtime/regexp/regexp_executor.h index bc74278da2915f04f5caf16ba5c24121607e75ea..d7d9db3886e0b6ee79ab015e378fbb81b1ed914b 100644 --- a/plugins/ets/runtime/regexp/regexp_executor.h +++ b/plugins/ets/runtime/regexp/regexp_executor.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/plugins/ets/runtime/types/ets_class.h b/plugins/ets/runtime/types/ets_class.h index b752434c2a440f6f9d83b6a9a38db479416e557b..4e102605d10561b7cd12163c2207390e3ec7ed3b 100644 --- a/plugins/ets/runtime/types/ets_class.h +++ b/plugins/ets/runtime/types/ets_class.h @@ -522,9 +522,7 @@ public: return GetObjectHeader()->GetFieldPrimitive(GetFlagsOffset()); } - /** - * Return true if given class has .finalize() method, false otherwise - */ + /// Return true if given class has .finalize() method, false otherwise static bool IsClassFinalizable(EtsClass *klass); void SetSoftReference(); @@ -539,9 +537,7 @@ public: [[nodiscard]] bool IsPhantomReference() const; [[nodiscard]] bool IsFinalizable() const; - /** - * True if class inherited from Reference, false otherwise - */ + /// True if class inherited from Reference, false otherwise [[nodiscard]] bool IsReference() const; EtsClass() = delete; @@ -581,30 +577,18 @@ private: } constexpr static uint32_t ETS_ACC_PRIMITIVE = 1U << 16U; - /** - * Class is a SoftReference or successor of this class - */ + /// Class is a SoftReference or successor of this class constexpr static uint32_t IS_SOFT_REFERENCE = 1U << 18U; - /** - * Class is a WeakReference or successor of this class - */ + /// Class is a WeakReference or successor of this class constexpr static uint32_t IS_WEAK_REFERENCE = 1U << 19U; - /** - * Class is a FinalizerReference or successor of this class - */ + /// Class is a FinalizerReference or successor of this class constexpr static uint32_t IS_FINALIZE_REFERENCE = 1U << 20U; - /** - * Class is a PhantomReference or successor of this class - */ + /// Class is a PhantomReference or successor of this class constexpr static uint32_t IS_PHANTOM_REFERENCE = 1U << 21U; - /** - * Class is a Reference or successor of this class - */ + /// Class is a Reference or successor of this class constexpr static uint32_t IS_REFERENCE = IS_SOFT_REFERENCE | IS_WEAK_REFERENCE | IS_FINALIZE_REFERENCE | IS_PHANTOM_REFERENCE; - /** - * Class override Object.finalize() or any of his ancestors, and implementation is not trivial. - */ + /// Class override Object.finalize() or any of his ancestors, and implementation is not trivial. constexpr static uint32_t IS_CLASS_FINALIZABLE = 1U << 22U; panda::ObjectHeader header_; // EtsObject diff --git a/plugins/ets/runtime/types/ets_weak_reference.h b/plugins/ets/runtime/types/ets_weak_reference.h index 861cc1c201e46d2b5e8374b92479ad1727f1d255..c917597ed44ab0a4a9028ede8fd7650286f3eb88 100644 --- a/plugins/ets/runtime/types/ets_weak_reference.h +++ b/plugins/ets/runtime/types/ets_weak_reference.h @@ -19,9 +19,7 @@ namespace panda::ets { -/** - * @class EtsWeakReference represent std.core.WeakRef class - */ +/// @class EtsWeakReference represent std.core.WeakRef class class EtsWeakReference : public EtsObject { public: EtsWeakReference() = delete; diff --git a/plugins/ets/tests/ets_test_suite/gc/pending_exception_test.cpp b/plugins/ets/tests/ets_test_suite/gc/pending_exception_test.cpp index f9fde7d8a702b8e3a2632b2e50f1584fdb3574af..2217658debc759b4058f99f3f87d637af1f7c707 100644 --- a/plugins/ets/tests/ets_test_suite/gc/pending_exception_test.cpp +++ b/plugins/ets/tests/ets_test_suite/gc/pending_exception_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/plugins/ets/tests/interop_js/tests/class_composite/class_composite.cpp b/plugins/ets/tests/interop_js/tests/class_composite/class_composite.cpp index be23f041f2e68feae255a5d33c6bcda0ec306de3..c57ac79db7ca326f742d90562a3e98bd2ba60127 100644 --- a/plugins/ets/tests/interop_js/tests/class_composite/class_composite.cpp +++ b/plugins/ets/tests/interop_js/tests/class_composite/class_composite.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2023 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. diff --git a/plugins/ets/tests/interop_js/tests/class_operations/class_operations.cpp b/plugins/ets/tests/interop_js/tests/class_operations/class_operations.cpp index d790e2f6c0cf084ab4e0dd072bd20f93bf7fd8fa..bb584c9be8c654cdcfc749e2801552ca4d55ce05 100644 --- a/plugins/ets/tests/interop_js/tests/class_operations/class_operations.cpp +++ b/plugins/ets/tests/interop_js/tests/class_operations/class_operations.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2023 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. diff --git a/plugins/ets/tests/interop_js/tests/strict_equality/strict_equality.cpp b/plugins/ets/tests/interop_js/tests/strict_equality/strict_equality.cpp index 042d6551499e49a69c520e2ecd1905ded59c8380..32c8560e994372d03da12da73f04285cae677a1b 100644 --- a/plugins/ets/tests/interop_js/tests/strict_equality/strict_equality.cpp +++ b/plugins/ets/tests/interop_js/tests/strict_equality/strict_equality.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2023 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. diff --git a/plugins/ets/tests/napi/lib/EtsnapiNameTest.cpp b/plugins/ets/tests/napi/lib/EtsnapiNameTest.cpp index 2e0d392a3664adc33d1e8d0dd541c21f67c139de..721e8498604c7d31a25e2aea5b47b323c4254c16 100644 --- a/plugins/ets/tests/napi/lib/EtsnapiNameTest.cpp +++ b/plugins/ets/tests/napi/lib/EtsnapiNameTest.cpp @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2023 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. + */ + #include "EtsnapiNameTest.h" #include #include diff --git a/plugins/ets/tests/napi/lib/EtsnapiNameTest.h b/plugins/ets/tests/napi/lib/EtsnapiNameTest.h index 20b7bed58d1c690ef0a30b065d504cc9107ad211..86e6eb93686831ade87dcbec256c7ccee10302f5 100644 --- a/plugins/ets/tests/napi/lib/EtsnapiNameTest.h +++ b/plugins/ets/tests/napi/lib/EtsnapiNameTest.h @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2023 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. + */ + /* DO NOT EDIT, file is autogenerated */ // NOLINTBEGIN(readability-identifier-naming, readability-named-parameter) #include diff --git a/plugins/ets/tests/runtime/tooling/test_debug_info.cpp b/plugins/ets/tests/runtime/tooling/test_debug_info.cpp index 941a74dae6b09c77fadd531dd2c0b1c05d8230e5..b7a5f0c6fdf36e1c0a29455d5c98d5dbaceeb59d 100644 --- a/plugins/ets/tests/runtime/tooling/test_debug_info.cpp +++ b/plugins/ets/tests/runtime/tooling/test_debug_info.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/quickener/quickener.h b/quickener/quickener.h index 20fa1759368db53b5fa6964ec7a97298ec93af6f..eae3f847df658d93a14fa93ca03f21878f377b76 100644 --- a/quickener/quickener.h +++ b/quickener/quickener.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/compiler.cpp b/runtime/compiler.cpp index d47bdde37dcd2cff2f2e7f46b04e78f15176ac60..72510a3265f81bf4ec23423fc9a7eaae9a61156a 100644 --- a/runtime/compiler.cpp +++ b/runtime/compiler.cpp @@ -61,9 +61,7 @@ bool CompilerProcessor::Process(CompilerTask &&task) return true; } -/** - * Intrinsics fast paths are supported only for G1 GC. - */ +/// Intrinsics fast paths are supported only for G1 GC. bool PandaRuntimeInterface::IsGcValidForFastPath(SourceLanguage lang) const { auto runtime = Runtime::GetCurrent(); @@ -679,9 +677,7 @@ void ClassHierarchyAnalysisWrapper::AddDependency(PandaRuntimeInterface::MethodP Runtime::GetCurrent()->GetCha()->AddDependency(MethodCast(callee), MethodCast(caller)); } -/** - * With 'no-async-jit' compilation inside of c2i bridge can forced and it can trigger GC - */ +/// With 'no-async-jit' compilation inside of c2i bridge can forced and it can trigger GC bool PandaRuntimeInterface::HasSafepointDuringCall() const { #ifdef PANDA_PRODUCT_BUILD diff --git a/runtime/compiler.h b/runtime/compiler.h index 80d1d20c6505bd392397ac9bcf08bc038e8cc071..c0450e67a88253ed47eadb7ec60900a62e87bb78 100644 --- a/runtime/compiler.h +++ b/runtime/compiler.h @@ -132,9 +132,8 @@ public: return ManagedThread::GetStackOverflowCheckOffset(); } - /************************************************************************** - * Binary file information - */ + /**********************************************************************************/ + /// Binary file information BinaryFilePtr GetBinaryFileForMethod(MethodPtr method) const override { return const_cast(MethodCast(method)->GetPandaFile()); @@ -146,9 +145,8 @@ public: IdType ResolveTypeIndex(MethodPtr parent_method, TypeIndex index) const override; - /************************************************************************** - * Method information - */ + /**********************************************************************************/ + /// Method information MethodPtr GetMethodById(MethodPtr parent_method, MethodId id) const override; MethodId GetMethodId(MethodPtr method) const override; @@ -379,9 +377,8 @@ public: bool CanThrowException(MethodPtr method) const override; - /************************************************************************** - * Thread information - */ + /**********************************************************************************/ + /// Thread information ::panda::mem::BarrierType GetPreType() const override; ::panda::mem::BarrierType GetPostType() const override; @@ -389,9 +386,8 @@ public: ::panda::mem::BarrierOperand GetBarrierOperand(::panda::mem::BarrierPosition barrier_position, std::string_view operand_name) const override; - /************************************************************************** - * Array information - */ + /**********************************************************************************/ + /// Array information uint32_t GetArrayElementSize(MethodPtr method, IdType id) const override; uint32_t GetMaxArrayLength(ClassPtr klass) const override; @@ -400,9 +396,8 @@ public: size_t GetOffsetToConstArrayData(MethodPtr method, IdType id) const override; - /************************************************************************** - * String information - */ + /**********************************************************************************/ + /// String information bool IsCompressedStringsEnabled() const override { return panda::coretypes::String::GetCompressedStringsEnabled(); @@ -412,9 +407,8 @@ public: ClassPtr GetStringClass(MethodPtr method) const override; - /************************************************************************** - * TLAB information - */ + /**********************************************************************************/ + /// TLAB information size_t GetTLABMaxSize() const override; size_t GetTLABAlignment() const override @@ -428,9 +422,8 @@ public: Logger::IsLoggingOn(Logger::Level::DEBUG, Logger::Component::MM_OBJECT_EVENTS); } - /************************************************************************** - * Object information - */ + /**********************************************************************************/ + /// Object information ClassPtr GetClass(MethodPtr method, IdType id) const override; compiler::ClassType GetClassType(MethodPtr method, IdType id) const override; @@ -475,9 +468,8 @@ public: : compiler::StringCtorType::STRING; } - /************************************************************************** - * Class information - */ + /**********************************************************************************/ + /// Class information uint8_t GetClassInitializedValue() const override { return static_cast(panda::Class::State::INITIALIZED); @@ -495,9 +487,8 @@ public: bool CanScalarReplaceObject(ClassPtr klass) const override; - /************************************************************************** - * Field information - */ + /**********************************************************************************/ + /// Field information FieldPtr ResolveField(MethodPtr method, size_t id, bool allow_external, uint32_t *class_id) override; compiler::DataType::Type GetFieldType(FieldPtr field) const override; @@ -522,9 +513,8 @@ public: FieldId GetFieldId(FieldPtr field) const override; - /************************************************************************** - * Type information - */ + /**********************************************************************************/ + /// Type information PandaRuntimeInterface::ClassPtr ResolveType(MethodPtr method, size_t id) const override; @@ -552,16 +542,14 @@ public: return static_cast(panda_file::Type::TypeId::REFERENCE); } - /************************************************************************** - * Entrypoints - */ + /**********************************************************************************/ + /// Entrypoints uintptr_t GetIntrinsicAddress(bool runtime_call, SourceLanguage lang, IntrinsicId id) const override; uintptr_t GetIntrinsicDirectAddress(IntrinsicId id) const override; - /************************************************************************** - * Dynamic object information - */ + /**********************************************************************************/ + /// Dynamic object information uint32_t GetFunctionTargetOffset(Arch arch) const override; @@ -698,9 +686,7 @@ public: thread_pool_->PutTask(std::move(task)); } - /** - * Basic method, which starts compilation. Do not use. - */ + /// Basic method, which starts compilation. Do not use. void CompileMethodLocked(const CompilerTask &&ctx); void ScaleThreadPool(size_t number_of_threads) diff --git a/runtime/compiler_queue_aged_counter_priority.h b/runtime/compiler_queue_aged_counter_priority.h index 9d96f0b7cc704c6c6f6c33c99805cb06edfed2cd..e0c34b2f2aa4911f95317812d47ffc02ce52a1dc 100644 --- a/runtime/compiler_queue_aged_counter_priority.h +++ b/runtime/compiler_queue_aged_counter_priority.h @@ -21,11 +21,12 @@ namespace panda { -/** The aged counter priority queue works mostly as counter priority queue (see description), - * but it sorts the methods by its aged hotness counters. - * If the aged counter is less then some death value, it is considered as expired and is removed. - * Epoch duration and death counter is configured. - * This queue is thread unsafe (should be used under lock). +/** + * The aged counter priority queue works mostly as counter priority queue (see description), + * but it sorts the methods by its aged hotness counters. + * If the aged counter is less then some death value, it is considered as expired and is removed. + * Epoch duration and death counter is configured. + * This queue is thread unsafe (should be used under lock). */ class CompilerPriorityAgedCounterQueue : public CompilerPriorityCounterQueue { public: diff --git a/runtime/compiler_queue_counter_priority.h b/runtime/compiler_queue_counter_priority.h index ece919dfaef2f0fee63d32172d0fcb5233a35a01..e35949451bf31eecbb2743bcd152e071d33730da 100644 --- a/runtime/compiler_queue_counter_priority.h +++ b/runtime/compiler_queue_counter_priority.h @@ -65,12 +65,13 @@ private: CompilerTask context_; }; -/** The counter priority queue sorts all tasks (methods) by its hotness counters. - * It extracts the most hot method for compilation (the lesser counter). - * It also has a limit of tasks for compilation. If the task is too old, it is expired and removed from the queue. - * Note, in case of skip the method due to length limit, its hotness counter is reset. - * Max length and life time is configured. - * This queue is thread unsafe (should be used under lock). +/** + * The counter priority queue sorts all tasks (methods) by its hotness counters. + * It extracts the most hot method for compilation (the lesser counter). + * It also has a limit of tasks for compilation. If the task is too old, it is expired and removed from the queue. + * Note, in case of skip the method due to length limit, its hotness counter is reset. + * Max length and life time is configured. + * This queue is thread unsafe (should be used under lock). */ class CompilerPriorityCounterQueue : public CompilerQueueInterface { public: diff --git a/runtime/compiler_queue_simple.h b/runtime/compiler_queue_simple.h index 97be3adc22dd5fd519af6e383e3cafdbcb0a7597..8a99159f70b2115ba3151d569a24818306e1fa58 100644 --- a/runtime/compiler_queue_simple.h +++ b/runtime/compiler_queue_simple.h @@ -20,9 +20,10 @@ namespace panda { -/** The simple queue works as FIFO without any other logic: it stores all tasks to a list and extracts the first one. - * There is no length limit or expiring condition. Mostly useful for debugging, as is more deterministic. - * This queue is thread unsafe (should be used under lock). +/** + * The simple queue works as FIFO without any other logic: it stores all tasks to a list and extracts the first one. + * There is no length limit or expiring condition. Mostly useful for debugging, as is more deterministic. + * This queue is thread unsafe (should be used under lock). */ class CompilerQueueSimple : public CompilerQueueInterface { public: diff --git a/runtime/core/core_itable_builder.h b/runtime/core/core_itable_builder.h index 464707d19d1d12d5420d3cd826bdb3db1aeec58c..17ff98bb2c6f310d029ab71a4e0be02810e0653a 100644 --- a/runtime/core/core_itable_builder.h +++ b/runtime/core/core_itable_builder.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/core/core_vtable_builder.h b/runtime/core/core_vtable_builder.h index c111a4b7b8d4130adacd6b323ce13c002a876cfe..2809352dee368de2492071327dc3ebcbcc07f408 100644 --- a/runtime/core/core_vtable_builder.h +++ b/runtime/core/core_vtable_builder.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/coroutine_context.h b/runtime/coroutine_context.h index f3f75449f05b6fd3556454804bdeb2f1c242f0bc..d396f8cac36812774601e8715803c4156553173c 100644 --- a/runtime/coroutine_context.h +++ b/runtime/coroutine_context.h @@ -20,7 +20,7 @@ namespace panda { /** - * \brief Native context of a coroutine. + * @brief Native context of a coroutine. * * Implementation dependent: may contain register state or OS thread pointer or something else. * Does not contain managed state (contains native state only). @@ -37,7 +37,7 @@ public: { co_ = co; } - /// get linked coroutine instance (contains managed portion of state) + /// Get linked coroutine instance (contains managed portion of state) Coroutine *GetCoroutine() { return co_; @@ -53,8 +53,10 @@ public: virtual void RequestResume() = 0; virtual void RequestUnblock() = 0; - /// writes coroutine stack parameters into the provided stack_addr, stack_size, guard_size variables - /// and returns true on successful operation + /** + * Writes coroutine stack parameters into the provided stack_addr, stack_size, guard_size variables + * and returns true on successful operation + */ virtual bool RetrieveStackInfo(void *&stack_addr, size_t &stack_size, size_t &guard_size) = 0; private: diff --git a/runtime/coroutine_manager.h b/runtime/coroutine_manager.h index 8db1759862bbdfc4b9f65327d3bd68e15dab9fef..f260357f9a6ec4dee57778d887eac9cff014f9a4 100644 --- a/runtime/coroutine_manager.h +++ b/runtime/coroutine_manager.h @@ -23,20 +23,18 @@ namespace panda { -/** - * \brief describes the set of adjustable parameters for CoroutineManager and its descendants initialization - */ +/// @brief describes the set of adjustable parameters for CoroutineManager and its descendants initialization struct CoroutineManagerConfig { static constexpr uint32_t WORKERS_COUNT_AUTO = 0; /// JS-compatible mode, affects async functions, await() and other things bool emulate_js = false; - /// number of coroutine workers for the N:M mode + /// Number of coroutine workers for the N:M mode uint32_t workers_count = WORKERS_COUNT_AUTO; }; /** - * \brief The interface of all coroutine manager implementations. + * @brief The interface of all coroutine manager implementations. * * Manages (registers, unregisters, enumerates) and schedules coroutines for execution. * Creates and destroys the main coroutine. @@ -45,14 +43,14 @@ struct CoroutineManagerConfig { class CoroutineManager : public ThreadManager { public: /** - * \brief The coroutine factory interface. + * @brief The coroutine factory interface. * - * \param name the coroutine name (for debugging and logging purposes) + * @param name the coroutine name (for debugging and logging purposes) * - * \param ctx the instance of implementation-dependend native coroutine context. Usually is provided by the + * @param ctx the instance of implementation-dependend native coroutine context. Usually is provided by the * concrete CoroutineManager descendant. * - * \param ep_info if provided (that means, ep_info != std::nullopt), defines the coroutine entry point to execute: + * @param ep_info if provided (that means, ep_info != std::nullopt), defines the coroutine entry point to execute: * the bytecode method, its arguments and the completion event instance to hold the method return value. See * Coroutine::EntrypointInfo for details. * If this parameter is std::nullopt (i.e. no entrypoint present) then the following rules apply: @@ -72,54 +70,56 @@ public: NO_COPY_SEMANTIC(CoroutineManager); NO_MOVE_SEMANTIC(CoroutineManager); - /// factory is used to create coroutines when needed. See CoroutineFactory for details. + /// Factory is used to create coroutines when needed. See CoroutineFactory for details. explicit CoroutineManager(CoroutineFactory factory); ~CoroutineManager() override = default; /** - * \brief should be called after CoroutineManager creation and before any other method calls - * \param config describes the CoroutineManager operation mode + * @brief should be called after CoroutineManager creation and before any other method calls + * @param config describes the CoroutineManager operation mode */ virtual void Initialize(CoroutineManagerConfig config) = 0; virtual void Finalize() = 0; - /// add coroutine to registry (used for enumeration and tracking) and perform all the required actions + /// Add coroutine to registry (used for enumeration and tracking) and perform all the required actions virtual void RegisterCoroutine(Coroutine *co) = 0; /** - * \brief Remove coroutine from all internal structures, notify waiters about its completion, correctly + * @brief Remove coroutine from all internal structures, notify waiters about its completion, correctly * delete coroutine and free its resources - * \return returnes true if coroutine has been deleted, false otherwise (e.g. in case of terminating main) + * @return returnes true if coroutine has been deleted, false otherwise (e.g. in case of terminating main) */ virtual bool TerminateCoroutine(Coroutine *co) = 0; /** - * \brief The public coroutine creation interface. + * @brief The public coroutine creation interface. * - * \param completion_event the event used for notification when coroutine completes (also used to pass the return + * @param completion_event the event used for notification when coroutine completes (also used to pass the return * value to the language-level entities) - * \param entrypoint the coroutine entrypoint method - * \param arguments array of coroutine's entrypoint arguments + * @param entrypoint the coroutine entrypoint method + * @param arguments array of coroutine's entrypoint arguments */ virtual Coroutine *Launch(CompletionEvent *completion_event, Method *entrypoint, PandaVector &&arguments) = 0; /// Suspend the current coroutine and schedule the next ready one for execution virtual void Schedule() = 0; /** - * \brief Move the current coroutine to the waiting state until awaitee happens and schedule the + * @brief Move the current coroutine to the waiting state until awaitee happens and schedule the * next ready coroutine for execution. * * NB! After the wait is over, awaitee is deleted by this method! */ virtual void Await(CoroutineEvent *awaitee) = 0; /** - * \brief notify the waiting coroutines that an event has happened, so they can stop waiting and + * @brief notify the waiting coroutines that an event has happened, so they can stop waiting and * become ready for execution - * \param blocker the blocking event which transitioned from pending to happened state + * @param blocker the blocking event which transitioned from pending to happened state * - * NB! this functions deletes \param blocker (assuming that it was allocated via InternalAllocator)! + * NB! this functions deletes @param blocker (assuming that it was allocated via InternalAllocator)! */ virtual void UnblockWaiters(CoroutineEvent *blocker) = 0; - /// The designated interface for creating the main coroutine instance. - /// The program EP will be invoked within its context. + /** + * The designated interface for creating the main coroutine instance. + * The program EP will be invoked within its context. + */ Coroutine *CreateMainCoroutine(Runtime *runtime, PandaVM *vm); /// Delete the main coroutine instance and free its resources void DestroyMainCoroutine(); @@ -130,29 +130,29 @@ public: * The created coroutine instance will not have any method to execute. All the control flow must be managed * by the caller. * - * \return nullptr if resource limit reached or something went wrong; ptr to the coroutine otherwise + * @return nullptr if resource limit reached or something went wrong; ptr to the coroutine otherwise */ Coroutine *CreateEntrypointlessCoroutine(Runtime *runtime, PandaVM *vm); void DestroyEntrypointlessCoroutine(Coroutine *co); protected: - /// create native coroutine context instance (implementation dependent) + /// Create native coroutine context instance (implementation dependent) virtual CoroutineContext *CreateCoroutineContext(bool coro_has_entrypoint) = 0; - /// delete native coroutine context instance (implementation dependent) + /// Delete native coroutine context instance (implementation dependent) virtual void DeleteCoroutineContext(CoroutineContext *) = 0; /** * Create coroutine instance including the native context and link the context and the coroutine. * The coroutine is created using the factory provided in the CoroutineManager constructor and the virtual * context creation function, which should be defined in concrete CoroutineManager implementations. * - * \return nullptr if resource limit reached or something went wrong; ptr to the coroutine otherwise + * @return nullptr if resource limit reached or something went wrong; ptr to the coroutine otherwise */ Coroutine *CreateCoroutineInstance(CompletionEvent *completion_event, Method *entrypoint, PandaVector &&arguments, PandaString name); - /// returns number of existing coroutines + /// Returns number of existing coroutines virtual size_t GetCoroutineCount() = 0; /** - * \brief returns number of coroutines that could be created till the resource limit is reached. + * @brief returns number of coroutines that could be created till the resource limit is reached. * The resource limit definition is specific to the exact coroutines/coroutine manager implementation. */ virtual size_t GetCoroutineCountLimit() = 0; diff --git a/runtime/default_debugger_agent.cpp b/runtime/default_debugger_agent.cpp index 675f94c2cfe3031fcb01032d046ea92c11e35311..087bdbe535a9c5314aa55ad1628b92051c164209 100644 --- a/runtime/default_debugger_agent.cpp +++ b/runtime/default_debugger_agent.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/default_debugger_agent.h b/runtime/default_debugger_agent.h index 535f2870afd650f2a89e4c1109197dc9344adf4c..f19575a04bd688d99749cadf7141e61ba2c22193 100644 --- a/runtime/default_debugger_agent.h +++ b/runtime/default_debugger_agent.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/deoptimization.cpp b/runtime/deoptimization.cpp index 6f31c5d63e7cd5ddc2731f83b151278ab949428d..bdf48b8b27c54ccba9057ca2d4fe37d184c55dec 100644 --- a/runtime/deoptimization.cpp +++ b/runtime/deoptimization.cpp @@ -26,7 +26,7 @@ namespace panda { /** - * \brief Deoptimize CFrame that lies after another CFrame. + * @brief Deoptimize CFrame that lies after another CFrame. * @param thread Pointer to thread * @param pc PC from which interpreter starts execution * @param frame Pointer to the first interpreter frame to that CFrame will be converted. It will be released via @@ -39,7 +39,7 @@ namespace panda { extern "C" [[noreturn]] void DeoptimizeAfterCFrame(ManagedThread *thread, const uint8_t *pc, Frame *frame, void *cframe_fp, Frame *last_frame, void *callee_regs); /** - * \brief Deoptimize CFrame that lies after interpreter frame. + * @brief Deoptimize CFrame that lies after interpreter frame. * @param thread Pointer to thread * @param pc PC from which interpreter starts execution * @param frame Pointer to the first interpreter frame to that CFrame will be converted. It will be released via @@ -52,7 +52,7 @@ extern "C" [[noreturn]] void DeoptimizeAfterCFrame(ManagedThread *thread, const extern "C" [[noreturn]] void DeoptimizeAfterIFrame(ManagedThread *thread, const uint8_t *pc, Frame *frame, void *cframe_fp, Frame *last_frame, void *callee_regs); /** - * \brief Drop given CFrame and return to its caller. + * @brief Drop given CFrame and return to its caller. * Drop means that we set stack pointer to the top of given CFrame, restores its return address and invoke `return` * instruction. * @param cframe_fp Pointer to Cframe to be dropped diff --git a/runtime/deoptimization.h b/runtime/deoptimization.h index fc8ff646ac601955b403aa57bbe957f2233e079a..bac6221814a7ac5fc55937bd392514aaf13b0c99 100644 --- a/runtime/deoptimization.h +++ b/runtime/deoptimization.h @@ -21,7 +21,7 @@ namespace panda { /** - * \brief Deoptimize compiled frame + * @brief Deoptimize compiled frame * @param stack Frame to be deoptimized. Must be CFrame (compiled frame). * @param pc PC from which interpreter starts execution, if nullptr, pc is got from deoptimized CFrame. * @param has_exception we use exception from current thread @@ -30,7 +30,7 @@ namespace panda { Method *destroy_method = nullptr); /** - * \brief Drop given CFrame and return to its caller. + * @brief Drop given CFrame and return to its caller. * @param stack Frame to be dropped. Must be CFrame. */ [[noreturn]] void DropCompiledFrame(StackWalker *stack); diff --git a/runtime/dprofiler/dprofiler.h b/runtime/dprofiler/dprofiler.h index 5fd5f98d2a984763dd628305b51190eb6bffab69..d2ffdbf886d5a835529e2b861e597a6e0342cc29 100644 --- a/runtime/dprofiler/dprofiler.h +++ b/runtime/dprofiler/dprofiler.h @@ -32,9 +32,7 @@ class Method; class Runtime; class RuntimeListener; -/** - * \brief The DProfiler class integrates the distributed profiling in the Panda. - */ +/// @brief The DProfiler class integrates the distributed profiling in the Panda. class DProfiler final { public: #ifdef PANDA_TARGET_UNIX @@ -49,14 +47,12 @@ public: ~DProfiler() = default; /** - * \brief Add a panda::Class for the dump. + * @brief Add a panda::Class for the dump. * @param klass */ void AddClass(const Class *klass); - /** - * \brief Send a dump of distributed profiling info - */ + /// @brief Send a dump of distributed profiling info void Dump(); private: diff --git a/runtime/fibers/arch/aarch64/context_layout.h b/runtime/fibers/arch/aarch64/context_layout.h index 8d4d22ae70c69d067f33f0626254a892fec8ce9e..472e21ec8627c24b847c7d8b04ed7e951cca22d1 100644 --- a/runtime/fibers/arch/aarch64/context_layout.h +++ b/runtime/fibers/arch/aarch64/context_layout.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/runtime/fibers/arch/amd64/context_layout.h b/runtime/fibers/arch/amd64/context_layout.h index 510f93cb49c38222ef7c68bc42494fb0aa8d80bb..a4cf76731979bb0167f440c673037d88d917d251 100644 --- a/runtime/fibers/arch/amd64/context_layout.h +++ b/runtime/fibers/arch/amd64/context_layout.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/runtime/fibers/arch/arm/context_layout.h b/runtime/fibers/arch/arm/context_layout.h index 9be3a9bdd74e891fd66cd98578bc8b917ed64f48..a9cb7eb759073bcd8541b44bca172a1b2a9a2d26 100644 --- a/runtime/fibers/arch/arm/context_layout.h +++ b/runtime/fibers/arch/arm/context_layout.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/runtime/fibers/arch/asm_macros.h b/runtime/fibers/arch/asm_macros.h index bc958e40a45c09f3d71203b8f0544f84923da330..7ca7ffd86a8c1c6f1d7cd7649972092fde7a31ff 100644 --- a/runtime/fibers/arch/asm_macros.h +++ b/runtime/fibers/arch/asm_macros.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/runtime/fibers/fiber_context.cpp b/runtime/fibers/fiber_context.cpp index 8ffe87e9948bfe39a495e4d2a3f2be6189ee4550..470a0df73f6b9a333982a9863efbf27842ac27c1 100644 --- a/runtime/fibers/fiber_context.cpp +++ b/runtime/fibers/fiber_context.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. diff --git a/runtime/fibers/fiber_context.h b/runtime/fibers/fiber_context.h index 97e789fa8b6f7d8b31f65a020e93295f76ed1710..828cb032fcc6aafd5ec3c7141c6149dd80aa927e 100644 --- a/runtime/fibers/fiber_context.h +++ b/runtime/fibers/fiber_context.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2023 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. @@ -48,41 +48,41 @@ namespace panda::fibers { using FiberContext = uint8_t[FCTX_LEN_BYTES]; using FiberEntry = void (*)(void *); -/// \brief Saves current usermode context to the provided buffer in memory. +/// @brief Saves current usermode context to the provided buffer in memory. extern "C" int GetCurrentContext(FiberContext *ctx); /** - * \brief Saves current context and switches to the target one. - * \param from the buffer to save the current context in - * \param to the buffer to load the new context from + * @brief Saves current context and switches to the target one. + * @param from the buffer to save the current context in + * @param to the buffer to load the new context from */ extern "C" int SwitchContext(FiberContext *from, const FiberContext *to); /** - * \brief Updates the previously saved context with a new stack and a new entry point. + * @brief Updates the previously saved context with a new stack and a new entry point. * - * \param ctx a buffer with a valid saved context (via GetCurrentContext() or SwitchContext()) - * \param func the new entry point. After a context switch to ctx with SwitchContext(), the control transfers + * @param ctx a buffer with a valid saved context (via GetCurrentContext() or SwitchContext()) + * @param func the new entry point. After a context switch to ctx with SwitchContext(), the control transfers * to the beginning of func. Upon completion, func should use SwitchContext() to transfer control further. * If func, instead of that, does a simple return, this counts as an abnormal EP termination and the main program * is terminated with an error. - * \param argument an optional argument to be passed to the func. Can be nullptr if needed. Might be a pointer to some + * @param argument an optional argument to be passed to the func. Can be nullptr if needed. Might be a pointer to some * structure or class that represents the fiber instance. - * \param stack a pointer to the stack to be used by the func. Should point to a preallocated buffer capable of holding + * @param stack a pointer to the stack to be used by the func. Should point to a preallocated buffer capable of holding * at least stack_size_bytes bytes. Allocation and deallocation of this buffer is the caller's responsibility. - * \param stack_size_bytes minimal size of the stack provided + * @param stack_size_bytes minimal size of the stack provided */ extern "C" int UpdateContext(FiberContext *ctx, FiberEntry func, void *argument, uint8_t *stack, size_t stack_size_bytes); /** - * \brief Updates the previously saved context with a new entry point, keeping the original stack. + * @brief Updates the previously saved context with a new entry point, keeping the original stack. * * Effectively emulates a function call, so EP's return address is the original PC of the saved context. */ extern "C" int UpdateContextKeepStack(FiberContext *ctx, FiberEntry func, void *argument); -/// \brief Copies the context stored in \param src to \param dst +/// @brief Copies the context stored in @param src to @param dst extern "C" void CopyContext(FiberContext *dst, const FiberContext *src); } // namespace panda::fibers diff --git a/runtime/include/coretypes/string.h b/runtime/include/coretypes/string.h index c7af18674fccd407ba8e5b91b7daae31c600673e..8837014604930ff533986d2d15fc9c98e8f2c019 100644 --- a/runtime/include/coretypes/string.h +++ b/runtime/include/coretypes/string.h @@ -89,9 +89,7 @@ public: return length * sizeof(data_utf16_[0]); } - /** - * Methods for uncompressed strings (UTF16) - */ + /// Methods for uncompressed strings (UTF16) static size_t ComputeSizeUtf16(uint32_t utf16_length) { return sizeof(String) + ComputeDataSizeUtf16(utf16_length); @@ -103,17 +101,13 @@ public: return data_utf16_; } - /** - * Methods for compresses strings (MUTF8 or LATIN1) - */ + /// Methods for compresses strings (MUTF8 or LATIN1) static size_t ComputeSizeMUtf8(uint32_t mutf8_length) { return sizeof(String) + mutf8_length; } - /** - * It's MUtf8 format, but without 0 in the end. - */ + /// It's MUtf8 format, but without 0 in the end. uint8_t *GetDataMUtf8() { LOG_IF(IsUtf16(), FATAL, RUNTIME) << "String: Read data as mutf8 for utf16 string"; @@ -245,19 +239,13 @@ public: return STRING_COMPRESSED_BIT; } - /** - * Compares strings by bytes, It doesn't check canonical unicode equivalence. - */ + /// Compares strings by bytes, It doesn't check canonical unicode equivalence. static bool StringsAreEqual(String *str1, String *str2); - /** - * Compares strings by bytes, It doesn't check canonical unicode equivalence. - */ + /// Compares strings by bytes, It doesn't check canonical unicode equivalence. static bool StringsAreEqualMUtf8(String *str1, const uint8_t *mutf8_data, uint32_t utf16_length); static bool StringsAreEqualMUtf8(String *str1, const uint8_t *mutf8_data, uint32_t utf16_length, bool can_be_compressed); - /** - * Compares strings by bytes, It doesn't check canonical unicode equivalence. - */ + /// Compares strings by bytes, It doesn't check canonical unicode equivalence. static bool StringsAreEqualUtf16(String *str1, const uint16_t *utf16_data, uint32_t utf16_data_length); static String *DoReplace(String *src, uint16_t old_c, uint16_t new_c, const LanguageContext &ctx, PandaVM *vm); static uint32_t ComputeHashcodeMutf8(const uint8_t *mutf8_data, uint32_t length); @@ -329,9 +317,7 @@ private: static bool IsMutf8EqualsUtf16(const uint8_t *utf8_data, const uint16_t *utf16_data, uint32_t utf16_data_length); template - /** - * Check that two spans are equal. Should have the same length. - */ + /// Check that two spans are equal. Should have the same length. static bool StringsAreEquals(Span &str1, Span &str2); template diff --git a/runtime/include/coroutine.h b/runtime/include/coroutine.h index 99df704882eaf5a8ead3b7fdec2392a411d88263..703fc3ded7621ca5ee2c6954ee11099d04088e58 100644 --- a/runtime/include/coroutine.h +++ b/runtime/include/coroutine.h @@ -24,7 +24,7 @@ namespace panda { class CoroutineContext; class CompletionEvent; /** - * \brief The base class for all coroutines. Holds the managed part of the coroutine context. + * @brief The base class for all coroutines. Holds the managed part of the coroutine context. * * The coroutine context is splitted into managed and native parts. * The managed part is store in this class and its descendants. For the native part see the @@ -56,7 +56,7 @@ public: */ enum class Status { CREATED, RUNNABLE, RUNNING, BLOCKED, TERMINATING, AWAIT_LOOP }; - /// a helper struct that aggregates all EP related data for a coroutine + /// A helper struct that aggregates all EP related data for a coroutine struct EntrypointInfo { // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes) CompletionEvent *completion_event; @@ -66,13 +66,13 @@ public: PandaVector &&arguments; /** - * \param completion_event an instance of CompletionEvent to be used on coroutine completion to pass the + * @param completion_event an instance of CompletionEvent to be used on coroutine completion to pass the * return value to the point where it is needed. Also is used to unblock the coroutines that are waiting for * the one being created to complete. * - * \param entrypoint managed method to execute in the context of coroutine. + * @param entrypoint managed method to execute in the context of coroutine. * - * \param arguments the array of EP method arguments + * @param arguments the array of EP method arguments */ explicit EntrypointInfo(CompletionEvent *event, Method *entry, PandaVector &&args) : completion_event(event), entrypoint(entry), arguments(std::move(args)) @@ -82,8 +82,10 @@ public: } }; - /// The coroutine factory: creates and initializes a coroutine instance. The preferred way to create a - /// coroutine. For details see CoroutineManager::CoroutineFactory + /** + * The coroutine factory: creates and initializes a coroutine instance. The preferred way to create a + * coroutine. For details see CoroutineManager::CoroutineFactory + */ static Coroutine *Create(Runtime *runtime, PandaVM *vm, PandaString name, CoroutineContext *context, std::optional &&ep_info = std::nullopt); ~Coroutine() override = default; @@ -96,8 +98,10 @@ public: * Implies that the CleanUp() method was called before caching. */ void ReInitialize(PandaString name, CoroutineContext *context, std::optional &&ep_info); - /// Manual destruction, applicable only to the main coro. Other ones get deleted by the coroutine manager once they - /// finish execution of their entrypoint method. + /** + * Manual destruction, applicable only to the main coro. Other ones get deleted by the coroutine manager once they + * finish execution of their entrypoint method. + */ void Destroy(); void CleanUp() override; @@ -134,15 +138,17 @@ public: /// Get coroutine name. PandaString GetName() const; - /// Suspend a coroutine, so its status becomes either Status::RUNNABLE or Status::BLOCKED, depending on the suspend - /// reason. + /** + * Suspend a coroutine, so its status becomes either Status::RUNNABLE or Status::BLOCKED, depending on the suspend + * reason. + */ virtual void RequestSuspend(bool gets_blocked); /// Resume the suspended coroutine, so its status becomes Status::RUNNING. virtual void RequestResume(); /// Unblock the blocked coroutine, setting its status to Status::RUNNABLE virtual void RequestUnblock(); /** - * \brief Indicate that coroutine entrypoint execution is finished. Propagates the coroutine + * @brief Indicate that coroutine entrypoint execution is finished. Propagates the coroutine * return value to language level objects. */ virtual void RequestCompletion(Value return_value); @@ -187,7 +193,7 @@ public: } protected: - // we would like everyone to use the factory to create a Coroutine + // We would like everyone to use the factory to create a Coroutine explicit Coroutine(ThreadId id, mem::InternalAllocatorPtr allocator, PandaVM *vm, panda::panda_file::SourceLang thread_lang, PandaString name, CoroutineContext *context, std::optional &&ep_info); diff --git a/runtime/include/coroutine_events.h b/runtime/include/coroutine_events.h index 4ae3091b939aac92d4e69087a2d4d2cbe2a7ff77..207fd2bc1cd7d7f88ec24815bf90ee8516c1843d 100644 --- a/runtime/include/coroutine_events.h +++ b/runtime/include/coroutine_events.h @@ -20,7 +20,7 @@ namespace panda { /** - * \brief The base class for coroutine events. Cannot be instantiated directly. + * @brief The base class for coroutine events. Cannot be instantiated directly. * * These events are used to implement blocking and unblocking the coroutines that are waiting for something. */ @@ -57,7 +57,7 @@ private: }; /** - * \brief The generic event: just some event that can be awaited. + * @brief The generic event: just some event that can be awaited. * * The only thing that it can do: it can happen. */ @@ -72,16 +72,16 @@ public: private: }; -/** - * \brief The coroutine completion event: happens when coroutine is done executing its bytecode. - */ +/// @brief The coroutine completion event: happens when coroutine is done executing its bytecode. class CompletionEvent : public CoroutineEvent { public: NO_COPY_SEMANTIC(CompletionEvent); NO_MOVE_SEMANTIC(CompletionEvent); - /// \param promise A weak reference (from global storage) to the language-dependent promise object that will hold - /// the coroutine return value. + /** + * @param promise A weak reference (from global storage) to the language-dependent promise object that will hold + * the coroutine return value. + */ explicit CompletionEvent(mem::Reference *promise) : CoroutineEvent(Type::COMPLETION), promise_(promise) {} ~CompletionEvent() override = default; diff --git a/runtime/include/gc_task.h b/runtime/include/gc_task.h index a5b2f7fcda52d27565a406f3a83c8071014f86e1..ad782ebc70083a6c254b62351a66585a22db589a 100644 --- a/runtime/include/gc_task.h +++ b/runtime/include/gc_task.h @@ -28,9 +28,7 @@ namespace mem { class GC; } // namespace mem -/** - * Causes are ordered by priority. Bigger index - means bigger priority in GC - */ +/// Causes are ordered by priority. Bigger index - means bigger priority in GC enum class GCTaskCause : uint8_t { INVALID_CAUSE = 0, YOUNG_GC_CAUSE, // if young space is full diff --git a/runtime/include/histogram.h b/runtime/include/histogram.h index ea2daa97ff0d170f8a888ea7a39141a82d861d08..d8a648f72f73b25ef6ff6df7afac3e1a8c9a4f2d 100644 --- a/runtime/include/histogram.h +++ b/runtime/include/histogram.h @@ -24,7 +24,7 @@ namespace panda { /** - * \brief Class for providing distribution statistics + * @brief Class for providing distribution statistics * Minimum, maximum, count, average, sum, dispersion */ template @@ -36,7 +36,7 @@ public: } /** - * \brief Add all element to statistics at the half-interval from \param start to \param finish + * @brief Add all element to statistics at the half-interval from @param start to @param finish * @param start begin of values inclusive * @param finish end of values ​​not inclusive */ @@ -45,13 +45,13 @@ public: helpers::ValueType type_of_value = helpers::ValueType::VALUE_TYPE_OBJECT); /** - * \brief Output the General statistics of Histogram + * @brief Output the General statistics of Histogram * @return PandaString with Sum, Avg, Max */ PandaString GetGeneralStatistic() const; /** - * \brief Add \param element to statistics \param number of times + * @brief Add @param element to statistics @param number of times * @param element * @param count */ @@ -105,7 +105,7 @@ private: }; /** - * \brief Class for providing distribution statistics + * @brief Class for providing distribution statistics * Minimum, maximum, count, average, sum, dispersion */ template @@ -117,7 +117,7 @@ public: } /** - * \brief Add all element to statistics at the half-interval from \param start to \param finish + * @brief Add all element to statistics at the half-interval from @param start to @param finish * @param start begin of values inclusive * @param finish end of values ​​not inclusive */ @@ -126,7 +126,7 @@ public: helpers::ValueType type_of_value = helpers::ValueType::VALUE_TYPE_OBJECT); /** - * \brief Output the first \param count_top of the lowest values by key + * @brief Output the first @param count_top of the lowest values by key * with the number of their count * @param count_top Number of first values to output * @return PandaString with in format: "[key:count[,]]*" @@ -134,7 +134,7 @@ public: PandaString GetTopDump(size_t count_top = DEFAULT_TOP_SIZE) const; /** - * \brief Add \param element to statistics \param number of times + * @brief Add @param element to statistics @param number of times * @param element * @param count */ diff --git a/runtime/include/loadable_agent.h b/runtime/include/loadable_agent.h index 8b457e9443fc5fd5b2cf101bcb10c1a5e5b58f68..3d7d85d598e14d7412a85d4eed3610ec9a52856d 100644 --- a/runtime/include/loadable_agent.h +++ b/runtime/include/loadable_agent.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/include/locks.h b/runtime/include/locks.h index 536eb17e8d08998ad92d1bc72cb3d7800de6261c..96993ecf528b34fffae95e0ce9ac7d9c0f3c466e 100644 --- a/runtime/include/locks.h +++ b/runtime/include/locks.h @@ -48,9 +48,7 @@ public: static MutatorLock *NewMutatorLock(); - /** - * Lock used for preventing custom_tls_cache_ modifications - */ + /// Lock used for preventing custom_tls_cache_ modifications static os::memory::Mutex *custom_tls_lock_; // NOLINT(misc-non-private-member-variables-in-classes) /** diff --git a/runtime/include/managed_thread.h b/runtime/include/managed_thread.h index 55518fc4b5d170037556ddff517ee4b30d2ab8a5..087f9abae58fcc5bcae11ac5ff103b0e141bf0ad 100644 --- a/runtime/include/managed_thread.h +++ b/runtime/include/managed_thread.h @@ -25,7 +25,7 @@ namespace panda { class MTThreadManager; /** - * \brief Class represents managed thread + * @brief Class represents managed thread * * When the thread is created it registers itself in the runtime, so * runtime knows about all managed threads at any given time. @@ -593,7 +593,7 @@ public: void InitForStackOverflowCheck(size_t native_stack_reserved_size, size_t native_stack_protected_size); virtual void DisableStackOverflowCheck(); virtual void EnableStackOverflowCheck(); - /// obtains current thread's native stack parameters and returns true on success + /// Obtains current thread's native stack parameters and returns true on success virtual bool RetrieveStackInfo(void *&stack_addr, size_t &stack_size, size_t &guard_size); template @@ -663,9 +663,7 @@ public: ResumeImpl(); } - /** - * Transition to suspended and back to runnable, re-acquire share on mutator_lock_ - */ + /// Transition to suspended and back to runnable, re-acquire share on mutator_lock_ void SuspendCheck(); bool IsUserSuspended() @@ -782,8 +780,10 @@ protected: id_.store(id, std::memory_order_relaxed); } - /// Prepares the ManagedThread instance for caching and further reuse by resetting its member variables to their - /// default values. + /** + * Prepares the ManagedThread instance for caching and further reuse by resetting its member variables to their + * default values. + */ virtual void CleanUp(); private: diff --git a/runtime/include/mem/allocator.h b/runtime/include/mem/allocator.h index 2071dd71d636935632912a153a01e0f53379592e..ab50d26d8040512b26b8f4529cdd2c99c3f941f5 100644 --- a/runtime/include/mem/allocator.h +++ b/runtime/include/mem/allocator.h @@ -50,9 +50,7 @@ class ObjectAllocConfigWithCrossingMap; class ObjectAllocConfig; class TLAB; -/** - * AllocatorPurpose and GCCollectMode provide info when we should collect from some allocator or not - */ +/// AllocatorPurpose and GCCollectMode provide info when we should collect from some allocator or not enum class AllocatorPurpose { ALLOCATOR_PURPOSE_OBJECT, // Allocator for objects ALLOCATOR_PURPOSE_INTERNAL, // Space for runtime internal needs @@ -187,17 +185,13 @@ public: LOG(FATAL, ALLOC) << "Allocator::IterateOverTenuredObjects" << std::endl; } - /** - * \brief iterates all objects in object allocator - */ + /// @brief iterates all objects in object allocator virtual void IterateRegularSizeObjects([[maybe_unused]] const ObjectVisitor &object_visitor) { LOG(FATAL, ALLOC) << "Allocator::IterateRegularSizeObjects"; } - /** - * \brief iterates objects in all allocators except object allocator - */ + /// @brief iterates objects in all allocators except object allocator virtual void IterateNonRegularSizeObjects([[maybe_unused]] const ObjectVisitor &object_visitor) { LOG(FATAL, ALLOC) << "Allocator::IterateNonRegularSizeObjects"; @@ -300,9 +294,7 @@ class ObjectAllocatorBase : public Allocator { protected: using PygoteAllocator = PygoteSpaceAllocator; // Allocator for pygote space - /** - * \brief Add new memory pools to object_allocator and allocate memory in them - */ + /// @brief Add new memory pools to object_allocator and allocate memory in them template inline void *AddPoolsAndAlloc(size_t size, Alignment align, AllocT *object_allocator, size_t pool_size, SpaceType space_type, HeapSpace *heap_space); @@ -321,7 +313,7 @@ protected: SpaceType space_type, HeapSpace *heap_space); /** - * \brief Initialize an object memory allocated by an allocator. + * @brief Initialize an object memory allocated by an allocator. * NOTE: object header should be zero * @param mem - pointer to allocated object * @param size - size of the object in bytes @@ -329,7 +321,7 @@ protected: void ObjectMemoryInit(void *mem, size_t size) const; /** - * \brief Initialize memory which will be used for objects. + * @brief Initialize memory which will be used for objects. * @param mem - pointer to allocated memory * @param size - size of the memory in bytes */ @@ -380,27 +372,25 @@ public: /** * Checks if object in the young space * @param object address - * @return true if \param object is in young space + * @return true if @param object is in young space */ virtual bool IsObjectInYoungSpace(const ObjectHeader *obj) = 0; /** - * Checks if \param mem_range intersect young space + * Checks if @param mem_range intersect young space * @param mem_range - * @return true if \param mem_range is intersect young space + * @return true if @param mem_range is intersect young space */ virtual bool IsIntersectedWithYoung(const MemRange &mem_range) = 0; /** * Checks if object in the non-movable space * @param obj - * @return true if \param obj is in non-movable space + * @return true if @param obj is in non-movable space */ virtual bool IsObjectInNonMovableSpace(const ObjectHeader *obj) = 0; - /** - * @return true if allocator has an young space - */ + /// @return true if allocator has an young space virtual bool HasYoungSpace() = 0; /** @@ -432,20 +422,16 @@ public: virtual bool IsTLABSupported() = 0; - /** - * \brief Check if the object allocator contains the object starting at address obj - */ + /// @brief Check if the object allocator contains the object starting at address obj virtual bool ContainObject([[maybe_unused]] const ObjectHeader *obj) const = 0; /** - * \brief Check if the object obj is live: obj is allocated already and + * @brief Check if the object obj is live: obj is allocated already and * not collected yet. */ virtual bool IsLive([[maybe_unused]] const ObjectHeader *obj) = 0; - /** - * \brief Check if current allocators' allocation state is valid. - */ + /// @brief Check if current allocators' allocation state is valid. virtual size_t VerifyAllocatorStatus() = 0; virtual HeapSpace *GetHeapSpace() = 0; @@ -667,14 +653,10 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates all objects in object allocator - */ + /// @brief iterates all objects in object allocator void IterateRegularSizeObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates objects in all allocators except object allocator - */ + /// @brief iterates objects in all allocators except object allocator void IterateNonRegularSizeObjects(const ObjectVisitor &object_visitor) final; void FreeObjectsMovedToPygoteSpace() final; @@ -795,14 +777,10 @@ public: NO_COPY_SEMANTIC(ObjectAllocatorGenBase); NO_MOVE_SEMANTIC(ObjectAllocatorGenBase); - /** - * Updates young space mem ranges, bitmaps etc - */ + /// Updates young space mem ranges, bitmaps etc virtual void UpdateSpaceData() = 0; - /** - * Invalidates space mem ranges, bitmaps etc - */ + /// Invalidates space mem ranges, bitmaps etc virtual void InvalidateSpaceData() final; protected: @@ -872,14 +850,10 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates all objects in object allocator - */ + /// @brief iterates all objects in object allocator void IterateRegularSizeObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates objects in all allocators except object allocator - */ + /// @brief iterates objects in all allocators except object allocator void IterateNonRegularSizeObjects(const ObjectVisitor &object_visitor) final; void FreeObjectsMovedToPygoteSpace() final; diff --git a/runtime/include/method-inl.h b/runtime/include/method-inl.h index a238b61685cb9ee643719dae60175a0a41602a51..70aaf6afcbf31b352e743e89fcffcabc198ea5e2 100644 --- a/runtime/include/method-inl.h +++ b/runtime/include/method-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/include/panda_vm.h b/runtime/include/panda_vm.h index bc45d1f2e27e54e0de6ca387045d87b6f445a5e3..677eae55d97ea00e8f7af4ea49f0390789d763fb 100644 --- a/runtime/include/panda_vm.h +++ b/runtime/include/panda_vm.h @@ -244,9 +244,7 @@ protected: virtual LoadableAgentHandle CreateDebuggerAgent(); private: - /** - * Lock used for preventing object heap modifications (for example at GC<->JIT,ManagedCode interaction during STW) - */ + /// Lock used for preventing object heap modifications (for example at GC<->JIT,ManagedCode interaction during STW) MutatorLock *mutator_lock_; uint32_t frame_ext_size_ {EMPTY_EXT_FRAME_DATA_SIZE}; LoadableAgentHandle debugger_agent_; diff --git a/runtime/include/relayout_profiler.h b/runtime/include/relayout_profiler.h index 8fc8704d59bf600750baf10bc44b568f63200477..81063b267590e7243f66bf91640da685a59eca35 100644 --- a/runtime/include/relayout_profiler.h +++ b/runtime/include/relayout_profiler.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/include/runtime_options.h b/runtime/include/runtime_options.h index 023ebe76593f57f9f4f9dcbcdefde27b146b30e0..4e08fb232739003494606484b50444634b620369 100644 --- a/runtime/include/runtime_options.h +++ b/runtime/include/runtime_options.h @@ -20,9 +20,7 @@ #include "runtime/plugins.h" namespace panda { -/** - * \brief Verification mode - */ +/// @brief Verification mode enum class VerificationMode { DISABLED, // No verification ON_THE_FLY, // Verify methods before they are executed (used by panda/ark executable) @@ -50,7 +48,7 @@ static inline VerificationMode VerificationModeFromString(const std::string &mod } /** - * \brief Class represents runtime options + * @brief Class represents runtime options * * It extends Options that represents public options (that described in options.yaml) and * adds some private options related to runtime initialization that cannot be controlled diff --git a/runtime/include/stackful_coroutine.h b/runtime/include/stackful_coroutine.h index 6c7f342e971b9c3b6bb30cc66c1da7666d3d99ac..4888ba8ca9eefb2fec87ae8cbc63a972b868a3cc 100644 --- a/runtime/include/stackful_coroutine.h +++ b/runtime/include/stackful_coroutine.h @@ -22,7 +22,7 @@ namespace panda { /** - * \brief Native context of a coroutine. "Fiber"-based implementation. + * @brief Native context of a coroutine. "Fiber"-based implementation. * * This implementation uses panda fibers library to implement native coroutine context. */ @@ -31,46 +31,56 @@ public: NO_COPY_SEMANTIC(StackfulCoroutineContext); NO_MOVE_SEMANTIC(StackfulCoroutineContext); - /// \param stack specifies the lowest address of the stack region to use; - /// it should have at least \param stack_size_bytes bytes accessible. If the stack grows down on the - /// target architecture, then the initial stack pointer of the coroutine will be set to - /// (stack + stack_size_bytes) + /** + * @param stack specifies the lowest address of the stack region to use; + * it should have at least @param stack_size_bytes bytes accessible. If the stack grows down on the + * target architecture, then the initial stack pointer of the coroutine will be set to + * (stack + stack_size_bytes) + */ explicit StackfulCoroutineContext(uint8_t *stack, size_t stack_size_bytes); ~StackfulCoroutineContext() override = default; - /// prepares the context for execution, links it to the managed context part (Coroutine instance) and registers the - /// created coroutine in the CoroutineManager (in the RUNNABLE status) + /** + * Prepares the context for execution, links it to the managed context part (Coroutine instance) and registers the + * created coroutine in the CoroutineManager (in the RUNNABLE status) + */ void AttachToCoroutine(Coroutine *co) override; - /// Manually destroys the context. Should be called by the Coroutine instance as a part of main coroutine - /// destruction. All other coroutines and their contexts are destroyed by the CoroutineManager once the coroutine - /// entrypoint execution finishes + /** + * Manually destroys the context. Should be called by the Coroutine instance as a part of main coroutine + * destruction. All other coroutines and their contexts are destroyed by the CoroutineManager once the coroutine + * entrypoint execution finishes + */ void Destroy() override; void CleanUp() override; bool RetrieveStackInfo(void *&stack_addr, size_t &stack_size, size_t &guard_size) override; - /// suspends the execution context, sets its status to either Status::RUNNABLE or Status::BLOCKED, depending on the - /// suspend reason. + /** + * Suspends the execution context, sets its status to either Status::RUNNABLE or Status::BLOCKED, depending on the + * suspend reason. + */ void RequestSuspend(bool gets_blocked) override; - /// resumes the suspended context, sets status to RUNNING. + /// Resumes the suspended context, sets status to RUNNING. void RequestResume() override; /// Unblock the coroutine and set its status to Status::RUNNABLE void RequestUnblock() override; // should be called then the main thread is done executing the program entrypoint void MainThreadFinished(); - /// moves the main coroutine to Status::AWAIT_LOOP + /// Moves the main coroutine to Status::AWAIT_LOOP void EnterAwaitLoop(); - /// coroutine status is a part of native context, because it might require some synchronization on access + /// Coroutine status is a part of native context, because it might require some synchronization on access Coroutine::Status GetStatus() const override; - /// transfer control to the target context - /// NB: this method will return only after the control is transferred back to the caller context + /** + * Transfer control to the target context + * NB: this method will return only after the control is transferred back to the caller context + */ bool SwitchTo(StackfulCoroutineContext *target); - /// return the lowest address of the coroutine native stack (provided in the ctx contructor) + /// @return the lowest address of the coroutine native stack (provided in the ctx contructor) uint8_t *GetStackLoAddrPtr() { return stack_; @@ -91,9 +101,7 @@ private: void ThreadProcImpl(); static void CoroThreadProc(void *ctx); - /** - * \brief The remote lambda call functionality implementation. - */ + /// @brief The remote lambda call functionality implementation. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) class RemoteCall { public: diff --git a/runtime/include/thread.h b/runtime/include/thread.h index fbb9c99e6749e6b3dd8908ea82ab3eaf47d67d88..ab1f24e165204c8e8763c225914d9a1f012a58d5 100644 --- a/runtime/include/thread.h +++ b/runtime/include/thread.h @@ -245,9 +245,7 @@ private: * MTManagedThread - extends ManagedThread to be able to run code in multi-threaded environment */ -/** - * \brief Class represents arbitrary runtime thread - */ +/// @brief Class represents arbitrary runtime thread // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding) class Thread { public: diff --git a/runtime/include/threaded_coroutine.h b/runtime/include/threaded_coroutine.h index 1ac7937cd8b5e894361e57e3b6d8c128900045d7..e94bf1a469209a546d6e09e5b2ff172b8c764dd1 100644 --- a/runtime/include/threaded_coroutine.h +++ b/runtime/include/threaded_coroutine.h @@ -20,7 +20,7 @@ namespace panda { /** - * \brief Native context of a coroutine. std::thread-based implementation. + * @brief Native context of a coroutine. std::thread-based implementation. * * This implementation utilizes std::thread with condition variables and mutexes * to emulate context switch on suspension. @@ -34,32 +34,42 @@ public: explicit ThreadedCoroutineContext() = default; ~ThreadedCoroutineContext() override = default; - /// prepares the context (including the std::thread object creation) for execution, links it to the managed context - /// part (Coroutine instance) and registers the created coroutine in the CoroutineManager (in the RUNNABLE status) + /** + * Prepares the context (including the std::thread object creation) for execution, links it to the managed context + * part (Coroutine instance) and registers the created coroutine in the CoroutineManager (in the RUNNABLE status) + */ void AttachToCoroutine(Coroutine *co) override; - /// Manually destroys the context. Should be called by the Coroutine instance as a part of main coroutine - /// destruction. All other coroutines and their contexts are destroyed by the CoroutineManager once the coroutine - /// entrypoint execution finishes + /** + * Manually destroys the context. Should be called by the Coroutine instance as a part of main coroutine + * destruction. All other coroutines and their contexts are destroyed by the CoroutineManager once the coroutine + * entrypoint execution finishes + */ void Destroy() override; void CleanUp() override {} bool RetrieveStackInfo(void *&stack_addr, size_t &stack_size, size_t &guard_size) override; - /// Intended to be called from the context of a running thread that is going to be suspended. - /// Changes status to Status::RUNNABLE or Status::BLOCKED, depending on the suspend - /// reason. The next step for the caller thread is to call WaitUntilResumed() and block on it. + /** + * Intended to be called from the context of a running thread that is going to be suspended. + * Changes status to Status::RUNNABLE or Status::BLOCKED, depending on the suspend + * reason. The next step for the caller thread is to call WaitUntilResumed() and block on it. + */ void RequestSuspend(bool gets_blocked) override; - /// Resume the suspended coroutine by setting status to Status::RUNNING. - /// Wakes up the thread that is blocked on WaitUntilResumed() + /** + * Resume the suspended coroutine by setting status to Status::RUNNING. + * Wakes up the thread that is blocked on WaitUntilResumed() + */ void RequestResume() override; /// Unblock the coroutine and set its status to Status::RUNNABLE void RequestUnblock() override; - /// Intended to be called from the context of a running coroutine that is going to - /// launch a new one. Blocks until the created coroutine passes the init sequence. + /** + * Intended to be called from the context of a running coroutine that is going to + * launch a new one. Blocks until the created coroutine passes the init sequence. + */ void WaitUntilInitialized(); - /// blocks until the coroutine becomes running + /// Blocks until the coroutine becomes running void WaitUntilResumed(); /// Moves the main coroutine to Status::TERMINATING void MainThreadFinished(); @@ -76,8 +86,10 @@ protected: private: /// std::thread's body static void ThreadProc(ThreadedCoroutineContext *ctx); - /// Notify the waiters that the coroutine has finished its initialization sequence. - /// Unblocks the thread waiting on the WaitUntilInitialized() + /** + * Notify the waiters that the coroutine has finished its initialization sequence. + * Unblocks the thread waiting on the WaitUntilInitialized() + */ void InitializationDone(); os::memory::ConditionVariable cv_; diff --git a/runtime/include/time_utils.h b/runtime/include/time_utils.h index 5e3879ae1f93ca96fc9133f095c2f87e65672207..cd01edddb915976e5e0aa8cb17857495442888f4 100644 --- a/runtime/include/time_utils.h +++ b/runtime/include/time_utils.h @@ -25,9 +25,7 @@ namespace panda::time { constexpr size_t MILLISECONDS_IN_SECOND = 1000; constexpr size_t PRECISION_FOR_TIME = 3; -/** - * Measures time from creation to deletion of an object - */ +/// Measures time from creation to deletion of an object class Timer { public: explicit Timer(uint64_t *duration, bool need_restart = false); @@ -40,9 +38,7 @@ private: uint64_t start_time_; }; -/** - * Return current time in readable format - */ +/// Return current time in readable format PandaString GetCurrentTimeString(); PandaString GetCurrentTimeString(const char *format); diff --git a/runtime/include/tooling/debug_interface.h b/runtime/include/tooling/debug_interface.h index c8fe5fe84f1185ab8425ed43aca8388e3b71efc1..faf782472fd7474d60648e42965443b3fbb755e8 100644 --- a/runtime/include/tooling/debug_interface.h +++ b/runtime/include/tooling/debug_interface.h @@ -230,7 +230,7 @@ public: PtHooks() = default; /** - * \brief Method is called by the runtime when breakpoint hits. Thread where breakpoint hits is stopped until + * @brief Method is called by the runtime when breakpoint hits. Thread where breakpoint hits is stopped until * continue or step event will be received * @param thread Identifier of the thread where breakpoint hits. Now the callback is called in the same * thread @@ -240,55 +240,51 @@ public: virtual void Breakpoint(PtThread /* thread */, Method * /* method */, const PtLocation & /* location */) {} /** - * \brief Method is called by the runtime when panda file is loaded + * @brief Method is called by the runtime when panda file is loaded * @param pandaFileName Path to panda file that is loaded */ virtual void LoadModule(std::string_view /* pandaFileName */) {} /** - * \brief Method is called by the runtime when managed thread is attached to it + * @brief Method is called by the runtime when managed thread is attached to it * @param thread The attached thread */ virtual void ThreadStart(PtThread /* thread */) {} /** - * \brief Method is called by the runtime when managed thread is detached + * @brief Method is called by the runtime when managed thread is detached * @param thread The detached thread */ virtual void ThreadEnd(PtThread /* thread */) {} - /** - * \brief Method is called by the runtime when virtual machine start initialization - */ + /// @brief Method is called by the runtime when virtual machine start initialization virtual void VmStart() {} /** - * \brief Method is called by the runtime when virtual machine finish initialization + * @brief Method is called by the runtime when virtual machine finish initialization * @param thread The initial thread */ virtual void VmInitialization(PtThread /* thread */) {} - /** - * \brief Method is called by the runtime when virtual machine death - */ + /// @brief Method is called by the runtime when virtual machine death virtual void VmDeath() {} /** - * \brief Method is called by the runtime when a class is first loaded + * @brief Method is called by the runtime when a class is first loaded * @param thread Thread loading the class * @param klass Class being loaded */ virtual void ClassLoad(PtThread /* thread */, BaseClass * /* klass */) {} /** - * \brief Method is called by the runtime when class preparation is complete + * @brief Method is called by the runtime when class preparation is complete * @param thread Thread generating the class prepare * @param klass Class being prepared */ virtual void ClassPrepare(PtThread /* thread */, BaseClass * /* klass */) {} /** - * \brief Method is called by the runtime when a thread is about to wait on an object + * @brief Method is called by the runtime when a thread is about to wait on an object * @param thread The thread about to wait * @param object Reference to the monitor * @param timeout The number of milliseconds the thread will wait @@ -296,7 +292,7 @@ public: virtual void MonitorWait(PtThread /* thread */, ObjectHeader * /* object */, int64_t /* timeout */) {} /** - * \brief Method is called by the runtime when a thread finishes waiting on an object + * @brief Method is called by the runtime when a thread finishes waiting on an object * @param thread The thread about to wait * @param object Reference to the monitor * @param timedOut True if the monitor timed out @@ -304,7 +300,7 @@ public: virtual void MonitorWaited(PtThread /* thread */, ObjectHeader * /* object */, bool /* timedOut */) {} /** - * \brief Method is called by the runtime when a thread is attempting to enter a monitor already acquired by another + * @brief Method is called by the runtime when a thread is attempting to enter a monitor already acquired by another * thread * @param thread The thread about to wait * @param object Reference to the monitor @@ -312,7 +308,7 @@ public: virtual void MonitorContendedEnter(PtThread /* thread */, ObjectHeader * /* object */) {} /** - * \brief Method is called by the runtime when a thread enters a monitor after waiting for it to be released by + * @brief Method is called by the runtime when a thread enters a monitor after waiting for it to be released by * another thread * @param thread The thread about to wait * @param object Reference to the monitor @@ -431,32 +427,32 @@ public: DebugInterface() = default; /** - * \brief Register debug hooks in the runtime + * @brief Register debug hooks in the runtime * @param hooks Pointer to object that implements PtHooks interface * @return Error if any errors occur */ virtual std::optional RegisterHooks(PtHooks *hooks) = 0; /** - * \brief Unregister debug hooks in the runtime + * @brief Unregister debug hooks in the runtime * @return Error if any errors occur */ virtual std::optional UnregisterHooks() = 0; /** - * \brief Enable all debug hooks in the runtime + * @brief Enable all debug hooks in the runtime * @return Error if any errors occur */ virtual std::optional EnableAllGlobalHook() = 0; /** - * \brief Disable all debug hooks in the runtime + * @brief Disable all debug hooks in the runtime * @return Error if any errors occur */ virtual std::optional DisableAllGlobalHook() = 0; /** - * \brief Set notification to hook (enable/disable). + * @brief Set notification to hook (enable/disable). * @param thread If thread is NONE, the notification is enabled or disabled globally * @param enable Enable or disable notifications (true - enable, false - disable) * @param hook_type Type of hook that must be enabled or disabled @@ -465,28 +461,28 @@ public: virtual std::optional SetNotification(PtThread thread, bool enable, PtHookType hook_type) = 0; /** - * \brief Set breakpoint to \param location + * @brief Set breakpoint to @param location * @param location Breakpoint location * @return Error if any errors occur */ virtual std::optional SetBreakpoint(const PtLocation &location) = 0; /** - * \brief Remove breakpoint from \param location + * @brief Remove breakpoint from @param location * @param location Breakpoint location * @return Error if any errors occur */ virtual std::optional RemoveBreakpoint(const PtLocation &location) = 0; /** - * \brief Get Frame + * @brief Get Frame * @param thread Identifier of the thread * @return Frame object that implements PtFrame or Error if any errors occur */ virtual Expected, Error> GetCurrentFrame(PtThread thread) const = 0; /** - * \brief Enumerates managed frames in the thread \param threadId + * @brief Enumerates managed frames in the thread @param threadId * @param thread Identifier of the thread * @param callback Callback that is called for each frame. Should return true to continue and false to stop * enumerating @@ -496,14 +492,14 @@ public: std::function callback) const = 0; /** - * \brief Suspend thread + * @brief Suspend thread * @param thread Identifier of the thread * @return Error if any errors occur */ virtual std::optional SuspendThread(PtThread thread) const = 0; /** - * \brief Resume thread + * @brief Resume thread * @param thread Identifier of the thread * @return Error if any errors occur */ diff --git a/runtime/include/tooling/pt_macros.h b/runtime/include/tooling/pt_macros.h index d48c32d88288fb65e6e9cfd676662a8d86f34bac..ff366f1536db444ef74413822eea78c5e78873d0 100644 --- a/runtime/include/tooling/pt_macros.h +++ b/runtime/include/tooling/pt_macros.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/include/tooling/vreg_value.h b/runtime/include/tooling/vreg_value.h index 3030202832ec467c8af42f3a590c042bc662cc79..74c9ce463929b03bb752a1a65f7070a713951923 100644 --- a/runtime/include/tooling/vreg_value.h +++ b/runtime/include/tooling/vreg_value.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/include/vtable_builder-inl.h b/runtime/include/vtable_builder-inl.h index ea3a1664be0107b6d294393209816c12aebf756f..e5aa9ca13a7ab5bb02990d7e2237bdbb737947e4 100644 --- a/runtime/include/vtable_builder-inl.h +++ b/runtime/include/vtable_builder-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/init_icu.cpp b/runtime/init_icu.cpp index 368342f7e5c62fd884be34963e8c212fcbeeb6f9..7a8b3ae27132ed7ed0a3883d0585d5a1d4b3e8e0 100644 --- a/runtime/init_icu.cpp +++ b/runtime/init_icu.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/runtime/init_icu.h b/runtime/init_icu.h index 8ceb843593236144c6ab8315b51926f449be5c10..57b06f402de8f27a2bc1b22064e9b549d6253ba9 100644 --- a/runtime/init_icu.h +++ b/runtime/init_icu.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. @@ -18,8 +18,6 @@ #include "common/unicode/putil.h" -/** - * convienient method to set icu data file directory to HW_DIRECTORY); - */ +/// convienient method to set icu data file directory to HW_DIRECTORY); void SetIcuDirectory(); #endif // RUNTIME_INIT_ICU_H diff --git a/runtime/interpreter/acc_vregister-inl.h b/runtime/interpreter/acc_vregister-inl.h index 44fff891f0f35a5b22da5abf274a72e5126cbdcf..5bf33372da6af98a7cd35e2e87ee61b2979b6422 100644 --- a/runtime/interpreter/acc_vregister-inl.h +++ b/runtime/interpreter/acc_vregister-inl.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/interpreter/runtime_interface.h b/runtime/interpreter/runtime_interface.h index 52c04bc29cf78de4c1044a9c4fd2338771bf0d78..f6b85e57deaaec24fc7771563bb3dc50b3d29c5e 100644 --- a/runtime/interpreter/runtime_interface.h +++ b/runtime/interpreter/runtime_interface.h @@ -276,7 +276,7 @@ public: } /** - * \brief Executes external implementation of safepoint + * @brief Executes external implementation of safepoint * * It is not-inlined version of safepoint. * Shouldn't be used in production in the JIT. diff --git a/runtime/loadable_agent.cpp b/runtime/loadable_agent.cpp index 8f75313fb02fe8084279875e1cafca0eb51780f3..9d25b58ff6852109927c967b4da84117c581e633 100644 --- a/runtime/loadable_agent.cpp +++ b/runtime/loadable_agent.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/lock_order_graph.cpp b/runtime/lock_order_graph.cpp index 0380ad462bb7920eaca27437387a2f21ce5a1aec..f29bdfbcbb427b99cfb6cb27866a2e1f8e65416a 100644 --- a/runtime/lock_order_graph.cpp +++ b/runtime/lock_order_graph.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022-2022 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. diff --git a/runtime/lock_order_graph.h b/runtime/lock_order_graph.h index a5ec89dfd8fc792892df932f8248f86ed4e4f59d..27984b7fd173e19cc7e6670330355c7bfcb7f904 100644 --- a/runtime/lock_order_graph.h +++ b/runtime/lock_order_graph.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022-2022 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. diff --git a/runtime/mark_word.h b/runtime/mark_word.h index 6d44928061ec21ecfd45cf62bfe6f169867a2336..3c02784fba6d2d795e49ea7c4aea5072b177af73 100644 --- a/runtime/mark_word.h +++ b/runtime/mark_word.h @@ -373,9 +373,7 @@ private: return MarkWord(forwarding_address_in_place | (STATUS_GC << STATUS_SHIFT)); } - /** - * @return pointer shifted by FORWARDING_ADDRESS_SHIFT - */ + /// @return pointer shifted by FORWARDING_ADDRESS_SHIFT MarkWordSize GetForwardingAddressField() const { LOG_IF(GetState() != STATE_GC, DEBUG, RUNTIME) << "Wrong State"; diff --git a/runtime/mem/alloc_config.h b/runtime/mem/alloc_config.h index 0fbb2ab0967a6dcefd81865acfd6d022c78dc5e1..888d28183407f341c1a5f34c010d98c106b4a940 100644 --- a/runtime/mem/alloc_config.h +++ b/runtime/mem/alloc_config.h @@ -32,9 +32,7 @@ namespace panda::mem { * we can cast void* to object and get the specific size of this object, otherwise we should believe to allocator and * can record only approximate size. Because of this we force allocators to use specific config for their needs. */ -/** - * Config for objects allocators with Crossing Map support. - */ +/// Config for objects allocators with Crossing Map support. class ObjectAllocConfigWithCrossingMap { public: static void OnAlloc(size_t size, SpaceType type_mem, MemStatsType *mem_stats) @@ -47,9 +45,7 @@ public: mem_stats->RecordFreeObject(size, type_mem); } - /** - * \brief Initialize an object memory allocated by an allocator. - */ + /// @brief Initialize an object memory allocated by an allocator. static void MemoryInit(void *mem) { // zeroing according to newobj description in ISA @@ -62,16 +58,14 @@ public: arch::FullMemoryBarrier(); } - /** - * \brief Record new allocation of an object and add it to Crossing Map. - */ + /// @brief Record new allocation of an object and add it to Crossing Map. static void AddToCrossingMap(void *obj_addr, size_t obj_size) { CrossingMapSingleton::AddObject(obj_addr, obj_size); } /** - * \brief Record free call of an object and remove it from Crossing Map. + * @brief Record free call of an object and remove it from Crossing Map. * @param obj_addr - pointer to the removing object (object header). * @param obj_size - size of the removing object. * @param next_obj_addr - pointer to the next object (object header). It can be nullptr. @@ -86,7 +80,7 @@ public: } /** - * \brief Find and return the first object, which starts in an interval inclusively + * @brief Find and return the first object, which starts in an interval inclusively * or an object, which crosses the interval border. * It is essential to check the previous object of the returned object to make sure that * we find the first object, which crosses the border of this interval. @@ -102,7 +96,7 @@ public: } /** - * \brief Initialize a Crossing map for the corresponding memory ranges. + * @brief Initialize a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ @@ -112,7 +106,7 @@ public: } /** - * \brief Remove a Crossing map for the corresponding memory ranges. + * @brief Remove a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ @@ -122,7 +116,7 @@ public: } /** - * \brief Record new allocation of the young range. + * @brief Record new allocation of the young range. * @param mem_range - range of a new young memory. */ static void OnInitYoungRegion(const MemRange &mem_range) @@ -131,9 +125,7 @@ public: } }; -/** - * Config for objects allocators. - */ +/// Config for objects allocators. class ObjectAllocConfig { public: static void OnAlloc(size_t size, SpaceType type_mem, MemStatsType *mem_stats) @@ -146,9 +138,7 @@ public: mem_stats->RecordFreeObject(size, type_mem); } - /** - * \brief Initialize an object memory allocated by an allocator. - */ + /// @brief Initialize an object memory allocated by an allocator. static void MemoryInit(void *mem) { // zeroing only ObjectHeader size according to newobj description in ISA @@ -187,7 +177,7 @@ public: static void RemoveCrossingMapForMemory([[maybe_unused]] void *start_addr, [[maybe_unused]] size_t size) {} /** - * \brief Record new allocation of the young range. + * @brief Record new allocation of the young range. * @param mem_range - range of a new young memory. */ static void OnInitYoungRegion(const MemRange &mem_range) @@ -196,9 +186,7 @@ public: } }; -/** - * Config for raw memory allocators. - */ +/// Config for raw memory allocators. class RawMemoryConfig { public: static void OnAlloc(size_t size, SpaceType type_mem, MemStatsType *mem_stats) @@ -213,9 +201,7 @@ public: mem_stats->RecordFreeRaw(size, type_mem); } - /** - * \brief We don't need it for raw memory. - */ + /// @brief We don't need it for raw memory. static void MemoryInit([[maybe_unused]] void *mem) {} // We don't use crossing map for raw memory allocations. @@ -247,9 +233,7 @@ public: static void OnInitYoungRegion([[maybe_unused]] const MemRange &mem_range) {} }; -/** - * Debug config with empty MemStats calls and with Crossing Map support. - */ +/// Debug config with empty MemStats calls and with Crossing Map support. class EmptyAllocConfigWithCrossingMap { public: static void OnAlloc([[maybe_unused]] size_t size, [[maybe_unused]] SpaceType type_mem, @@ -262,21 +246,17 @@ public: { } - /** - * \brief Initialize memory for correct test execution. - */ + /// @brief Initialize memory for correct test execution. static void MemoryInit([[maybe_unused]] void *mem) {} - /** - * \brief Record new allocation of an object and add it to Crossing Map. - */ + /// @brief Record new allocation of an object and add it to Crossing Map. static void AddToCrossingMap(void *obj_addr, size_t obj_size) { CrossingMapSingleton::AddObject(obj_addr, obj_size); } /** - * \brief Record free call of an object and remove it from Crossing Map. + * @brief Record free call of an object and remove it from Crossing Map. * @param obj_addr - pointer to the removing object (object header). * @param obj_size - size of the removing object. * @param next_obj_addr - pointer to the next object (object header). It can be nullptr. @@ -291,7 +271,7 @@ public: } /** - * \brief Find and return the first object, which starts in an interval inclusively + * @brief Find and return the first object, which starts in an interval inclusively * or an object, which crosses the interval border. * It is essential to check the previous object of the returned object to make sure that * we find the first object, which crosses the border of this interval. @@ -307,7 +287,7 @@ public: } /** - * \brief Initialize a Crossing map for the corresponding memory ranges. + * @brief Initialize a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ @@ -317,7 +297,7 @@ public: } /** - * \brief Remove a Crossing map for the corresponding memory ranges. + * @brief Remove a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ diff --git a/runtime/mem/bump-allocator.h b/runtime/mem/bump-allocator.h index 9f4952a82c40e64498d0ab629443b343eb2e9f15..5711020f58c17b8ff926b9aa48f948d1eb41cef1 100644 --- a/runtime/mem/bump-allocator.h +++ b/runtime/mem/bump-allocator.h @@ -85,13 +85,13 @@ public: void VisitAndRemoveFreePools(const MemVisitor &mem_visitor); /** - * \brief Iterates over all objects allocated by this allocator + * @brief Iterates over all objects allocated by this allocator * @param object_visitor */ void IterateOverObjects(const std::function &object_visitor); /** - * \brief Iterates over objects in the range inclusively. + * @brief Iterates over objects in the range inclusively. * @tparam MemVisitor * @param mem_visitor - function pointer or functor * @param left_border - a pointer to the first byte of the range @@ -100,13 +100,11 @@ public: template void IterateOverObjectsInRange(const MemVisitor &mem_visitor, void *left_border, void *right_border); - /** - * Resets to the "all clear" state - */ + /// Resets to the "all clear" state void Reset(); /** - * \brief Add an extra memory pool to the allocator. + * @brief Add an extra memory pool to the allocator. * The memory pool must be located just after the current memory given to this allocator. * @param mem - pointer to the extra memory pool. * @param size - a size of the extra memory pool. diff --git a/runtime/mem/frame_allocator.h b/runtime/mem/frame_allocator.h index 1f0f6bfa0c9955d309c4bebb3ba1262ee0520eab..4d5fd10db0b0af78df1fca68d6327816b331245a 100644 --- a/runtime/mem/frame_allocator.h +++ b/runtime/mem/frame_allocator.h @@ -58,9 +58,7 @@ public: // We must free objects allocated by this allocator strictly in reverse order void Free(void *mem); - /** - * \brief Returns true if address inside current allocator. - */ + /// @brief Returns true if address inside current allocator. bool Contains(void *mem); static constexpr AllocatorType GetAllocatorType() @@ -82,38 +80,36 @@ private: static constexpr size_t FRAME_ALLOC_MAX_FREE_ARENAS_THRESHOLD = 1; /** - * \brief Heuristic for arena size increase. + * @brief Heuristic for arena size increase. * @return new size */ size_t GetNextArenaSize(size_t size); /** - * \brief Try to allocate an arena from the memory. + * @brief Try to allocate an arena from the memory. * @return true on success, or false on fail */ bool TryAllocateNewArena(size_t size = ARENA_SIZE_GREW_LEVEL); /** - * \brief Try to allocate memory for a frame in the current arena or in the next one if it exists. + * @brief Try to allocate memory for a frame in the current arena or in the next one if it exists. * @param size - size of the allocated memory * @return pointer to the allocated memory on success, or nullptr on fail */ void *TryToAllocate(size_t size); - /** - * \brief Free last_allocated_arena_, i.e., free last arena in the list. - */ + /// @brief Free last_allocated_arena_, i.e., free last arena in the list. void FreeLastArena(); /** - * \brief Try to allocate an arena from the memory. + * @brief Try to allocate an arena from the memory. * @param size - size of the required arena * @return pointer on success, or nullptr on fail */ FramesArena *AllocateArenaImpl(size_t size); /** - * \brief Free given arena + * @brief Free given arena * @param arena - arena to free */ void FreeArenaImpl(FramesArena *arena); diff --git a/runtime/mem/free_object.h b/runtime/mem/free_object.h index 03d077535270b1e1afdcf289bcfa7a0f0fce1927..369349492a206569778ee913daf2df6a36305948 100644 --- a/runtime/mem/free_object.h +++ b/runtime/mem/free_object.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/mem/freelist_allocator.h b/runtime/mem/freelist_allocator.h index 9d51c5c77a70847213aba45a8c72d881034ea38d..a5eebc03500b3bc39e6bde2c5d130847d51d19fe 100644 --- a/runtime/mem/freelist_allocator.h +++ b/runtime/mem/freelist_allocator.h @@ -108,7 +108,7 @@ public: bool AddMemoryPool(void *mem, size_t size); /** - * \brief Iterates over all objects allocated by this allocator. + * @brief Iterates over all objects allocated by this allocator. * @tparam MemVisitor * @param object_visitor - function pointer or functor */ @@ -116,7 +116,7 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor); /** - * \brief Iterates over all memory pools used by this allocator + * @brief Iterates over all memory pools used by this allocator * and remove them from the allocator structure. * NOTE: This method can't be used to clear all internal allocator * information and reuse the allocator somewhere else. @@ -127,7 +127,7 @@ public: void VisitAndRemoveAllPools(const MemVisitor &mem_visitor); /** - * \brief Visit memory pools that can be returned to the system in this allocator + * @brief Visit memory pools that can be returned to the system in this allocator * and remove them from the allocator structure. * @tparam MemVisitor * @param mem_visitor - function pointer or functor @@ -136,7 +136,7 @@ public: void VisitAndRemoveFreePools(const MemVisitor &mem_visitor); /** - * \brief Iterates over objects in the range inclusively. + * @brief Iterates over objects in the range inclusively. * @tparam MemVisitor * @param mem_visitor - function pointer or functor * @param left_border - a pointer to the first byte of the range @@ -148,7 +148,7 @@ public: FreeListAllocatorAdapter Adapter(); /** - * \brief returns maximum size which can be allocated by this allocator + * @brief returns maximum size which can be allocated by this allocator * @return */ static constexpr size_t GetMaxSize() @@ -157,7 +157,7 @@ public: } /** - * \brief returns minimum pool size which can be added to this allocator + * @brief returns minimum pool size which can be added to this allocator * @return */ static constexpr size_t GetMinPoolSize() @@ -299,7 +299,7 @@ private: void CoalesceMemoryBlocks(MemoryBlockHeader *first_block, MemoryBlockHeader *second_block); /** - * \brief Divide memory_block into two - the first with first_block_size. + * @brief Divide memory_block into two - the first with first_block_size. * @param memory_block - a pointer to the divided block, first_block_size - size of the first part * @return the second memory block header */ diff --git a/runtime/mem/gc/bitmap.h b/runtime/mem/gc/bitmap.h index de78b10b098f2acfaa0922a75e8359516a16116b..6ff4ee2a02102dd9ad876454b09bff9d4178eaa0 100644 --- a/runtime/mem/gc/bitmap.h +++ b/runtime/mem/gc/bitmap.h @@ -30,9 +30,7 @@ namespace panda::mem { -/** - * Abstract base class. Constructor/destructor are protected. No virtual function to avoid dynamic polymorphism. - */ +/// Abstract base class. Constructor/destructor are protected. No virtual function to avoid dynamic polymorphism. class Bitmap { public: using BitmapWordType = uintptr_t; @@ -61,7 +59,7 @@ public: protected: /** - * \brief Set the bit indexed by bit_offset. + * @brief Set the bit indexed by bit_offset. * @param bit_offset - index of the bit to set. */ void SetBit(size_t bit_offset) @@ -71,7 +69,7 @@ protected: } /** - * \brief Clear the bit indexed by bit_offset. + * @brief Clear the bit indexed by bit_offset. * @param bit_offset - index of the bit to clear. */ void ClearBit(size_t bit_offset) @@ -81,7 +79,7 @@ protected: } /** - * \brief Test the bit indexed by bit_offset. + * @brief Test the bit indexed by bit_offset. * @param bit_offset - index of the bit to test. * @return Returns value of indexed bit. */ @@ -92,28 +90,28 @@ protected: } /** - * \brief Atomically set bit indexed by bit_offset. If the bit is not set, set it atomically. Otherwise, do nothing. + * @brief Atomically set bit indexed by bit_offset. If the bit is not set, set it atomically. Otherwise, do nothing. * @param bit_offset - index of the bit to set. * @return Returns old value of the bit. */ bool AtomicTestAndSetBit(size_t bit_offset); /** - * \brief Atomically clear bit corresponding to addr. If the bit is set, clear it atomically. Otherwise, do nothing. + * @brief Atomically clear bit corresponding to addr. If the bit is set, clear it atomically. Otherwise, do nothing. * @param addr - addr must be aligned to BYTESPERCHUNK. * @return Returns old value of the bit. */ bool AtomicTestAndClearBit(size_t bit_offset); /** - * \brief Atomically test bit corresponding to addr. + * @brief Atomically test bit corresponding to addr. * @param addr - addr must be aligned to BYTESPERCHUNK. * @return Returns the value of the bit. */ bool AtomicTestBit(size_t bit_offset); /** - * \brief Iterates over all bits of bitmap sequentially. + * @brief Iterates over all bits of bitmap sequentially. * @tparam VisitorType * @param visitor - function pointer or functor. */ @@ -124,7 +122,7 @@ protected: } /** - * \brief Iterates over marked bits in range [begin, end) sequentially. + * @brief Iterates over marked bits in range [begin, end) sequentially. * Finish iteration if the visitor returns false. * @tparam atomic - true if want to set bit atomically. * @tparam VisitorType @@ -192,7 +190,7 @@ protected: } /** - * \brief Iterates over marked bits of bitmap sequentially. + * @brief Iterates over marked bits of bitmap sequentially. * Finish iteration if the visitor returns false. * @tparam atomic - true if want to iterate with atomic reading. * @tparam VisitorType @@ -205,7 +203,7 @@ protected: } /** - * \brief Iterates over all bits in range [begin, end) sequentially. + * @brief Iterates over all bits in range [begin, end) sequentially. * @tparam VisitorType * @param begin - beginning index of the range, inclusive. * @param end - end index of the range, exclusive. @@ -221,14 +219,14 @@ protected: } /** - * \brief Clear all bits in range [begin, end). + * @brief Clear all bits in range [begin, end). * @param begin - beginning index of the range, inclusive. * @param end - end index of the range, exclusive. */ void ClearBitsInRange(size_t begin, size_t end); /** - * \brief Set all bits in range [begin, end). [begin, end) must be within a BitmapWord. + * @brief Set all bits in range [begin, end). [begin, end) must be within a BitmapWord. * @param begin - beginning index of the range, inclusive. * @param end - end index of the range, exclusive. */ @@ -240,7 +238,7 @@ protected: } /** - * \brief Clear all bits in range [begin, end). [begin, end) must be within a BitmapWord. + * @brief Clear all bits in range [begin, end). [begin, end) must be within a BitmapWord. * @param begin - beginning index of the range, inclusive. * @param end - end index of the range, exclusive. */ @@ -252,7 +250,7 @@ protected: } /** - * \brief Set all BitmapWords in index range [begin, end). + * @brief Set all BitmapWords in index range [begin, end). * @param begin - beginning BitmapWord index of the range, inclusive. * @param end - end BitmapWord index of the range, exclusive. */ @@ -267,7 +265,7 @@ protected: } /** - * \brief Clear all BitmapWords in index range [begin, end). + * @brief Clear all BitmapWords in index range [begin, end). * @param begin - beginning BitmapWord index of the range, inclusive. * @param end - end BitmapWord index of the range, exclusive. */ @@ -295,7 +293,7 @@ private: size_t bitsize_ = 0; /** - * \brief Compute word index from bit index. + * @brief Compute word index from bit index. * @param bit_offset - bit index. * @return Returns BitmapWord Index of bit_offset. */ @@ -305,7 +303,7 @@ private: } /** - * \brief Compute bit index within a BitmapWord from bit index. + * @brief Compute bit index within a BitmapWord from bit index. * @param bit_offset - bit index. * @return Returns bit index within a BitmapWord. */ @@ -317,7 +315,7 @@ private: } /** - * \brief Compute bit mask from bit index. + * @brief Compute bit mask from bit index. * @param bit_offset - bit index. * @return Returns bit mask of bit_offset. */ @@ -327,7 +325,7 @@ private: } /** - * \brief Compute bit mask of range [begin_within_word, end_within_word). + * @brief Compute bit mask of range [begin_within_word, end_within_word). * @param begin_within_word - beginning index within word, in range [0, BITSPERWORD). * @param end_within_word - end index within word, in range [0, BITSPERWORD]. Make sure end_within_word is * BITSPERWORD(instead of 0) if you want to cover from certain bit to last. [0, 0) is the only valid case when @@ -344,16 +342,14 @@ private: return end_mask - (GetBitMask(begin_within_word) - 1); } - /** - * \brief Check if bit_offset is valid. - */ + /// @brief Check if bit_offset is valid. void CheckBitOffset([[maybe_unused]] size_t bit_offset) const { ASSERT(bit_offset <= Size()); } /** - * \brief According to SET, set or clear range [begin, end) within a BitmapWord. + * @brief According to SET, set or clear range [begin, end) within a BitmapWord. * @param begin - beginning global bit index. * @param end - end global bit index. */ @@ -382,9 +378,7 @@ private: } } - /** - * \brief Check if bit range [begin, end) is valid. - */ + /// @brief Check if bit range [begin, end) is valid. void CheckBitRange([[maybe_unused]] size_t begin, [[maybe_unused]] size_t end) const { ASSERT(begin < Size()); @@ -410,7 +404,7 @@ public: NO_MOVE_SEMANTIC(MemBitmap); /** - * \brief Reinitialize the MemBitmap for new memory range. + * @brief Reinitialize the MemBitmap for new memory range. * The size of range will be the same as the initial * because we reuse the same bitmap storage. * @param mem_addr - start addr of the new range. @@ -442,7 +436,7 @@ public: } /** - * \brief Set bit corresponding to addr. + * @brief Set bit corresponding to addr. * @param addr - addr must be aligned to BYTESPERCHUNK. */ void Set(void *addr) @@ -452,7 +446,7 @@ public: } /** - * \brief Clear bit corresponding to addr. + * @brief Clear bit corresponding to addr. * @param addr - addr must be aligned to BYTESPERCHUNK. */ void Clear(void *addr) @@ -461,9 +455,7 @@ public: ClearBit(AddrToBitOffset(ToPointerType(addr))); } - /** - * \brief Clear bits corresponding to addr range [begin, end). - */ + /// @brief Clear bits corresponding to addr range [begin, end). ALWAYS_INLINE void ClearRange(void *begin, void *end) { CheckHalfClosedHalfOpenAddressRange(begin, end); @@ -471,7 +463,7 @@ public: } /** - * \brief Test bit corresponding to addr. + * @brief Test bit corresponding to addr. * @param addr - addr must be aligned to BYTESPERCHUNK. */ bool Test(const void *addr) const @@ -481,7 +473,7 @@ public: } /** - * \brief Test bit corresponding to addr if addr is valid. + * @brief Test bit corresponding to addr if addr is valid. * @return value of indexed bit if addr is valid. If addr is invalid then false */ bool TestIfAddrValid(const void *addr) const @@ -493,7 +485,7 @@ public: } /** - * \brief Atomically set bit corresponding to addr. If the bit is not set, set it atomically. Otherwise, do nothing. + * @brief Atomically set bit corresponding to addr. If the bit is not set, set it atomically. Otherwise, do nothing. * @param addr - addr must be aligned to BYTESPERCHUNK. * @return Returns old value of the bit. */ @@ -504,7 +496,7 @@ public: } /** - * \brief Atomically clear bit corresponding to addr. If the bit is set, clear it atomically. Otherwise, do nothing. + * @brief Atomically clear bit corresponding to addr. If the bit is set, clear it atomically. Otherwise, do nothing. * @param addr - addr must be aligned to BYTESPERCHUNK. * @return Returns old value of the bit. */ @@ -515,7 +507,7 @@ public: } /** - * \brief Atomically test bit corresponding to addr. + * @brief Atomically test bit corresponding to addr. * @param addr - addr must be aligned to BYTESPERCHUNK. * @return Returns the value of the bit. */ @@ -525,9 +517,7 @@ public: return AtomicTestBit(AddrToBitOffset(ToPointerType(addr))); } - /** - * \brief Find first marked chunk. - */ + /// @brief Find first marked chunk. template void *FindFirstMarkedChunks() { @@ -539,9 +529,7 @@ public: return first_marked; } - /** - * \brief Iterates over marked chunks of memory sequentially. - */ + /// @brief Iterates over marked chunks of memory sequentially. template void IterateOverMarkedChunks(const MemVisitor &visitor) { @@ -551,18 +539,14 @@ public: }); } - /** - * \brief Iterates over all chunks of memory sequentially. - */ + /// @brief Iterates over all chunks of memory sequentially. template void IterateOverChunks(const MemVisitor &visitor) { IterateOverBits([&visitor, this](size_t bit_offset) { visitor(BitOffsetToAddr(bit_offset)); }); } - /** - * \brief Iterates over marked chunks of memory in range [begin, end) sequentially. - */ + /// @brief Iterates over marked chunks of memory in range [begin, end) sequentially. template void IterateOverMarkedChunkInRange(void *begin, void *end, const MemVisitor &visitor) { @@ -575,7 +559,7 @@ public: } /** - * \brief Iterates over marked chunks of memory in range [begin, end) sequentially and stops iteration if visitor + * @brief Iterates over marked chunks of memory in range [begin, end) sequentially and stops iteration if visitor * returns false */ template @@ -587,9 +571,7 @@ public: [&visitor, this](size_t bit_offset) { return visitor(BitOffsetToAddr(bit_offset)); }); } - /** - * \brief Iterates over all chunks of memory in range [begin, end) sequentially. - */ + /// @brief Iterates over all chunks of memory in range [begin, end) sequentially. template void IterateOverChunkInRange(void *begin, void *end, const MemVisitor &visitor) { @@ -610,9 +592,7 @@ public: } private: - /** - * \brief Computes bit offset from addr. - */ + /// @brief Computes bit offset from addr. size_t AddrToBitOffset(PointerType addr) const { return (addr - begin_addr_) / BYTESPERCHUNK; @@ -623,17 +603,13 @@ private: return (AlignUp(addr, BYTESPERCHUNK) - begin_addr_) / BYTESPERCHUNK; } - /** - * \brief Computes address from bit offset. - */ + /// @brief Computes address from bit offset. void *BitOffsetToAddr(size_t bit_offset) const { return ToVoidPtr(begin_addr_ + bit_offset * BYTESPERCHUNK); } - /** - * \brief Check if addr is valid. - */ + /// @brief Check if addr is valid. void CheckAddrValidity([[maybe_unused]] const void *addr) const { ASSERT(IsAddrInRange(addr)); @@ -641,7 +617,7 @@ private: } /** - * \brief Check if addr is valid with returned value. + * @brief Check if addr is valid with returned value. * @return true if addr is valid */ bool IsAddrValid(const void *addr) const @@ -649,9 +625,7 @@ private: return IsAddrInRange(addr) && (ToPointerType(addr) - begin_addr_) % BYTESPERCHUNK == 0; } - /** - * \brief Check if [begin, end) is a valid address range. - */ + /// @brief Check if [begin, end) is a valid address range. void CheckHalfClosedHalfOpenAddressRange([[maybe_unused]] void *begin, [[maybe_unused]] void *end) const { CheckAddrValidity(begin); diff --git a/runtime/mem/gc/g1/collection_set.h b/runtime/mem/gc/g1/collection_set.h index d0895eb28042b57baddc8323b6f17432b35caa96..2b72164a142e4e239d36352d8174aa8b26506ea7 100644 --- a/runtime/mem/gc/g1/collection_set.h +++ b/runtime/mem/gc/g1/collection_set.h @@ -22,9 +22,7 @@ namespace panda::mem { -/** - * Represent a set of regions grouped by type. - */ +/// Represent a set of regions grouped by type. class CollectionSet { public: CollectionSet() diff --git a/runtime/mem/gc/g1/g1-allocator.h b/runtime/mem/gc/g1/g1-allocator.h index 0dab62f1b627e6af8c580986854de9eaeea5cd5f..2a3c7b83653dbc65d5e960cd05129db2fd7e2265 100644 --- a/runtime/mem/gc/g1/g1-allocator.h +++ b/runtime/mem/gc/g1/g1-allocator.h @@ -73,9 +73,7 @@ public: PandaVector GetAllRegions(); - /** - * Returns a vector which contains non-movable and humongous regions - */ + /// Returns a vector which contains non-movable and humongous regions PandaVector GetNonRegularRegions(); void IterateOverTenuredObjects(const ObjectVisitor &object_visitor) final; @@ -84,14 +82,10 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates all objects in object allocator - */ + /// @brief iterates all objects in object allocator void IterateRegularSizeObjects(const ObjectVisitor &object_visitor) final; - /** - * \brief iterates objects in all allocators except object allocator - */ + /// @brief iterates objects in all allocators except object allocator void IterateNonRegularSizeObjects(const ObjectVisitor &object_visitor) final; void FreeObjectsMovedToPygoteSpace() final; diff --git a/runtime/mem/gc/g1/g1-allocator_constants.h b/runtime/mem/gc/g1/g1-allocator_constants.h index bec79916f36842ac96fbac73477ba333205d6c41..d0b07a0d616542e4e6f26a08846cfef1db8e8b0b 100644 --- a/runtime/mem/gc/g1/g1-allocator_constants.h +++ b/runtime/mem/gc/g1/g1-allocator_constants.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/mem/gc/g1/g1-gc.h b/runtime/mem/gc/g1/g1-gc.h index dc346dbbaa7505d406d8b3deab7d28c08f8bf2a8..cd3f27c22503dea4b69a3284225d4aefe3ce1b9e 100644 --- a/runtime/mem/gc/g1/g1-gc.h +++ b/runtime/mem/gc/g1/g1-gc.h @@ -40,9 +40,7 @@ namespace panda::mem { template class UpdateRemsetThread; -/** - * \brief G1 alike GC - */ +/// @brief G1 alike GC template class G1GC : public GenerationalGC { using RefVector = PandaVector; @@ -128,11 +126,12 @@ protected: return static_cast *>(this->GetObjectAllocator()); } - // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes) - GCG1BarrierSet::ThreadLocalCardQueues *updated_refs_queue_ {nullptr}; //! queue with updated refs info - // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes) + // NOLINTBEGIN(misc-non-private-member-variables-in-classes) + /// Queue with updated refs info + GCG1BarrierSet::ThreadLocalCardQueues *updated_refs_queue_ {nullptr}; os::memory::Mutex queue_lock_; - os::memory::Mutex gc_worker_queue_lock_; // NOLINT(misc-non-private-member-variables-in-classes) + os::memory::Mutex gc_worker_queue_lock_; + // NOLINTEND(misc-non-private-member-variables-in-classes) private: void WaitForUpdateRemsetThread(); @@ -181,14 +180,10 @@ private: void RunMixedGC(panda::GCTask &task, const CollectionSet &collection_set); - /** - * Determine whether GC need to run concurrent mark or mixed GC - */ + /// Determine whether GC need to run concurrent mark or mixed GC bool ScheduleMixedGCAndConcurrentMark(panda::GCTask &task); - /** - * Start concurrent mark - */ + /// Start concurrent mark void RunConcurrentMark(panda::GCTask &task); void RunPhasesForRegions([[maybe_unused]] panda::GCTask &task, const CollectionSet &collectible_regions); @@ -197,14 +192,10 @@ private: void VisitCard(CardTable::CardPtr card, const ObjectVisitor &object_visitor, const CardVisitor &card_visitor); - /** - * GC for young generation. Runs with STW. - */ + /// GC for young generation. Runs with STW. void RunGC(GCTask &task, const CollectionSet &collectible_regions); - /** - * GC for tenured generation. - */ + /// GC for tenured generation. void RunTenuredGC(const GCTask &task); /** @@ -225,9 +216,7 @@ private: */ static void CalcLiveBytesNotAtomicallyMarkPreprocess(const ObjectHeader *object, BaseClass *base_klass); - /** - * Caches refs from remset and marks objects in collection set (young-generation + maybe some tenured regions). - */ + /// Caches refs from remset and marks objects in collection set (young-generation + maybe some tenured regions). MemRange MixedMarkAndCacheRefs(const GCTask &task, const CollectionSet &collectible_regions); /** @@ -288,9 +277,7 @@ private: EnqueueRemsetRefUpdater> CreateRefUpdater(GCG1BarrierSet::ThreadLocalCardQueues *updated_ref_queue) const; - /** - * Update all refs to moved objects - */ + /// Update all refs to moved objects template void UpdateRefsToMovedObjects(MovedObjectsContainer *moved_objects_container); @@ -298,9 +285,7 @@ private: bool IsMarked(const ObjectHeader *object) const override; - /** - * Start process of on pause marking - */ + /// Start process of on pause marking void FullMarking(panda::GCTask &task); /** @@ -311,14 +296,10 @@ private: */ void OnPauseMark(GCTask &task, GCMarkingStackType *objects_stack, bool use_gc_workers); - /** - * Start process of concurrent marking - */ + /// Start process of concurrent marking void ConcurrentMarking(panda::GCTask &task); - /** - * Iterate over roots and mark them concurrently - */ + /// Iterate over roots and mark them concurrently NO_THREAD_SAFETY_ANALYSIS void ConcurentMarkImpl(GCMarkingStackType *objects_stack); void PauseTimeGoalDelay(); @@ -330,21 +311,15 @@ private: */ void ConcurrentMark(GCMarkingStackType *objects_stack); - /** - * ReMarks objects after Concurrent marking and actualize information about live bytes - */ + /// ReMarks objects after Concurrent marking and actualize information about live bytes void Remark(panda::GCTask const &task); - /** - * Sweep VM refs for non-regular (humongous + nonmovable) objects - */ + /// Sweep VM refs for non-regular (humongous + nonmovable) objects void SweepNonRegularVmRefs(); void SweepRegularVmRefs(); - /** - * Return collectible regions - */ + /// Return collectible regions CollectionSet GetCollectibleRegions(panda::GCTask const &task, bool is_mixed); void AddOldRegionsMaxAllowed(CollectionSet &collection_set); void AddOldRegionsAccordingPauseTimeGoal(CollectionSet &collection_set); @@ -353,14 +328,10 @@ private: void UpdateCollectionSet(const CollectionSet &collectible_regions); - /** - * Estimate space in tenured to objects from collectible regions - */ + /// Estimate space in tenured to objects from collectible regions bool HaveEnoughSpaceToMove(const CollectionSet &collectible_regions); - /** - * Check if we have enough free regions in tenured space - */ + /// Check if we have enough free regions in tenured space bool HaveEnoughRegionsToMove(size_t num); /** @@ -418,9 +389,12 @@ private: G1GCPauseMarker marker_; G1GCConcurrentMarker conc_marker_; G1GCMixedMarker mixed_marker_; - std::atomic concurrent_marking_flag_ {false}; //! flag indicates if we currently in concurrent marking phase - std::atomic interrupt_concurrent_flag_ {false}; //! flag indicates if we need to interrupt concurrent marking - std::function post_queue_func_ {nullptr}; //! function called in the post WRB + /// Flag indicates if we currently in concurrent marking phase + std::atomic concurrent_marking_flag_ {false}; + /// Flag indicates if we need to interrupt concurrent marking + std::atomic interrupt_concurrent_flag_ {false}; + /// Function called in the post WRB + std::function post_queue_func_ {nullptr}; /** * After first process it stores humongous objects only, after marking them it's still store them for updating * pointers from Humongous @@ -433,7 +407,8 @@ private: GCMarkingStackType concurrent_marking_stack_; GCMarkingStackType::MarkedObjects mixed_marked_objects_; std::atomic is_mixed_gc_required_ {false}; - size_t number_of_mixed_tenured_regions_ {2}; //! number of tenured regions added at the young GC + /// Number of tenured regions added at the young GC + size_t number_of_mixed_tenured_regions_ {2}; double region_garbage_rate_threshold_ {0.0}; double g1_promotion_region_alive_rate_ {0.0}; bool g1_track_freed_objects_ {false}; diff --git a/runtime/mem/gc/g1/g1_pause_tracker.h b/runtime/mem/gc/g1/g1_pause_tracker.h index 46915681fac253ab6bc3a1caf51d64753b6dff90..7e7d6389f0df8466fafd0d152766c1d396ea26d7 100644 --- a/runtime/mem/gc/g1/g1_pause_tracker.h +++ b/runtime/mem/gc/g1/g1_pause_tracker.h @@ -23,9 +23,7 @@ namespace panda::mem { -/** - * Track G1 GC pause goal: pauses sum does not exceed max_gc_time in gc_pause_interval - */ +/// Track G1 GC pause goal: pauses sum does not exceed max_gc_time in gc_pause_interval class G1PauseTracker { public: NO_COPY_SEMANTIC(G1PauseTracker); @@ -39,14 +37,10 @@ public: bool AddPause(int64_t start_time_us, int64_t end_time_us); - /** - * @return minimum delay for pause from now to achieve pause goal - */ + /// @return minimum delay for pause from now to achieve pause goal int64_t MinDelayBeforePauseInMicros(int64_t now_us, int64_t pause_time_us); - /** - * @return minimum delay for maximum allowed pause from now to achieve pause goal - */ + /// @return minimum delay for maximum allowed pause from now to achieve pause goal int64_t MinDelayBeforeMaxPauseInMicros(int64_t now_us); class Scope { diff --git a/runtime/mem/gc/g1/update_remset_thread.h b/runtime/mem/gc/g1/update_remset_thread.h index ca56fd91f15770c26aed867fdc0aa99d91615f5c..ef7149b40e5907b3cd3a54496ee6a29a4224c3d7 100644 --- a/runtime/mem/gc/g1/update_remset_thread.h +++ b/runtime/mem/gc/g1/update_remset_thread.h @@ -100,9 +100,7 @@ public: void StartThread(); - /** - * Blocking call until all tasks are not processed - */ + /// Blocking call until all tasks are not processed void WaitUntilTasksEnd(); void ThreadLoop(); @@ -144,13 +142,9 @@ public: // Interrupts card processing and returns all unprocessed cards void DrainAllCards(PandaUnorderedSet *cards); - /** - * Suspend UpdateRemsetThread to reduce CPU usage - */ + /// Suspend UpdateRemsetThread to reduce CPU usage void SuspendThread(); - /** - * Resume UpdateRemsetThread execution loop - */ + /// Resume UpdateRemsetThread execution loop void ResumeThread(); /** * Process all cards in the GC thread. diff --git a/runtime/mem/gc/gc-hung/gc_hung.cpp b/runtime/mem/gc/gc-hung/gc_hung.cpp index 4778b6a6d84a47c01e11c182539003ad9002703b..731f1d8f217ef9c21209c474f2bb78d2b4d90170 100644 --- a/runtime/mem/gc/gc-hung/gc_hung.cpp +++ b/runtime/mem/gc/gc-hung/gc_hung.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/mem/gc/gc-hung/gc_hung.h b/runtime/mem/gc/gc-hung/gc_hung.h index 34de8b0d392a57c7a283628e746bbdce4786b473..830be6e3aecf2b588c607276746fb354860af49a 100644 --- a/runtime/mem/gc/gc-hung/gc_hung.h +++ b/runtime/mem/gc/gc-hung/gc_hung.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/mem/gc/gc.h b/runtime/mem/gc/gc.h index d44f1bdde74ff28cb6db640a2f5cfd3386e6bd38..3c9ca00e95bec4002ad3ce0c616ff99ff832e0f8 100644 --- a/runtime/mem/gc/gc.h +++ b/runtime/mem/gc/gc.h @@ -154,19 +154,17 @@ public: GCType GetType(); - /** - * \brief Initialize GC - */ + /// @brief Initialize GC void Initialize(PandaVM *vm); /** - * \brief Starts GC after initialization + * @brief Starts GC after initialization * Creates worker thread, sets gc_running_ to true */ virtual void StartGC(); /** - * \brief Stops GC for runtime destruction + * @brief Stops GC for runtime destruction * Joins GC thread, clears queue */ virtual void StopGC(); @@ -188,9 +186,7 @@ public: */ bool WaitForGCInManaged(const GCTask &task) NO_THREAD_SAFETY_ANALYSIS; - /** - * Only be used to at first pygote fork - */ + /// Only be used to at first pygote fork void WaitForGCOnPygoteFork(const GCTask &task); bool IsOnPygoteFork() const; @@ -201,9 +197,7 @@ public: */ virtual void InitGCBits(panda::ObjectHeader *obj_header) = 0; - /** - * Initialize GC bits on object creation for the TLAB allocation. - */ + /// Initialize GC bits on object creation for the TLAB allocation. virtual void InitGCBitsForAllocationInTLAB(panda::ObjectHeader *obj_header) = 0; bool IsTLABsSupported() const @@ -211,14 +205,10 @@ public: return tlabs_supported_; } - /** - * @return true if GC supports object pinning (will not move pinned object), false otherwise - */ + /// @return true if GC supports object pinning (will not move pinned object), false otherwise virtual bool IsPinningSupported() const = 0; - /** - * @return true if cause is suitable for the GC, false otherwise - */ + /// @return true if cause is suitable for the GC, false otherwise virtual bool CheckGCCause(GCTaskCause cause) const; /** @@ -231,9 +221,7 @@ public: virtual bool IsFullGC() const; - /** - * Return true if gc has generations, false otherwise - */ + /// Return true if gc has generations, false otherwise bool IsGenerational() const; PandaString DumpStatistics() @@ -325,9 +313,7 @@ public: */ void EnqueueReferences(); - /** - * Process all references which GC found in marking phase. - */ + /// Process all references which GC found in marking phase. void ProcessReferences(GCPhase gc_phase, const GCTask &task, const ReferenceClearPredicateT &pred); size_t GetNativeBytesRegistered() @@ -356,7 +342,7 @@ public: /** * Processes thread's remaining pre and post barrier buffer entries on its termination. * - * \param keep_buffers specifies whether to clear (=BuffersKeepingFlag::KEEP) or deallocate + * @param keep_buffers specifies whether to clear (=BuffersKeepingFlag::KEEP) or deallocate * (=BuffersKeepingFlag::DELETE) pre and post barrier buffers upon OnThreadTerminate() completion */ virtual void OnThreadTerminate([[maybe_unused]] ManagedThread *thread, @@ -383,9 +369,7 @@ public: virtual void PostForkCallback() {} - /** - * Check if the object addr is in the GC sweep range - */ + /// Check if the object addr is in the GC sweep range virtual bool InGCSweepRange([[maybe_unused]] const ObjectHeader *obj) const { return true; @@ -396,23 +380,17 @@ public: return nullptr; } - /** - * Called from GCWorker thread to assign thread specific data - */ + /// Called from GCWorker thread to assign thread specific data virtual bool InitWorker(void **worker_data) { *worker_data = nullptr; return true; } - /** - * Called from GCWorker thread to destroy thread specific data - */ + /// Called from GCWorker thread to destroy thread specific data virtual void DestroyWorker([[maybe_unused]] void *worker_data) {} - /** - * Process a task sent to GC workers thread. - */ + /// Process a task sent to GC workers thread. virtual void WorkerTaskProcessing([[maybe_unused]] GCWorkersTask *task, [[maybe_unused]] void *worker_data) { LOG(FATAL, GC) << "Unimplemented method"; @@ -423,9 +401,7 @@ public: return false; } - /** - * Return true of ref is an instance of reference or it's ancestor, false otherwise - */ + /// Return true of ref is an instance of reference or it's ancestor, false otherwise bool IsReference(const BaseClass *cls, const ObjectHeader *ref, const ReferenceCheckPredicateT &pred); void ProcessReference(GCMarkingStackType *objects_stack, const BaseClass *cls, const ObjectHeader *ref, @@ -505,9 +481,7 @@ public: } protected: - /** - * \brief Runs all phases - */ + /// @brief Runs all phases void RunPhases(GCTask &task); /** @@ -585,15 +559,11 @@ protected: workers_pool_ = nullptr; } - /** - * Mark all references which we added by AddReference method - */ + /// Mark all references which we added by AddReference method virtual void MarkReferences(GCMarkingStackType *references, GCPhase gc_phase) = 0; virtual void UpdateRefsToMovedObjectsInPygoteSpace() = 0; - /** - * Update all refs to moved objects - */ + /// Update all refs to moved objects virtual void CommonUpdateRefsToMovedObjects() = 0; virtual void UpdateVmRefs() = 0; @@ -651,9 +621,7 @@ protected: void EnableWorkerThreads(); void DisableWorkerThreads(); - /** - * @return true if GC can work in concurrent mode - */ + /// @return true if GC can work in concurrent mode bool IsConcurrencyAllowed() const { return gc_settings_.IsConcurrencyEnabled(); @@ -668,24 +636,16 @@ protected: void SetFullGC(bool value); - /** - * Set GC Threads on best and middle cores before GC - */ + /// Set GC Threads on best and middle cores before GC void SetupCpuAffinity(); - /** - * Set GC Threads on best and middle cores after concurrent phase - */ + /// Set GC Threads on best and middle cores after concurrent phase void SetupCpuAffinityAfterConcurrent(); - /** - * Set GC Threads on saved or weak cores before concurrent phase - */ + /// Set GC Threads on saved or weak cores before concurrent phase void SetupCpuAffinityBeforeConcurrent(); - /** - * Restore GC Threads after GC on saved cores - */ + /// Restore GC Threads after GC on saved cores void RestoreCpuAffinity(); virtual void StartConcurrentScopeRoutine() const; @@ -701,9 +661,7 @@ protected: virtual size_t VerifyHeap() = 0; private: - /** - * Reset GC Threads on saved or weak cores - */ + /// Reset GC Threads on saved or weak cores void ResetCpuAffinity(bool before_concurrent); /** @@ -729,9 +687,7 @@ private: void JoinWorker(); void CreateWorker(); - /** - * Move small objects to pygote space at first pygote fork - */ + /// Move small objects to pygote space at first pygote fork void MoveObjectsToPygoteSpace(); size_t GetNativeBytesFromMallinfoAndRegister() const; @@ -782,9 +738,7 @@ private: void TriggerGCForNative(); size_t SimpleNativeAllocationGcWatermark(); - /** - * Waits while current GC task(if any) will be processed - */ + /// Waits while current GC task(if any) will be processed void WaitForIdleGC() NO_THREAD_SAFETY_ANALYSIS; friend class GCScopedPhase; @@ -825,16 +779,14 @@ public: }; /** - * \brief Create GC with \param gc_type + * @brief Create GC with @param gc_type * @param gc_type - type of create GC * @return pointer to created GC on success, nullptr on failure */ template GC *CreateGC(GCType gc_type, ObjectAllocatorBase *object_allocator, const GCSettings &settings); -/** - * Enable concurrent mode. Should be used only from STW code. - */ +/// Enable concurrent mode. Should be used only from STW code. class ConcurrentScope final { public: explicit ConcurrentScope(GC *gc, bool auto_start = true); diff --git a/runtime/mem/gc/gc_adaptive_stack.h b/runtime/mem/gc/gc_adaptive_stack.h index 782d298b52ca6d1a2bbbdc9825439b024e78c5ae..e845d077e244d0a49190e275b4452492604f0af5 100644 --- a/runtime/mem/gc/gc_adaptive_stack.h +++ b/runtime/mem/gc/gc_adaptive_stack.h @@ -59,55 +59,47 @@ public: void PushToStack(RootType root_type, ObjectHeader *object); /** - * \brief Pop an object from source stack. + * @brief Pop an object from source stack. * If the source stack is empty, we will swap it with destination stack * and return an object from it. */ ObjectHeader *PopFromStack(); /** - * \brief Travers objects in stack via visitor and return marked objects. + * @brief Travers objects in stack via visitor and return marked objects. * Visitor can push in stack, but mustn't pop from it. */ MarkedObjects TraverseObjects(const ObjectVisitor &visitor); - /** - * \brief Check that destination or source stack has at least one object. - */ + /// @brief Check that destination or source stack has at least one object. bool Empty(); - /** - * \brief Returns the sum of destination and source stacks sizes. - */ + /// @brief Returns the sum of destination and source stacks sizes. size_t Size(); /** - * \brief Set the src stack pointer to nullptr. + * @brief Set the src stack pointer to nullptr. * Should be used if we decide to free it not on destructor of this instance. */ PandaDeque *MoveStacksPointers(); - /** - * \brief Returns true if stack supports parallel workers, false otherwise - */ + /// @brief Returns true if stack supports parallel workers, false otherwise bool IsWorkersTaskSupported(); - /** - * \brief Remove all elements from stack - */ + /// @brief Remove all elements from stack void Clear(); private: static constexpr size_t DEFAULT_TASKS_FOR_TIME_CHECK = 10; /** - * \brief Add new object into destination stack. + * @brief Add new object into destination stack. * If we set the limit for stack, we will create a new task for * GC workers with it. */ void PushToStack(ObjectHeader *element); /** - * \brief Check tasks creation rate. + * @brief Check tasks creation rate. * If we create tasks too frequently, return true. */ bool IsHighTaskCreationRate(); diff --git a/runtime/mem/gc/gc_barrier_set.h b/runtime/mem/gc/gc_barrier_set.h index d53c2e635063ceb2912545089ec447b4adba90ab..57d5f40a5c8efb6be3a0002210914dd0bba9868b 100644 --- a/runtime/mem/gc/gc_barrier_set.h +++ b/runtime/mem/gc/gc_barrier_set.h @@ -23,9 +23,7 @@ namespace panda::mem { -/** - * Base barrier set - */ +/// Base barrier set class GCBarrierSet { public: GCBarrierSet() = delete; @@ -122,9 +120,7 @@ private: PandaMap post_operands_; }; -/** - * BarrierSet with barriers do nothing - */ +/// BarrierSet with barriers do nothing class GCDummyBarrierSet : public GCBarrierSet { public: explicit GCDummyBarrierSet(mem::InternalAllocatorPtr allocator) @@ -186,10 +182,14 @@ public: private: // Store operands explicitly for interpreter perf // POST BARRIER - void *min_addr_ {nullptr}; //! Minimal address used by VM. Used as a base for card index calculation - uint8_t *card_table_addr_ {nullptr}; //! Address of card table - uint8_t card_bits_ {0}; //! how many bits encoded by card (i.e. size covered by card = 2^card_bits_) - uint8_t dirty_card_value_ {0}; //! value of dirty card + /// Minimal address used by VM. Used as a base for card index calculation + void *min_addr_ {nullptr}; + /// Address of card table + uint8_t *card_table_addr_ {nullptr}; + /// How many bits encoded by card (i.e. size covered by card = 2^card_bits_) + uint8_t card_bits_ {0}; + /// Value of dirty card + uint8_t dirty_card_value_ {0}; FIELD_UNUSED CardTable *card_table_ {nullptr}; }; @@ -270,10 +270,14 @@ private: // PRE BARRIER ObjRefProcessFunc pre_store_func_ {nullptr}; // POST BARRIER - ObjTwoRefProcessFunc post_func_; //! function which is called for the post barrier if all conditions - uint8_t region_size_bits_count_ {0}; //! how much bits needed for the region - CardTable *card_table_ {nullptr}; //! - void *min_addr_ {nullptr}; //! Minimal address used by VM. Used as a base for card index calculation + /// Function which is called for the post barrier if all conditions + ObjTwoRefProcessFunc post_func_; + /// How much bits needed for the region + uint8_t region_size_bits_count_ {0}; + /// Card table pointer + CardTable *card_table_ {nullptr}; + /// Minimal address used by VM. Used as a base for card index calculation + void *min_addr_ {nullptr}; ThreadLocalCardQueues *updated_refs_queue_; os::memory::Mutex *queue_lock_; }; diff --git a/runtime/mem/gc/gc_root.h b/runtime/mem/gc/gc_root.h index d7e8322622bc15c1b74bb4c1cadaa94e50c82b9e..811193b5fd6829d6b736cca7e278ba4e38ed4eac 100644 --- a/runtime/mem/gc/gc_root.h +++ b/runtime/mem/gc/gc_root.h @@ -54,9 +54,7 @@ uint32_t operator&(VisitGCRootFlags left, VisitGCRootFlags right); VisitGCRootFlags operator|(VisitGCRootFlags left, VisitGCRootFlags right); -/** - * \brief I am groot - */ +/// @brief I am groot class GCRoot { public: GCRoot(RootType type, ObjectHeader *obj); @@ -85,15 +83,11 @@ private: template class RootManager final { public: - /** - * Visit all non-heap roots(registers, thread locals, etc) - */ + /// Visit all non-heap roots(registers, thread locals, etc) void VisitNonHeapRoots(const GCRootVisitor &gc_root_visitor, VisitGCRootFlags flags = VisitGCRootFlags::ACCESS_ROOT_ALL) const; - /** - * Visit local roots for frame - */ + /// Visit local roots for frame void VisitLocalRoots(const GCRootVisitor &gc_root_visitor) const; /** @@ -110,17 +104,13 @@ public: MemRangeChecker range_checker, ObjectChecker range_object_checker, ObjectChecker from_object_checker, uint32_t processed_flag) const; - /** - * Visit roots in class linker - */ + /// Visit roots in class linker void VisitClassRoots(const GCRootVisitor &gc_root_visitor, VisitGCRootFlags flags = VisitGCRootFlags::ACCESS_ROOT_ALL) const; void VisitAotStringRoots(const GCRootVisitor &gc_root_visitor, VisitGCRootFlags flags) const; - /** - * Updates references to moved objects in TLS - */ + /// Updates references to moved objects in TLS void UpdateThreadLocals(); void UpdateVmRefs(); @@ -137,9 +127,7 @@ public: } private: - /** - * Visit VM-specific roots - */ + /// Visit VM-specific roots void VisitVmRoots(const GCRootVisitor &gc_root_visitor) const; template @@ -148,7 +136,7 @@ private: void VisitClassLinkerContextRoots(const GCRootVisitor &gc_root_visitor) const; /** - * Visit roots for \param thread + * Visit roots for @param thread * @param thread */ void VisitRootsForThread(ManagedThread *thread, const GCRootVisitor &gc_root_visitor) const; diff --git a/runtime/mem/gc/gc_root_type.cpp b/runtime/mem/gc/gc_root_type.cpp index c09c1237cc69c5b8860ef116ae9ef31e1e16c11c..45bfe3c3c1dac983b492d133012a3c167d1d6583 100644 --- a/runtime/mem/gc/gc_root_type.cpp +++ b/runtime/mem/gc/gc_root_type.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/runtime/mem/gc/gc_root_type.h b/runtime/mem/gc/gc_root_type.h index 34fb0c1c3b9614745ecec05da9c7efb4d153744e..1db3d086b40062fd6cb0ab29a88377bbfbeb063a 100644 --- a/runtime/mem/gc/gc_root_type.h +++ b/runtime/mem/gc/gc_root_type.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/mem/gc/gc_settings.h b/runtime/mem/gc/gc_settings.h index 3b4c1c570e3de2b63a0dc3ce0db306f8c8410882..23cede063dbe5c61104e0383d94db8aa05ff1fbb 100644 --- a/runtime/mem/gc/gc_settings.h +++ b/runtime/mem/gc/gc_settings.h @@ -42,106 +42,70 @@ public: GCSettings() = default; explicit GCSettings(const RuntimeOptions &options, panda_file::SourceLang lang); - /** - * \brief if true then enable tracing - */ + /// @brief if true then enable tracing bool IsGcEnableTracing() const; - /** - * \brief type of native trigger - */ + /// @brief type of native trigger NativeGcTriggerType GetNativeGcTriggerType() const; - /** - * \brief dump heap at the beginning and the end of GC - */ + /// @brief dump heap at the beginning and the end of GC bool IsDumpHeap() const; - /** - * \brief true if concurrency enabled - */ + /// @brief true if concurrency enabled bool IsConcurrencyEnabled() const; - /** - * \brief true if explicit GC should be running in concurrent - */ + /// @brief true if explicit GC should be running in concurrent bool IsExplicitConcurrentGcEnabled() const; - /** - * \brief true if GC should be running in place - */ + /// @brief true if GC should be running in place bool RunGCInPlace() const; - /** - * \brief use FastHeapVerifier if true - */ + /// @brief use FastHeapVerifier if true bool EnableFastHeapVerifier() const; - /** - * \brief true if heap verification before GC enabled - */ + /// @brief true if heap verification before GC enabled bool PreGCHeapVerification() const; - /** - * \brief true if heap verification during GC enabled - */ + /// @brief true if heap verification during GC enabled bool IntoGCHeapVerification() const; - /** - * \brief true if heap verification after GC enabled - */ + /// @brief true if heap verification after GC enabled bool PostGCHeapVerification() const; - /** - * true if heap verification before G1-GC concurrent phase enabled - */ + /// true if heap verification before G1-GC concurrent phase enabled bool BeforeG1ConcurrentHeapVerification() const; - /** - * \brief if true then fail execution if heap verifier found heap corruption - */ + /// @brief if true then fail execution if heap verifier found heap corruption bool FailOnHeapVerification() const; - /** - * \brief if true then run gc every savepoint - */ + /// @brief if true then run gc every savepoint bool RunGCEverySafepoint() const; - /** - * \brief garbage rate threshold of a tenured region to be included into a mixed collection - */ + /// @brief garbage rate threshold of a tenured region to be included into a mixed collection double G1RegionGarbageRateThreshold() const; - /** - * \brief runs full collection one of N times in GC thread - */ + /// @brief runs full collection one of N times in GC thread uint32_t FullGCBombingFrequency() const; - /** - * \brief specify a max number of tenured regions which can be collected at mixed collection in G1GC. - */ + /// @brief specify a max number of tenured regions which can be collected at mixed collection in G1GC. uint32_t GetG1NumberOfTenuredRegionsAtMixedCollection() const; - /** - * \brief minimum percentage of alive bytes in young region to promote it into tenured without moving for G1GC - */ + /// @brief minimum percentage of alive bytes in young region to promote it into tenured without moving for G1GC double G1PromotionRegionAliveRate() const; /** - * \brief minimum percentage of not used bytes in tenured region to collect it on full even if we have no garbage + * @brief minimum percentage of not used bytes in tenured region to collect it on full even if we have no garbage * inside */ double G1FullGCRegionFragmentationRate() const; /** - * \brief Specify if we need to track removing objects + * @brief Specify if we need to track removing objects * (i.e. update objects count in memstats and log removed objects) during the G1GC collection or not. */ bool G1TrackFreedObjects() const; - /** - * \brief if not zero and gc supports workers, create a gc workers and try to use them - */ + /// @brief if not zero and gc supports workers, create a gc workers and try to use them size_t GCWorkersCount() const; void SetGCWorkersCount(size_t value); @@ -151,68 +115,52 @@ public: bool UseWeakCpuForGcConcurrent() const; /** - * \brief Limit the creation rate of tasks during marking in nanoseconds. + * @brief Limit the creation rate of tasks during marking in nanoseconds. * if average task creation is less than this value - it increases the stack size limit to create tasks less * frequently. */ size_t GCMarkingStackNewTasksFrequency() const; /** - * \brief Max stack size for marking in main thread, if it exceeds we will send a new task to workers, + * @brief Max stack size for marking in main thread, if it exceeds we will send a new task to workers, * 0 means unlimited. */ size_t GCRootMarkingStackMaxSize() const; /** - * \brief Max stack size for marking in a gc worker, if it exceeds we will send a new task to workers, + * @brief Max stack size for marking in a gc worker, if it exceeds we will send a new task to workers, * 0 means unlimited. */ size_t GCWorkersMarkingStackMaxSize() const; - /** - * \brief size of young-space - */ + /// @brief size of young-space uint64_t YoungSpaceSize() const; - /** - * \brief true if print INFO log to get more detailed information in GC. - */ + /// @brief true if print INFO log to get more detailed information in GC. bool LogDetailedGCInfoEnabled() const; - /** - * \brief true if print INFO log to get more detailed compaction/promotion information per region in GC. - */ + /// @brief true if print INFO log to get more detailed compaction/promotion information per region in GC. bool LogDetailedGCCompactionInfoEnabled() const; - /** - * \brief true if we want to do marking phase in multithreading mode. - */ + /// @brief true if we want to do marking phase in multithreading mode. bool ParallelMarkingEnabled() const; void SetParallelMarkingEnabled(bool value); - /** - * \brief true if we want to do compacting phase in multithreading mode. - */ + /// @brief true if we want to do compacting phase in multithreading mode. bool ParallelCompactingEnabled() const; void SetParallelCompactingEnabled(bool value); - /** - * \brief true if we want to do ref updating phase in multithreading mode - */ + /// @brief true if we want to do ref updating phase in multithreading mode bool ParallelRefUpdatingEnabled() const; void SetParallelRefUpdatingEnabled(bool value); - /** - * \brief true if G1 should updates remsets concurrently - */ + /// @brief true if G1 should updates remsets concurrently bool G1EnableConcurrentUpdateRemset() const; - /** - * \brief - */ + /// @brief size_t G1MinConcurrentCardsToProcess() const; bool G1EnablePauseTimeGoal() const; @@ -223,53 +171,78 @@ public: private: // clang-tidy complains about excessive padding - double g1_region_garbage_rate_threshold_ = - 0; /// garbage rate threshold of a tenured region to be included into a mixed collection - double g1_full_gc_region_fragmentation_rate_ = 0; /// Minimum percentage of not used bytes in tenured region to - /// collect it on full even if we have no garbage inside - /// Limit the creation rate of tasks during marking in nanoseconds. - /// if average task creation is less than this value - it increases the stack size limit twice to create tasks less - /// frequently. + /// Garbage rate threshold of a tenured region to be included into a mixed collection + double g1_region_garbage_rate_threshold_ = 0; + /** + * Minimum percentage of not used bytes in tenured region to + * collect it on full even if we have no garbage inside + */ + double g1_full_gc_region_fragmentation_rate_ = 0; + /** + * Limit the creation rate of tasks during marking in nanoseconds. + * If average task creation is less than this value - it increases the stack size limit twice to create tasks less + * frequently. + */ size_t gc_marking_stack_new_tasks_frequency_ = 0; /// Max stack size for marking in main thread, if it exceeds we will send a new task to workers, 0 means unlimited. size_t gc_root_marking_stack_max_size_ = 0; /// Max stack size for marking in a gc worker, if it exceeds we will send a new task to workers, 0 means unlimited. size_t gc_workers_marking_stack_max_size_ = 0; - size_t gc_workers_count_ = 0; /// if not zero and gc supports workers, create a gc workers and try to use them - uint64_t young_space_size_ = 0; /// size of young-space + /// If not zero and gc supports workers, create a gc workers and try to use them + size_t gc_workers_count_ = 0; + /// Size of young-space + uint64_t young_space_size_ = 0; size_t g1_min_concurrent_cards_to_process_ = 0; - NativeGcTriggerType native_gc_trigger_type_ = { - NativeGcTriggerType::INVALID_NATIVE_GC_TRIGGER}; /// type of native trigger - uint32_t full_gc_bombing_frequency_ = 0; /// runs full collection one of N times in GC thread - uint32_t g1_number_of_tenured_regions_at_mixed_collection_ = - 0; /// specify a max number of tenured regions which can be collected at mixed collection in G1GC. - uint32_t g1_promotion_region_alive_rate_ = - 0; /// minimum percentage of alive bytes in young region to promote it into tenured without moving for G1GC + /// Type of native trigger + NativeGcTriggerType native_gc_trigger_type_ = {NativeGcTriggerType::INVALID_NATIVE_GC_TRIGGER}; + /// Runs full collection one of N times in GC thread + uint32_t full_gc_bombing_frequency_ = 0; + /// Specify a max number of tenured regions which can be collected at mixed collection in G1GC. + uint32_t g1_number_of_tenured_regions_at_mixed_collection_ = 0; + /// Minimum percentage of alive bytes in young region to promote it into tenured without moving for G1GC + uint32_t g1_promotion_region_alive_rate_ = 0; uint32_t g1_max_gc_pause_ms_ = 0; uint32_t g1_gc_pause_interval_ms_ = 0; - bool is_gc_enable_tracing_ = false; /// if true then enable tracing - bool is_dump_heap_ = false; /// dump heap at the beginning and the end of GC - bool is_concurrency_enabled_ = true; /// true if concurrency enabled - bool is_explicit_concurrent_gc_enabled_ = true; /// true if explicit GC should be running in concurrent - bool run_gc_in_place_ = false; /// true if GC should be running in place - bool enable_fast_heap_verifier_ = true; /// use FastHeapVerifier if true - bool pre_gc_heap_verification_ = false; /// true if heap verification before GC enabled - bool into_gc_heap_verification_ = false; /// true if heap verification during GC enabled - bool post_gc_heap_verification_ = false; /// true if heap verification after GC enabled - bool before_g1_concurrent_heap_verification_ = - false; /// true if heap verification before G1-GC concurrent phase enabled - bool fail_on_heap_verification_ = false; /// if true then fail execution if heap verifier found heap corruption - bool run_gc_every_safepoint_ = false; /// if true then run gc every savepoint + /// If true then enable tracing + bool is_gc_enable_tracing_ = false; + /// Dump heap at the beginning and the end of GC + bool is_dump_heap_ = false; + /// True if concurrency enabled + bool is_concurrency_enabled_ = true; + /// True if explicit GC should be running in concurrent + bool is_explicit_concurrent_gc_enabled_ = true; + /// True if GC should be running in place + bool run_gc_in_place_ = false; + /// Use FastHeapVerifier if true + bool enable_fast_heap_verifier_ = true; + /// True if heap verification before GC enabled + bool pre_gc_heap_verification_ = false; + /// True if heap verification during GC enabled + bool into_gc_heap_verification_ = false; + /// True if heap verification after GC enabled + bool post_gc_heap_verification_ = false; + /// True if heap verification before G1-GC concurrent phase enabled + bool before_g1_concurrent_heap_verification_ = false; + /// If true then fail execution if heap verifier found heap corruption + bool fail_on_heap_verification_ = false; + /// If true then run gc every savepoint + bool run_gc_every_safepoint_ = false; bool manage_gc_threads_affinity_ = true; bool use_weak_cpu_for_gc_concurrent_ = false; - bool g1_track_freed_objects_ = false; /// if we need to track removing objects during the G1GC collection or not - bool log_detailed_gc_info_enabled_ = false; /// true if print INFO log to get more detailed information in GC. - bool log_detailed_gc_compaction_info_enabled_ = - false; /// true if print INFO log to get more detailed compaction/promotion information per region in GC. - bool parallel_marking_enabled_ = false; /// true if we want to do marking phase in multithreading mode. - bool parallel_compacting_enabled_ = false; /// true if we want to do compacting phase in multithreading mode. - bool parallel_ref_updating_enabled_ = false; /// true if we want to do ref updating phase in multithreading mode - bool g1_enable_concurrent_update_remset_ = false; /// true if G1 should updates remsets concurrently + /// If we need to track removing objects during the G1GC collection or not + bool g1_track_freed_objects_ = false; + /// True if print INFO log to get more detailed information in GC + bool log_detailed_gc_info_enabled_ = false; + /// True if print INFO log to get more detailed compaction/promotion information per region in GC + bool log_detailed_gc_compaction_info_enabled_ = false; + /// True if we want to do marking phase in multithreading mode + bool parallel_marking_enabled_ = false; + /// True if we want to do compacting phase in multithreading mode + bool parallel_compacting_enabled_ = false; + /// True if we want to do ref updating phase in multithreading mode + bool parallel_ref_updating_enabled_ = false; + /// True if G1 should updates remsets concurrently + bool g1_enable_concurrent_update_remset_ = false; bool g1_enable_pause_time_goal_ {false}; }; diff --git a/runtime/mem/gc/gc_trigger.h b/runtime/mem/gc/gc_trigger.h index 9a63fdeabba25075f4a1ddf19193fee6746a3f26..65b90e061d8cc6a9843a802ea8071189367987b7 100644 --- a/runtime/mem/gc/gc_trigger.h +++ b/runtime/mem/gc/gc_trigger.h @@ -118,7 +118,7 @@ public: NO_MOVE_SEMANTIC(GCTrigger); /** - * \brief Checks if GC required + * @brief Checks if GC required * @return returns true if GC should be executed */ virtual void TriggerGcIfNeeded(GC *gc) = 0; @@ -130,9 +130,7 @@ private: friend class GC; }; -/** - * Triggers when heap increased by predefined % - */ +/// Triggers when heap increased by predefined % class GCTriggerHeap : public GCTrigger { public: explicit GCTriggerHeap(MemStatsType *mem_stats, HeapSpace *heap_space); @@ -183,9 +181,7 @@ private: friend class panda::test::GCTriggerTest; }; -/** - * Triggers when heap increased by adaptive strategy - */ +/// Triggers when heap increased by adaptive strategy class GCAdaptiveTriggerHeap : public GCTriggerHeap { public: GCAdaptiveTriggerHeap(MemStatsType *mem_stats, HeapSpace *heap_space, size_t min_heap_size, @@ -213,9 +209,7 @@ private: friend class panda::test::GCTriggerTest; }; -/** - * Trigger always returns true after given start - */ +/// Trigger always returns true after given start class GCTriggerDebug : public GCTrigger { public: explicit GCTriggerDebug(uint64_t debug_start, HeapSpace *heap_space); diff --git a/runtime/mem/gc/gen-gc/gen-gc.h b/runtime/mem/gc/gen-gc/gen-gc.h index a87879c7e077c4cad64c47e074f0add8b0536e70..fceb8632d51a601d009a121346b923aa17884327 100644 --- a/runtime/mem/gc/gen-gc/gen-gc.h +++ b/runtime/mem/gc/gen-gc/gen-gc.h @@ -26,9 +26,7 @@ class ManagedThread; } // namespace panda namespace panda::mem { -/** - * \brief Generational GC - */ +/// @brief Generational GC template class GenGC : public GenerationalGC { public: @@ -128,9 +126,7 @@ private: */ void FullMark(const GCTask &task); - /** - * Collect dead objects in young generation and move survivors - */ + /// Collect dead objects in young generation and move survivors void CollectYoungAndMove(); /** @@ -149,20 +145,14 @@ private: */ void VerifyCollectAndMove(HeapVerifierIntoGC &&young_verifier); - /** - * Update all refs to moved objects - */ + /// Update all refs to moved objects void UpdateRefsToMovedObjects(PandaVector *moved_objects); - /** - * Sweep dead objects in tenured space - */ + /// Sweep dead objects in tenured space template void Sweep(); - /** - * Sweep dead objects in young space - */ + /// Sweep dead objects in young space void SweepYoungVmRefs(); bool IsMarked(const ObjectHeader *object) const override; @@ -180,7 +170,8 @@ private: bool HaveEnoughSpaceToMove() const; DefaultGCMarkerImpl marker_; - bool concurrent_marking_flag_ {false}; //! flag indicates if we currently in concurrent marking phase + /// Flag indicates if we currently in concurrent marking phase + bool concurrent_marking_flag_ {false}; PandaUniquePtr card_table_ {nullptr}; bool is_explicit_concurrent_gc_enabled_ {false}; }; diff --git a/runtime/mem/gc/generational-gc-base.h b/runtime/mem/gc/generational-gc-base.h index c2651de6bc4433fdd6ad0cb9ccd8bb2f86fdadfa..cfaffb3c3b709d96eb4954789a2c57b5a6435f72 100644 --- a/runtime/mem/gc/generational-gc-base.h +++ b/runtime/mem/gc/generational-gc-base.h @@ -23,9 +23,7 @@ namespace panda::mem { namespace test { class MemStatsGenGCTest; } // namespace test -/** - * Base class for generational GC - */ +/// Base class for generational GC template class GenerationalGC : public GCLang { public: @@ -72,9 +70,7 @@ protected: const MemRangeChecker &mem_range_checker, const GC::MarkPreprocess &mark_preprocess = GC::EmptyMarkPreprocess); - /** - * Mark all objects in stack recursively - */ + /// Mark all objects in stack recursively template void MarkStack(Marker *marker, GCMarkingStackType *stack, const ReferenceCheckPredicateT &ref_pred, const GC::MarkPreprocess &mark_preprocess); diff --git a/runtime/mem/gc/heap-space-misc/crossing_map.h b/runtime/mem/gc/heap-space-misc/crossing_map.h index 94d27d0c6c2c77004f430082e5c380069b3161e7..ca09a0c6d7bdddef4b90f26756c9964b61d359ba 100644 --- a/runtime/mem/gc/heap-space-misc/crossing_map.h +++ b/runtime/mem/gc/heap-space-misc/crossing_map.h @@ -60,7 +60,7 @@ static_assert(PANDA_CROSSING_MAP_GRANULARITY == PAGE_SIZE); class CrossingMap { public: /** - * \brief Create a new instance of a Crossing map. + * @brief Create a new instance of a Crossing map. * @param internal_allocator - pointer to the internal allocator. * @param start_addr - first bit of the memory which must be covered by the Crossing Map. * @param size - size of the memory which must be covered by the Crossing Map. @@ -74,14 +74,14 @@ public: void Destroy(); /** - * \brief Add object to the Crossing map. + * @brief Add object to the Crossing map. * @param obj_addr - pointer to the object (object header). * @param obj_size - size of the object. */ void AddObject(const void *obj_addr, size_t obj_size); /** - * \brief Remove object from the Crossing map. + * @brief Remove object from the Crossing map. * Crossing map doesn't know about existed objects (it knows only about first). * Therefore, during removing we need to send next and previous object parameters. * @param obj_addr - pointer to the removing object (object header). @@ -95,7 +95,7 @@ public: const void *prev_obj_addr = nullptr, size_t prev_obj_size = 0); /** - * \brief Find and return the first object, which starts in an interval inclusively + * @brief Find and return the first object, which starts in an interval inclusively * or an object, which crosses the interval border. * It is essential to check the previous object of the returned object to make sure that * we find the first object, which crosses the border of this interval. @@ -108,14 +108,14 @@ public: void *FindFirstObject(const void *start_addr, const void *end_addr); /** - * \brief Initialize a Crossing map for the corresponding memory ranges. + * @brief Initialize a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ void InitializeCrossingMapForMemory(const void *start_addr, size_t size); /** - * \brief Remove a Crossing map for the corresponding memory ranges. + * @brief Remove a Crossing map for the corresponding memory ranges. * @param start_addr - pointer to the first byte of the interval. * @param size - size of the interval. */ diff --git a/runtime/mem/gc/heap-space-misc/crossing_map_singleton.h b/runtime/mem/gc/heap-space-misc/crossing_map_singleton.h index 146ebdcb6cb5030a791742012d428edd9cfe371f..a13f291a8455542326f3eff6059882ae8951f8f0 100644 --- a/runtime/mem/gc/heap-space-misc/crossing_map_singleton.h +++ b/runtime/mem/gc/heap-space-misc/crossing_map_singleton.h @@ -24,9 +24,7 @@ namespace panda::mem { class CrossingMap; -/** - * Singleton for CrossingMap class. - */ +/// Singleton for CrossingMap class. class CrossingMapSingleton { public: CrossingMapSingleton() = delete; diff --git a/runtime/mem/gc/reference-processor/reference_processor.h b/runtime/mem/gc/reference-processor/reference_processor.h index 2f6af1fcc72c0384c214da592f61f567e140d3de..060570bdb186a9faa25215342de29af79f5cc839 100644 --- a/runtime/mem/gc/reference-processor/reference_processor.h +++ b/runtime/mem/gc/reference-processor/reference_processor.h @@ -34,9 +34,7 @@ class Reference; namespace panda::mem { -/** - * General language-independent interface for ReferenceProcessing. - */ +/// General language-independent interface for ReferenceProcessing. class ReferenceProcessor { public: using ReferenceCheckPredicateT = typename GC::ReferenceCheckPredicateT; @@ -69,21 +67,15 @@ public: virtual void ProcessReferences(bool concurrent, bool clear_soft_references, GCPhase gc_phase, const mem::GC::ReferenceClearPredicateT &pred) = 0; - /** - * Collect all processed references. They were cleared on the previous phase - we only collect them. - */ + /// Collect all processed references. They were cleared on the previous phase - we only collect them. virtual panda::mem::Reference *CollectClearedReferences() = 0; virtual void ScheduleForEnqueue(Reference *cleared_references) = 0; - /** - * Enqueue cleared references to corresponding queue, if necessary. - */ + /// Enqueue cleared references to corresponding queue, if necessary. virtual void Enqueue(panda::mem::Reference *cleared_references) = 0; - /** - * Return size of the queue of references. - */ + /// Return size of the queue of references. virtual size_t GetReferenceQueueSize() const = 0; }; diff --git a/runtime/mem/gc/stw-gc/stw-gc.h b/runtime/mem/gc/stw-gc/stw-gc.h index 409d7c758e9594d17275f596be976bdef3465f3d..63be0c3c62a5e1c0dbe8225760549cc020d87a56 100644 --- a/runtime/mem/gc/stw-gc/stw-gc.h +++ b/runtime/mem/gc/stw-gc/stw-gc.h @@ -73,9 +73,7 @@ private: bool reverse_mark_ = false; }; -/** - * \brief Stop the world, non-concurrent GC - */ +/// @brief Stop the world, non-concurrent GC template class StwGC final : public GCLang { public: diff --git a/runtime/mem/heap_manager.cpp b/runtime/mem/heap_manager.cpp index 15a8bbe4dea94e9ee01355bc46068cdfb08630c4..dab70099a01354cb749741dbd8670c46e7451f3f 100644 --- a/runtime/mem/heap_manager.cpp +++ b/runtime/mem/heap_manager.cpp @@ -338,7 +338,7 @@ void HeapManager::ClampNewMaxHeapSize() } /** - * \brief Check whether the given object is an instance of the given class. + * @brief Check whether the given object is an instance of the given class. * @param obj - ObjectHeader pointer * @param h_class - Class pointer * @param assignable - whether the subclass of h_class counts diff --git a/runtime/mem/heap_manager.h b/runtime/mem/heap_manager.h index 37db7df87ca264d9aeff23c1dd5c2df0713e6b05..5ca69ea5a3aee0f69aa9f9caf8b9dc6d35198c61 100644 --- a/runtime/mem/heap_manager.h +++ b/runtime/mem/heap_manager.h @@ -55,7 +55,7 @@ public: ObjectAllocatorBase::ObjMemInitPolicy obj_init_type = ObjectAllocatorBase::ObjMemInitPolicy::REQUIRE_INIT); /** - * \brief Allocates memory for ExtFrame, but do not construct it + * @brief Allocates memory for ExtFrame, but do not construct it * @param size - size of allocation (ExtFrame) in bytes * @param ext_sz - size of frame extension in bytes * @return pointer to Frame @@ -63,7 +63,7 @@ public: [[nodiscard]] Frame *AllocateExtFrame(size_t size, size_t ext_sz); /** - * \brief Frees memory occupied by ExtFrame + * @brief Frees memory occupied by ExtFrame * @param frame - pointer to Frame * @param ext_sz - size of frame extension in bytes */ @@ -131,9 +131,7 @@ public: // Returns how much free memory we have until we need to grow the heap to perform an allocation. size_t GetFreeMemory() const; - /** - * Clamp current accessable heap size as maximum heap size - */ + /// Clamp current accessable heap size as maximum heap size void ClampNewMaxHeapSize(); // added for VMDebug::countInstancesOfClass and countInstancesOfClasses @@ -201,9 +199,7 @@ private: */ ObjectHeader *InitObjectHeaderAtMem(BaseClass *cls, void *mem); - /** - * Triggers GC if needed - */ + /// Triggers GC if needed void TriggerGCIfNeeded(); void *TryGCAndAlloc(size_t size, Alignment align, ManagedThread *thread, @@ -224,9 +220,7 @@ private: bool use_tlab_for_allocations_ = false; - /** - * StackFrameAllocator is per thread - */ + /// StackFrameAllocator is per thread StackFrameAllocator *GetCurrentStackFrameAllocator(); friend class ::panda::Runtime; diff --git a/runtime/mem/heap_space.h b/runtime/mem/heap_space.h index 895898e5cfe0b494835e6555e74c41cb6103988d..9bb8c1bbab6ffe880a20ba8bbe79a44a607983b6 100644 --- a/runtime/mem/heap_space.h +++ b/runtime/mem/heap_space.h @@ -60,7 +60,7 @@ class RemSetTest; // +---------<----------| PoolManager | // +-------------+ /** - * \brief Class for description of object spaces and limits (minimum, maximum, current sizes). + * @brief Class for description of object spaces and limits (minimum, maximum, current sizes). * Pools for object spaces is allocated via this class. Also this class cooperate with PoolManager for info getting * about object heap. * Class is some virtual layer between PoolManager and Object allocators and GC for object pools allocations. @@ -74,7 +74,7 @@ public: virtual ~HeapSpace() = default; /** - * \brief Heap space inilialization + * @brief Heap space inilialization * @param initial_size initial (also minimum) heap space size * @param max_size maximum heap space size * @param min_free_percentage minimum possible percentage of free memory in this heap space, use for heap increasing @@ -84,36 +84,24 @@ public: */ void Initialize(size_t initial_size, size_t max_size, uint32_t min_free_percentage, uint32_t max_free_percentage); - /** - * \brief Compute new size of heap space - */ + /// @brief Compute new size of heap space virtual void ComputeNewSize(); - /** - * \brief Get current used heap size - */ + /// @brief Get current used heap size virtual size_t GetHeapSize() const; - /** - * \brief Try to allocate pool via PoolManager - */ + /// @brief Try to allocate pool via PoolManager [[nodiscard]] virtual Pool TryAllocPool(size_t pool_size, SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr); - /** - * \brief Try to allocate arena via PoolManager - */ + /// @brief Try to allocate arena via PoolManager [[nodiscard]] virtual Arena *TryAllocArena(size_t arena_size, SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr); - /** - * \brief Free pool via PoolManager - */ + /// @brief Free pool via PoolManager void FreePool(void *pool_mem, size_t pool_size, bool release_pages = true); - /** - * \brief Free arena via PoolManager - */ + /// @brief Free arena via PoolManager void FreeArena(Arena *arena); double GetMinFreePercentage() const @@ -131,9 +119,7 @@ public: is_work_gc_ = value; } - /** - * Clamp current maximum heap size as maximum possible heap size - */ + /// Clamp current maximum heap size as maximum possible heap size void ClampCurrentMaxHeapSize(); protected: @@ -173,19 +159,17 @@ protected: current_size_ = max_size_; } - /** - * \brief Compute new size of heap space - */ + /// @brief Compute new size of heap space void ComputeNewSize(size_t free_bytes, double min_free_percentage, double max_free_percentage); /** - * \brief Increase current heap space + * @brief Increase current heap space * @param bytes bytes count for heap space increasing */ void IncreaseBy(uint64_t bytes); /** - * \brief Reduce current heap space + * @brief Reduce current heap space * @param bytes bytes count for heap space reducing */ void ReduceBy(size_t bytes); @@ -216,7 +200,7 @@ protected: ObjectMemorySpace *mem_space); /** - * \brief Check that we can to allocate requested size into target space + * @brief Check that we can to allocate requested size into target space * * @param pool_size size of memory chunk for allocation * @param current_free_bytes_in_space current freebytes count into target space @@ -228,14 +212,10 @@ protected: std::optional WillAlloc(size_t pool_size, size_t current_free_bytes_in_space, const ObjectMemorySpace *mem_space) const; - /** - * @return current maximum size of this heap space - */ + /// @return current maximum size of this heap space size_t GetCurrentSize() const; - /** - * @return free bytes count for current heap space size - */ + /// @return free bytes count for current heap space size size_t GetCurrentFreeBytes(size_t bytes_not_in_this_space = 0) const; inline bool IsWorkGC() const @@ -321,9 +301,7 @@ public: bool was_set_max_young_size, size_t initial_total_size, size_t max_total_size, uint32_t min_free_percentage, uint32_t max_free_percentage); - /** - * \brief Compute new sizes for young and tenured spaces - */ + /// @brief Compute new sizes for young and tenured spaces void ComputeNewSize() override; void UpdateSize(size_t desired_young_size); @@ -348,20 +326,18 @@ public: void UseFullYoungSpace(); - /** - * \brief Allocate alone young pool (use for Gen-GC) with maximum possible size of young space - */ + /// @brief Allocate alone young pool (use for Gen-GC) with maximum possible size of young space [[nodiscard]] Pool AllocAlonePoolForYoung(SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr); /** - * \brief Try allocate pool for young space (use for G1-GC). + * @brief Try allocate pool for young space (use for G1-GC). * If free size in young space less requested pool size then pool can be allocate only during GC work */ [[nodiscard]] Pool TryAllocPoolForYoung(size_t pool_size, SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr); /** - * \brief Try allocate pool for tenured space (use for generational-based GC). + * @brief Try allocate pool for tenured space (use for generational-based GC). * If free size in tenured space less requested pool size then pool can be allocate only during GC work */ [[nodiscard]] Pool TryAllocPoolForTenured(size_t pool_size, SpaceType space_type, AllocatorType allocator_type, @@ -377,9 +353,7 @@ public: [[nodiscard]] Arena *TryAllocArena(size_t arena_size, SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr) final; - /** - * \brief Allocate pool shared usage between young and tenured spaces (use for regions in G1-GC). - */ + /// @brief Allocate pool shared usage between young and tenured spaces (use for regions in G1-GC). [[nodiscard]] Pool AllocSharedPool(size_t pool_size, SpaceType space_type, AllocatorType allocator_type, void *allocator_ptr); diff --git a/runtime/mem/heap_verifier.h b/runtime/mem/heap_verifier.h index 1850ecc461777b3c75ebaf184ab65bcce3e83ca3..d1fef46a42ce86ec94b2ef6a8f378328b8deb3eb 100644 --- a/runtime/mem/heap_verifier.h +++ b/runtime/mem/heap_verifier.h @@ -25,9 +25,7 @@ namespace panda::mem { class HeapManager; class GCRoot; -/** - * HeapReferenceVerifier checks reference checks if the referent is with the heap and it is live. - */ +/// HeapReferenceVerifier checks reference checks if the referent is with the heap and it is live. template class HeapReferenceVerifier { public: @@ -76,9 +74,7 @@ protected: HeapManager *heap_ = nullptr; // NOLINT(misc-non-private-member-variables-in-classes) }; -/** - * A class to query address validity. - */ +/// A class to query address validity. template class HeapVerifier : public HeapVerifierBase { public: @@ -103,9 +99,7 @@ public: size_t VerifyAllPaused() const; }; -/** - * Fast heap verifier for check heap and stack - */ +/// Fast heap verifier for check heap and stack template class FastHeapVerifier : public HeapVerifierBase { public: diff --git a/runtime/mem/humongous_obj_allocator.h b/runtime/mem/humongous_obj_allocator.h index 64fba2c4f496f6c18fa3cafdbb8f69aee8a88047..0cc078c695ff20995eca52fe8380946be141a5da 100644 --- a/runtime/mem/humongous_obj_allocator.h +++ b/runtime/mem/humongous_obj_allocator.h @@ -84,7 +84,7 @@ public: bool AddMemoryPool(void *mem, size_t size); /** - * \brief Iterates over all objects allocated by this allocator. + * @brief Iterates over all objects allocated by this allocator. * @tparam MemVisitor * @param object_visitor - function pointer or functor */ @@ -92,7 +92,7 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor); /** - * \brief Iterates over all memory pools used by this allocator + * @brief Iterates over all memory pools used by this allocator * and remove them from the allocator structure. * NOTE: This method can't be used to clear all internal allocator * information and reuse the allocator somewhere else. @@ -103,7 +103,7 @@ public: void VisitAndRemoveAllPools(const MemVisitor &mem_visitor); /** - * \brief Visit memory pools that can be returned to the system in this allocator + * @brief Visit memory pools that can be returned to the system in this allocator * and remove them from the allocator structure. * @tparam MemVisitor * @param mem_visitor - function pointer or functor @@ -112,7 +112,7 @@ public: void VisitAndRemoveFreePools(const MemVisitor &mem_visitor); /** - * \brief Iterates over objects in the range inclusively. + * @brief Iterates over objects in the range inclusively. * @tparam MemVisitor * @param mem_visitor - function pointer or functor * @param left_border - a pointer to the first byte of the range @@ -124,7 +124,7 @@ public: HumongousObjAllocatorAdapter Adapter(); /** - * \brief returns maximum size which can be allocated by this allocator + * @brief returns maximum size which can be allocated by this allocator * @return */ static constexpr size_t GetMaxSize() @@ -133,7 +133,7 @@ public: } /** - * \brief returns minimum pool size to allocate an object with \param obj_size bytes + * @brief returns minimum pool size to allocate an object with @param obj_size bytes * @return */ static constexpr size_t GetMinPoolSize(size_t obj_size) @@ -237,14 +237,12 @@ private: void Pop(MemoryPoolHeader *pool); /** - * \brief Try to find a pool suitable for object with \param size. + * @brief Try to find a pool suitable for object with @param size. * @return a pointer to pool header on success, nullptr otherwise. */ MemoryPoolHeader *FindSuitablePool(size_t size); - /** - * \brief Iterate over pools in this list and pop all the elements. - */ + /// @brief Iterate over pools in this list and pop all the elements. template void IterateAndPopOverPools(const MemVisitor &mem_visitor); @@ -267,8 +265,8 @@ private: class ReservedMemoryPools : public MemoryPoolList { public: /** - * \brief Try to insert \param pool inside ReservedMemoryPools. - * @return \param pool if not success, nullptr or crowded out pool on success. + * @brief Try to insert @param pool inside ReservedMemoryPools. + * @return @param pool if not success, nullptr or crowded out pool on success. */ MemoryPoolHeader *TryToInsert(MemoryPoolHeader *pool); diff --git a/runtime/mem/internal_allocator.h b/runtime/mem/internal_allocator.h index 31959f09f7a3ed974b660308e9e35d6a40b143a2..7ebb070787936999b78d230beef395240c2ac357 100644 --- a/runtime/mem/internal_allocator.h +++ b/runtime/mem/internal_allocator.h @@ -104,7 +104,7 @@ public: ~InternalAllocator(); /** - * \brief Iterates over memory pools used by this allocator. + * @brief Iterates over memory pools used by this allocator. * @tparam MemVisitor * @param mem_visitor - function pointer or functor */ @@ -112,7 +112,7 @@ public: void VisitAndRemoveAllPools(MemVisitor mem_visitor); /** - * \brief Visit memory pools that can be returned to the system in this allocator + * @brief Visit memory pools that can be returned to the system in this allocator * and remove them from the allocator structure. * @tparam MemVisitor * @param mem_visitor - function pointer or functor @@ -123,21 +123,21 @@ public: using LocalSmallObjectAllocator = RunSlotsAllocator; /** - * \brief Create and set up local internal allocator instance for fast small objects allocation + * @brief Create and set up local internal allocator instance for fast small objects allocation * @param allocator - a pointer to the allocator which will be used for local allocator instance storage * @return - a pointer to the local internal allocator instance */ static InternalAllocator::LocalSmallObjectAllocator *SetUpLocalInternalAllocator(Allocator *allocator); /** - * \brief Delete local internal allocator instance and return all pools to the system + * @brief Delete local internal allocator instance and return all pools to the system * @param allocator - a pointer to the allocator which was used for local allocator instance storage * @param local_allocator - a pointer to the local internal allocator instance */ static void FinalizeLocalInternalAllocator(LocalSmallObjectAllocator *local_allocator, Allocator *allocator); /** - * \brief Return free memory pools to the system in local internal allocator + * @brief Return free memory pools to the system in local internal allocator * and remove them from the allocator structure. * @param local_allocator - a pointer to a local internal allocator instance */ diff --git a/runtime/mem/malloc-proxy-allocator.h b/runtime/mem/malloc-proxy-allocator.h index ce605da728164fb43ad5b504fa38c417ea5497a7..4f3e0124ed1691ed96130b90b4e3b9cf72774c1c 100644 --- a/runtime/mem/malloc-proxy-allocator.h +++ b/runtime/mem/malloc-proxy-allocator.h @@ -30,9 +30,7 @@ namespace panda::mem { using panda::Alignment; class EmptyMemoryConfig; -/** - * \brief Class-proxy to the malloc, do some logging. - */ +/// @brief Class-proxy to the malloc, do some logging. template class MallocProxyAllocator { public: diff --git a/runtime/mem/mem_stats.h b/runtime/mem/mem_stats.h index 518fb63e6815c377eb46177d929bab1c9409a28f..478032013ca8823c6630d47c7098b2cd37064be9 100644 --- a/runtime/mem/mem_stats.h +++ b/runtime/mem/mem_stats.h @@ -59,54 +59,34 @@ public: void RecordFreeObjects(size_t total_object_num, size_t total_object_size, SpaceType type_mem); - /** - * Number of allocated objects for all time - */ + /// Number of allocated objects for all time [[nodiscard]] uint64_t GetTotalObjectsAllocated() const; - /** - * Number of freed objects for all time - */ + /// Number of freed objects for all time [[nodiscard]] uint64_t GetTotalObjectsFreed() const; - /** - * Number of allocated large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects for all time - */ + /// Number of allocated large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects for all time [[nodiscard]] uint64_t GetTotalRegularObjectsAllocated() const; - /** - * Number of freed large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects for all time - */ + /// Number of freed large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects for all time [[nodiscard]] uint64_t GetTotalRegularObjectsFreed() const; - /** - * Number of allocated humongous (size > FREELIST_MAX_ALLOC_SIZE) objects for all time - */ + /// Number of allocated humongous (size > FREELIST_MAX_ALLOC_SIZE) objects for all time [[nodiscard]] uint64_t GetTotalHumongousObjectsAllocated() const; - /** - * Number of freed humongous (size > FREELIST_MAX_ALLOC_SIZE) objects for all time - */ + /// Number of freed humongous (size > FREELIST_MAX_ALLOC_SIZE) objects for all time [[nodiscard]] uint64_t GetTotalHumongousObjectsFreed() const; - /** - * Number of alive objects now - */ + /// Number of alive objects now [[nodiscard]] uint64_t GetObjectsCountAlive() const; - /** - * Number of alive large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects now - */ + /// Number of alive large and regular (size <= FREELIST_MAX_ALLOC_SIZE) objects now [[nodiscard]] uint64_t GetRegularObjectsCountAlive() const; - /** - * Number of alive humongous (size > FREELIST_MAX_ALLOC_SIZE) objects now - */ + /// Number of alive humongous (size > FREELIST_MAX_ALLOC_SIZE) objects now [[nodiscard]] uint64_t GetHumonguousObjectsCountAlive() const; - /** - * Number of moved bytes in last gc - */ + /// Number of moved bytes in last gc [[nodiscard]] uint64_t GetLastYoungObjectsMovedBytes() const; void ClearLastYoungObjectsMovedBytes() diff --git a/runtime/mem/mem_stats_additional_info.h b/runtime/mem/mem_stats_additional_info.h index 72323eb8108b445ca99de2161e13b74afa31397c..244c2fcf854ae86f3e85139608f20c256e75e4c6 100644 --- a/runtime/mem/mem_stats_additional_info.h +++ b/runtime/mem/mem_stats_additional_info.h @@ -22,9 +22,7 @@ namespace panda::mem { -/** - * Implementation of MemStats with additional info about memory. - */ +/// Implementation of MemStats with additional info about memory. class MemStatsAdditionalInfo : public MemStats { enum StatType { BYTES_ALLOCATED = 0, BYTES_FREED, MAX_FOOTPRINT, OBJECTS_ALLOCATED, STAT_TYPE_NUM }; diff --git a/runtime/mem/mem_stats_default.h b/runtime/mem/mem_stats_default.h index e9e4aa23bc7a22b9a1d461429151acbeae7ab1d8..29255757505193a290d885fb9558d1eb7c05cde6 100644 --- a/runtime/mem/mem_stats_default.h +++ b/runtime/mem/mem_stats_default.h @@ -25,9 +25,7 @@ class Class; namespace panda::mem { -/** - * Default implementation of MemStats in release mode. - */ +/// Default implementation of MemStats in release mode. class MemStatsDefault : public MemStats { public: NO_COPY_SEMANTIC(MemStatsDefault); diff --git a/runtime/mem/object_helpers.h b/runtime/mem/object_helpers.h index dbacf17fe32627b023fd77e7257228561bdd10a1..1b7d1ad16fbe77c2059608d739f843defb9f586c 100644 --- a/runtime/mem/object_helpers.h +++ b/runtime/mem/object_helpers.h @@ -107,14 +107,10 @@ size_t GetDynClassInstanceSize(coretypes::DynClass *object); class GCStaticObjectHelpers { public: - /** - * Check the object is an instance of class - */ + /// Check the object is an instance of class static inline bool IsClassObject(ObjectHeader *obj); - /** - * Traverse all kinds of object_header and call obj_visitor for each reference field. - */ + /// Traverse all kinds of object_header and call obj_visitor for each reference field. static void TraverseAllObjects(ObjectHeader *object_header, const std::function &obj_visitor); @@ -149,14 +145,10 @@ private: class GCDynamicObjectHelpers { public: - /** - * Check the object is an instance of class - */ + /// Check the object is an instance of class static inline bool IsClassObject(ObjectHeader *obj); - /** - * Traverse all kinds of object_header and call obj_visitor for each reference field. - */ + /// Traverse all kinds of object_header and call obj_visitor for each reference field. static void TraverseAllObjects(ObjectHeader *object_header, const std::function &obj_visitor); diff --git a/runtime/mem/refstorage/global_object_storage.h b/runtime/mem/refstorage/global_object_storage.h index 78d48f2e874e2425e614c8c44e0d54d1b4edae52..2bf9b81269b634e77f73a6298666335170a0c18b 100644 --- a/runtime/mem/refstorage/global_object_storage.h +++ b/runtime/mem/refstorage/global_object_storage.h @@ -47,19 +47,13 @@ public: ~GlobalObjectStorage(); - /** - * Check whether ref is a valid global reference or not. - */ + /// Check whether ref is a valid global reference or not. bool IsValidGlobalRef(const Reference *ref) const; - /** - * Add object to the storage and return associated pointer with this object - */ + /// Add object to the storage and return associated pointer with this object Reference *Add(const ObjectHeader *object, Reference::ObjectType type) const; - /** - * Get stored object associated with given reference. Reference should be returned on Add method before. - */ + /// Get stored object associated with given reference. Reference should be returned on Add method before. ObjectHeader *Get(const Reference *reference) const { if (reference == nullptr) { @@ -96,21 +90,15 @@ public: return result; } - /** - * Remove object from storage by given reference. Reference should be returned on Add method before. - */ + /// Remove object from storage by given reference. Reference should be returned on Add method before. void Remove(const Reference *reference); - /** - * Get all objects from storage. Used by debugging. - */ + /// Get all objects from storage. Used by debugging. PandaVector GetAllObjects(); void VisitObjects(const GCRootVisitor &gc_root_visitor, mem::RootType root_type); - /** - * Update pointers to moved Objects in global storage. - */ + /// Update pointers to moved Objects in global storage. // TODO(alovkov): take a closure from gc void UpdateMovedRefs(); @@ -154,13 +142,14 @@ private: static constexpr size_t ENSURE_CAPACITY_MULTIPLIER = 2; /** - There are 2 cases: - 1) When index is busy - then we store jobject in storage_ and 0 in the lowest bit (cause of alignment). - Reference* contains it's index shifted by 2 with reference-type in lowest bits which we return to user and - doesn't stores inside storage explicity. - - 2) When index if free - storage[index] stores next free index (shifted by 1) with lowest bit equals to 1 - + * There are 2 cases: + * 1) When index is busy - then we store jobject in storage_ and 0 in the lowest bit (cause of alignment). + * Reference* contains it's index shifted by 2 with reference-type in lowest bits which we return to user and + * doesn't stores inside storage explicity. + * + * 2) When index if free - storage[index] stores next free index (shifted by 1) with lowest bit equals to 1 + */ + /* |-----------------------------------------------------|------------------|------------------| | Case | Highest bits | [1] lowest bit | [0] lowest bit | --------------------------------------------------------------------------------------------| @@ -174,13 +163,9 @@ private: */ PandaVector storage_ GUARDED_BY(mutex_) {}; - /** - * Index of first available block in list - */ + /// Index of first available block in list uintptr_t first_available_block_; - /** - * How many blocks are available in current storage (can be increased if size less than max size) - */ + /// How many blocks are available in current storage (can be increased if size less than max size) size_t blocks_available_; bool enable_size_check_; diff --git a/runtime/mem/refstorage/reference.h b/runtime/mem/refstorage/reference.h index 75ce2bb4cb880fc43b24263188e0b7e727914c81..70687a15a63d62c37ae7e2b59a8bbebb96be4457 100644 --- a/runtime/mem/refstorage/reference.h +++ b/runtime/mem/refstorage/reference.h @@ -33,27 +33,21 @@ class GlobalObjectStorage; class Reference { public: enum class ObjectType : uint8_t { - /** - * Used for objects on stack (arguments for methods) - */ + /// Used for objects on stack (arguments for methods) STACK = 0, /** * Local references which can be used inside Frame. If Frame was removed all references inside this Frame can't * be used anymore */ LOCAL = 1, - /** - * Global references which can be used without Frames - */ + /// Global references which can be used without Frames GLOBAL = 2, /** * Weak references which work as Global references, but will be nullified when GC clears the object when the * object becomes unreachable (no guarantees when it will happen) */ WEAK = 3, - /** - * Global references which can be used without Frames. Addresses of references aren't changed - */ + /// Global references which can be used without Frames. Addresses of references aren't changed GLOBAL_FIXED = LOCAL, ENUM_SIZE }; diff --git a/runtime/mem/refstorage/reference_storage.h b/runtime/mem/refstorage/reference_storage.h index caae685ea4d08c7bfa794414ee212efa2f76ef4d..470689621c1fa082e935a9879f2f71988691a6e7 100644 --- a/runtime/mem/refstorage/reference_storage.h +++ b/runtime/mem/refstorage/reference_storage.h @@ -33,9 +33,7 @@ class ReferenceStorageTest; namespace panda::mem { -/** - * Storage stores all References for proper interaction with GC. - */ +/// Storage stores all References for proper interaction with GC. class ReferenceStorage { public: static_assert(offsetof(RefBlock, refs_) == 0); @@ -88,26 +86,18 @@ public: */ bool EnsureLocalCapacity(size_t capacity); - /** - * Get all objects in global & local storage. Use for debugging only - */ + /// Get all objects in global & local storage. Use for debugging only PandaVector GetAllObjects(); void VisitObjects(const GCRootVisitor &gc_root_visitor, mem::RootType root_type); - /** - * Update pointers to moved Objects in local storage - */ + /// Update pointers to moved Objects in local storage void UpdateMovedRefs(); - /** - * Dump the last several local references info(max MAX_DUMP_LOCAL_NUMS). - */ + /// Dump the last several local references info(max MAX_DUMP_LOCAL_NUMS). void DumpLocalRef(); - /** - * Dump the top MAX_DUMP_LOCAL_NUMS(if exists) classes of local references. - */ + /// Dump the top MAX_DUMP_LOCAL_NUMS(if exists) classes of local references. void DumpLocalRefClasses(); bool IsValidRef(const Reference *ref); void SetRefCheckValidate(bool ref_check_validate); diff --git a/runtime/mem/region_allocator.h b/runtime/mem/region_allocator.h index b3591a68cbbf8a44ea381b369cd7ca6ba2d99d28..9bbd64676eac7576a0bdf99821f732787402de4f 100644 --- a/runtime/mem/region_allocator.h +++ b/runtime/mem/region_allocator.h @@ -35,9 +35,7 @@ public: using RegionsVisitor = std::function &vector)>; -/** - * Return the region which corresponds to the start of the object. - */ +/// Return the region which corresponds to the start of the object. static inline Region *ObjectToRegion(const ObjectHeader *object) { auto *region = reinterpret_cast(((ToUintPtr(object)) & ~DEFAULT_REGION_MASK)); @@ -56,9 +54,7 @@ static inline bool IsSameRegion(ObjectHeader *o1, ObjectHeader *o2, size_t regio return ((ToUintPtr(o1) ^ ToUintPtr(o2)) >> region_size_bits == 0); } -/** - * Return the region which corresponds to the address. - */ +/// Return the region which corresponds to the address. static inline Region *AddrToRegion(const void *addr) { auto region_addr = PoolManager::GetMmapMemPool()->GetStartAddrPoolForAddr(addr); @@ -148,9 +144,7 @@ protected: Pool init_block_; // the initial memory block for region allocation }; -/** - * \brief A region-based bump-pointer allocator. - */ +/// @brief A region-based bump-pointer allocator. template class RegionAllocator final : public RegionAllocatorBase { public: @@ -161,7 +155,7 @@ public: NO_COPY_SEMANTIC(RegionAllocator); /** - * \brief Create new region allocator + * @brief Create new region allocator * @param mem_stats - memory statistics * @param space_type - space type * @param init_space_size - initial continuous space size, 0 means no need for initial space @@ -172,7 +166,7 @@ public: bool extend = true, size_t empty_tenured_regions_max_count = 0); /** - * \brief Create new region allocator with shared region pool specified + * @brief Create new region allocator with shared region pool specified * @param mem_stats - memory statistics * @param space_type - space type * @param shared_region_pool - a shared region pool that can be reused by multi-spaces @@ -198,20 +192,20 @@ public: void UnpinObject(ObjectHeader *object); /** - * \brief Create a TLAB of the specified size + * @brief Create a TLAB of the specified size * @param size - required size of tlab * @return newly allocated TLAB, TLAB is set to Empty is allocation failed. */ TLAB *CreateTLAB(size_t size); /** - * \brief Create a TLAB in a new region. TLAB will occupy the whole region. + * @brief Create a TLAB in a new region. TLAB will occupy the whole region. * @return newly allocated TLAB, TLAB is set to Empty is allocation failed. */ TLAB *CreateRegionSizeTLAB(); /** - * \brief Iterates over all objects allocated by this allocator. + * @brief Iterates over all objects allocated by this allocator. * @param visitor - function pointer or functor */ template @@ -319,14 +313,10 @@ public: OSPagesPolicy OS_PAGES_POLICY, bool NEED_LOCK, typename Container> void ResetSeveralSpecificRegions(const Container ®ions); - /** - * Reserve one region if no reserved region - */ + /// Reserve one region if no reserved region void ReserveRegionIfNeeded(); - /** - * Release reserved region to free space - */ + /// Release reserved region to free space void ReleaseReservedRegion(); void VisitAndRemoveAllPools([[maybe_unused]] const MemVisitor &mem_visitor) @@ -597,9 +587,7 @@ private: mutable ObjectAllocator object_allocator_; }; -/** - * \brief A region-based humongous allocator. - */ +/// @brief A region-based humongous allocator. template class RegionHumongousAllocator final : public RegionAllocatorBase { public: @@ -609,7 +597,7 @@ public: NO_COPY_SEMANTIC(RegionHumongousAllocator); /** - * \brief Create new humongous region allocator + * @brief Create new humongous region allocator * @param mem_stats - memory statistics * @param space_type - space type */ @@ -631,7 +619,7 @@ public: void CollectAndRemoveFreeRegions(const RegionsVisitor ®ion_visitor, const GCObjectVisitor &death_checker); /** - * \brief Iterates over all objects allocated by this allocator. + * @brief Iterates over all objects allocated by this allocator. * @param visitor - function pointer or functor */ template diff --git a/runtime/mem/rem_set.h b/runtime/mem/rem_set.h index 96820ce426960c386c96065c04aa4dcb4a06a7b8..277135ab0eae22f32b2a40062dbb711d44a3a564 100644 --- a/runtime/mem/rem_set.h +++ b/runtime/mem/rem_set.h @@ -32,9 +32,7 @@ public: class Region; -/** - * \brief Set in the Region. To record the regions and cards reference to this region. - */ +/// @brief Set in the Region. To record the regions and cards reference to this region. template class RemSet { public: diff --git a/runtime/mem/rendezvous.h b/runtime/mem/rendezvous.h index 84594b16b7a60f4920aa8c08d44774a0629fd83e..f5f99e10bd40c6eb990a609f808d9445bbf9be36 100644 --- a/runtime/mem/rendezvous.h +++ b/runtime/mem/rendezvous.h @@ -26,7 +26,8 @@ namespace panda { class PandaVM; -/** Meeting point for all managed threads. +/** + * Meeting point for all managed threads. * High level plan: * * Check if there's already a main thread (running_) * * If there is, wait until we get woken up diff --git a/runtime/mem/runslots.h b/runtime/mem/runslots.h index 7e9c5f6bd6fd757012517fe18b8ea6b43c5bce11..adc6b88513a97da2c7f3ae14835e6f3f0e0fe61b 100644 --- a/runtime/mem/runslots.h +++ b/runtime/mem/runslots.h @@ -205,9 +205,7 @@ public: ASAN_POISON_MEMORY_REGION(this, GetHeaderSize()); } - /** - * \brief Check integraty of ROS allocator, return failure count. - */ + /// @brief Check integraty of ROS allocator, return failure count. size_t VerifyRun() { return RunVerifier()(this); diff --git a/runtime/mem/runslots_allocator.h b/runtime/mem/runslots_allocator.h index 933f2766ab21134a12b5fa9cca7fab3c97f23b9d..72ce84f1f486b747d72dfb27a51009d123214002 100644 --- a/runtime/mem/runslots_allocator.h +++ b/runtime/mem/runslots_allocator.h @@ -91,7 +91,7 @@ public: bool AddMemoryPool(void *mem, size_t size); /** - * \brief Iterates over all objects allocated by this allocator. + * @brief Iterates over all objects allocated by this allocator. * @tparam MemVisitor * @param mem_visitor - function pointer or functor */ @@ -99,7 +99,7 @@ public: void IterateOverObjects(const ObjectVisitor &object_visitor); /** - * \brief Iterates over all memory pools used by this allocator + * @brief Iterates over all memory pools used by this allocator * and remove them from the allocator structure. * NOTE: This method can't be used to clear all internal allocator * information and reuse the allocator somewhere else. @@ -110,7 +110,7 @@ public: void VisitAndRemoveAllPools(const MemVisitor &mem_visitor); /** - * \brief Visit memory pools that can be returned to the system in this allocator + * @brief Visit memory pools that can be returned to the system in this allocator * and remove them from the allocator structure. * @tparam MemVisitor * @param mem_visitor - function pointer or functor @@ -119,7 +119,7 @@ public: void VisitAndRemoveFreePools(const MemVisitor &mem_visitor); /** - * \brief Iterates over objects in the range inclusively. + * @brief Iterates over objects in the range inclusively. * @tparam MemVisitor * @param mem_visitor - function pointer or functor * @param left_border - a pointer to the first byte of the range @@ -131,7 +131,7 @@ public: RunSlotsAllocatorAdapter Adapter(); /** - * \brief returns maximum size which can be allocated by this allocator + * @brief returns maximum size which can be allocated by this allocator * @return */ static constexpr size_t GetMaxSize() @@ -140,7 +140,7 @@ public: } /** - * \brief returns minimum pool size which can be added to this allocator + * @brief returns minimum pool size which can be added to this allocator * @return */ static constexpr size_t GetMinPoolSize() diff --git a/runtime/mem/tlab.h b/runtime/mem/tlab.h index 982d0b26f087f3bf27bb8aa863ee5be068dff0fa..8c3c6aeedb6c63f87518fd040ed9e376c531c899 100644 --- a/runtime/mem/tlab.h +++ b/runtime/mem/tlab.h @@ -117,7 +117,7 @@ static constexpr bool PANDA_TRACK_TLAB_ALLOCATIONS = true; class TLAB { public: /** - * \brief Construct TLAB with the buffer at \param address with \param size + * @brief Construct TLAB with the buffer at @param address with @param size * @param address - a pointer into the memory where TLAB memory will be created * @param size - a size of the allocated memory for the TLAB */ @@ -127,15 +127,13 @@ public: void Destroy(); /** - * \brief Fill a TLAB with the buffer at \param address with \param size + * @brief Fill a TLAB with the buffer at @param address with @param size * @param address - a pointer into the memory where TLAB memory will be created * @param size - a size of the allocated memory for the TLAB */ void Fill(void *address, size_t size); - /** - * \brief Set TLAB to be empty - */ + /// @brief Set TLAB to be empty void Reset() { Fill(nullptr, 0U); @@ -150,7 +148,7 @@ public: NO_COPY_SEMANTIC(TLAB); /** - * \brief returns maximum size which can be allocated by TLAB allocator + * @brief returns maximum size which can be allocated by TLAB allocator * @return */ static constexpr size_t GetMaxSize() @@ -159,7 +157,7 @@ public: } /** - * \brief returns default pool size which must be added to a TLAB + * @brief returns default pool size which must be added to a TLAB * @return */ static constexpr size_t GetDefaultPoolSize() @@ -168,20 +166,20 @@ public: } /** - * \brief Allocates memory with size \param size and aligned with DEFAULT_ALIGNMENT alignment + * @brief Allocates memory with size @param size and aligned with DEFAULT_ALIGNMENT alignment * @param size - size of the allocated memory * @return pointer to the allocated memory on success, or nullptr on fail */ void *Alloc(size_t size); /** - * \brief Iterates over all objects in this TLAB + * @brief Iterates over all objects in this TLAB * @param object_visitor */ void IterateOverObjects(const std::function &object_visitor); /** - * \brief Iterates over objects in the range inclusively. + * @brief Iterates over objects in the range inclusively. * @param mem_visitor - function pointer or functor * @param mem_range - memory range */ diff --git a/runtime/monitor.h b/runtime/monitor.h index 29d22c60d1f16762a94dca953a421ad1fdd25b81..2cbb636bc68d5fb885ad5ba5400f2d0cd642b45a 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -29,9 +29,7 @@ class ObjectHeader; template class VMHandle; -/** - * To avoid inheritance in the `Thread` class we don't use `List` (it forces list element to inherit `ListNode`). - */ +/// To avoid inheritance in the `Thread` class we don't use `List` (it forces list element to inherit `ListNode`). template class ThreadList { public: diff --git a/runtime/plugins.cpp b/runtime/plugins.cpp index b89829cde732139a43532df81d5e900bd470050a..ad9dcaa94fed9f386b18c1b2eec50c53613c1282 100644 --- a/runtime/plugins.cpp +++ b/runtime/plugins.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/regexp/ecmascript/mem/dyn_chunk.cpp b/runtime/regexp/ecmascript/mem/dyn_chunk.cpp index cb5ec2ba0ff778282942eec0ad932561e7729100..385092dc0d12ae88d81da4f6133583788ec33501 100644 --- a/runtime/regexp/ecmascript/mem/dyn_chunk.cpp +++ b/runtime/regexp/ecmascript/mem/dyn_chunk.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/regexp/ecmascript/mem/dyn_chunk.h b/runtime/regexp/ecmascript/mem/dyn_chunk.h index bfc35269c89baca87e4472a573611a32f364872a..2fe335b4b56af76cba876d86c46a6a6d76f473f2 100644 --- a/runtime/regexp/ecmascript/mem/dyn_chunk.h +++ b/runtime/regexp/ecmascript/mem/dyn_chunk.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/regexp/ecmascript/regexp_executor.cpp b/runtime/regexp/ecmascript/regexp_executor.cpp index d55366d8989d1a10b24ce42dacaf145299130618..c9cdd41547065705988d66b9ac2b70f9360ce779 100644 --- a/runtime/regexp/ecmascript/regexp_executor.cpp +++ b/runtime/regexp/ecmascript/regexp_executor.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/regexp/ecmascript/regexp_executor.h b/runtime/regexp/ecmascript/regexp_executor.h index 4420c19b39faa2684ee0b175079a27bfa746767f..eaebcfc943a4a7c5c00df660f1c6fb9c98e5ae71 100644 --- a/runtime/regexp/ecmascript/regexp_executor.h +++ b/runtime/regexp/ecmascript/regexp_executor.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/regexp/ecmascript/regexp_opcode.cpp b/runtime/regexp/ecmascript/regexp_opcode.cpp index 8d7538b668b04c874b6b8f52b24f17ee464fd40a..37963d7660a0deb018122d90fe1b6ca87f6fcd31 100644 --- a/runtime/regexp/ecmascript/regexp_opcode.cpp +++ b/runtime/regexp/ecmascript/regexp_opcode.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/regexp/ecmascript/regexp_opcode.h b/runtime/regexp/ecmascript/regexp_opcode.h index 618529fdf00054f544d6a235ae6044fe9fd9bea5..bd3e2d3cf97bfa97c73c787616c7caecc1600178 100644 --- a/runtime/regexp/ecmascript/regexp_opcode.h +++ b/runtime/regexp/ecmascript/regexp_opcode.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/regexp/ecmascript/regexp_parser.cpp b/runtime/regexp/ecmascript/regexp_parser.cpp index 2bbc0854eb72b6be8873aacf70a0631b09bdc9da..34e351bd5c98641ee54f6f4021b53e3840fb7518 100644 --- a/runtime/regexp/ecmascript/regexp_parser.cpp +++ b/runtime/regexp/ecmascript/regexp_parser.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/regexp/ecmascript/regexp_parser.h b/runtime/regexp/ecmascript/regexp_parser.h index 9b8d5e9ff5ab0d0d565e588cfc2325c54e746410..71d98da60b13aeaf9729bcdf55fecedf93124356 100644 --- a/runtime/regexp/ecmascript/regexp_parser.h +++ b/runtime/regexp/ecmascript/regexp_parser.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/relayout_profiler.cpp b/runtime/relayout_profiler.cpp index 751d5366b29cd92c2567408bca302e915bc7fd52..cc0b2700f8f16660a967caa925e67e38dbc03587 100644 --- a/runtime/relayout_profiler.cpp +++ b/runtime/relayout_profiler.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/runtime_controller.cpp b/runtime/runtime_controller.cpp index f5ec8983baf43d50b058e03389e52aeb57c9811a..a7292fab64020bdd80229f05d1bd9b4762cf21cd 100644 --- a/runtime/runtime_controller.cpp +++ b/runtime/runtime_controller.cpp @@ -26,14 +26,10 @@ namespace panda { -/** - * Data directory of applications for default user. - */ +/// Data directory of applications for default user. constexpr std::string_view DIR_DATA_DATA = "/data/data/"; -/** - * Data directory of applications for non-default users. - */ +/// Data directory of applications for non-default users. constexpr std::string_view DIR_DATA_USER = "/data/user/"; static bool StartsWith(std::string_view s, std::string_view prefix) diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index be3098e121cb5460346c18b3df95e8515be82281..c85b067772edbce6c89d4d4bcc12988afcd84f30 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -22,9 +22,7 @@ namespace panda { -/** - * For application related feature. - */ +/// For application related feature. class RuntimeController { public: RuntimeController() = default; diff --git a/runtime/stackful_coroutine_manager.h b/runtime/stackful_coroutine_manager.h index 361cfb2fd8624a59bf7d9f80b5bf9c7cbf69b9b1..b1790a93aa3c2c820bfb73e9852d390ccc697ca4 100644 --- a/runtime/stackful_coroutine_manager.h +++ b/runtime/stackful_coroutine_manager.h @@ -22,7 +22,7 @@ namespace panda { /** - * \brief Stackful ("fiber"-based) coroutine manager implementation. + * @brief Stackful ("fiber"-based) coroutine manager implementation. * * In this implementation coroutines are user-level threads ("fibers") with manually allocated stacks. * @@ -110,7 +110,7 @@ private: bool js_mode_ = false; /** - * \brief holds pointers to the cached coroutine instances in order to speedup coroutine creation and destruction. + * @brief holds pointers to the cached coroutine instances in order to speedup coroutine creation and destruction. * linked coroutinecontext instances are cached too (we just keep the cached coroutines linked to their contexts). * used only in case when --use-coroutine-pool=true */ diff --git a/runtime/taskmanager/task.h b/runtime/taskmanager/task.h index c90f1409ec80b1bd08cc3ad4747624b629d43770..dae7528a10591fde35cd2bffe57017abc1d87118 100644 --- a/runtime/taskmanager/task.h +++ b/runtime/taskmanager/task.h @@ -51,9 +51,7 @@ public: NO_COPY_SEMANTIC(Task); DEFAULT_MOVE_SEMANTIC(Task); - /** - * @brief Tasks are created through this method with the specified arguments. - */ + /// @brief Tasks are created through this method with the specified arguments. static Task Create(TaskType type, TaskProperties properties, std::function runner); const TaskType &GetTaskType() const; @@ -116,9 +114,7 @@ public: */ void SubscribeCondVarToAddTask(os::memory::ConditionVariable *cond_var); - /** - * @brief Remove pointer on cond_var. - */ + /// @brief Remove pointer on cond_var. void UnsubscribeCondVarFromAddTask(); /** diff --git a/runtime/taskmanager/task_manager.cpp b/runtime/taskmanager/task_manager.cpp index 3fd2ddbb752499be56356bae1c985d3a102c7556..029307389079f801af35fc26ad747628d9017c77 100644 --- a/runtime/taskmanager/task_manager.cpp +++ b/runtime/taskmanager/task_manager.cpp @@ -101,9 +101,10 @@ std::optional TaskManager::GetNextTask(bool is_worker_empty) // Wait for any queue will have task // if kinetic_priorities.empty(), it was no queue with tasks while (kinetic_priorities.empty()) { - /** We exit in 2 situations: - * - !is_worker_empty : if worker has tasks and queues are empty, worker will not wait. - * - finish_ : when TM Finalize, Worker wake up and go finish WorkerLoop. + /** + * We exit in 2 situations: + * - !is_worker_empty : if worker has tasks and queues are empty, worker will not wait. + * - finish_ : when TM Finalize, Worker wake up and go finish WorkerLoop. */ if (!is_worker_empty || finalize_free_workers_for_waiting_) { return std::nullopt; diff --git a/runtime/taskmanager/task_manager.h b/runtime/taskmanager/task_manager.h index 23dbbeb583c9eecace847f11e51f799b203aab5d..5ac4ff7ba7322c752aa58e1ab822c703fed507c8 100644 --- a/runtime/taskmanager/task_manager.h +++ b/runtime/taskmanager/task_manager.h @@ -26,16 +26,13 @@ namespace panda { * - GC queue(ECMA) * - GC queue(ArkTS) * - JIT queue - * - **/ + */ class TaskManager { public: NO_COPY_SEMANTIC(TaskManager); NO_MOVE_SEMANTIC(TaskManager); - /** - * @brief Creates an instance of TaskManager. - */ + /// @brief Creates an instance of TaskManager. static TaskManager *Create(size_t threads_count); /** @@ -44,9 +41,7 @@ public: */ static TaskManager *GetTaskManager(); - /** - * @brief Deletes the existed TaskManager. You should not use it if you didn't use Create before. - */ + /// @brief Deletes the existed TaskManager. You should not use it if you didn't use Create before. static void Destroy(); /** @@ -56,9 +51,7 @@ public: */ void RegisterQueue(TaskQueue *queue); - /** - * @brief Creates and starts workers with registered queues. After this method, you can not register new queues. - */ + /// @brief Creates and starts workers with registered queues. After this method, you can not register new queues. void Initialize(); /** @@ -74,9 +67,7 @@ public: */ bool FillWithTasks(WorkerThread *worker, size_t tasks_count); - /** - * @brief This method indicates that workers can no longer wait for new tasks and be completed. - */ + /// @brief This method indicates that workers can no longer wait for new tasks and be completed. void Finalize(); ~TaskManager(); @@ -104,17 +95,13 @@ private: */ std::map GetKineticPriorities(); - /** - * @brief Check if there are no tasks in queues and workers - */ + /// @brief Check if there are no tasks in queues and workers bool IsNoMoreTasks(); static TaskManager *instance_; size_t workers_count_; - /** - * Pointers to Worker Threads. - */ + /// Pointers to Worker Threads. std::vector workers_; /** * Map from TaskType and VMType to queue. @@ -123,13 +110,9 @@ private: * Initialize method */ std::map task_queues_; - /** - * queue_wait_lock_ is used with queue_wait_cond_var_ for waiting. - */ + /// queue_wait_lock_ is used with queue_wait_cond_var_ for waiting. os::memory::Mutex queue_wait_lock_; - /** - * queues_wait_cond_var_ is used when all registered queues are empty to wait until one of them will have a task - */ + /// queues_wait_cond_var_ is used when all registered queues are empty to wait until one of them will have a task os::memory::ConditionVariable queues_wait_cond_var_; /** * task_manager_lock_ is used in case of access to shared resources operated by the task manager: @@ -137,18 +120,14 @@ private: * - in FillWithMethods to synchronize access for multiple workers; */ os::memory::Mutex task_manager_lock_; - /** - * start_ is true if we used Initialize method - */ + /// start_ is true if we used Initialize method std::atomic_bool start_ {false}; /** * free_workers_for_waiting it true only when method Finalize is called. * If it's true workers will not wait new tasks in GetNextTask method */ std::atomic_bool finalize_free_workers_for_waiting_ {false}; - /** - * finish_ is true when TaskManager finish Workers and TaskQueues - */ + /// finish_ is true when TaskManager finish Workers and TaskQueues std::atomic_bool finish_ {false}; /** * This atomic bool is true only in time period when: @@ -157,9 +136,7 @@ private: * If we don't use this atomic, Finalize() method can finish when one task still exist. */ std::atomic_bool is_worker_queue_filling_ {false}; - /** - * finish_tasks_lock_ is used with finish_tasks_cond_var_ for waiting. - */ + /// finish_tasks_lock_ is used with finish_tasks_cond_var_ for waiting. os::memory::Mutex finish_tasks_lock_; /** * This cond var uses to wait for all tasks will be done. diff --git a/runtime/tests/allocator_test_base.h b/runtime/tests/allocator_test_base.h index a9aebdf9abb02caead83feca2e91cb9128c42156..19fb20be114a8d4ed09738e7484015ea84969018 100644 --- a/runtime/tests/allocator_test_base.h +++ b/runtime/tests/allocator_test_base.h @@ -55,9 +55,7 @@ protected: unsigned int seed_; // NOLINT(misc-non-private-member-variables-in-classes) std::array byte_array_ {}; // NOLINT(misc-non-private-member-variables-in-classes) - /** - * Byte array initialization of random bytes - */ + /// Byte array initialization of random bytes void InitByteArray() { for (size_t i = 0; i < BYTE_ARRAY_SIZE; ++i) { @@ -66,26 +64,26 @@ protected: } /** - * \brief Add pool to allocator (maybe empty for some allocators) + * @brief Add pool to allocator (maybe empty for some allocators) * @param allocator - allocator for pool memory adding */ virtual void AddMemoryPoolToAllocator([[maybe_unused]] Allocator &allocator) = 0; /** - * \brief Add pool to allocator and protect (maybe empty for some allocators) + * @brief Add pool to allocator and protect (maybe empty for some allocators) * @param allocator - allocator for pool memory addition and protection */ virtual void AddMemoryPoolToAllocatorProtected([[maybe_unused]] Allocator &allocator) = 0; /** - * \brief Check to allocated by this allocator + * @brief Check to allocated by this allocator * @param allocator - allocator * @param mem - allocated memory */ virtual bool AllocatedByThisAllocator([[maybe_unused]] Allocator &allocator, [[maybe_unused]] void *mem) = 0; /** - * \brief Generate random value from [min_value, max_value] + * @brief Generate random value from [min_value, max_value] * @param min_value - minimum size_t value in range * @param max_value - maximum size_t value in range * @return random size_t value [min_value, max_value] @@ -101,7 +99,7 @@ protected: } /** - * \brief Write value in memory for death test + * @brief Write value in memory for death test * @param mem - memory for writing * * Write value in memory for address sanitizer test @@ -113,7 +111,7 @@ protected: } /** - * \brief Set random bytes in memory from byte array + * @brief Set random bytes in memory from byte array * @param mem - memory for random bytes from byte array writing * @param size - size memory in bytes * @return start index in byte_array @@ -140,7 +138,7 @@ protected: } /** - * \brief Compare bytes in memory with byte array + * @brief Compare bytes in memory with byte array * @param mem - memory for random bytes from byte array writing * @param size - size memory in bytes * @param start_index_in_byte_array - start index in byte array for comaration with memory @@ -169,7 +167,7 @@ protected: } /** - * \brief Allocate with one alignment + * @brief Allocate with one alignment * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam ALIGNMENT - enum Alignment value for allocations @@ -183,7 +181,7 @@ protected: void OneAlignedAllocFreeTest(size_t pools_count, AllocatorArgs &&...allocator_args); /** - * \brief Allocate with all alignment + * @brief Allocate with all alignment * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam LOG_ALIGN_MIN_VALUE - minimum possible alignment for one allocation @@ -198,7 +196,7 @@ protected: void AlignedAllocFreeTest(size_t pools_count = 1); /** - * \brief Simple test for allocate and free + * @brief Simple test for allocate and free * @param alloc_size - size in bytes for each allocation * @param elements_count - count of elements for allocation * @param pools_count - count of pools needed by allocation @@ -208,7 +206,7 @@ protected: void AllocateAndFree(size_t alloc_size, size_t elements_count, size_t pools_count = 1); /** - * \brief Simple test for checking iteration over free pools method. + * @brief Simple test for checking iteration over free pools method. * @tparam pools_count - count of pools needed by allocation, must be bigger than 3 * @param alloc_size - size in bytes for each allocation * @@ -220,7 +218,7 @@ protected: void VisitAndRemoveFreePools(size_t alloc_size); /** - * \brief Allocate with different sizes and free in random order + * @brief Allocate with different sizes and free in random order * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam AllocatorArgs - arguments types for allocor creation @@ -234,14 +232,14 @@ protected: void AllocateFreeDifferentSizesTest(size_t elements_count, size_t pools_count, AllocatorArgs &&...allocator_args); /** - * \brief Try to allocate too big object, must not allocate memory + * @brief Try to allocate too big object, must not allocate memory * @tparam MAX_ALLOC_SIZE - maximum possible size for allocation by this allocator */ template void AllocateTooBigObjectTest(); /** - * \brief Try to allocate too many objects, must not allocate all objects + * @brief Try to allocate too many objects, must not allocate all objects * @param alloc_size - size in bytes for one allocation * @param elements_count - count of elements for allocation * @@ -250,7 +248,7 @@ protected: void AllocateTooMuchTest(size_t alloc_size, size_t elements_count); /** - * \brief Use allocator in std::vector + * @brief Use allocator in std::vector * @param elements_count - count of elements for allocation * * Check working of adapter of this allocator on example std::vector @@ -259,7 +257,7 @@ protected: void AllocateVectorTest(size_t elements_count = 32); /** - * \brief Allocate and reuse + * @brief Allocate and reuse * @tparam element_type - type of elements for allocations * @param alignment_mask - mask for alignment of two addresses * @param elements_count - count of elements for allocation @@ -270,7 +268,7 @@ protected: void AllocateReuseTest(size_t alignment_mask, size_t elements_count = 100); // NOLINT(readability-magic-numbers) /** - * \brief Allocate and free objects, collect via allocator method + * @brief Allocate and free objects, collect via allocator method * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam LOG_ALIGN_MIN_VALUE - minimum possible alignment for one allocation @@ -288,7 +286,7 @@ protected: void ObjectCollectionTest(size_t free_granularity = 4, size_t pools_count = 2); /** - * \brief Allocate and free objects, collect via allocator method + * @brief Allocate and free objects, collect via allocator method * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam LOG_ALIGN_MIN_VALUE - minimum possible alignment for one allocation @@ -306,7 +304,7 @@ protected: void ObjectIteratorTest(size_t free_granularity = 4, size_t pools_count = 2); /** - * \brief Allocate and free objects, iterate via allocator method iterating in range + * @brief Allocate and free objects, iterate via allocator method iterating in range * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam LOG_ALIGN_MIN_VALUE - minimum possible alignment for one allocation @@ -325,7 +323,7 @@ protected: void ObjectIteratorInRangeTest(size_t range_iteration_size, size_t free_granularity = 4, size_t pools_count = 2); /** - * \brief Address sanitizer test for allocator + * @brief Address sanitizer test for allocator * @tparam elements_count - count of elements for allocation * @param free_granularity - granularity for freed elements * @param pools_count - count of pools needed by allocation @@ -337,21 +335,21 @@ protected: void AsanTest(size_t free_granularity = 3, size_t pools_count = 1); // NOLINT(readability-magic-numbers) /** - * \brief Test to allocated by this allocator + * @brief Test to allocated by this allocator * * Test for allocator function which check memory on allocaion by this allocator */ void AllocatedByThisAllocatorTest(); /** - * \brief Test to allocated by this allocator + * @brief Test to allocated by this allocator * * Test for allocator function which check memory on allocaion by this allocator */ void AllocatedByThisAllocatorTest(Allocator &allocator); /** - * \brief Simultaneously allocate/free objects in different threads + * @brief Simultaneously allocate/free objects in different threads * @tparam allocator - target allocator for test * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation @@ -363,7 +361,7 @@ protected: void MtAllocTest(Allocator *allocator, size_t min_elements_count, size_t max_elements_count); /** - * \brief Simultaneously allocate/free objects in different threads + * @brief Simultaneously allocate/free objects in different threads * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam THREADS_COUNT - the number of threads used in this test @@ -375,7 +373,7 @@ protected: void MtAllocFreeTest(size_t min_elements_count, size_t max_elements_count, size_t free_granularity = 4); /** - * \brief Simultaneously allocate objects and iterate over objects (in range too) in different threads + * @brief Simultaneously allocate objects and iterate over objects (in range too) in different threads * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam THREADS_COUNT - the number of threads used in this test @@ -387,7 +385,7 @@ protected: void MtAllocIterateTest(size_t min_elements_count, size_t max_elements_count, size_t range_iteration_size); /** - * \brief Simultaneously allocate and collect objects in different threads + * @brief Simultaneously allocate and collect objects in different threads * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam THREADS_COUNT - the number of threads used in this test @@ -400,7 +398,7 @@ protected: private: /** - * \brief Allocate and free objects in allocator for future collecting/iterating checks + * @brief Allocate and free objects in allocator for future collecting/iterating checks * @tparam MIN_ALLOC_SIZE - minimum possible size for one allocation * @tparam MAX_ALLOC_SIZE - maximum possible size for one allocation * @tparam LOG_ALIGN_MIN_VALUE - minimum possible alignment for one allocation @@ -418,7 +416,7 @@ private: std::vector &allocated_elements, std::unordered_set &used_indexes); /** - * \brief Prepare Allocator for the MT work. Allocate and free everything except one element + * @brief Prepare Allocator for the MT work. Allocate and free everything except one element * It will generate a common allocator state before specific tests. */ void MTTestPrologue(Allocator &allocator, size_t alloc_size); diff --git a/runtime/tests/collection_set_test.cpp b/runtime/tests/collection_set_test.cpp index a610f0c57f1251e8c87779879db81e540344b811..7ced83bf1b45c244ad89686e1752ec83413f0b9d 100644 --- a/runtime/tests/collection_set_test.cpp +++ b/runtime/tests/collection_set_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/dyn_buffer_test.cpp b/runtime/tests/dyn_buffer_test.cpp index a13f0bb9c492c8da7857ae2343c0badfb7c562ae..2646c957615f14d252f4a711cb1c94a0eae74797 100644 --- a/runtime/tests/dyn_buffer_test.cpp +++ b/runtime/tests/dyn_buffer_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/epsilon_gcs_test.cpp b/runtime/tests/epsilon_gcs_test.cpp index 7be769418c8601f2d50e810e7bfb85bf87521485..6792ede696b2d94bbb1efa622c0902c5d3d1dbcb 100644 --- a/runtime/tests/epsilon_gcs_test.cpp +++ b/runtime/tests/epsilon_gcs_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022-2023 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. diff --git a/runtime/tests/exception_test.cpp b/runtime/tests/exception_test.cpp index 06701b4824b1e0073b4d57a0cb0ff16e765dd796..20b456fd4a1e1ace72b634fa6d99a461d35233ea 100644 --- a/runtime/tests/exception_test.cpp +++ b/runtime/tests/exception_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/explicit_gc_test.cpp b/runtime/tests/explicit_gc_test.cpp index 1d675f99ae1e914205346079adf1fd620b5e5fd5..b848dc1c4e16ffb6b612042be71ca1b91eef16c4 100644 --- a/runtime/tests/explicit_gc_test.cpp +++ b/runtime/tests/explicit_gc_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/fibers_test.cpp b/runtime/tests/fibers_test.cpp index 487eae19cd7478cd3c70fe129d0646cd1bdbf462..e24068b11dae16506797c9ed24f8d5a5aed51ebc 100644 --- a/runtime/tests/fibers_test.cpp +++ b/runtime/tests/fibers_test.cpp @@ -24,7 +24,7 @@ namespace panda::fibers::test { -/// the fixture +/// The fixture class FibersTest : public testing::Test { public: size_t GetEntryExecCounter() @@ -151,8 +151,10 @@ TEST_F(FibersTest, SwitchExecuteSwitchBack) ASSERT_EQ(GetEntryExecCounter(), 1); } -/// Create several fibers, organizing them in a chain using the "parent" field. -/// Switch to the last one, wait till the whole chain is executed +/** + * Create several fibers, organizing them in a chain using the "parent" field. + * Switch to the last one, wait till the whole chain is executed + */ TEST_F(FibersTest, ChainSwitch) { Fiber f_init(*this); @@ -200,8 +202,10 @@ TEST_F(FibersTest, LoopedSwitch) } using FibersDeathTest = FibersTest; -/// Death test. Creates an orphaned fiber that will silently return from its entry function. -/// Should cause the program to be abort()-ed +/** + * Death test. Creates an orphaned fiber that will silently return from its entry function. + * Should cause the program to be abort()-ed + */ TEST_F(FibersDeathTest, AbortOnFiberReturn) { Fiber f_init(*this); diff --git a/runtime/tests/g1gc_test.cpp b/runtime/tests/g1gc_test.cpp index 4e74c13f6aff63dbab363f078e1d4ae626a1f7df..72418ba942b80fb1bad231dbd033a0e3de9cfc51 100644 --- a/runtime/tests/g1gc_test.cpp +++ b/runtime/tests/g1gc_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/gc_log_test.cpp b/runtime/tests/gc_log_test.cpp index de61053da9c4deed2830f1c44684e1cf31686da2..dfed77b402bf4638d3f2d968691dcdf0d03c97fa 100644 --- a/runtime/tests/gc_log_test.cpp +++ b/runtime/tests/gc_log_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.cpp b/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.cpp index 1fc58dbec1f1b8d9b5b656a8ad35515181e6a549..4c4bc12a727ae9bb6542b391d17b3cd6c5fd9616 100644 --- a/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.cpp +++ b/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.h b/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.h index 9faef6d5647f9a05eb0db43e5f9ee9826b459642..6df9ec953d49b6b8e0f2bed15ae186fffa1e7d35 100644 --- a/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.h +++ b/runtime/tests/intrusive-tests/clear_interrupted_intrusive_test/sync_api.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/intrusive_test.cpp b/runtime/tests/intrusive-tests/intrusive_test.cpp index 0532c12793c3bb20dfaa0f2fa3d6b0cc713ad6fa..2098822a7cd8e6ce40ded508a6d6d2ddc8178eb8 100644 --- a/runtime/tests/intrusive-tests/intrusive_test.cpp +++ b/runtime/tests/intrusive-tests/intrusive_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/intrusive_test.h b/runtime/tests/intrusive-tests/intrusive_test.h index 3a141138b28f22b7f9794e7cf87cc75730d94805..fe56242cdf29f34e5a6c75bda22d0dc4dcc571c3 100644 --- a/runtime/tests/intrusive-tests/intrusive_test.h +++ b/runtime/tests/intrusive-tests/intrusive_test.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/intrusive_test_option.h b/runtime/tests/intrusive-tests/intrusive_test_option.h index 796438c93a66ef1b4c89ac1550e5af89c7eb35fc..8145fae321aa9b67e43cdff7a31d3fa3ba429742 100644 --- a/runtime/tests/intrusive-tests/intrusive_test_option.h +++ b/runtime/tests/intrusive-tests/intrusive_test_option.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive-tests/intrusive_test_suite.h b/runtime/tests/intrusive-tests/intrusive_test_suite.h index 9c100c611b341345c15e77075f0f56bc33fb8504..146853d4bf4b95184311bbf6d92a2036ca5fca69 100644 --- a/runtime/tests/intrusive-tests/intrusive_test_suite.h +++ b/runtime/tests/intrusive-tests/intrusive_test_suite.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/intrusive_gc_test_api_test.cpp b/runtime/tests/intrusive_gc_test_api_test.cpp index 890cdc938c14fbe896e8b07ee8912f9ee4b6fc1d..83108de8d16198a114ec78c1261d2ee8b8c15b60 100644 --- a/runtime/tests/intrusive_gc_test_api_test.cpp +++ b/runtime/tests/intrusive_gc_test_api_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/mem_stats_gen_gc_test.cpp b/runtime/tests/mem_stats_gen_gc_test.cpp index 195cb7539074a3f38284410a9960344e0ed1fe0b..38b0acc4428abb0840e630aa8d8ddf28f4bf1bd5 100644 --- a/runtime/tests/mem_stats_gen_gc_test.cpp +++ b/runtime/tests/mem_stats_gen_gc_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/object_helpers_test.cpp b/runtime/tests/object_helpers_test.cpp index 4a85c2ddc312cde58ecf1b751064aaa940c00b50..85a47d74c4ea8671d6dba684dcf639612830146a 100644 --- a/runtime/tests/object_helpers_test.cpp +++ b/runtime/tests/object_helpers_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/regexp_test.cpp b/runtime/tests/regexp_test.cpp index 29a5f39b3ed71441afbb9da6527b4057fc71acc2..e0d04636ba074a22427cf2b2697ff05dee5b0dbf 100644 --- a/runtime/tests/regexp_test.cpp +++ b/runtime/tests/regexp_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/signal_handler_test.cpp b/runtime/tests/signal_handler_test.cpp index 74b4b89f6b3b9c89c680d402f88c845abd4a9031..36a97794bc3e24ae766d019fb280e1dc9aa72380 100644 --- a/runtime/tests/signal_handler_test.cpp +++ b/runtime/tests/signal_handler_test.cpp @@ -1,3 +1,18 @@ +/** + * Copyright (c) 2023 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. + */ + #include #include #include diff --git a/runtime/tests/stack_like_allocator_test.cpp b/runtime/tests/stack_like_allocator_test.cpp index 9d6938fcd66b62b24fd0c4443ccc6b21c251fe31..a800b4770c3bc4a520591528938881a3a793e496 100644 --- a/runtime/tests/stack_like_allocator_test.cpp +++ b/runtime/tests/stack_like_allocator_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021 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. diff --git a/runtime/tests/static_analyzer_test.cpp b/runtime/tests/static_analyzer_test.cpp index 9506e5b89c9db119a8896f7019d9194a3dc213cb..55fa78da3a849e664bda1ecbc2bd7cba1deef4e2 100644 --- a/runtime/tests/static_analyzer_test.cpp +++ b/runtime/tests/static_analyzer_test.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/taskmanager/task_manager_test.cpp b/runtime/tests/taskmanager/task_manager_test.cpp index 2b7b602e371b8280048848da33d3b58fc6b8c4bd..11a2607b9e5f1e3b2951ac68ae345f4300b3f30b 100644 --- a/runtime/tests/taskmanager/task_manager_test.cpp +++ b/runtime/tests/taskmanager/task_manager_test.cpp @@ -74,9 +74,8 @@ public: { tasks_count_ = set_count; } - /** - * Wait for all queues will be registered - */ + + /// Wait for all queues will be registered void WaitAllQueue() { while (registered_queues_counter_ != queue_count_) { @@ -85,9 +84,7 @@ public: } } - /** - * Wait for all tasks would be added in queues - */ + /// Wait for all tasks would be added in queues void WaitAllTask() { while (tasks_set_added_ != tasks_count_) { diff --git a/runtime/tests/test_utils.h b/runtime/tests/test_utils.h index b4be77f2dcb134d0139af0da24822ac60d4443d2..2d725080c679d28a70ff29248b40ef6602384092 100644 --- a/runtime/tests/test_utils.h +++ b/runtime/tests/test_utils.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/tooling/api_test.h b/runtime/tests/tooling/api_test.h index 200f074e16bca7c140b9ffa14e7765acb3fa7a15..fdb72cd3f340f9c2af95f02eea6d113c77b26335 100644 --- a/runtime/tests/tooling/api_test.h +++ b/runtime/tests/tooling/api_test.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/tooling/init.cpp b/runtime/tests/tooling/init.cpp index 645d88bff8a07f39d3971a64bed6e64ce351a597..2b0ccaa9eb856e5fe255e98b0d80510e7cb79c4b 100644 --- a/runtime/tests/tooling/init.cpp +++ b/runtime/tests/tooling/init.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/tooling/test_extractor.cpp b/runtime/tests/tooling/test_extractor.cpp index 3ba0cf30c0b78241c0b57f46211c1be02af1f28e..6bbb005be306fcbaf406764fd4a0879f2f554ae7 100644 --- a/runtime/tests/tooling/test_extractor.cpp +++ b/runtime/tests/tooling/test_extractor.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/tooling/test_extractor.h b/runtime/tests/tooling/test_extractor.h index 5691e63e355710ed54d635d7710a46c11d683291..fa437b8057be78d050b057981a906231f8581f18 100644 --- a/runtime/tests/tooling/test_extractor.h +++ b/runtime/tests/tooling/test_extractor.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/tests/tooling/test_runner.h b/runtime/tests/tooling/test_runner.h index d546d05e823f20b48e18d6f2abb7e7d74261b9f2..48f2a4a4e8a9debfecf0b6d8c72105eea4f2df7a 100644 --- a/runtime/tests/tooling/test_runner.h +++ b/runtime/tests/tooling/test_runner.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/runtime/thread_manager.h b/runtime/thread_manager.h index 3f08df27ff255a1a22cf88fd670812df17823d63..90b7791bb9cffd334cf9a5392950c59baca212c2 100644 --- a/runtime/thread_manager.h +++ b/runtime/thread_manager.h @@ -53,8 +53,8 @@ public: virtual ~ThreadManager() = default; /** - * \brief thread enumeration and applying \param cb to them - * @return true if for every thread \param cb was successful (returned true) and false otherwise + * @brief thread enumeration and applying @param cb to them + * @return true if for every thread @param cb was successful (returned true) and false otherwise */ bool EnumerateThreads(const Callback &cb, unsigned int inc_mask = static_cast(EnumerationFlag::ALL), unsigned int xor_mask = static_cast(EnumerationFlag::NONE)) const diff --git a/runtime/threaded_coroutine_manager.h b/runtime/threaded_coroutine_manager.h index a46446f8c6019b68af7986126b87c9a94a3caebc..bd861d8f41cbc818946943bc406b5b504e4a44bc 100644 --- a/runtime/threaded_coroutine_manager.h +++ b/runtime/threaded_coroutine_manager.h @@ -23,7 +23,7 @@ namespace panda { /** - * \brief Thread-based coroutine manager implementation. + * @brief Thread-based coroutine manager implementation. * * In this implementation coroutines are OS threads. The invariants (only N coroutines are running simultaniously, etc.) * are kept with the help of mutexes and condition variables. @@ -63,9 +63,9 @@ protected: size_t GetCoroutineCount() override; size_t GetCoroutineCountLimit() override; - /// sets number of coroutines that can execute simultaniously + /// Sets number of coroutines that can execute simultaniously void SetWorkersCount(uint32_t n); - /// returns number of coroutines that can execute simultaniously + /// Returns number of coroutines that can execute simultaniously uint32_t GetWorkersCount() const; private: diff --git a/runtime/tooling/inspector/debuggable_thread.h b/runtime/tooling/inspector/debuggable_thread.h index 3c4f4f071dc08be3c6a4bb0d428620aa6a7cd947..b62d7d3e78f042f90b66ad1e91bbdfae8e3fa264 100644 --- a/runtime/tooling/inspector/debuggable_thread.h +++ b/runtime/tooling/inspector/debuggable_thread.h @@ -36,11 +36,7 @@ public: NO_COPY_SEMANTIC(DebuggableThread); NO_MOVE_SEMANTIC(DebuggableThread); - //////////////////////////////////////////////////////////////////////////// - // - // The following methods should be called on the server thread - // - //////////////////////////////////////////////////////////////////////////// + /// The following methods should be called on the server thread // Resets the state on a new connection void Reset(); @@ -85,11 +81,7 @@ public: // Executes a request to object repository on a paused thread (does nothing for running threads) bool RequestToObjectRepository(std::function request); - //////////////////////////////////////////////////////////////////////////// - // - // The following methods should be called on an application thread - // - //////////////////////////////////////////////////////////////////////////// + /// The following methods should be called on an application thread // Notification that an exception was thrown. Pauses the thread if necessary void OnException(bool uncaught); diff --git a/runtime/tooling/inspector/object_repository.h b/runtime/tooling/inspector/object_repository.h index 4c4c5825fafe7d1814e7e053b3fe7395cd201443..3653b02a413f4ce7f2342bcf73d43086a6102e3b 100644 --- a/runtime/tooling/inspector/object_repository.h +++ b/runtime/tooling/inspector/object_repository.h @@ -24,12 +24,10 @@ #include "runtime/tooling/inspector/types/property_descriptor.h" namespace panda::tooling::inspector { -//////////////////////////////////////////////////////////////////////////// -// -// All manipulations with an object repository should be made -// on the corresponding application thread with mutator lock held -// -//////////////////////////////////////////////////////////////////////////// +/** + * All manipulations with an object repository should be made + * on the corresponding application thread with mutator lock held + */ class ObjectRepository { public: diff --git a/runtime/tooling/pt_method_private.h b/runtime/tooling/pt_method_private.h index 8ac97a9305a0c136e7f329a84800890987ca4f2f..30362b343d6ab035a5e0f75d3d0a8ec728920a34 100644 --- a/runtime/tooling/pt_method_private.h +++ b/runtime/tooling/pt_method_private.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2019-2022 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. diff --git a/runtime/verify_app_install.h b/runtime/verify_app_install.h index a85ad837aeaaf35126972357bd8211aa830f88bf..b2dd0d899e5d5509f0661e9879f74a231948195c 100644 --- a/runtime/verify_app_install.h +++ b/runtime/verify_app_install.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/scripts/code_style/doxygen_style_check.py b/scripts/code_style/doxygen_style_check.py new file mode 100755 index 0000000000000000000000000000000000000000..a95f2365310110da025c6baa852c7302179f57dc --- /dev/null +++ b/scripts/code_style/doxygen_style_check.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 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. + +import argparse +import os +import re +import sys + +def get_args(): + parser = argparse.ArgumentParser( + description="Doxygen style checker for panda project.") + parser.add_argument( + 'panda_dir', help='panda sources directory.', type=str) + + return parser.parse_args() + +def get_file_list(panda_dir) -> list: + src_exts = (".c", '.cc', ".cp", ".cxx", ".cpp", ".CPP", ".c++", ".C", ".h", + ".hh", ".H", ".hp", ".hxx", ".hpp", ".HPP", ".h++", ".tcc") + skip_dirs = ["third_party", "artifacts", "\..*", "build.*"] + file_list = [] + for dirpath, dirnames, filenames in os.walk(panda_dir): + dirnames[:] = [d for d in dirnames if not re.match(f"({')|('.join(skip_dirs)})" , d)] + for fname in filenames: + if (fname.endswith(src_exts)): + full_path = os.path.join(panda_dir, dirpath, fname) + full_path = str(os.path.realpath(full_path)) + file_list.append(full_path) + + return file_list + +# Additional check because regexps sometimes find correct comments +def wrong_doxygen_comment(s: str) -> bool: + # Helps not to raise warnings for fine comments + # Examples of fine comments: /************/, /* ///////TEXT */ + fine_comments = [re.compile(r'///[^\n]*\*/[^\n]*'), re.compile(r'/\*\*[^\n]*\*/')] + for comm in fine_comments: + if comm.search(s): + return False + return True + +def print_correct_style() -> None: + lines = ["\nPlease, for single-line doxygen comments use the following formats:",\ + "'/// TEXT' - used for commenting on an empty line", "or",\ + "'///< TEXT' - used for commenting after declared/defined variables in the same line",\ + "\nand for multi-line doxygen comments use the following Javadoc format:\n/**\n * TEXT\n * TEXT\n * TEXT\n */"] + for line in lines: + print(line) + +def check_keywords(src_path: str, splitted_lines: list, line_num: int) -> bool: + is_right_style = True + keywords_to_check = ["brief", "param", "tparam", "return", "class", "see", "code", "endcode"] + for line in splitted_lines: + for keyword in keywords_to_check: + ind = line.find(keyword) + if ind != -1 and line[ind - 1] == '\\': + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Please, use '@' instead of '\\' before '%s':\n%s\n" % (keyword, line)) + is_right_style = False + line_num += 1 + return is_right_style + +def check_javadoc(src_path: str, strings: list) -> bool: + f = open(src_path, 'r') + text = f.read() + f.close() + found_wrong_comment = False + found_wrong_keyword_sign = False + for i in range(0, len(strings)): + line_num = text[:text.find(strings[i])].count('\n') + 1 + if strings[i].find("Copyright") != -1 or strings[i].count('\n') <= 1: + continue + pattern_to_check = re.search(r' */\*\* *\n( *\* *[^\n]*\n)+ *\*/', strings[i]) + if not pattern_to_check or pattern_to_check.group(0) != strings[i]: + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Found doxygen comment with a wrong Javadoc style:\n%s\n" % strings[i]) + found_wrong_comment = True + continue + if strings[i].count('\n') == 2: + err_msg = "%s:%s" % (src_path, line_num) + print("%s\n%s\n" % (err_msg, strings[i])) + found_wrong_comment = True + continue + found_wrong_keyword_sign |= not check_keywords(src_path, strings[i].splitlines(), line_num) + if found_wrong_comment: + print_correct_style() + return not (found_wrong_comment or found_wrong_keyword_sign) + +def check_additional_slashes(src_path: str, strings: list) -> bool: + f = open(src_path, 'r') + text = f.read() + f.close() + lines = text.splitlines() + found_wrong_comment = False + found_wrong_keyword_sign = False + line_before_is_correct = False # Used to determine when '///' is used for multi-line comments + for i in range(0, len(strings)): + line_num = text[:text.find(strings[i])].count('\n') + 1 + pattern_to_check = re.search(r' */// [^ ]+?[^\n]*', lines[line_num - 1]) + if not pattern_to_check or pattern_to_check.group(0) != lines[line_num - 1]: + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Found doxygen comment with a wrong style:\n%s\n" % strings[i]) + found_wrong_comment = True + line_before_is_correct = False + continue + if text[:text.find(strings[i - 1])].count('\n') + 1 == line_num - 1 and line_before_is_correct: + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Please, use '///' only for single-line comments:\n%s\n%s\n" % (lines[line_num - 2], lines[line_num - 1])) + found_wrong_comment = True + line_before_is_correct = True + found_wrong_keyword_sign |= not check_keywords(src_path, strings[i].splitlines(), line_num) + if found_wrong_comment: + print_correct_style() + return not (found_wrong_comment or found_wrong_keyword_sign) + +def check_less_than_slashes(src_path: str, strings: list) -> bool: + f = open(src_path, 'r') + text = f.read() + f.close() + lines = text.splitlines() + found_wrong_comment = False + found_wrong_keyword_sign = False + for i in range(0, len(strings)): + line_num = text[:text.find(strings[i])].count('\n') + 1 + pattern_to_check = re.search(r' *[^ \n]+[^\n]* +///< [^\n]+', lines[line_num - 1]) + if not pattern_to_check or pattern_to_check.group(0) != lines[line_num - 1]: + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Found doxygen comment with a wrong style:\n%s\n" % strings[i]) + found_wrong_comment = True + continue + found_wrong_keyword_sign |= not check_keywords(src_path, strings[i].splitlines(), line_num) + if found_wrong_comment: + print_correct_style() + return not (found_wrong_comment or found_wrong_keyword_sign) + +def check_all(src_path: str, fine_patterns_found: list, wrong_patterns_number: int) -> bool: + passed = wrong_patterns_number == 0 + passed &= check_javadoc(src_path, fine_patterns_found[0]) + passed &= check_additional_slashes(src_path, fine_patterns_found[1]) + passed &= check_less_than_slashes(src_path, fine_patterns_found[2]) + return passed + +def run_doxygen_check(src_path: str, msg: str) -> bool: + print(msg) + # Forbidden styles + qt_style = re.compile(r'/\*![^\n]*') + slashes_with_exclamation_style = re.compile(r'//![^\n]*') + # Allowed styles + javadoc_style = re.compile(r' */\*\*[\w\W]*?\*/') # Allowed if number of lines in a comment is >= 2 + additional_slashes_style = re.compile(r'/// *[^< ][^\n]*') # Allowed to comment only one line. Otherwise javadoc style should be used + less_than_slashes_style = re.compile(r'/// *< *[^\n]*') # Allowed to comment declared/defined variables in the same line + + regexps_for_fine_styles = [javadoc_style, additional_slashes_style, less_than_slashes_style] + regexps_for_wrong_styles = [qt_style, slashes_with_exclamation_style] + fine_patterns_found = [[] for i in range(len(regexps_for_fine_styles))] + wrong_patterns_found = [] + # Looking for comments with wrong style + for regexp in regexps_for_wrong_styles: + f = open(src_path, 'r') + strings = regexp.findall(f.read()) + f.close() + for s in strings: + if wrong_doxygen_comment(s): + wrong_patterns_found.append(s) + line_num = 1 + f = open(src_path, 'r') + lines = f.readlines() + f.close() + for line in lines: + for pattern in wrong_patterns_found: + if pattern in line: + err_msg = "%s:%s" % (src_path, line_num) + print(err_msg) + print("Found wrong doxygen style:\n", line) + break + line_num += 1 + + # Getting comments with possibly allowed styles + for i in range(len(regexps_for_fine_styles)): + f = open(src_path, 'r') + strings = regexps_for_fine_styles[i].findall(f.read()) + f.close() + for s in strings: + if wrong_doxygen_comment(s): + fine_patterns_found[i].append(s) + + return check_all(src_path, fine_patterns_found, len(wrong_patterns_found)) + +def check_file_list(file_list: list) -> bool: + jobs = [] + main_ret_val = True + total_count = str(len(file_list)) + idx = 0 + for src in file_list: + idx += 1 + msg = "[%s/%s] Running doxygen style checker: %s" % (str(idx), total_count, src) + proc = run_doxygen_check(src, msg) + jobs.append(proc) + + for job in jobs: + if not job: + main_ret_val = False + break + + return main_ret_val + +if __name__ == "__main__": + args = get_args() + file_list = get_file_list(args.panda_dir) + if not file_list: + sys.exit( + "Source list can't be prepared. Please check panda_dir variable: " + args.panda_dir) + + if not check_file_list(file_list): + sys.exit("Failed: doxygen style checker got errors") + print("Doxygen style checker was passed successfully!") \ No newline at end of file diff --git a/static_linker/linker_code_parser_context.cpp b/static_linker/linker_code_parser_context.cpp index 67e44f92d1e19f738e37220fe908f9c6e6eab3b6..205735e23b28608f8688929293603581c4869776 100644 --- a/static_linker/linker_code_parser_context.cpp +++ b/static_linker/linker_code_parser_context.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.cpp b/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.cpp index 1421ca5a29cb09b4543ffbebc1d40878da2c04cb..92e3e78c05aabd38c368779c7d302e9cbae2c94a 100644 --- a/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.cpp +++ b/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.h b/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.h index e502a34a62b9079eadf07077810067a6654ec60e..ad1dc250e46dac7379556c2ecb0afbc5816eec5c 100644 --- a/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.h +++ b/tests/fuzztest/checkheader_fuzzer/checkheader_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.cpp b/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.cpp index 49e8bfb42f9687f0ff108079ffb3a2f07740c89c..e20cf114fd5abcdb537e595b562cd9f94156bd33 100644 --- a/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.cpp +++ b/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.h b/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.h index 6012a91285d839853f33556d09f70e9a90e5c82e..81fd1317172c7d87586e6f8d4a3a9d8cf56c1300 100644 --- a/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.h +++ b/tests/fuzztest/literaldataaccessor_fuzzer/literaldataaccessor_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.cpp b/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.cpp index 0c047f3e96527449ce97f6836f578264cfc0c79c..d7552ebd1a201825e4368389d5c7431329bf5103 100644 --- a/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.cpp +++ b/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.h b/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.h index 70884151b0d59e060e990c7bd58208d8e6305fa0..ec38bece01b537dcfe3e46153fd74a68eebcdfec 100644 --- a/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.h +++ b/tests/fuzztest/methoddataaccessor_fuzzer/methoddataaccessor_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/open_fuzzer/open_fuzzer.cpp b/tests/fuzztest/open_fuzzer/open_fuzzer.cpp index 13c9382487ad95a5c1909a969eda4163b695d72f..1c2498ef7c56da92130196eb34cffc5448d53e7c 100644 --- a/tests/fuzztest/open_fuzzer/open_fuzzer.cpp +++ b/tests/fuzztest/open_fuzzer/open_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/open_fuzzer/open_fuzzer.h b/tests/fuzztest/open_fuzzer/open_fuzzer.h index 42e61caeee9dcf585e1da9809683fee01bdce4e8..1f40ea58042665cea4601b9c8973846c1f86439b 100644 --- a/tests/fuzztest/open_fuzzer/open_fuzzer.h +++ b/tests/fuzztest/open_fuzzer/open_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.cpp b/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.cpp index 3a8395572fd3ce34d40ca1f97284e53681537637..aa6ff138ff5a2d205380696617075e29f92e164f 100644 --- a/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.cpp +++ b/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.h b/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.h index 55872dfbb00aeeedebbed781090a929180082118..b8bd78e402b9a177c60d2fabf2699e0b38197e16 100644 --- a/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.h +++ b/tests/fuzztest/openfrommemory1arg_fuzzer/openfrommemory1arg_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.cpp b/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.cpp index b1b4125d26352dbd18a2aab0efac5758b10e46b2..3b53ecd7452c675f4f2939c1a6a7d79cd26360c4 100644 --- a/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.cpp +++ b/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.h b/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.h index 97d02d260f97d3666e2022415763ecd6e40534cf..e46a70fc2b527565042c08331370369fe83c0382 100644 --- a/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.h +++ b/tests/fuzztest/openfrommemory2arg_fuzzer/openfrommemory2arg_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.cpp b/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.cpp index 4ec7747a87194e7f7de4c19759d1648087475132..650354bf1dae040e075530e5bdd6b90b92209e03 100644 --- a/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.cpp +++ b/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.h b/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.h index 962c6e7caa5d812f110aae7e52d5c6c168606ce1..65238d233aa0eb4c5b7bfdca120c4ca7cede33e4 100644 --- a/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.h +++ b/tests/fuzztest/openpandafile_fuzzer/openpandafile_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.cpp b/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.cpp index 36bf5528d351b6c1b0f1364e0d7878bec179a723..4244a48921bc4ce11f7e4530c9ae6f6b77adf82a 100644 --- a/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.cpp +++ b/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.h b/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.h index 0be44ae34862224bc3634e804782b3b9a641e0f4..9837382da6e1eeec4237ea219fc72881972fa59c 100644 --- a/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.h +++ b/tests/fuzztest/openpandafilefrommemory_fuzzer/openpandafilefrommemory_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.cpp b/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.cpp index 4043a5367ec8a20184dfa33d1720d240ae247464..a9a9d50bd893e5735317bb8861d875c4f11d33dd 100644 --- a/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.cpp +++ b/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.h b/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.h index 1835554ded1bd9a575f40a895a61fede21117bc7..3bc55c1383ede5d86dbc79d022000c2ad9d40f43 100644 --- a/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.h +++ b/tests/fuzztest/openpandafileorzip_fuzzer/openpandafileorzip_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.cpp b/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.cpp index 8eb2fbe0435016bab848cf66d1acdb0b4ae07343..5002522cc61a8807053596df4693f70f3395d9ec 100644 --- a/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.cpp +++ b/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.h b/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.h index bce7aecbdfe7a35b71ea0dc1a6643e32c4a392b0..9419a9a4cac79a2082c8a8c93f69bbde344cbeb6 100644 --- a/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.h +++ b/tests/fuzztest/openuncompressedarchive_fuzzer/openuncompressedarchive_fuzzer.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/tools/sampler/args_parser.h b/tools/sampler/args_parser.h index 87b0e3da6dc4c24c89022edb0ca2d0f834fc0dac..103e821f1edf405cdb3472aa824c17b554d295b2 100644 --- a/tools/sampler/args_parser.h +++ b/tools/sampler/args_parser.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tools/sampler/aspt_converter.cpp b/tools/sampler/aspt_converter.cpp index 15edfc19120803b2a1e69fad9f9e7a08b3aa09b0..3021b10f0005d9fda8c56ce24642888eef107913 100644 --- a/tools/sampler/aspt_converter.cpp +++ b/tools/sampler/aspt_converter.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tools/sampler/aspt_converter.h b/tools/sampler/aspt_converter.h index e6cd3a43f344c3bd9d80d35d1e92a27b7d279f7c..8ca79d79f6977aa9962520cfddf4d068c3aef699 100644 --- a/tools/sampler/aspt_converter.h +++ b/tools/sampler/aspt_converter.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tools/sampler/main.cpp b/tools/sampler/main.cpp index 2eebf95aacfe49687fcb94e6befebf47dafcad88..1361821066c1594f35c7bdebaaf6bcdf1ecc4d43 100644 --- a/tools/sampler/main.cpp +++ b/tools/sampler/main.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tools/sampler/trace_dumper.cpp b/tools/sampler/trace_dumper.cpp index e704111775558a56946a450e1411d4042767621f..1eb3a8b65db4e042c885b5474c6b69b5f089de1c 100644 --- a/tools/sampler/trace_dumper.cpp +++ b/tools/sampler/trace_dumper.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/tools/sampler/trace_dumper.h b/tools/sampler/trace_dumper.h index 7d1a2f2d5960ac1a250b6e7a558be0320111cb76..7f768fad0dd560a1fc61ac8db441463b052ee692 100644 --- a/tools/sampler/trace_dumper.h +++ b/tools/sampler/trace_dumper.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/verification/config/config.h b/verification/config/config.h index b144b3950845694bb9f8c16f5e037e583720ba41..fb35220d3caf1dfc5895607310afedfea4023075 100644 --- a/verification/config/config.h +++ b/verification/config/config.h @@ -61,4 +61,4 @@ struct Section { }; } // namespace panda::verifier::config -#endif //! PANDA_VERIF_CONFIG_H_ +#endif // PANDA_VERIF_CONFIG_H_ diff --git a/verification/config/config_load.cpp b/verification/config/config_load.cpp index 3a72e184393f820f264f63278c169b8bb62a91f3..3991f34dedd48aa7c0d21951edd5175e011e7cc3 100644 --- a/verification/config/config_load.cpp +++ b/verification/config/config_load.cpp @@ -101,4 +101,4 @@ bool LoadConfig(Config *cfg, std::string_view filename) } // namespace panda::verifier::config -#endif //! PANDA_VERIF_CONFIG_LOAD_H_ +#endif // PANDA_VERIF_CONFIG_LOAD_H_ diff --git a/verification/config/config_load.h b/verification/config/config_load.h index cb5087f542adbba0907f4c6b23d4a87d05f4d45f..3e4a79c87aab4c6826db5fec2e68227dc8893250 100644 --- a/verification/config/config_load.h +++ b/verification/config/config_load.h @@ -24,4 +24,4 @@ namespace panda::verifier::config { bool LoadConfig(Config *cfg, std::string_view filename); } // namespace panda::verifier::config -#endif //! PANDA_VERIF_CONFIG_LOAD_H_ +#endif // PANDA_VERIF_CONFIG_LOAD_H_ diff --git a/verification/config/debug_breakpoint/breakpoint.h b/verification/config/debug_breakpoint/breakpoint.h index c4ec723313483becf31333a76e1156cd18a08a5f..80e1336351ef61a7e10373b0da74f5c3b65ea554 100644 --- a/verification/config/debug_breakpoint/breakpoint.h +++ b/verification/config/debug_breakpoint/breakpoint.h @@ -56,4 +56,4 @@ inline bool ManagedBreakpointPresent([[maybe_unused]] DebugContext const *ctx, [ #endif } // namespace panda::verifier::debug -#endif //! PANDA_VERIFIER_DEBUG_BREAKPOINT_H__ +#endif // PANDA_VERIFIER_DEBUG_BREAKPOINT_H__ diff --git a/verification/config/handlers/config_handlers.h b/verification/config/handlers/config_handlers.h index 4a9e12cc1e83e1c36b897806a3405abba8ad5733..ca195f747705756ddba47676f3e6fe1200ebbe59 100644 --- a/verification/config/handlers/config_handlers.h +++ b/verification/config/handlers/config_handlers.h @@ -27,4 +27,4 @@ void SetDefaultMethodOptions(Config *dcfg); void RegisterConfigHandlerMethodGroups(Config *dcfg); } // namespace panda::verifier::debug -#endif //! PANDA_VERIFIER_DEBUG_HANDLERS_H_ +#endif // PANDA_VERIFIER_DEBUG_HANDLERS_H_ diff --git a/verification/config/options/method_group_parser.h b/verification/config/options/method_group_parser.h index 82d6e912e321700f99150bbe003ae3263f90d5dd..7de692e7325e9ff7ee1cd93b37d18a441ec52fee 100644 --- a/verification/config/options/method_group_parser.h +++ b/verification/config/options/method_group_parser.h @@ -56,4 +56,4 @@ const auto &MethodGroupParser(RegexHandler ®ex_handler) } // namespace panda::verifier -#endif //! PANDA_VERIFIER_DEBUG_METHOD_GROUP_PARSER_H_ +#endif // PANDA_VERIFIER_DEBUG_METHOD_GROUP_PARSER_H_ diff --git a/verification/config/options/method_options.h b/verification/config/options/method_options.h index 0355a6008a0f8d8192225644971a56082931de76..a990cc8a4035b4ab18437ace88db4eb673a6c711 100644 --- a/verification/config/options/method_options.h +++ b/verification/config/options/method_options.h @@ -241,4 +241,4 @@ private: } // namespace panda::verifier -#endif //! PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_H_ +#endif // PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_H_ diff --git a/verification/config/options/method_options_config.h b/verification/config/options/method_options_config.h index f46a88ea71131e77ab61d96b4cbc831a25ecab00..02f3beee2559600131287d58270b218b9428e6b9 100644 --- a/verification/config/options/method_options_config.h +++ b/verification/config/options/method_options_config.h @@ -66,4 +66,4 @@ private: } // namespace panda::verifier -#endif //! PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_CONFIG_H_ +#endif // PANDA_VERIFIER_DEBUG_OPTIONS_METHOD_OPTIONS_CONFIG_H_ diff --git a/verification/config/options/msg_set_parser.h b/verification/config/options/msg_set_parser.h index 7760b22ef605b480871d2d5a88e76401708aa1cd..32133cc18f2ecaa1232e851df628454c77d2c598 100644 --- a/verification/config/options/msg_set_parser.h +++ b/verification/config/options/msg_set_parser.h @@ -115,4 +115,4 @@ inline const auto &MessageSetParser() } // namespace panda::verifier::debug -#endif //! PANDA_VERIFIER_DEBUG_MSG_SET_PARSER_H_ +#endif // PANDA_VERIFIER_DEBUG_MSG_SET_PARSER_H_ diff --git a/verification/config/parse/config_parse.h b/verification/config/parse/config_parse.h index f94ea5c9dedf3bcb19137e4607ed76e2480b800d..55ca77fa059eae8d8910c4d3a17a06df0c6aba10 100644 --- a/verification/config/parse/config_parse.h +++ b/verification/config/parse/config_parse.h @@ -22,4 +22,4 @@ namespace panda::verifier::config { bool ParseConfig(const char *str, Section &cfg); } // namespace panda::verifier::config -#endif //! PANDA_VERIF_CONFIG_PARSE_H_ +#endif // PANDA_VERIF_CONFIG_PARSE_H_ diff --git a/verification/config/process/config_process.h b/verification/config/process/config_process.h index 0b0c40a75042e35e71fa9b65687f4569603bdd17..5f0e91190e1641f97644f9d35c8c829048ad1529 100644 --- a/verification/config/process/config_process.h +++ b/verification/config/process/config_process.h @@ -31,4 +31,4 @@ bool ProcessConfig(Config *cfg, const Section §ion); void RegisterConfigHandler(Config *cfg, const PandaString &path, callable handler); } // namespace panda::verifier::config -#endif //! PANDA_VERIF_CONFIG_PROCESS_H_ +#endif // PANDA_VERIF_CONFIG_PROCESS_H_ diff --git a/verification/jobs/job.cpp b/verification/jobs/job.cpp index 767e0bc4300d3b963012332ea7d2985695e59a5f..04b501639fc8a493e2c0d1bb94d8c8313d6851ba 100644 --- a/verification/jobs/job.cpp +++ b/verification/jobs/job.cpp @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2021-2022 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. diff --git a/verification/jobs/job.h b/verification/jobs/job.h index a671e55f33fa56e25cb87b88f1877194b5a0b9da..f7bd27a275e5c51066450d74c6aaa160e7e40a29 100644 --- a/verification/jobs/job.h +++ b/verification/jobs/job.h @@ -174,4 +174,4 @@ private: }; } // namespace panda::verifier -#endif //! PANDA_VERIFIER_JOB_QUEUE_JOB_H_ +#endif // PANDA_VERIFIER_JOB_QUEUE_JOB_H_ diff --git a/verification/plugins.cpp b/verification/plugins.cpp index 39b5fe7681aa5c83283cecaf56243464f10deb08..eaa343fc40b80700c6c0158631555f8c4312b0e2 100644 --- a/verification/plugins.cpp +++ b/verification/plugins.cpp @@ -1 +1,16 @@ +/** + * Copyright (c) 2023 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. + */ + #include "plugins_gen.inc" diff --git a/verification/util/flags.h b/verification/util/flags.h index 38ad6c83f228575ce305f685fedc7bb7d3b4e3e8..aa4655b6776160d3591db46f7e841a97bac3f02e 100644 --- a/verification/util/flags.h +++ b/verification/util/flags.h @@ -142,4 +142,4 @@ protected: }; } // namespace panda::verifier -#endif //! PANDA_VERIFIER_UTIL_FLAGS_H__ +#endif // PANDA_VERIFIER_UTIL_FLAGS_H__ diff --git a/verification/util/mem.h b/verification/util/mem.h index 2273ebed3cc4307a2f8ae83dc41710ef5c89c22e..ac974fc36ae055439d2cc989543272148d1ba68d 100644 --- a/verification/util/mem.h +++ b/verification/util/mem.h @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) 2022 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. diff --git a/verification/util/optional_ref.h b/verification/util/optional_ref.h index 1437bc95c619aa548efbb1d1915c4a341235fdb5..452fab5e6503760ecdfa05c8cb3868f2e5c18fa2 100644 --- a/verification/util/optional_ref.h +++ b/verification/util/optional_ref.h @@ -72,9 +72,7 @@ public: return Get(); } - /** - * @brief The unsafe direction of const_cast, though without UB. Try to avoid using. - */ + /// @brief The unsafe direction of const_cast, though without UB. Try to avoid using. OptionalRef Unconst() const { return OptionalRef {value_}; diff --git a/verification/util/parser/charset.h b/verification/util/parser/charset.h index 5c1df6bc6e617605e7b474d4fb92801b9c41012c..e23c0d8fc9003207164c959b0f3897c018f76ab6 100644 --- a/verification/util/parser/charset.h +++ b/verification/util/parser/charset.h @@ -92,4 +92,4 @@ private: } // namespace panda::parser -#endif //! PANDA_VERIF_PARSER_CHARSET_H_ +#endif // PANDA_VERIF_PARSER_CHARSET_H_ diff --git a/verification/util/parser/parser.h b/verification/util/parser/parser.h index 2287a98502d644796ab581d3b94fe1b9d0357fa8..d6a936b38333f6ca1e555855c9d6cc03bdae23bb 100644 --- a/verification/util/parser/parser.h +++ b/verification/util/parser/parser.h @@ -393,4 +393,4 @@ using Parser = BaseParser; } // namespace panda::parser -#endif //! PANDA_VERIF_PARSER_H_ +#endif // PANDA_VERIF_PARSER_H_ diff --git a/verification/util/saturated_enum.h b/verification/util/saturated_enum.h index ddf7b8c4c4549fc72e639706daf1912c5ac75d39..3f173cf47470aa9af89a8c5b32ba727349a1129a 100644 --- a/verification/util/saturated_enum.h +++ b/verification/util/saturated_enum.h @@ -166,4 +166,4 @@ protected: } // namespace panda::verifier -#endif //! PANDA_VERIFIER_UTIL_SATURATED_ENUM_H__ +#endif // PANDA_VERIFIER_UTIL_SATURATED_ENUM_H__ diff --git a/verification/value/origin.h b/verification/value/origin.h index 3ebef2addfc7ca557a476c0bf7378b81c1ab3aba..0d8653973a4cec949d21d0ead8d1f6eae7bfa4fe 100644 --- a/verification/value/origin.h +++ b/verification/value/origin.h @@ -67,4 +67,4 @@ public: }; } // namespace panda::verifier -#endif //! PANDA_VERIFIER_VALUE_ORIGIN_H__ +#endif // PANDA_VERIFIER_VALUE_ORIGIN_H__ diff --git a/verification/verifier_messages_data.cpp b/verification/verifier_messages_data.cpp index 52ca7256178d5f0dae1e14b64a9ee9fdb3ae3d92..1336cdd7ece13897e220a08884ac157187d9d23d 100644 --- a/verification/verifier_messages_data.cpp +++ b/verification/verifier_messages_data.cpp @@ -1,2 +1,17 @@ +/** + * Copyright (c) 2023 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. + */ + // Work around a CMake bug, include generated C++ file #include "verification/verifier_messages_data_gen.cpp"