From 6bc2b795831181be7b911e100379fa7c830dd010 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Tue, 20 Jun 2023 14:38:16 +0800 Subject: [PATCH] Support calculating hash with platform independent interface Issue: I7EWSR Signed-off-by: gavin1012_hw Change-Id: I1945855dc1b018a514cd3a8e5eb2cf4ea47223d9 --- es2panda/binder/binder.cpp | 3 +- .../test-commonjs-main-func-args-expected.txt | 4 +-- .../base_mod.js | 6 ++-- .../expected.txt | 16 +++++----- .../add-anon-function/expected.txt | 2 +- .../add-dup-name-function/expected.txt | 2 +- .../add-two-anon-function/expected.txt | 4 +-- .../del-dup-add-anon-function/expected.txt | 2 +- .../expected.txt | 2 +- .../binder/test-func-naming-expected.txt | 20 ++++++------ .../test-function-with-this-expected.txt | 2 +- ...ace-enum-transformed-function-expected.txt | 14 ++++---- es2panda/util/helpers.cpp | 14 ++++++++ es2panda/util/helpers.h | 3 ++ es2panda/util/patchFix.cpp | 32 ++++++++----------- es2panda/util/patchFix.h | 5 +-- 16 files changed, 72 insertions(+), 59 deletions(-) diff --git a/es2panda/binder/binder.cpp b/es2panda/binder/binder.cpp index 53475854ca..ebf25d0f8b 100644 --- a/es2panda/binder/binder.cpp +++ b/es2panda/binder/binder.cpp @@ -55,7 +55,6 @@ #include "ir/ts/tsTypeParameterInstantiation.h" #include "util/concurrent.h" #include "util/patchFix.h" -#include "util/helpers.h" namespace panda::es2panda::binder { void Binder::InitTopScope() @@ -363,7 +362,7 @@ void Binder::BuildFunction(FunctionScope *funcScope, util::StringView name, cons // For anonymous, special-name and duplicate function, get its source and name, make hash code, // and make #hash_duplicateHashTime#name as its name; auto funcContentNameStr = func->SourceCode(this).Mutf8() + name.Mutf8(); - ss << ANONYMOUS_SPECIAL_DUPLICATE_FUNCTION_SPECIFIER << std::hash{}(funcContentNameStr); + ss << ANONYMOUS_SPECIAL_DUPLICATE_FUNCTION_SPECIFIER << util::Helpers::GetHashString(funcContentNameStr); auto res = functionHashNames_.find(funcContentNameStr); if (res != functionHashNames_.end()) { diff --git a/es2panda/test/bytecode/commonjs/test-commonjs-main-func-args-expected.txt b/es2panda/test/bytecode/commonjs/test-commonjs-main-func-args-expected.txt index 5c8f4f309f..7b14cad064 100644 --- a/es2panda/test/bytecode/commonjs/test-commonjs-main-func-args-expected.txt +++ b/es2panda/test/bytecode/commonjs/test-commonjs-main-func-args-expected.txt @@ -1,6 +1,6 @@ .language ECMAScript -.function any .#6142509188972423790#(any a0, any a1, any a2, any a3, any a4, any a5, any a6, any a7) { +.function any .#14695981039346656037#(any a0, any a1, any a2, any a3, any a4, any a5, any a6, any a7) { label_1: label_0: lda.str commonjsTest @@ -21,7 +21,7 @@ label_0: sta v0 ldobjbyname 0x1, apply sta v1 - definefunc 0x3, .#6142509188972423790#, 0x5 + definefunc 0x3, .#14695981039346656037#, 0x5 sta v2 createemptyarray 0x4 sta v3 diff --git a/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/base_mod.js b/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/base_mod.js index e09b6a533b..b5a54d3d93 100644 --- a/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/base_mod.js +++ b/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/base_mod.js @@ -16,9 +16,9 @@ // Test scenario: just modify anonymous function's content, no addition or deletion of anonymous functions in hotfix, // es2abc will keep the name in patch.abc same as base.abc. -// in hotfix patch, its name keeps -// as #9041263686285634408# other than #5678037123100335536# for first anonymous function -// as #8070990178058117078# other than #14150848034378622959# for second anonymous function +// in hotfix patch, special-name-function's name keeps the same as original +// #16327008318272898567# other than #4142007332460109178# for first anonymous function +// #7595881967332036965# other than #311697330876580632# for second anonymous function function A () { print("A2"); (()=>{ diff --git a/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/expected.txt b/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/expected.txt index 56547c0848..f6ebbeabe4 100644 --- a/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/expected.txt +++ b/es2panda/test/hotfix/hotfix-noerror/modify-anon-content-keep-origin-name/expected.txt @@ -13,12 +13,12 @@ .language ECMAScript -.function any .#8070990178058117078#(any a0, any a1, any a2) { +.function any .#16327008318272898567#(any a0, any a1, any a2) { label_1: label_0: tryldglobalbyname 0x0, print sta v0 - lda.str anonymous: 4 + lda.str anonymous: 2 sta v1 lda v0 callarg1 0x1, v1 @@ -27,12 +27,12 @@ label_0: label_2: } -.function any .#9041263686285634408#(any a0, any a1, any a2) { +.function any .#7595881967332036965#(any a0, any a1, any a2) { label_1: label_0: tryldglobalbyname 0x0, print sta v0 - lda.str anonymous: 2 + lda.str anonymous: 4 sta v1 lda v0 callarg1 0x1, v1 @@ -55,9 +55,9 @@ label_0: sta v1 lda v0 callarg1 0x1, v1 - definefunc 0x3, .#9041263686285634408#, 0x0 + definefunc 0x3, .#16327008318272898567#, 0x0 callarg0 0x4 - definefunc 0x6, .#8070990178058117078#, 0x0 + definefunc 0x6, .#7595881967332036965#, 0x0 callarg0 0x7 ldundefined returnundefined @@ -84,8 +84,8 @@ label_2: .function any .patch_main_1(any a0, any a1, any a2) { label_1: label_0: - definefunc 0x3, .#9041263686285634408#, 0x0 - definefunc 0x6, .#8070990178058117078#, 0x0 + definefunc 0x3, .#16327008318272898567#, 0x0 + definefunc 0x6, .#7595881967332036965#, 0x0 definefunc 0x0, .A, 0x0 returnundefined label_2: diff --git a/es2panda/test/hotfix/hotfix-throwerror/add-anon-function/expected.txt b/es2panda/test/hotfix/hotfix-throwerror/add-anon-function/expected.txt index b9f1fe56c7..d983d7b8f7 100644 --- a/es2panda/test/hotfix/hotfix-throwerror/add-anon-function/expected.txt +++ b/es2panda/test/hotfix/hotfix-throwerror/add-anon-function/expected.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#18285894206679515281# not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#13887853599761210546# not supported! [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/test/hotfix/hotfix-throwerror/add-dup-name-function/expected.txt b/es2panda/test/hotfix/hotfix-throwerror/add-dup-name-function/expected.txt index e715aa57ec..e90554a2fb 100644 --- a/es2panda/test/hotfix/hotfix-throwerror/add-dup-name-function/expected.txt +++ b/es2panda/test/hotfix/hotfix-throwerror/add-dup-name-function/expected.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#8673712528507858220#B not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#2599032559167169951#B not supported! [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/test/hotfix/hotfix-throwerror/add-two-anon-function/expected.txt b/es2panda/test/hotfix/hotfix-throwerror/add-two-anon-function/expected.txt index ed948cd399..cd418a508d 100644 --- a/es2panda/test/hotfix/hotfix-throwerror/add-two-anon-function/expected.txt +++ b/es2panda/test/hotfix/hotfix-throwerror/add-two-anon-function/expected.txt @@ -11,8 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#16597496927988530042# not supported! -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#13875230917451910345# not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#2883375060634092134# not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#3272928923455689677# not supported! [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/test/hotfix/hotfix-throwerror/del-dup-add-anon-function/expected.txt b/es2panda/test/hotfix/hotfix-throwerror/del-dup-add-anon-function/expected.txt index 20b7bd5808..d19d1b9fb7 100644 --- a/es2panda/test/hotfix/hotfix-throwerror/del-dup-add-anon-function/expected.txt +++ b/es2panda/test/hotfix/hotfix-throwerror/del-dup-add-anon-function/expected.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#12722007832241670856# not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function .#13944622105046532762# not supported! [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/test/hotfix/hotfix-throwerror/record-name-with-dots-throw-error/expected.txt b/es2panda/test/hotfix/hotfix-throwerror/record-name-with-dots-throw-error/expected.txt index 878d0559b6..3cf16d8361 100644 --- a/es2panda/test/hotfix/hotfix-throwerror/record-name-with-dots-throw-error/expected.txt +++ b/es2panda/test/hotfix/hotfix-throwerror/record-name-with-dots-throw-error/expected.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function record.name.with.dots.#9956324451753869683# not supported! +[Patch] Found new anonymous, special(containing '.' or '\') or duplicate name function record.name.with.dots.#13351732007776538668# not supported! [Patch] Found unsupported change in file, will not generate patch! Error: [base_mod.js:0:0] the size of programs is expected to be 1, but is 0 diff --git a/es2panda/test/parser/binder/test-func-naming-expected.txt b/es2panda/test/parser/binder/test-func-naming-expected.txt index 67fcceb5ff..793348b894 100644 --- a/es2panda/test/parser/binder/test-func-naming-expected.txt +++ b/es2panda/test/parser/binder/test-func-naming-expected.txt @@ -1,6 +1,6 @@ .language ECMAScript -.function any .#1026149943769461333#(any a0, any a1, any a2) { +.function any .#1016906796659230483#(any a0, any a1, any a2) { label_1: label_0: ldundefined @@ -8,7 +8,7 @@ label_0: label_2: } -.function any .#103306036873806529#(any a0, any a1, any a2) { +.function any .#1016906796659230483_1#(any a0, any a1, any a2) { label_1: label_0: ldundefined @@ -16,7 +16,7 @@ label_0: label_2: } -.function any .#4367845697697881801#(any a0, any a1, any a2) { +.function any .#1471473088249306135#(any a0, any a1, any a2) { label_1: label_0: ldundefined @@ -24,7 +24,7 @@ label_0: label_2: } -.function any .#4367845697697881801_1#(any a0, any a1, any a2) { +.function any .#5496465400387880830#(any a0, any a1, any a2) { label_1: label_0: ldundefined @@ -32,7 +32,7 @@ label_0: label_2: } -.function any .#6139272227607078344#aa(any a0, any a1, any a2) { +.function any .#7640569466637989364#aa(any a0, any a1, any a2) { label_1: label_0: ldundefined @@ -60,18 +60,18 @@ label_0: stglobalvar 0x1, aa definefunc 0x2, .name1, 0x0 sttoglobalrecord 0x3, name1 - definefunc 0x4, .#4367845697697881801#, 0x0 - definefunc 0x5, .#4367845697697881801_1#, 0x0 - definefunc 0x6, .#6139272227607078344#aa, 0x0 + definefunc 0x4, .#1016906796659230483#, 0x0 + definefunc 0x5, .#1016906796659230483_1#, 0x0 + definefunc 0x6, .#7640569466637989364#aa, 0x0 createobjectwithbuffer 0x7, _0 sta v0 - definefunc 0x8, .#103306036873806529#, 0x0 + definefunc 0x8, .#1471473088249306135#, 0x0 stownbyname 0x9, index.js, v0 lda v0 sttoglobalrecord 0xb, obj createobjectwithbuffer 0xc, _1 sta v0 - definefunc 0xd, .#1026149943769461333#, 0x0 + definefunc 0xd, .#5496465400387880830#, 0x0 stownbyname 0xe, \testcase, v0 lda v0 sttoglobalrecord 0x10, objBackslash diff --git a/es2panda/test/type_extractor/testcases/test-function-with-this-expected.txt b/es2panda/test/type_extractor/testcases/test-function-with-this-expected.txt index 904fc60c3c..ff02cec21a 100644 --- a/es2panda/test/type_extractor/testcases/test-function-with-this-expected.txt +++ b/es2panda/test/type_extractor/testcases/test-function-with-this-expected.txt @@ -1,6 +1,6 @@ ======> literal array buffer <====== ------------------------------------ -slot _.#10022928042193459397#dump_-1 +slot _.#13552676315192987081#dump_-1 { index: 0 tag: 0 diff --git a/es2panda/test/type_extractor/testcases/test-namespace-enum-transformed-function-expected.txt b/es2panda/test/type_extractor/testcases/test-namespace-enum-transformed-function-expected.txt index 624c19573f..735bf6a63e 100644 --- a/es2panda/test/type_extractor/testcases/test-namespace-enum-transformed-function-expected.txt +++ b/es2panda/test/type_extractor/testcases/test-namespace-enum-transformed-function-expected.txt @@ -1,6 +1,6 @@ ======> literal array buffer <====== ------------------------------------ -slot _.#6142509188972423790#_-1 +slot _.#14695981039346656037#_-1 { index: 0 tag: 0 @@ -22,7 +22,7 @@ slot _.#6142509188972423790#_-1 val: 255 }, ------------------------------------ -slot _.#6142509188972423790_1#_-1 +slot _.#14695981039346656037_1#_-1 { index: 0 tag: 0 @@ -44,7 +44,7 @@ slot _.#6142509188972423790_1#_-1 val: 255 }, ------------------------------------ -slot _.#6142509188972423790_2#_-1 +slot _.#14695981039346656037_2#_-1 { index: 0 tag: 0 @@ -66,7 +66,7 @@ slot _.#6142509188972423790_2#_-1 val: 254 }, ------------------------------------ -slot _.#6142509188972423790_3#_-1 +slot _.#14695981039346656037_3#_-1 { index: 0 tag: 0 @@ -88,7 +88,7 @@ slot _.#6142509188972423790_3#_-1 val: 255 }, ------------------------------------ -slot _.#6142509188972423790_4#_-1 +slot _.#14695981039346656037_4#_-1 { index: 0 tag: 0 @@ -110,7 +110,7 @@ slot _.#6142509188972423790_4#_-1 val: 254 }, ------------------------------------ -slot _.#6142509188972423790_5#_-1 +slot _.#14695981039346656037_5#_-1 { index: 0 tag: 0 @@ -132,7 +132,7 @@ slot _.#6142509188972423790_5#_-1 val: 255 }, ------------------------------------ -slot _.#6142509188972423790_6#_-1 +slot _.#14695981039346656037_6#_-1 { index: 0 tag: 0 diff --git a/es2panda/util/helpers.cpp b/es2panda/util/helpers.cpp index 40bbf1dae8..3eb0d69326 100644 --- a/es2panda/util/helpers.cpp +++ b/es2panda/util/helpers.cpp @@ -577,4 +577,18 @@ bool Helpers::SetFuncFlagsForDirectives(const ir::StringLiteral *strLit, ir::Scr return false; } +std::string Helpers::GetHashString(std::string str) +{ + uint64_t result = FNV_OFFSET; + + const uint8_t *input = reinterpret_cast(str.c_str()); + // FNV-1a 64-bit Algorithm + for (size_t i = 0; i < str.size(); i++) { + result ^= input[i]; + result *= FNV_PRIME; + } + + return std::to_string(result); +} + } // namespace panda::es2panda::util diff --git a/es2panda/util/helpers.h b/es2panda/util/helpers.h index 01d1dfa338..5d06cac59f 100644 --- a/es2panda/util/helpers.h +++ b/es2panda/util/helpers.h @@ -96,6 +96,7 @@ public: static T BaseName(T const &path, T const &delims = std::string(panda::os::file::File::GetPathDelim())); static bool ReadFileToBuffer(const std::string &file, std::stringstream &ss); static void ScanDirectives(ir::ScriptFunction *func, const lexer::LineIndex &lineIndex); + static std::string GetHashString(std::string str); static const uint32_t INVALID_INDEX = 4294967295L; static const uint32_t MAX_INT32 = 2147483647; @@ -103,6 +104,8 @@ public: static const uint32_t MAX_INT8 = std::numeric_limits::max(); static constexpr std::string_view SHOW_SOURCE = "show source"; static constexpr std::string_view USE_CONCURRENT = "use concurrent"; + static const uint64_t FNV_PRIME = 1099511628211U; + static const uint64_t FNV_OFFSET = 14695981039346656037U; private: static bool SetFuncFlagsForDirectives(const ir::StringLiteral *strLit, ir::ScriptFunction *func, const lexer::LineIndex &lineIndex); diff --git a/es2panda/util/patchFix.cpp b/es2panda/util/patchFix.cpp index 3808658f65..4a384100d5 100644 --- a/es2panda/util/patchFix.cpp +++ b/es2panda/util/patchFix.cpp @@ -76,8 +76,7 @@ void PatchFix::DumpModuleInfo(const std::string &recordName, { std::stringstream ss; ss << recordName << SymbolTable::SECOND_LEVEL_SEPERATOR; - auto hash = std::hash{}(ConvertLiteralToString(moduleBuffer)); - ss << hash << std::endl; + ss << Helpers::GetHashString(ConvertLiteralToString(moduleBuffer)) << std::endl; symbolTable_->WriteSymbolTable(ss.str()); } @@ -91,8 +90,7 @@ void PatchFix::ValidateModuleInfo(const std::string &recordName, return; } - auto hash = std::hash{}(ConvertLiteralToString(moduleBuffer)); - if (std::to_string(hash) != it->second) { + if (Helpers::GetHashString(ConvertLiteralToString(moduleBuffer)) != it->second) { std::cerr << "[Patch] Found import/export expression changed in " << recordName << ", not supported!" << std::endl; patchError_ = true; @@ -104,8 +102,7 @@ void PatchFix::DumpJsonContentRecInfo(const std::string &recordName, const std:: { std::stringstream ss; ss << recordName << SymbolTable::SECOND_LEVEL_SEPERATOR; - auto hash = std::hash{}(jsonFileContent); - ss << hash << std::endl; + ss << Helpers::GetHashString(jsonFileContent) << std::endl; symbolTable_->WriteSymbolTable(ss.str()); } @@ -119,8 +116,7 @@ void PatchFix::ValidateJsonContentRecInfo(const std::string &recordName, const s return; } - auto hash = std::hash{}(jsonFileContent); - if (std::to_string(hash) != it->second) { + if (Helpers::GetHashString(jsonFileContent) != it->second) { std::cerr << "[Patch] Found imported/required json file content changed in " << recordName << ", not supported!" << std::endl; patchError_ = true; @@ -151,11 +147,11 @@ void PatchFix::CollectFunctionsWithDefinedClasses(std::string funcName, std::str funcDefinedClasses_.insert({funcName, funcDefinedClasses}); } -std::vector> PatchFix::GenerateFunctionAndClassHash(panda::pandasm::Function *func, +std::vector> PatchFix::GenerateFunctionAndClassHash(panda::pandasm::Function *func, LiteralBuffers &literalBuffers) { std::stringstream ss; - std::vector> hashList; + std::vector> hashList; ss << ".function any " << func->name << '('; @@ -177,8 +173,8 @@ std::vector> PatchFix::GenerateFunctionAndClassHa CollectFunctionsWithDefinedClasses(func->name, ins.ids[0]); int64_t bufferIdx = GetLiteralIdxFromStringId(ins.ids[1]); std::string literalStr = ExpandLiteral(bufferIdx, literalBuffers); - auto classHash = std::hash{}(literalStr); - hashList.push_back(std::pair(ins.ids[0], classHash)); + auto classHash = Helpers::GetHashString(literalStr); + hashList.push_back(std::pair(ins.ids[0], classHash)); CollectClassMemberFunctions(ins.ids[0], bufferIdx, literalBuffers); } ss << " "; @@ -191,8 +187,8 @@ std::vector> PatchFix::GenerateFunctionAndClassHa << std::endl; } - auto funcHash = std::hash{}(ss.str()); - hashList.push_back(std::pair(func->name, funcHash)); + auto funcHash = Helpers::GetHashString(ss.str()); + hashList.push_back(std::pair(func->name, funcHash)); return hashList; } @@ -491,14 +487,14 @@ bool PatchFix::CompareLexenv(const std::string &funcName, const compiler::PandaG return true; } -bool PatchFix::CompareClassHash(std::vector> &hashList, +bool PatchFix::CompareClassHash(std::vector> &hashList, SymbolTable::OriginFunctionInfo &bytecodeInfo) { auto &classInfo = bytecodeInfo.classHash; for (size_t i = 0; i < hashList.size() - 1; ++i) { auto &className = hashList[i].first; auto classIter = classInfo.find(className); - if (classIter != classInfo.end() && classIter->second != std::to_string(hashList[i].second)) { + if (classIter != classInfo.end() && classIter->second != hashList[i].second) { if (IsColdFix()) { modifiedClassNames_.insert(className); continue; @@ -568,7 +564,7 @@ void PatchFix::HandleFunction(const compiler::PandaGen *pg, panda::pandasm::Func return; } - auto funcHash = std::to_string(hashList.back().second); + auto funcHash = hashList.back().second; if (funcName == funcMain0_) { if (IsHotFix()) { @@ -595,7 +591,7 @@ void PatchFix::DumpFunctionInfo(const compiler::PandaGen *pg, panda::pandasm::Fu ss << pg->InternalName(); ss << SymbolTable::SECOND_LEVEL_SEPERATOR << pg->InternalName() << SymbolTable::SECOND_LEVEL_SEPERATOR; - std::vector> hashList = GenerateFunctionAndClassHash(func, literalBuffers); + std::vector> hashList = GenerateFunctionAndClassHash(func, literalBuffers); ss << hashList.back().second << SymbolTable::SECOND_LEVEL_SEPERATOR; auto internalNameStr = pg->InternalName().Mutf8(); diff --git a/es2panda/util/patchFix.h b/es2panda/util/patchFix.h index 58ff22883c..3b255b2328 100644 --- a/es2panda/util/patchFix.h +++ b/es2panda/util/patchFix.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -82,7 +83,7 @@ private: void DumpFunctionInfo(const compiler::PandaGen *pg, panda::pandasm::Function *func, LiteralBuffers &literalBuffers); void HandleFunction(const compiler::PandaGen *pg, panda::pandasm::Function *func, LiteralBuffers &literalBuffers); void CollectFunctionsWithDefinedClasses(std::string funcName, std::string className); - std::vector> GenerateFunctionAndClassHash(panda::pandasm::Function *func, + std::vector> GenerateFunctionAndClassHash(panda::pandasm::Function *func, LiteralBuffers &literalBuffers); void DumpModuleInfo(const std::string &recordName, std::vector &moduleBuffer); @@ -101,7 +102,7 @@ private: bool IsAnonymousOrSpecialOrDuplicateFunction(const std::string &funcName); bool CompareLexenv(const std::string &funcName, const compiler::PandaGen *pg, SymbolTable::OriginFunctionInfo &bytecodeInfo); - bool CompareClassHash(std::vector> &hashList, + bool CompareClassHash(std::vector> &hashList, SymbolTable::OriginFunctionInfo &bytecodeInfo); void CollectClassMemberFunctions(const std::string &className, int64_t bufferIdx, LiteralBuffers &literalBuffers); std::vector GetLiteralMethods(int64_t bufferIdx, LiteralBuffers &literalBuffers); -- Gitee