From d0465704fa406b7bcf5652a5c5a30e9941afee0e Mon Sep 17 00:00:00 2001 From: huyunhui1 Date: Fri, 7 Feb 2025 16:48:36 +0800 Subject: [PATCH] Signed-off-by: huyunhui1 Change-Id: I6c946e862dc50d4ed5e382190a18b58a9373bdaa Change-Id: I16e549aed354e8079b2b9e6ce18ceb68d3ee9676 --- es2panda/aot/main.cpp | 3 +- es2panda/compiler/core/emitter/emitter.cpp | 16 ++--- es2panda/compiler/core/emitter/emitter.h | 2 +- .../compiler/debugger/debuginfoDumper.cpp | 24 +++----- es2panda/compiler/debugger/debuginfoDumper.h | 2 +- es2panda/compiler/templates/isa.h.erb | 41 +++++-------- es2panda/ir/irnode.h | 4 +- es2panda/util/commonUtil.h | 8 +-- es2panda/util/patchFix.cpp | 60 ++++++++----------- es2panda/util/patchFix.h | 6 +- merge_abc/src/assemblyDebugProto.cpp | 4 -- merge_abc/src/assemblyFunctionProto.cpp | 6 +- merge_abc/src/assemblyInsProto.cpp | 50 +++++++++------- merge_abc/src/assemblyInsProto.h | 4 +- 14 files changed, 102 insertions(+), 128 deletions(-) diff --git a/es2panda/aot/main.cpp b/es2panda/aot/main.cpp index d15e3db20..32474d7c3 100644 --- a/es2panda/aot/main.cpp +++ b/es2panda/aot/main.cpp @@ -145,12 +145,13 @@ static void DumpProgramInfos(const std::mapprogram); } - +#endif if (compilerOptions.dumpAsm) { es2panda::Compiler::DumpAsm(&(progInfo.second->program)); } diff --git a/es2panda/compiler/core/emitter/emitter.cpp b/es2panda/compiler/core/emitter/emitter.cpp index 761954307..4e017d5c5 100644 --- a/es2panda/compiler/core/emitter/emitter.cpp +++ b/es2panda/compiler/core/emitter/emitter.cpp @@ -199,11 +199,6 @@ void FunctionEmitter::GenInstructionDebugInfo(const IRNode *ins, panda::pandasm: if (pg_->IsDebug()) { size_t insLen = GetIRNodeWholeLength(ins); - if (insLen != 0) { - pandaIns->ins_debug.bound_left = offset_; - pandaIns->ins_debug.bound_right = offset_ + insLen; - } - offset_ += insLen; pandaIns->ins_debug.column_number = columnNum; } @@ -214,10 +209,9 @@ void FunctionEmitter::GenFunctionInstructions() func_->ins.reserve(pg_->Insns().size()); for (const auto *ins : pg_->Insns()) { - auto &pandaIns = func_->ins.emplace_back(); - - ins->Transform(&pandaIns); - GenInstructionDebugInfo(ins, &pandaIns); + auto *pandaIns = ins->Transform(); + func_->ins.push_back(pandaIns); + GenInstructionDebugInfo(ins, pandaIns); } } @@ -723,8 +717,8 @@ void Emitter::DumpAsm(const panda::pandasm::Program *prog) ss << ") {" << std::endl; - for (const auto &ins : func.ins) { - ss << (ins.set_label ? "" : "\t") << ins.ToString("", true, func.GetTotalRegs()) << std::endl; + for (const auto *ins : func.ins) { + ss << (ins->IsLabel() ? "" : "\t") << ins->ToString("", true, func.GetTotalRegs()) << std::endl; } ss << "}" << std::endl << std::endl; diff --git a/es2panda/compiler/core/emitter/emitter.h b/es2panda/compiler/core/emitter/emitter.h index 124ec1d4a..f68e55a15 100644 --- a/es2panda/compiler/core/emitter/emitter.h +++ b/es2panda/compiler/core/emitter/emitter.h @@ -34,7 +34,7 @@ namespace panda::pandasm { struct Program; struct Function; -struct Ins; +class Ins; struct Record; } // namespace panda::pandasm diff --git a/es2panda/compiler/debugger/debuginfoDumper.cpp b/es2panda/compiler/debugger/debuginfoDumper.cpp index cc15388e7..b211e74d9 100644 --- a/es2panda/compiler/debugger/debuginfoDumper.cpp +++ b/es2panda/compiler/debugger/debuginfoDumper.cpp @@ -60,7 +60,7 @@ void DebugInfoDumper::WrapArray(const char *name, const std::vector &array, b for (elem = array.begin(); elem != array.end(); ++elem) { Indent(); // NOLINTNEXTLINE - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { WriteIns(*elem); // NOLINTNEXTLINE } else if constexpr (std::is_same_v) { @@ -91,25 +91,19 @@ void DebugInfoDumper::WrapArray(const char *name, const std::vector &array, b ss_ << "]" << PutComma(comma); } -void DebugInfoDumper::WriteIns(const pandasm::Ins &ins) +void DebugInfoDumper::WriteIns(const pandasm::Ins *ins) { ss_ << "{"; - { - pandasm::Ins insCopy; - insCopy.opcode = ins.opcode; - insCopy.set_label = ins.set_label; - insCopy.label = ins.label; - WriteProperty("opcode", insCopy.ToString()); - } + WriteProperty("opcode", ins->OpcodeToString()); indent_++; - WrapArray("regs", ins.regs); - WrapArray("ids", ins.ids); - WrapArray("imms", ins.imms); + WrapArray("regs", ins->Regs()); + WrapArray("ids", ins->Ids()); + WrapArray("imms", ins->Imms()); ss_ << std::endl; Indent(); ss_ << "\"label\": " - << "\"" << ins.label << "\","; - WritePosInfo(ins.ins_debug); + << "\"" << (ins->IsLabel() ? static_cast(ins)->Label() : "") << "\","; + WritePosInfo(ins->ins_debug); indent_--; Indent(); ss_ << "}"; @@ -134,8 +128,6 @@ void DebugInfoDumper::WritePosInfo(const pandasm::debuginfo::Ins &posInfo) ss_ << std::endl; Indent(); ss_ << "\"debug_pos_info\": {"; - WriteProperty("boundLeft", posInfo.bound_left); - WriteProperty("boundRight", posInfo.bound_right); WriteProperty("sourceLineNum", static_cast(posInfo.line_number), false); Indent(); ss_ << "}" << std::endl; diff --git a/es2panda/compiler/debugger/debuginfoDumper.h b/es2panda/compiler/debugger/debuginfoDumper.h index a9d0aecf5..88e492f3f 100644 --- a/es2panda/compiler/debugger/debuginfoDumper.h +++ b/es2panda/compiler/debugger/debuginfoDumper.h @@ -36,7 +36,7 @@ public: private: template void WrapArray(const char *name, const std::vector &array, bool comma = true); - void WriteIns(const pandasm::Ins &ins); + void WriteIns(const pandasm::Ins *ins); void WriteMetaData(const std::vector &metaData); void WriteProperty(const char *key, const Value &value, bool comma = true); void WritePosInfo(const pandasm::debuginfo::Ins &posInfo); diff --git a/es2panda/compiler/templates/isa.h.erb b/es2panda/compiler/templates/isa.h.erb index 9d5137be1..eeaef9e91 100644 --- a/es2panda/compiler/templates/isa.h.erb +++ b/es2panda/compiler/templates/isa.h.erb @@ -57,11 +57,9 @@ public: return 0; } - void Transform(pandasm::Ins *ins) const override + pandasm::Ins *Transform() const override { - ins->opcode = pandasm::Opcode::INVALID; - ins->set_label = true; - ins->label = id_; + return new pandasm::LabelIns(id_); } ICSlot SetIcSlot(IcSizeType currentSlot) override @@ -236,30 +234,21 @@ public: return <%= reg_cnt %>; } - void Transform(pandasm::Ins* ins) const override + pandasm::Ins *Transform() const override { - ins->opcode = pandasm::Opcode::<%= node_kind %>; -% if op_map['reg'].length != 0 - ins->regs.reserve(<%= op_map['reg'].length %>); -% end -% if op_map['imm'].length != 0 - ins->imms.reserve(<%= op_map['imm'].length %>); -% end -% if op_map['str'].length + op_map['lbl'].length != 0 - ins->ids.reserve(<%= op_map['str'].length + op_map['lbl'].length %>); -% end -% for reg in op_map['reg'] - ins->regs.emplace_back(<%= reg %>); -% end -% for imm in op_map['imm'] - ins->imms.emplace_back(<%= imm %>); -% end -% for str in op_map['str'] - ins->ids.emplace_back(<%= str %>.Mutf8()); -% end -% for lbl in op_map['lbl'] - ins->ids.emplace_back(<%= lbl %>->Id()); +% pa_ins_args_list = Array.new +% ctor_arg_list.each do |arg| +% type = arg.split(" ")[0] +% name = arg.split(" ")[1] +% if type == "util::StringView" +% pa_ins_args_list.push("#{name}_.Mutf8()") +% elsif type == "Label*" +% pa_ins_args_list.push("#{name}_->Id()") +% else +% pa_ins_args_list.push("#{name}_") +% end % end + return new pandasm::<%= class_name %>(<%= pa_ins_args_list.join(", ") %>); } ICSlot SetIcSlot(IcSizeType slot) override diff --git a/es2panda/ir/irnode.h b/es2panda/ir/irnode.h index 576c50cbf..bde613106 100644 --- a/es2panda/ir/irnode.h +++ b/es2panda/ir/irnode.h @@ -33,7 +33,7 @@ class AstNode; } // namespace panda::es2panda::ir namespace panda::pandasm { -struct Ins; +class Ins; } // namespace panda::pandasm namespace panda::es2panda::compiler { @@ -120,7 +120,7 @@ public: virtual Formats GetFormats() const = 0; virtual size_t Registers([[maybe_unused]] std::array *regs) = 0; virtual size_t Registers([[maybe_unused]] std::array *regs) const = 0; - virtual void Transform(panda::pandasm::Ins *ins) const = 0; + virtual panda::pandasm::Ins *Transform() const = 0; virtual ICSlot SetIcSlot(IcSizeType currentSlot) = 0; virtual bool InlineCacheEnabled() = 0; virtual ICSlot GetIcSlot() = 0; diff --git a/es2panda/util/commonUtil.h b/es2panda/util/commonUtil.h index 8bcef4ec8..ee1c5924a 100644 --- a/es2panda/util/commonUtil.h +++ b/es2panda/util/commonUtil.h @@ -100,15 +100,15 @@ void VisitDyanmicImports(ConstReferenceIf function, // The dynamicimport bytecode should not have label, otherwise the dyanmicimport might be a jump // target and its parameter is a variable instead of a constant string expression (Check // AbcCodeProcessor::AddJumpLabels for more details). - if (iter->opcode != pandasm::Opcode::DYNAMICIMPORT || iter->set_label) { + if ((*iter)->opcode != pandasm::Opcode::DYNAMICIMPORT || (*iter)->IsLabel()) { continue; } auto prevIns = iter - 1; - if (prevIns->opcode != pandasm::Opcode::LDA_STR) { + if ((*prevIns)->opcode != pandasm::Opcode::LDA_STR) { continue; } - ASSERT(prevIns->ids.size() == 1); - cb(prevIns->ids[0]); // 0: index of the string in lda.str bytecode + ASSERT((*prevIns)->Ids().size() == 1); + cb((*prevIns)->Ids()[0]); // 0: index of the string in lda.str bytecode } } } // namespace panda::es2panda::util diff --git a/es2panda/util/patchFix.cpp b/es2panda/util/patchFix.cpp index 69c7add25..41d7be585 100644 --- a/es2panda/util/patchFix.cpp +++ b/es2panda/util/patchFix.cpp @@ -184,19 +184,19 @@ std::vector> PatchFix::GenerateFunctionAndCl } ss << ") {" << std::endl; - for (const auto &ins : func->ins) { - ss << (ins.set_label ? "" : "\t") << ins.ToString("", true, func->GetTotalRegs()) << " "; - if (ins.opcode == panda::pandasm::Opcode::CREATEARRAYWITHBUFFER || - ins.opcode == panda::pandasm::Opcode::CREATEOBJECTWITHBUFFER) { - int64_t bufferIdx = GetLiteralIdxFromStringId(ins.ids[0]); + for (const auto *ins : func->ins) { + ss << (ins->IsLabel() ? "" : "\t") << ins->ToString("", true, func->GetTotalRegs()) << " "; + if (ins->opcode == panda::pandasm::Opcode::CREATEARRAYWITHBUFFER || + ins->opcode == panda::pandasm::Opcode::CREATEOBJECTWITHBUFFER) { + int64_t bufferIdx = GetLiteralIdxFromStringId(ins->Ids()[0]); ss << ExpandLiteral(bufferIdx, literalBuffers) << " "; - } else if (ins.opcode == panda::pandasm::Opcode::DEFINECLASSWITHBUFFER) { - CollectFunctionsWithDefinedClasses(func->name, ins.ids[0]); - int64_t bufferIdx = GetLiteralIdxFromStringId(ins.ids[1]); + } else if (ins->opcode == panda::pandasm::Opcode::DEFINECLASSWITHBUFFER) { + CollectFunctionsWithDefinedClasses(func->name, ins->Ids()[0]); + int64_t bufferIdx = GetLiteralIdxFromStringId(ins->Ids()[1]); std::string literalStr = ExpandLiteral(bufferIdx, literalBuffers); auto classHash = Helpers::GetHashString(literalStr); - hashList.push_back(std::pair(ins.ids[0], classHash)); - CollectClassMemberFunctions(ins.ids[0], bufferIdx, literalBuffers); + hashList.push_back(std::pair(ins->Ids()[0], classHash)); + CollectClassMemberFunctions(ins->Ids()[0], bufferIdx, literalBuffers); } ss << " "; } @@ -328,19 +328,19 @@ uint32_t PatchFix::GetPatchLexicalIdx(const std::string &variableName) return topScopeLexEnvs_[variableName]; } -bool IsFunctionOrClassDefineIns(panda::pandasm::Ins &ins) +bool IsFunctionOrClassDefineIns(panda::pandasm::Ins *ins) { - if (ins.opcode == panda::pandasm::Opcode::DEFINEMETHOD || - ins.opcode == panda::pandasm::Opcode::DEFINEFUNC || - ins.opcode == panda::pandasm::Opcode::DEFINECLASSWITHBUFFER) { + if (ins->opcode == panda::pandasm::Opcode::DEFINEMETHOD || + ins->opcode == panda::pandasm::Opcode::DEFINEFUNC || + ins->opcode == panda::pandasm::Opcode::DEFINECLASSWITHBUFFER) { return true; } return false; } -bool IsStPatchVarIns(panda::pandasm::Ins &ins) +bool IsStPatchVarIns(panda::pandasm::Ins *ins) { - return ins.opcode == panda::pandasm::Opcode::WIDE_STPATCHVAR; + return ins->opcode == panda::pandasm::Opcode::WIDE_STPATCHVAR; } void PatchFix::CollectFuncDefineIns(panda::pandasm::Function *func) @@ -386,30 +386,22 @@ void PatchFix::HandleModifiedDefinedClassFunc(panda::pandasm::Program *prog) } } -void PatchFix::AddHeadAndTailInsForPatchFuncMain0(std::vector &ins) +void PatchFix::AddHeadAndTailInsForPatchFuncMain0(std::vector &ins) { - panda::pandasm::Ins returnUndefine; - returnUndefine.opcode = pandasm::Opcode::RETURNUNDEFINED; - + auto returnUndefined = new pandasm::Returnundefined(); if (ins.size() == 0) { - ins.push_back(returnUndefine); + ins.push_back(returnUndefined); return; } - panda::pandasm::Ins newLexenv; - newLexenv.opcode = pandasm::Opcode::NEWLEXENV; - newLexenv.imms.reserve(1); - auto newFuncNum = long(ins.size() / 2); // each new function has 2 ins: define and store - newLexenv.imms.emplace_back(newFuncNum); - + auto newLexenv = new pandasm::Newlexenv(long(ins.size() / 2)); // each new function has 2 ins: define and stor ins.insert(ins.begin(), newLexenv); - ins.push_back(returnUndefine); + ins.push_back(returnUndefined); } -void PatchFix::AddTailInsForPatchFuncMain1(std::vector &ins) +void PatchFix::AddTailInsForPatchFuncMain1(std::vector &ins) { - panda::pandasm::Ins returnUndefined; - returnUndefined.opcode = pandasm::Opcode::RETURNUNDEFINED; + auto returnUndefined = new pandasm::Returnundefined(); ins.push_back(returnUndefined); } @@ -424,12 +416,12 @@ void PatchFix::CreateFunctionPatchMain0AndMain1(panda::pandasm::Function &patchF patchFuncMain1.params.emplace_back(panda::pandasm::Type("any", 0), SRC_LANG); } - std::vector patchMain0DefineIns; - std::vector patchMain1DefineIns; + std::vector patchMain0DefineIns; + std::vector patchMain1DefineIns; for (size_t i = 0; i < funcDefineIns_.size(); ++i) { if (IsFunctionOrClassDefineIns(funcDefineIns_[i])) { - auto &name = funcDefineIns_[i].ids[0]; + auto name = funcDefineIns_[i]->Ids()[0]; if (newFuncNames_.count(name) && IsStPatchVarIns(funcDefineIns_[i + 1])) { patchMain0DefineIns.push_back(funcDefineIns_[i]); patchMain0DefineIns.push_back(funcDefineIns_[i + 1]); diff --git a/es2panda/util/patchFix.h b/es2panda/util/patchFix.h index f1dfdd508..f5979e4fe 100644 --- a/es2panda/util/patchFix.h +++ b/es2panda/util/patchFix.h @@ -99,8 +99,8 @@ private: std::string ExpandLiteral(int64_t bufferIdx, LiteralBuffers &literalBuffers); std::string ConvertLiteralToString(std::vector &literalBuffer); void CollectFuncDefineIns(panda::pandasm::Function *func); - void AddHeadAndTailInsForPatchFuncMain0(std::vector &ins); - void AddTailInsForPatchFuncMain1(std::vector &ins); + void AddHeadAndTailInsForPatchFuncMain0(std::vector &ins); + void AddTailInsForPatchFuncMain1(std::vector &ins); void CreateFunctionPatchMain0AndMain1(panda::pandasm::Function &patchFuncMain0, panda::pandasm::Function &patchFuncMain1); bool IsAnonymousOrSpecialOrDuplicateFunction(const std::string &funcName); @@ -134,7 +134,7 @@ private: ArenaUnorderedMap topScopeLexEnvs_; ArenaSet patchFuncNames_; ArenaSet newFuncNames_; - ArenaVector funcDefineIns_; + ArenaVector funcDefineIns_; ArenaSet modifiedClassNames_; ArenaUnorderedMap> classMemberFunctions_; ArenaUnorderedMap> funcDefinedClasses_; diff --git a/merge_abc/src/assemblyDebugProto.cpp b/merge_abc/src/assemblyDebugProto.cpp index 5fad0e562..0be9fbf1f 100644 --- a/merge_abc/src/assemblyDebugProto.cpp +++ b/merge_abc/src/assemblyDebugProto.cpp @@ -20,16 +20,12 @@ void DebuginfoIns::Serialize(const panda::pandasm::debuginfo::Ins &debug, protoP { protoDebug.set_linenumber(debug.line_number); protoDebug.set_columnnumber(debug.column_number); - protoDebug.set_boundleft(debug.bound_left); - protoDebug.set_boundright(debug.bound_right); } void DebuginfoIns::Deserialize(const protoPanda::DebuginfoIns &protoDebug, panda::pandasm::debuginfo::Ins &debug) { debug.line_number = protoDebug.linenumber(); debug.column_number = protoDebug.columnnumber(); - debug.bound_left = protoDebug.boundleft(); - debug.bound_right = protoDebug.boundright(); } void LocalVariable::Serialize(const panda::pandasm::debuginfo::LocalVariable &debug, diff --git a/merge_abc/src/assemblyFunctionProto.cpp b/merge_abc/src/assemblyFunctionProto.cpp index 6e489737e..4ea451ed7 100644 --- a/merge_abc/src/assemblyFunctionProto.cpp +++ b/merge_abc/src/assemblyFunctionProto.cpp @@ -58,7 +58,7 @@ void Function::Serialize(const panda::pandasm::Function &function, protoPanda::F Label::Serialize(label, *protoLabel); } - for (const auto &insn : function.ins) { + for (const auto *insn : function.ins) { auto *protoIns = protoFunction.add_ins(); Ins::Serialize(insn, *protoIns); } @@ -123,9 +123,9 @@ void Function::DeserializeProtoIns(const protoPanda::Function &protoFunction, pa { function.ins.reserve(protoFunction.ins_size()); for (const auto &protoIns : protoFunction.ins()) { - panda::pandasm::Ins ins; + panda::pandasm::Ins *ins {nullptr}; Ins::Deserialize(protoIns, ins); - function.ins.emplace_back(std::move(ins)); + function.ins.emplace_back(ins); } } diff --git a/merge_abc/src/assemblyInsProto.cpp b/merge_abc/src/assemblyInsProto.cpp index c1016ef04..4b3910faf 100644 --- a/merge_abc/src/assemblyInsProto.cpp +++ b/merge_abc/src/assemblyInsProto.cpp @@ -16,16 +16,16 @@ #include "assemblyInsProto.h" namespace panda::proto { -void Ins::Serialize(const panda::pandasm::Ins &insn, protoPanda::Ins &protoInsn) +void Ins::Serialize(const panda::pandasm::Ins *insn, protoPanda::Ins &protoInsn) { - protoInsn.set_opcode(static_cast(insn.opcode)); - for (const auto ® : insn.regs) { + protoInsn.set_opcode(static_cast(insn->opcode)); + for (const auto ® : insn->Regs()) { protoInsn.add_regs(static_cast(reg)); } - for (const auto &str : insn.ids) { + for (const auto &str : insn->Ids()) { protoInsn.add_ids(str); } - for (const auto &imm : insn.imms) { + for (const auto &imm : insn->Imms()) { auto *protoImm = protoInsn.add_imms(); switch (static_cast(imm.index() + 1)) { // 1: enum TypeCase start from 1 case protoPanda::Ins_IType::kValueInt: @@ -38,41 +38,51 @@ void Ins::Serialize(const panda::pandasm::Ins &insn, protoPanda::Ins &protoInsn) UNREACHABLE(); } } - protoInsn.set_label(insn.label); - protoInsn.set_setlabelval(insn.set_label); + protoInsn.set_label(insn->IsLabel() ? static_cast(insn)->Label() : ""); + protoInsn.set_setlabelval(insn->IsLabel()); auto *protoDebug = protoInsn.mutable_insdebug(); - DebuginfoIns::Serialize(insn.ins_debug, *protoDebug); + DebuginfoIns::Serialize(insn->ins_debug, *protoDebug); } -void Ins::Deserialize(const protoPanda::Ins &protoInsn, panda::pandasm::Ins &insn) +void Ins::Deserialize(const protoPanda::Ins &protoInsn, panda::pandasm::Ins *&insn) { - insn.opcode = static_cast(protoInsn.opcode()); - insn.regs.reserve(protoInsn.regs_size()); + auto opcode = static_cast(protoInsn.opcode()); + std::vector regs; + regs.reserve(protoInsn.regs_size()); for (const auto &protoReg : protoInsn.regs()) { - insn.regs.push_back(static_cast(protoReg)); + regs.push_back(static_cast(protoReg)); } - insn.ids.reserve(protoInsn.ids_size()); + std::vector ids; + ids.reserve(protoInsn.ids_size()); for (const auto &protoId : protoInsn.ids()) { - insn.ids.push_back(protoId); + ids.push_back(protoId); } - insn.imms.reserve(protoInsn.imms_size()); + std::vector imms; + imms.reserve(protoInsn.imms_size()); for (const auto &protoImm : protoInsn.imms()) { switch (protoImm.type_case()) { case protoPanda::Ins_IType::kValueInt: { - insn.imms.push_back(protoImm.valueint()); + imms.push_back(protoImm.valueint()); break; } case protoPanda::Ins_IType::kValueDouble: { - insn.imms.push_back(protoImm.valuedouble()); + imms.push_back(protoImm.valuedouble()); break; } default: UNREACHABLE(); } } - insn.label = protoInsn.label(); - insn.set_label = protoInsn.setlabelval(); + + auto set_label = protoInsn.setlabelval(); + if (set_label) { + auto label = protoInsn.label(); + insn = new pandasm::LabelIns(label); + } else { + insn = pandasm::Ins::CreateIns(opcode, regs, imms, ids); + } + const protoPanda::DebuginfoIns &protoDebugInfoIns = protoInsn.insdebug(); - DebuginfoIns::Deserialize(protoDebugInfoIns, insn.ins_debug); + DebuginfoIns::Deserialize(protoDebugInfoIns, insn->ins_debug); } } // panda::proto diff --git a/merge_abc/src/assemblyInsProto.h b/merge_abc/src/assemblyInsProto.h index 05053d5de..beeb05013 100644 --- a/merge_abc/src/assemblyInsProto.h +++ b/merge_abc/src/assemblyInsProto.h @@ -23,8 +23,8 @@ namespace panda::proto { class Ins { public: - static void Serialize(const panda::pandasm::Ins &insn, protoPanda::Ins &protoInsn); - static void Deserialize(const protoPanda::Ins &protoInsn, panda::pandasm::Ins &insn); + static void Serialize(const panda::pandasm::Ins *insn, protoPanda::Ins &protoInsn); + static void Deserialize(const protoPanda::Ins &protoInsn, panda::pandasm::Ins *&insn); }; } // panda::proto #endif -- Gitee