From 2b6e4624bf2c104114ffa1bec749035443abf9d9 Mon Sep 17 00:00:00 2001 From: zhongmingwei Date: Wed, 18 Jun 2025 22:52:10 +0800 Subject: [PATCH] Fix external annotation record bug Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICG727 Description: Fix external annotation record bug Signed-off-by: zhongmingwei Change-Id: I788f4c17cb6a9fdb1d743445862b5c880a465ea9 --- es2panda/binder/binder.cpp | 5 +- es2panda/compiler/core/compileQueue.cpp | 11 +- es2panda/compiler/core/emitter/emitter.cpp | 3 +- es2panda/ir/statements/classDeclaration.cpp | 4 +- es2panda/parser/statementParser.cpp | 9 +- .../hap-file-exec-expected.pa.txt | 32 +-- .../hap-file-exec-expected.pa.txt | 48 ++-- .../inter-app-hsp-file-exec-expected.pa.txt | 32 +-- .../abcinputs/bytecodehar.txt | 2 + .../exportAnno.ts | 21 ++ .../importAnno-exec-expected.pa.txt | 254 ++++++++++++++++++ .../importAnno-exec.ts | 23 ++ .../recordnames.txt | 2 + .../hap-file-exec-expected.pa.txt | 52 ++-- .../hap-file-exec-expected.pa.txt | 32 +-- .../hap-file-exec-expected.pa.txt | 48 ++-- .../hap-file-exec-expected.pa.txt | 64 ++--- es2panda/test/runner.py | 3 + es2panda/util/commonUtil.h | 2 +- es2panda/util/helpers.cpp | 4 +- es2panda/util/helpers.h | 2 +- 21 files changed, 486 insertions(+), 167 deletions(-) create mode 100644 es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/abcinputs/bytecodehar.txt create mode 100644 es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/exportAnno.ts create mode 100644 es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec-expected.pa.txt create mode 100644 es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec.ts create mode 100644 es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/recordnames.txt diff --git a/es2panda/binder/binder.cpp b/es2panda/binder/binder.cpp index 612e64e4b0..feef8b90b7 100644 --- a/es2panda/binder/binder.cpp +++ b/es2panda/binder/binder.cpp @@ -49,6 +49,7 @@ #include "ir/ts/tsSignatureDeclaration.h" #include "ir/ts/tsTypeParameterDeclaration.h" #include "ir/ts/tsTypeParameterInstantiation.h" +#include "util/commonUtil.h" #include "util/concurrent.h" namespace panda::es2panda::binder { @@ -732,8 +733,8 @@ void Binder::ResolveReference(const ir::AstNode *parent, ir::AstNode *childNode) } else if (!res.variable->Declaration()->Node()->IsClassDefinition()) { ThrowInvalidAnnotationDeclaration(annotation->Start(), annotation->Name()); } - } else if (annoName.find_first_of(".") != std::string::npos) { - auto importName = annoName.substr(0, annoName.find_first_of(".")); + } else if (annoName.find_first_of(util::ANNOTATION_QUALIFIED_NAME_SEPARATOR) != std::string::npos) { + auto importName = annoName.substr(0, annoName.find_first_of(util::ANNOTATION_QUALIFIED_NAME_SEPARATOR)); ScopeFindResult res = scope_->Find(util::StringView(importName), bindingOptions_); if (res.variable != nullptr && res.variable->Declaration()->Node()->IsImportNamespaceSpecifier()) { annotation->SetIsImported(); diff --git a/es2panda/compiler/core/compileQueue.cpp b/es2panda/compiler/core/compileQueue.cpp index 5abe071217..bd39c4af4f 100644 --- a/es2panda/compiler/core/compileQueue.cpp +++ b/es2panda/compiler/core/compileQueue.cpp @@ -258,7 +258,13 @@ void CompileAbcClassJob::Run() auto name = compiler_.GetAbcFile().GetFilename(); name += util::CHAR_VERTICAL_LINE + program->record_table.begin()->first; auto *cache = allocator_->New(src_->hash, std::move(*program), true); - progsInfo_.emplace(name, cache); + if (progsInfo_.count(name) && !compiler_.ClassIdIsExternal(classId_) && + progsInfo_[name]->program.record_table.begin()->second.metadata->IsForeign()) { + progsInfo_[name] = cache; + } + else { + progsInfo_.emplace(name, cache); + } } panda::Timer::timerEnd(panda::EVENT_UPDATE_ABC_PROG_CACHE, record_name); @@ -422,7 +428,8 @@ void CompileAbcClassQueue::Schedule() auto classIds = compiler_.GetAbcFile().GetClasses(); bool needUpdateVersion = NeedUpdateVersion(); for (size_t i = 0; i != classIds.size(); ++i) { - if (!compiler_.CheckClassId(classIds[i], i)) { + if (!compiler_.CheckClassId(classIds[i], i, + util::Helpers::IsSupportAnnotationVersion(options_.targetApiVersion))) { continue; } diff --git a/es2panda/compiler/core/emitter/emitter.cpp b/es2panda/compiler/core/emitter/emitter.cpp index 1041491304..32c26dca20 100644 --- a/es2panda/compiler/core/emitter/emitter.cpp +++ b/es2panda/compiler/core/emitter/emitter.cpp @@ -38,6 +38,7 @@ #include #include #include +#include namespace panda::es2panda::compiler { @@ -394,7 +395,7 @@ pandasm::AnnotationData FunctionEmitter::CreateAnnotation(const ir::Annotation * { std::string annoName = std::string(anno->Name()); if (pg_->Context()->IsMergeAbc()) { - std::string prefix = std::string(pg_->Context()->RecordName()) + "."; + std::string prefix = std::string(pg_->Context()->RecordName()) + std::string(pandasm::RECORD_ANNOTATION_SEPARATOR); annoName.insert(0, prefix); } pandasm::AnnotationData annotation(annoName); diff --git a/es2panda/ir/statements/classDeclaration.cpp b/es2panda/ir/statements/classDeclaration.cpp index 9930632b15..4afad04e1c 100644 --- a/es2panda/ir/statements/classDeclaration.cpp +++ b/es2panda/ir/statements/classDeclaration.cpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace panda::es2panda::ir { @@ -53,7 +54,8 @@ void ClassDeclaration::Compile(compiler::PandaGen *pg) const if (isAnnotationDecl_) { std::string annoName = std::string(def_->GetName()); if (pg->Context()->IsMergeAbc()) { - std::string prefix = std::string(pg->Context()->RecordName()) + "."; + std::string prefix = + std::string(pg->Context()->RecordName()) + std::string(pandasm::RECORD_ANNOTATION_SEPARATOR); annoName.insert(0, prefix); } pg->Context()->GetEmitter()->AddAnnotationRecord(annoName, this); diff --git a/es2panda/parser/statementParser.cpp b/es2panda/parser/statementParser.cpp index b158dbae4e..63708f7ce9 100644 --- a/es2panda/parser/statementParser.cpp +++ b/es2panda/parser/statementParser.cpp @@ -2610,11 +2610,14 @@ ir::ExportNamedDeclaration *ParserImpl::ParseExportNamedSpecifiers(const lexer:: } lexer::Token localToken = lexer_->GetToken(); + auto *local = AllocNode(lexer_->GetToken().Ident()); if (program_.IsEnableAnnotations() && CheckAnnotationPrefix(lexer_->GetToken().Ident())) { - localToken.SetIdent(lexer_->GetToken().Ident().Substr(std::strlen(ir::Annotation::annotationPrefix), - lexer_->GetToken().Ident().Length())); + auto annotationName = lexer_->GetToken().Ident().Substr(std::strlen(ir::Annotation::annotationPrefix), + lexer_->GetToken().Ident().Length()); + localToken.SetIdent(annotationName); + local->SetName(annotationName); } - auto *local = AllocNode(lexer_->GetToken().Ident()); + local->SetRange(lexer_->GetToken().Loc()); if (Extension() == ScriptExtension::TS) { diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-accuate-version-update/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-accuate-version-update/hap-file-exec-expected.pa.txt index 6f146bddc0..c7666a78bd 100644 --- a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-accuate-version-update/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-accuate-version-update/hap-file-exec-expected.pa.txt @@ -84,7 +84,7 @@ slotNum = 0x7 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2514, 0x0, v0 + defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2516, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -92,9 +92,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2466 +slot &bytecodehar/bytecodehar-dynamic-import&_2468 ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2470 +slot &bytecodehar/bytecodehar-dynamic-import&_2472 { index: 0 tag: 2 @@ -146,7 +146,7 @@ slot &bytecodehar/bytecodehar-dynamic-import&_2470 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2514 +slot &bytecodehar/bytecodehar-dynamic-import&_2516 { index: 0 tag: 0 @@ -259,7 +259,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2663, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2665, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -267,9 +267,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2523 +slot &bytecodehar/bytecodehar-static-import&_2525 ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2527 +slot &bytecodehar/bytecodehar-static-import&_2529 { index: 0 tag: 2 @@ -461,7 +461,7 @@ slot &bytecodehar/bytecodehar-static-import&_2527 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2663 +slot &bytecodehar/bytecodehar-static-import&_2665 { index: 0 tag: 0 @@ -917,7 +917,7 @@ slotNum = 0x7 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2514, 0x0, v0 + defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2516, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -925,9 +925,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2466 +slot &bytecodehar/bytecodehar-dynamic-import&_2468 ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2470 +slot &bytecodehar/bytecodehar-dynamic-import&_2472 { index: 0 tag: 2 @@ -979,7 +979,7 @@ slot &bytecodehar/bytecodehar-dynamic-import&_2470 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2514 +slot &bytecodehar/bytecodehar-dynamic-import&_2516 { index: 0 tag: 0 @@ -1092,7 +1092,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2663, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2665, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1100,9 +1100,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2523 +slot &bytecodehar/bytecodehar-static-import&_2525 ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2527 +slot &bytecodehar/bytecodehar-static-import&_2529 { index: 0 tag: 2 @@ -1294,7 +1294,7 @@ slot &bytecodehar/bytecodehar-static-import&_2527 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2663 +slot &bytecodehar/bytecodehar-static-import&_2665 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-dependency-resolve/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-dependency-resolve/hap-file-exec-expected.pa.txt index d327a5a78a..980d65da19 100644 --- a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-dependency-resolve/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-dependency-resolve/hap-file-exec-expected.pa.txt @@ -38,7 +38,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1844, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1846, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -46,9 +46,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1782 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1784 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1788 { index: 0 tag: 2 @@ -120,7 +120,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1844 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1846 { index: 0 tag: 0 @@ -165,7 +165,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1915, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1917, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -173,9 +173,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1853 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1855 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1859 { index: 0 tag: 2 @@ -247,7 +247,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1915 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1917 { index: 0 tag: 0 @@ -302,7 +302,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -310,9 +310,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1609 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1613 { index: 0 tag: 2 @@ -364,7 +364,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657 { index: 0 tag: 0 @@ -407,7 +407,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -415,9 +415,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1664 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1666 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1670 { index: 0 tag: 2 @@ -469,7 +469,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714 { index: 0 tag: 0 @@ -837,7 +837,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1844, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1846, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -845,9 +845,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1782 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1784 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1788 { index: 0 tag: 2 @@ -919,7 +919,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1844 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1846 { index: 0 tag: 0 @@ -962,7 +962,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -970,9 +970,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1609 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1613 { index: 0 tag: 2 @@ -1024,7 +1024,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-inter-app-hsp/inter-app-hsp-file-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-inter-app-hsp/inter-app-hsp-file-exec-expected.pa.txt index cf4b80b652..99a503aa90 100644 --- a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-inter-app-hsp/inter-app-hsp-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-inter-app-hsp/inter-app-hsp-file-exec-expected.pa.txt @@ -92,7 +92,7 @@ slotNum = 0x7 stmodulevar 0x0 ldhole sta v0 - defineclasswithbuffer 0x4, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&.#~A1=#A1, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2561, 0x0, v0 + defineclasswithbuffer 0x4, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&.#~A1=#A1, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2563, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -100,9 +100,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2521 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2523 ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2525 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2527 { index: 0 tag: 2 @@ -144,7 +144,7 @@ slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2525 val: 0 }, ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2561 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2563 { index: 0 tag: 0 @@ -257,7 +257,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&.#~B=#B, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2702, 0x0, v0 + defineclasswithbuffer 0x1, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&.#~B=#B, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2704, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -265,9 +265,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2570 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2572 ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2574 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2576 { index: 0 tag: 2 @@ -449,7 +449,7 @@ slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2574 val: 0 }, ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2702 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2704 { index: 0 tag: 0 @@ -893,7 +893,7 @@ slotNum = 0x7 stmodulevar 0x0 ldhole sta v0 - defineclasswithbuffer 0x4, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&.#~A1=#A1, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2561, 0x0, v0 + defineclasswithbuffer 0x4, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&.#~A1=#A1, com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2563, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -901,9 +901,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2521 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2523 ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2525 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2527 { index: 0 tag: 2 @@ -945,7 +945,7 @@ slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2525 val: 0 }, ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2561 +slot com.inter_app.hsp&bytecodehar/bytecodehar-dynamic-import&_2563 { index: 0 tag: 0 @@ -1058,7 +1058,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&.#~B=#B, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2702, 0x0, v0 + defineclasswithbuffer 0x1, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&.#~B=#B, com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2704, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1066,9 +1066,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2570 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2572 ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2574 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2576 { index: 0 tag: 2 @@ -1250,7 +1250,7 @@ slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2574 val: 0 }, ------------------------------------ -slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2702 +slot com.inter_app.hsp&bytecodehar/bytecodehar-static-import&_2704 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/abcinputs/bytecodehar.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/abcinputs/bytecodehar.txt new file mode 100644 index 0000000000..e08eaf2f74 --- /dev/null +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/abcinputs/bytecodehar.txt @@ -0,0 +1,2 @@ +importAnno-exec.ts +exportAnno.ts diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/exportAnno.ts b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/exportAnno.ts new file mode 100644 index 0000000000..d9b358d931 --- /dev/null +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/exportAnno.ts @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export @interface __$$ETS_ANNOTATION$$__MyAnno { } + +@__$$ETS_ANNOTATION$$__MyAnno +class A { + +} \ No newline at end of file diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec-expected.pa.txt new file mode 100644 index 0000000000..cbfd40b8fe --- /dev/null +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec-expected.pa.txt @@ -0,0 +1,254 @@ +slotNum = 0x0 +.language ECMAScript +.function any &importAnnoPgName/exportAnno&2.0.0.#~A=#A(any a0, any a1, any a2) { + lda a2 + return +} + +slotNum = 0x3 +.language ECMAScript +.function any &importAnnoPgName/exportAnno&2.0.0.func_main_0(any a0, any a1, any a2) { + ldhole + sta v0 + defineclasswithbuffer 0x0, &importAnnoPgName/exportAnno&2.0.0.#~A=#A, &importAnnoPgName/exportAnno&2.0.0_1380, 0x0, v0 + ldobjbyname 0x1, prototype + returnundefined +} + + +======> literal array buffer <====== +------------------------------------ +slot &importAnnoPgName/exportAnno&2.0.0_1340 +------------------------------------ +slot &importAnnoPgName/exportAnno&2.0.0_1344 +{ + index: 0 + tag: 2 + val: 0 +}, +{ + index: 1 + tag: 2 + val: 0 +}, +{ + index: 2 + tag: 2 + val: 0 +}, +{ + index: 3 + tag: 2 + val: 1 +}, +{ + index: 4 + tag: 5 + val: MyAnno +}, +{ + index: 5 + tag: 5 + val: MyAnno +}, +{ + index: 6 + tag: 2 + val: 0 +}, +{ + index: 7 + tag: 2 + val: 0 +}, +------------------------------------ +slot &importAnnoPgName/exportAnno&2.0.0_1380 +{ + index: 0 + tag: 0 + val: 2 +}, +{ + index: 1 + tag: 2 + val: 0 +}, +======> strings <====== +"&importAnnoPgName/exportAnno&2.0.0.#~A=#A"; "prototype"; + +======> literal array buffer <====== +======> strings <====== + +slotNum = 0x0 +.language ECMAScript +.function any &importAnnoPgName/importAnno-exec&2.0.0.#~B=#B(any a0, any a1, any a2) { + lda a2 + return +} + +slotNum = 0x3 +.language ECMAScript +.function any &importAnnoPgName/importAnno-exec&2.0.0.#~B>#fun(any a0, any a1, any a2) { + tryldglobalbyname 0x0, print + sta v0 + lda.str B + sta v1 + lda v0 + callarg1 0x1, v1 + returnundefined +} + +slotNum = 0x3 +.language ECMAScript +.function any &importAnnoPgName/importAnno-exec&2.0.0.func_main_0(any a0, any a1, any a2) { + ldhole + sta v0 + defineclasswithbuffer 0x0, &importAnnoPgName/importAnno-exec&2.0.0.#~B=#B, &importAnnoPgName/importAnno-exec&2.0.0_1453, 0x0, v0 + sta v0 + ldobjbyname 0x1, prototype + lda v0 + stmodulevar 0x0 + returnundefined +} + + +======> literal array buffer <====== +------------------------------------ +slot &importAnnoPgName/importAnno-exec&2.0.0_1389 +------------------------------------ +slot &importAnnoPgName/importAnno-exec&2.0.0_1393 +{ + index: 0 + tag: 2 + val: 1 +}, +{ + index: 1 + tag: 5 + val: @normalized:N&&&importAnnoPgName/exportAnno& +}, +{ + index: 2 + tag: 2 + val: 2 +}, +{ + index: 3 + tag: 5 + val: MyAnno +}, +{ + index: 4 + tag: 5 + val: MyAnno +}, +{ + index: 5 + tag: 9 + val: 0 +}, +{ + index: 6 + tag: 5 + val: fun +}, +{ + index: 7 + tag: 5 + val: fun +}, +{ + index: 8 + tag: 9 + val: 0 +}, +{ + index: 9 + tag: 2 + val: 0 +}, +{ + index: 10 + tag: 2 + val: 1 +}, +{ + index: 11 + tag: 5 + val: B +}, +{ + index: 12 + tag: 5 + val: B +}, +{ + index: 13 + tag: 2 + val: 0 +}, +{ + index: 14 + tag: 2 + val: 0 +}, +------------------------------------ +slot &importAnnoPgName/importAnno-exec&2.0.0_1453 +{ + index: 0 + tag: 0 + val: 5 +}, +{ + index: 1 + tag: 5 + val: fun +}, +{ + index: 2 + tag: 0 + val: 6 +}, +{ + index: 3 + tag: 6 + val: &importAnnoPgName/importAnno-exec&2.0.0.#~B>#fun +}, +{ + index: 4 + tag: 0 + val: 9 +}, +{ + index: 5 + tag: 9 + val: 0 +}, +{ + index: 6 + tag: 0 + val: 2 +}, +{ + index: 7 + tag: 2 + val: 1 +}, +======> strings <====== +"&importAnnoPgName/importAnno-exec&2.0.0.#~B=#B"; "B"; "print"; "prototype"; + +======> literal array buffer <====== +======> strings <====== + + +======> literal array buffer <====== +======> strings <====== + + +======> literal array buffer <====== +======> strings <====== + + +======> literal array buffer <====== +======> strings <====== + diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec.ts b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec.ts new file mode 100644 index 0000000000..ab3da7352e --- /dev/null +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/importAnno-exec.ts @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { __$$ETS_ANNOTATION$$__MyAnno, fun } from "@normalized:N&&&importAnnoPgName/exportAnno&" + +export class B { + @__$$ETS_ANNOTATION$$__MyAnno + fun() { + print("B") + } +} diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/recordnames.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/recordnames.txt new file mode 100644 index 0000000000..a85a0366c4 --- /dev/null +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-non-merged-abc/recordnames.txt @@ -0,0 +1,2 @@ +importAnno-exec:&importAnnoPgName/importAnno-exec&2.0.0 +exportAnno:&importAnnoPgName/exportAnno&2.0.0 diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-test-project/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-test-project/hap-file-exec-expected.pa.txt index d6cd6d3e45..aa9c422fe8 100644 --- a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-test-project/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-test-project/hap-file-exec-expected.pa.txt @@ -50,7 +50,7 @@ slotNum = 0x5 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x2, &bytecodehar1/bytecodehar1-file1&2.0.0.#~B=#B, &bytecodehar1/bytecodehar1-file1&2.0.0_2142, 0x0, v0 + defineclasswithbuffer 0x2, &bytecodehar1/bytecodehar1-file1&2.0.0.#~B=#B, &bytecodehar1/bytecodehar1-file1&2.0.0_2144, 0x0, v0 ldobjbyname 0x3, prototype returnundefined } @@ -58,9 +58,9 @@ slotNum = 0x5 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2080 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2082 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2084 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2086 { index: 0 tag: 2 @@ -132,7 +132,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_2084 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2142 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2144 { index: 0 tag: 0 @@ -195,11 +195,11 @@ slotNum = 0x7 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~@0=#Example, &bytecodehar1/bytecodehar1-file2&2.0.0_2218, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~@0=#Example, &bytecodehar1/bytecodehar1-file2&2.0.0_2220, 0x0, v0 ldobjbyname 0x2, prototype ldhole sta v0 - defineclasswithbuffer 0x4, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_2240, 0x0, v0 + defineclasswithbuffer 0x4, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_2242, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -207,7 +207,7 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_2151 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_2153 { index: 0 tag: 0 @@ -219,7 +219,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_2151 val: Example }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_2160 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_2162 { index: 0 tag: 2 @@ -291,7 +291,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_2160 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_2218 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_2220 { index: 0 tag: 0 @@ -333,7 +333,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_2218 val: 1 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_2240 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_2242 { index: 0 tag: 0 @@ -388,7 +388,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1649, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1651, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -396,9 +396,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1601 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1603 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1605 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 { index: 0 tag: 2 @@ -450,7 +450,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1605 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1649 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1651 { index: 0 tag: 0 @@ -493,7 +493,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~B=#B, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1706, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~B=#B, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1708, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -501,9 +501,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1658 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1660 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1662 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1664 { index: 0 tag: 2 @@ -555,7 +555,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1662 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1706 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1708 { index: 0 tag: 0 @@ -917,7 +917,7 @@ slotNum = 0x5 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x2, &bytecodehar1/bytecodehar1-file1&2.0.0.#~B=#B, &bytecodehar1/bytecodehar1-file1&2.0.0_2142, 0x0, v0 + defineclasswithbuffer 0x2, &bytecodehar1/bytecodehar1-file1&2.0.0.#~B=#B, &bytecodehar1/bytecodehar1-file1&2.0.0_2144, 0x0, v0 ldobjbyname 0x3, prototype returnundefined } @@ -925,9 +925,9 @@ slotNum = 0x5 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2080 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2082 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2084 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2086 { index: 0 tag: 2 @@ -999,7 +999,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_2084 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_2142 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_2144 { index: 0 tag: 0 @@ -1042,7 +1042,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1649, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1651, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1050,9 +1050,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1601 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1603 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1605 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 { index: 0 tag: 2 @@ -1104,7 +1104,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1605 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1649 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1651 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-version-update/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-version-update/hap-file-exec-expected.pa.txt index 951b2a1d14..5cadb0d5a8 100644 --- a/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-version-update/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/bytecodehar/projects/bytecodehar-annotations-version-update/hap-file-exec-expected.pa.txt @@ -84,7 +84,7 @@ slotNum = 0x7 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2498, 0x0, v0 + defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2500, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -92,9 +92,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2450 +slot &bytecodehar/bytecodehar-dynamic-import&_2452 ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2454 +slot &bytecodehar/bytecodehar-dynamic-import&_2456 { index: 0 tag: 2 @@ -146,7 +146,7 @@ slot &bytecodehar/bytecodehar-dynamic-import&_2454 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2498 +slot &bytecodehar/bytecodehar-dynamic-import&_2500 { index: 0 tag: 0 @@ -259,7 +259,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2647, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2649, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -267,9 +267,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2507 +slot &bytecodehar/bytecodehar-static-import&_2509 ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2511 +slot &bytecodehar/bytecodehar-static-import&_2513 { index: 0 tag: 2 @@ -461,7 +461,7 @@ slot &bytecodehar/bytecodehar-static-import&_2511 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2647 +slot &bytecodehar/bytecodehar-static-import&_2649 { index: 0 tag: 0 @@ -917,7 +917,7 @@ slotNum = 0x7 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2498, 0x0, v0 + defineclasswithbuffer 0x4, &bytecodehar/bytecodehar-dynamic-import&.#~A=#A, &bytecodehar/bytecodehar-dynamic-import&_2500, 0x0, v0 ldobjbyname 0x5, prototype returnundefined } @@ -925,9 +925,9 @@ slotNum = 0x7 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2450 +slot &bytecodehar/bytecodehar-dynamic-import&_2452 ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2454 +slot &bytecodehar/bytecodehar-dynamic-import&_2456 { index: 0 tag: 2 @@ -979,7 +979,7 @@ slot &bytecodehar/bytecodehar-dynamic-import&_2454 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-dynamic-import&_2498 +slot &bytecodehar/bytecodehar-dynamic-import&_2500 { index: 0 tag: 0 @@ -1092,7 +1092,7 @@ slotNum = 0x4 stlexvar 0x0, 0x9 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2647, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar/bytecodehar-static-import&.#~A=#A, &bytecodehar/bytecodehar-static-import&_2649, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1100,9 +1100,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2507 +slot &bytecodehar/bytecodehar-static-import&_2509 ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2511 +slot &bytecodehar/bytecodehar-static-import&_2513 { index: 0 tag: 2 @@ -1294,7 +1294,7 @@ slot &bytecodehar/bytecodehar-static-import&_2511 val: 0 }, ------------------------------------ -slot &bytecodehar/bytecodehar-static-import&_2647 +slot &bytecodehar/bytecodehar-static-import&_2649 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/cache_projects/bytecodehar-annotations-cache-file/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/cache_projects/bytecodehar-annotations-cache-file/hap-file-exec-expected.pa.txt index 819272cd4a..4a6e6dec27 100644 --- a/es2panda/test/compiler/cache_projects/bytecodehar-annotations-cache-file/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/cache_projects/bytecodehar-annotations-cache-file/hap-file-exec-expected.pa.txt @@ -38,7 +38,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1826, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1828, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -46,9 +46,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1764 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1766 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1768 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1770 { index: 0 tag: 2 @@ -120,7 +120,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1768 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1826 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1828 { index: 0 tag: 0 @@ -165,7 +165,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1897, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1899, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -173,9 +173,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1835 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1837 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1839 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1841 { index: 0 tag: 2 @@ -247,7 +247,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_1839 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1897 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1899 { index: 0 tag: 0 @@ -302,7 +302,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1637, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1639, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -310,9 +310,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1589 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1591 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1593 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1595 { index: 0 tag: 2 @@ -364,7 +364,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1593 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1637 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1639 { index: 0 tag: 0 @@ -407,7 +407,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1694, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1696, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -415,9 +415,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1646 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1648 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1650 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1652 { index: 0 tag: 2 @@ -469,7 +469,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1650 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1694 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1696 { index: 0 tag: 0 @@ -837,7 +837,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1826, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1828, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -845,9 +845,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1764 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1766 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1768 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1770 { index: 0 tag: 2 @@ -919,7 +919,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1768 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1826 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1828 { index: 0 tag: 0 @@ -962,7 +962,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1637, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1639, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -970,9 +970,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1589 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1591 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1593 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1595 { index: 0 tag: 2 @@ -1024,7 +1024,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1593 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1637 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1639 { index: 0 tag: 0 diff --git a/es2panda/test/compiler/cache_projects/bytecodehar-annotations-mod-hap-cache-file/hap-file-exec-expected.pa.txt b/es2panda/test/compiler/cache_projects/bytecodehar-annotations-mod-hap-cache-file/hap-file-exec-expected.pa.txt index 839d23a63b..322cc66003 100644 --- a/es2panda/test/compiler/cache_projects/bytecodehar-annotations-mod-hap-cache-file/hap-file-exec-expected.pa.txt +++ b/es2panda/test/compiler/cache_projects/bytecodehar-annotations-mod-hap-cache-file/hap-file-exec-expected.pa.txt @@ -44,7 +44,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1844, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1846, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -52,9 +52,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1782 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1784 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1788 { index: 0 tag: 2 @@ -126,7 +126,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1844 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1846 { index: 0 tag: 0 @@ -171,7 +171,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1915, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1917, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -179,9 +179,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1853 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1855 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1859 { index: 0 tag: 2 @@ -253,7 +253,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1915 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1917 { index: 0 tag: 0 @@ -308,7 +308,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -316,9 +316,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1609 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1613 { index: 0 tag: 2 @@ -370,7 +370,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657 { index: 0 tag: 0 @@ -413,7 +413,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -421,9 +421,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1664 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1666 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1670 { index: 0 tag: 2 @@ -475,7 +475,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714 { index: 0 tag: 0 @@ -906,7 +906,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1844, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file1&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file1&2.0.0_1846, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -914,9 +914,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1782 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1784 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1788 { index: 0 tag: 2 @@ -988,7 +988,7 @@ slot &bytecodehar1/bytecodehar1-file1&2.0.0_1786 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file1&2.0.0_1844 +slot &bytecodehar1/bytecodehar1-file1&2.0.0_1846 { index: 0 tag: 0 @@ -1033,7 +1033,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1915, 0x0, v0 + defineclasswithbuffer 0x1, &bytecodehar1/bytecodehar1-file2&2.0.0.#~A=#A, &bytecodehar1/bytecodehar1-file2&2.0.0_1917, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1041,9 +1041,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1853 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1855 ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1859 { index: 0 tag: 2 @@ -1115,7 +1115,7 @@ slot &bytecodehar1/bytecodehar1-file2&2.0.0_1857 val: 0 }, ------------------------------------ -slot &bytecodehar1/bytecodehar1-file2&2.0.0_1915 +slot &bytecodehar1/bytecodehar1-file2&2.0.0_1917 { index: 0 tag: 0 @@ -1158,7 +1158,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1166,9 +1166,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1607 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1609 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1613 { index: 0 tag: 2 @@ -1220,7 +1220,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1611 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1655 +slot &@ohos/bytecodehar2/bytecodehar2-file1&2.0.0_1657 { index: 0 tag: 0 @@ -1263,7 +1263,7 @@ slotNum = 0x4 stmodulevar 0x1 ldhole sta v0 - defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712, 0x0, v0 + defineclasswithbuffer 0x1, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0.#~A=#A, &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714, 0x0, v0 ldobjbyname 0x2, prototype returnundefined } @@ -1271,9 +1271,9 @@ slotNum = 0x4 ======> literal array buffer <====== ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1664 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1666 ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1670 { index: 0 tag: 2 @@ -1325,7 +1325,7 @@ slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1668 val: 0 }, ------------------------------------ -slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1712 +slot &@ohos/bytecodehar2/bytecodehar2-file2&2.0.0_1714 { index: 0 tag: 0 diff --git a/es2panda/test/runner.py b/es2panda/test/runner.py index 9b625b98c1..7ce643ee21 100755 --- a/es2panda/test/runner.py +++ b/es2panda/test/runner.py @@ -1161,6 +1161,9 @@ class CompilerProjectTest(Test): if "merge_abc_consistence_check" in self.path and "--merge-abc" not in self.flags: self.flags.append("--merge-abc") + if "non_merged_abc" in self.path and "--merge-abc" in self.flags: + self.flags.remove("--merge-abc") + # Check dump-assembly outputs when required if "--dump-assembly" in self.flags: pa_expected_path = "".join([self.get_path_to_expected()[:self.get_path_to_expected().rfind(".txt")], diff --git a/es2panda/util/commonUtil.h b/es2panda/util/commonUtil.h index 036d49c765..8cabefe87c 100644 --- a/es2panda/util/commonUtil.h +++ b/es2panda/util/commonUtil.h @@ -43,12 +43,12 @@ const std::string NORMALIZED = "@normalized:"; const std::string MODULE_RECORD_IDX = "moduleRecordIdx"; const std::string GLOBAL_TYPE_NAME = "_GLOBAL"; +constexpr char ANNOTATION_QUALIFIED_NAME_SEPARATOR = '.'; constexpr char NORMALIZED_OHMURL_SEPARATOR = '&'; constexpr char NORMALIZED_OHMURL_PREFIX = '@'; constexpr char SLASH_TAG = '/'; constexpr char CHAR_VERTICAL_LINE = '|'; constexpr char COLON_SEPARATOR = ':'; -constexpr char DOT_SEPARATOR = '.'; constexpr size_t ORIGINAL_PKG_NAME_POS = 0U; constexpr size_t TARGET_PKG_NAME_POS = 1U; diff --git a/es2panda/util/helpers.cpp b/es2panda/util/helpers.cpp index 30f0a4bc1c..bf03e6d6d0 100644 --- a/es2panda/util/helpers.cpp +++ b/es2panda/util/helpers.cpp @@ -957,7 +957,7 @@ bool Helpers::BelongingToRecords(const std::string &name, const std::unordered_s return retainRecordSet.find(recordName) != retainRecordSet.end(); } -bool Helpers::IsInnerAnnotationRecordName(const std::string &name) +bool Helpers::IsInnerAnnotationRecordName(const std::string_view &name) { return name == panda::abc2program::CONCURRENT_MODULE_REQUEST_RECORD_NAME || name == panda::abc2program::SLOT_NUMBER_RECORD_NAME || @@ -966,7 +966,7 @@ bool Helpers::IsInnerAnnotationRecordName(const std::string &name) std::string Helpers::RemoveRecordSuffixAnnotationName(const std::string &name) { - auto pos = name.rfind(util::DOT_SEPARATOR); + auto pos = name.rfind(pandasm::RECORD_ANNOTATION_SEPARATOR); if (pos == std::string::npos) { return name; } diff --git a/es2panda/util/helpers.h b/es2panda/util/helpers.h index 91e738b542..c1e4ca166b 100644 --- a/es2panda/util/helpers.h +++ b/es2panda/util/helpers.h @@ -176,7 +176,7 @@ public: static bool IsSpecialScopeName(const util::StringView &str); static bool BelongingToRecords(const std::string &name, const std::unordered_set &retainRecordSet, const std::string &delimiter = std::string(DOT)); - static bool IsInnerAnnotationRecordName(const std::string &name); + static bool IsInnerAnnotationRecordName(const std::string_view &name); static std::string RemoveRecordSuffixAnnotationName(const std::string &name); static void RemoveProgramsRedundantData(std::map &progsInfo, const std::map> &resolveDepsRelation); -- Gitee