arkanalyzer 1.0.94 → 2.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Config.d.ts +7 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/Scene.d.ts +134 -170
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +412 -976
- package/lib/callgraph/algorithm/AbstractAnalysis.js +3 -2
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +1 -1
- package/lib/callgraph/model/CallGraph.js +1 -1
- package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts +1 -3
- package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PTAUtils.js +17 -7
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +4 -14
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +2 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +1 -2
- package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.js +0 -1
- package/lib/cli/commands/cg.d.ts +1 -0
- package/lib/cli/commands/cg.d.ts.map +1 -1
- package/lib/cli/commands/cg.js +22 -18
- package/lib/cli/commands/ir.d.ts +1 -0
- package/lib/cli/commands/ir.d.ts.map +1 -1
- package/lib/cli/commands/ir.js +5 -2
- package/lib/core/base/Constant.d.ts +5 -5
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +12 -9
- package/lib/core/base/Expr.d.ts +36 -20
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +206 -94
- package/lib/core/base/Local.d.ts +10 -20
- package/lib/core/base/Local.d.ts.map +1 -1
- package/lib/core/base/Local.js +25 -28
- package/lib/core/base/Position.d.ts +6 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +37 -11
- package/lib/core/base/Ref.d.ts +45 -33
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +225 -51
- package/lib/core/base/Stmt.d.ts +19 -9
- package/lib/core/base/Stmt.d.ts.map +1 -1
- package/lib/core/base/Stmt.js +135 -52
- package/lib/core/base/Type.d.ts +67 -4
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +391 -20
- package/lib/core/base/TypeExpr.d.ts +6 -4
- package/lib/core/base/TypeExpr.d.ts.map +1 -1
- package/lib/core/base/TypeExpr.js +34 -10
- package/lib/core/base/Value.d.ts +20 -2
- package/lib/core/base/Value.d.ts.map +1 -1
- package/lib/core/base/Value.js +12 -0
- package/lib/core/common/ArkIRTransformer.d.ts +18 -0
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +94 -75
- package/lib/core/common/ArkValueTransformer.d.ts +21 -3
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +455 -265
- package/lib/core/common/Builtin.d.ts +48 -24
- package/lib/core/common/Builtin.d.ts.map +1 -1
- package/lib/core/common/Builtin.js +90 -52
- package/lib/core/common/CanonicalizerValidator.d.ts +308 -0
- package/lib/core/common/CanonicalizerValidator.d.ts.map +1 -0
- package/lib/core/common/CanonicalizerValidator.js +888 -0
- package/lib/core/common/Const.d.ts +3 -3
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +3 -3
- package/lib/core/common/DummyMainCreater.d.ts +2 -21
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +8 -105
- package/lib/core/common/IRInference.d.ts +55 -3
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +407 -126
- package/lib/core/common/IRUtils.d.ts +1 -0
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +44 -13
- package/lib/core/common/ModelUtils.d.ts +44 -20
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +378 -208
- package/lib/core/common/SdkUtils.d.ts +35 -5
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +181 -53
- package/lib/core/common/SignatureCanonicalizer.d.ts +95 -0
- package/lib/core/common/SignatureCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/SignatureCanonicalizer.js +116 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.d.ts +176 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.d.ts.map +1 -0
- package/lib/core/common/SignatureCanonicalizerRegistry.js +343 -0
- package/lib/core/common/SignatureModelCanonicalizer.d.ts +69 -0
- package/lib/core/common/SignatureModelCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/SignatureModelCanonicalizer.js +109 -0
- package/lib/core/common/StmtUseReplacer.d.ts +1 -0
- package/lib/core/common/StmtUseReplacer.d.ts.map +1 -1
- package/lib/core/common/StmtUseReplacer.js +9 -0
- package/lib/core/common/StringUtils.d.ts +12 -1
- package/lib/core/common/StringUtils.d.ts.map +1 -1
- package/lib/core/common/StringUtils.js +36 -17
- package/lib/core/common/TempSignatureCanonicalizer.d.ts +82 -0
- package/lib/core/common/TempSignatureCanonicalizer.d.ts.map +1 -0
- package/lib/core/common/TempSignatureCanonicalizer.js +177 -0
- package/lib/core/common/TypeInference.d.ts +24 -6
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +243 -117
- package/lib/core/common/ValueUtil.d.ts +2 -1
- package/lib/core/common/ValueUtil.d.ts.map +1 -1
- package/lib/core/common/ValueUtil.js +4 -1
- package/lib/core/graph/Cfg.d.ts.map +1 -1
- package/lib/core/graph/Cfg.js +21 -6
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +46 -33
- package/lib/core/graph/builder/IfBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/IfBuilder.js +6 -2
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ViewTreeBuilder.js +6 -2
- package/lib/core/inference/ModelInference.d.ts +24 -4
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ModelInference.js +273 -79
- package/lib/core/inference/ValueInference.d.ts +3 -2
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +90 -40
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +28 -15
- package/lib/core/inference/arkts/ArkTsInference.d.ts +9 -3
- package/lib/core/inference/arkts/ArkTsInference.d.ts.map +1 -1
- package/lib/core/inference/arkts/ArkTsInference.js +54 -16
- package/lib/core/model/ArkClass.d.ts +192 -18
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +852 -122
- package/lib/core/model/ArkExport.d.ts.map +1 -1
- package/lib/core/model/ArkExport.js +1 -2
- package/lib/core/model/ArkField.d.ts +34 -2
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +89 -14
- package/lib/core/model/ArkFile.d.ts +72 -12
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +275 -65
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +1 -2
- package/lib/core/model/ArkMethod.d.ts +101 -15
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +252 -39
- package/lib/core/model/ArkModule.d.ts +1 -1
- package/lib/core/model/ArkModule.js +1 -1
- package/lib/core/model/ArkNamespace.d.ts +80 -10
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +309 -76
- package/lib/core/model/ArkSignature.d.ts +242 -18
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +725 -95
- package/lib/core/model/builder/ArkClassBuilder.d.ts +6 -3
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +116 -71
- package/lib/core/model/builder/ArkExportBuilder.d.ts +1 -1
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkExportBuilder.js +1 -1
- package/lib/core/model/builder/ArkFieldBuilder.d.ts +0 -2
- package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFieldBuilder.js +9 -43
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFileBuilder.js +32 -33
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +10 -3
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +40 -26
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +3 -2
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +45 -77
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkSignatureBuilder.js +26 -3
- package/lib/core/model/builder/BodyBuilder.d.ts +1 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/BodyBuilder.js +37 -11
- package/lib/core/model/builder/builderUtils.d.ts +11 -1
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +124 -90
- package/lib/frontend/FrontendBuilder.d.ts +10 -6
- package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
- package/lib/frontend/FrontendBuilder.js +19 -45
- package/lib/frontend/ModuleScene.d.ts +43 -0
- package/lib/frontend/ModuleScene.d.ts.map +1 -0
- package/lib/frontend/ModuleScene.js +143 -0
- package/lib/frontend/SceneBuildStage.d.ts +15 -0
- package/lib/frontend/SceneBuildStage.d.ts.map +1 -0
- package/lib/frontend/SceneBuildStage.js +32 -0
- package/lib/frontend/SceneBuilder.d.ts +153 -0
- package/lib/frontend/SceneBuilder.d.ts.map +1 -0
- package/lib/frontend/SceneBuilder.js +859 -0
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +0 -2
- package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
- package/lib/frontend/arktsFrontend/ArktsFrontend.js +0 -18
- package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts +17 -0
- package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts.map +1 -0
- package/lib/frontend/arktsFrontend/FileBodyRemount.js +187 -0
- package/lib/frontend/common/ModuleBuilder.d.ts +4 -2
- package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -1
- package/lib/frontend/common/ModuleBuilder.js +19 -9
- package/lib/frontend/cppFrontend/CppFrontend.d.ts +0 -6
- package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/CppFrontend.js +0 -56
- package/lib/frontend/cppFrontend/base/Type.d.ts +7 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/base/Type.js +29 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +56 -56
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +1 -1
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +124 -113
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +29 -19
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/Builtin.js +56 -35
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +7 -2
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/IRInference.js +61 -28
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/IRUtils.js +22 -10
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +19 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/ModelUtils.js +84 -3
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/common/TypeInference.js +44 -54
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +2 -1
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +1 -1
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +41 -5
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +18 -28
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +2 -3
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +2 -2
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +31 -24
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +10 -16
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +0 -2
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +19 -37
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +30 -3
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +8 -4
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -2
- package/lib/save/json/JsonSerialization.js +2 -2
- package/lib/save/source/SourceStmt.js +1 -1
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -9
- package/lib/statistics/StageStatistics.d.ts +195 -0
- package/lib/statistics/StageStatistics.d.ts.map +1 -0
- package/lib/statistics/StageStatistics.js +346 -0
- package/lib/statistics/StageStatisticsReporter.d.ts +58 -0
- package/lib/statistics/StageStatisticsReporter.d.ts.map +1 -0
- package/lib/statistics/StageStatisticsReporter.js +255 -0
- package/lib/utils/Canonicalizer.d.ts +9 -2
- package/lib/utils/Canonicalizer.d.ts.map +1 -1
- package/lib/utils/Canonicalizer.js +19 -2
- package/lib/utils/CxxSceneUtils.d.ts +7 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -1
- package/lib/utils/CxxSceneUtils.js +10 -1
- package/lib/utils/FileUtils.d.ts +0 -1
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +1 -9
- package/lib/utils/HashUtils.d.ts +9 -0
- package/lib/utils/HashUtils.d.ts.map +1 -0
- package/lib/utils/HashUtils.js +65 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -1
- package/lib/utils/ModuleUtils.js +24 -5
- package/lib/utils/VisitedSegment.d.ts +23 -0
- package/lib/utils/VisitedSegment.d.ts.map +1 -0
- package/lib/utils/VisitedSegment.js +64 -0
- package/lib/utils/callGraphUtils.d.ts.map +1 -1
- package/lib/utils/callGraphUtils.js +7 -7
- package/lib/utils/getAllFiles.d.ts.map +1 -1
- package/lib/utils/getAllFiles.js +11 -8
- package/lib/utils/logger.d.ts +4 -0
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +16 -0
- package/lib/utils/parseArkSourceFile.d.ts +33 -0
- package/lib/utils/parseArkSourceFile.d.ts.map +1 -0
- package/lib/utils/parseArkSourceFile.js +131 -0
- package/package.json +1 -1
- package/lib/utils/DependenciesSort.d.ts +0 -3
- package/lib/utils/DependenciesSort.d.ts.map +0 -1
- package/lib/utils/DependenciesSort.js +0 -72
- package/lib/utils/crypto_utils.d.ts +0 -6
- package/lib/utils/crypto_utils.d.ts.map +0 -1
- package/lib/utils/crypto_utils.js +0 -57
|
@@ -70,21 +70,39 @@ class TypeQueryExpr extends AbstractTypeExpr {
|
|
|
70
70
|
getGenerateTypes() {
|
|
71
71
|
return this.genericTypes;
|
|
72
72
|
}
|
|
73
|
+
isUnclearWithVisited(visited) {
|
|
74
|
+
if (visited.has(this)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
visited.add(this);
|
|
78
|
+
if (this.getType().isUnclearWithVisited(visited)) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
const generateTypes = this.getGenerateTypes();
|
|
82
|
+
if (generateTypes === undefined || generateTypes === null) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
for (let i = 0; i < generateTypes.length; i++) {
|
|
86
|
+
if (generateTypes[i].isUnclearWithVisited(visited)) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
73
92
|
addGenericType(gType) {
|
|
74
93
|
if (!this.genericTypes) {
|
|
75
94
|
this.genericTypes = [];
|
|
76
95
|
}
|
|
77
96
|
this.genericTypes.push(gType);
|
|
78
97
|
}
|
|
79
|
-
getUses() {
|
|
98
|
+
getUses(acc = []) {
|
|
80
99
|
const opValue = this.getOpValue();
|
|
81
100
|
if (opValue instanceof ArkBaseModel_1.ArkBaseModel) {
|
|
82
|
-
return
|
|
101
|
+
return acc;
|
|
83
102
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return uses;
|
|
103
|
+
acc.push(opValue);
|
|
104
|
+
opValue.getUses(acc);
|
|
105
|
+
return acc;
|
|
88
106
|
}
|
|
89
107
|
getType() {
|
|
90
108
|
var _a;
|
|
@@ -138,12 +156,18 @@ class KeyofTypeExpr extends AbstractTypeExpr {
|
|
|
138
156
|
setOpType(opType) {
|
|
139
157
|
this.opType = opType;
|
|
140
158
|
}
|
|
141
|
-
|
|
142
|
-
|
|
159
|
+
isUnclearWithVisited(visited) {
|
|
160
|
+
if (visited.has(this)) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
visited.add(this);
|
|
164
|
+
return this.getOpType().isUnclearWithVisited(visited);
|
|
165
|
+
}
|
|
166
|
+
getUses(acc = []) {
|
|
143
167
|
if (this.getOpType() instanceof TypeQueryExpr) {
|
|
144
|
-
|
|
168
|
+
this.getOpType().getUses(acc);
|
|
145
169
|
}
|
|
146
|
-
return
|
|
170
|
+
return acc;
|
|
147
171
|
}
|
|
148
172
|
getType() {
|
|
149
173
|
return this;
|
package/lib/core/base/Value.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import type { Stmt } from './Stmt';
|
|
1
2
|
import { Type } from './Type';
|
|
3
|
+
/**
|
|
4
|
+
* The one shared read-only empty array documented at {@link Value.getUses}. Every implementation
|
|
5
|
+
* hands back this same instance when it has nothing to report, so callers must never append to it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EMPTY_USES: Value[];
|
|
8
|
+
/**
|
|
9
|
+
* The one shared read-only empty array handed back when no using-statement has been recorded, e.g.
|
|
10
|
+
* by `Local.getUsedStmts` and `GlobalRef.getUsedStmts`. Every value shares this instance, so
|
|
11
|
+
* callers must never append to it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const EMPTY_USED_STMTS: Stmt[];
|
|
2
14
|
/**
|
|
3
15
|
* @category core/base
|
|
4
16
|
*/
|
|
@@ -6,9 +18,15 @@ export interface Value {
|
|
|
6
18
|
/**
|
|
7
19
|
* Return a list of values which are contained in this {@link Value}.
|
|
8
20
|
* Value is a core interface in ArkAnalyzer, which may represent any value or expression.
|
|
9
|
-
* @
|
|
21
|
+
* @param acc - Optional accumulator to append into instead of allocating a fresh array. Threading
|
|
22
|
+
* one accumulator through a traversal avoids the transient array per node that a
|
|
23
|
+
* recursive concat allocates.
|
|
24
|
+
* @returns An **array** of values used by this value. When called without `acc` on a value that
|
|
25
|
+
* has no uses, implementations hand back one shared process-wide instance so the hot
|
|
26
|
+
* accessor stays allocation-free. Treat that array as read-only - appending to it would
|
|
27
|
+
* add the element to every other value's uses - and pass your own `acc` to append.
|
|
10
28
|
*/
|
|
11
|
-
getUses(): Value[];
|
|
29
|
+
getUses(acc?: Value[]): Value[];
|
|
12
30
|
/**
|
|
13
31
|
* Return the type of this value. The interface is encapsulated in {@link Value}.
|
|
14
32
|
* The `Type` is defined in type.ts, such as **Any**, **Unknown**, **TypeParameter**,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../src/core/base/Value.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB
|
|
1
|
+
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../src/core/base/Value.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,EAAO,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,IAAI,IAAI,CAAC;CACnB"}
|
package/lib/core/base/Value.js
CHANGED
|
@@ -14,3 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EMPTY_USED_STMTS = exports.EMPTY_USES = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* The one shared read-only empty array documented at {@link Value.getUses}. Every implementation
|
|
20
|
+
* hands back this same instance when it has nothing to report, so callers must never append to it.
|
|
21
|
+
*/
|
|
22
|
+
exports.EMPTY_USES = [];
|
|
23
|
+
/**
|
|
24
|
+
* The one shared read-only empty array handed back when no using-statement has been recorded, e.g.
|
|
25
|
+
* by `Local.getUsedStmts` and `GlobalRef.getUsedStmts`. Every value shares this instance, so
|
|
26
|
+
* callers must never append to it.
|
|
27
|
+
*/
|
|
28
|
+
exports.EMPTY_USED_STMTS = [];
|
|
@@ -8,6 +8,9 @@ import { AliasType } from '../base/Type';
|
|
|
8
8
|
import { ArkMethod } from '../model/ArkMethod';
|
|
9
9
|
import { FullPosition } from '../base/Position';
|
|
10
10
|
import { ArkValueTransformer } from './ArkValueTransformer';
|
|
11
|
+
import { ArkClass } from '../model/ArkClass';
|
|
12
|
+
import { ArkFile } from '../model/ArkFile';
|
|
13
|
+
import { ArkNamespace } from '../model/ArkNamespace';
|
|
11
14
|
export type ValueAndStmts = {
|
|
12
15
|
value: Value;
|
|
13
16
|
valueOriginalPositions: FullPosition[];
|
|
@@ -28,10 +31,16 @@ export declare class ArkIRTransformer {
|
|
|
28
31
|
static readonly DUMMY_IF_OPERATOR_END = "IfEnd";
|
|
29
32
|
protected sourceFile: ts.SourceFile;
|
|
30
33
|
protected declaringMethod: ArkMethod;
|
|
34
|
+
protected _declaringClass: ArkClass;
|
|
35
|
+
protected _declaringNamespace?: ArkNamespace;
|
|
36
|
+
protected _declaringFile: ArkFile;
|
|
31
37
|
protected inBuilderMethod: boolean;
|
|
32
38
|
protected builderMethodContextFlag: boolean;
|
|
33
39
|
protected arkValueTransformer: ArkValueTransformer;
|
|
34
40
|
constructor(sourceFile: ts.SourceFile, declaringMethod: ArkMethod);
|
|
41
|
+
get declaringClass(): ArkClass;
|
|
42
|
+
get declaringNamespace(): ArkNamespace | undefined;
|
|
43
|
+
get declaringFile(): ArkFile;
|
|
35
44
|
getLocals(): Set<Local>;
|
|
36
45
|
getGlobals(): Map<string, GlobalRef> | null;
|
|
37
46
|
getThisLocal(): Local;
|
|
@@ -78,6 +87,15 @@ export declare class ArkIRTransformer {
|
|
|
78
87
|
static tokenToUnaryOperator(token: ts.SyntaxKind): UnaryOperator | null;
|
|
79
88
|
static tokenToBinaryOperator(token: ts.SyntaxKind): BinaryOperator | null;
|
|
80
89
|
generateAssignStmtForValue(value: Value, valueOriginalPositions: FullPosition[]): ValueAndStmts;
|
|
90
|
+
/**
|
|
91
|
+
* Appends the temp-variable assignment (when one is needed) directly into `stmts` and
|
|
92
|
+
* returns the temp local with its position, skipping the ValueAndStmts wrapper and its
|
|
93
|
+
* single-element stmts array that generateAssignStmtForValue allocates per call.
|
|
94
|
+
*/
|
|
95
|
+
generateAssignStmtForValueInto(value: Value, valueOriginalPositions: FullPosition[], stmts: Stmt[]): {
|
|
96
|
+
value: Value;
|
|
97
|
+
positions: FullPosition[];
|
|
98
|
+
};
|
|
81
99
|
generateIfStmtForValues(leftValue: Value, leftOpOriginalPositions: FullPosition[], rightValue: Value, rightOpOriginalPositions: FullPosition[]): Stmt[];
|
|
82
100
|
setBuilderMethodContextFlag(builderMethodContextFlag: boolean): void;
|
|
83
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkIRTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkIRTransformer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArkIRTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkIRTransformer.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEH,aAAa,EAKb,cAAc,EAGd,aAAa,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA2E,SAAS,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAA2F,IAAI,EAAE,MAAM,cAAc,CAAC;AACrJ,OAAO,EAAE,SAAS,EAA6E,MAAM,cAAc,CAAC;AAKpH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,sBAAsB,EAAE,YAAY,EAAE,CAAC;IACvC,KAAK,EAAE,IAAI,EAAE,CAAC;CACjB,CAAC;AAEF,qBAAa,SAAU,SAAQ,IAAI;gBACnB,IAAI,EAAE,MAAM;IAKjB,QAAQ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AG,IAAI;WAQ7C,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,GAAG,IAAI;WAahE,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,cAAc,GAAG,IAAI;IAqDzE,0BAA0B,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,GAAG,aAAa;IAUtG;;;;OAIG;IACI,8BAA8B,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,YAAY,EAAE,CAAA;KAAE;IAiBhJ,uBAAuB,CAC1B,SAAS,EAAE,KAAK,EAChB,uBAAuB,EAAE,YAAY,EAAE,EACvC,UAAU,EAAE,KAAK,EACjB,wBAAwB,EAAE,YAAY,EAAE,GACzC,IAAI,EAAE;IAmCF,2BAA2B,CAAC,wBAAwB,EAAE,OAAO,GAAG,IAAI;CAG9E"}
|
|
@@ -38,6 +38,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ArkIRTransformer = exports.DummyStmt = void 0;
|
|
41
|
+
const SdkUtils_1 = require("./SdkUtils");
|
|
41
42
|
const Expr_1 = require("../base/Expr");
|
|
42
43
|
const Ref_1 = require("../base/Ref");
|
|
43
44
|
const ts = __importStar(require("ohos-typescript"));
|
|
@@ -49,10 +50,10 @@ const ArkSignature_1 = require("../model/ArkSignature");
|
|
|
49
50
|
const IRUtils_1 = require("./IRUtils");
|
|
50
51
|
const ArkMethod_1 = require("../model/ArkMethod");
|
|
51
52
|
const ArkMethodBuilder_1 = require("../model/builder/ArkMethodBuilder");
|
|
52
|
-
const ArkSignatureBuilder_1 = require("../model/builder/ArkSignatureBuilder");
|
|
53
53
|
const EtsConst_1 = require("./EtsConst");
|
|
54
54
|
const Position_1 = require("../base/Position");
|
|
55
55
|
const ModelUtils_1 = require("./ModelUtils");
|
|
56
|
+
const SignatureCanonicalizerRegistry_1 = require("./SignatureCanonicalizerRegistry");
|
|
56
57
|
const Builtin_1 = require("./Builtin");
|
|
57
58
|
const TSConst_1 = require("./TSConst");
|
|
58
59
|
const builderUtils_1 = require("../model/builder/builderUtils");
|
|
@@ -79,9 +80,21 @@ class ArkIRTransformer {
|
|
|
79
80
|
this.builderMethodContextFlag = false;
|
|
80
81
|
this.sourceFile = sourceFile;
|
|
81
82
|
this.declaringMethod = declaringMethod;
|
|
83
|
+
this._declaringClass = this.declaringMethod.getDeclaringArkClass();
|
|
84
|
+
this._declaringNamespace = this._declaringClass.getDeclaringArkNamespace();
|
|
85
|
+
this._declaringFile = this._declaringClass.getDeclaringArkFile();
|
|
82
86
|
this.inBuilderMethod = ModelUtils_1.ModelUtils.isArkUIBuilderMethod(declaringMethod);
|
|
83
87
|
this.arkValueTransformer = new ArkValueTransformer_1.ArkValueTransformer(this, sourceFile, this.declaringMethod);
|
|
84
88
|
}
|
|
89
|
+
get declaringClass() {
|
|
90
|
+
return this._declaringClass;
|
|
91
|
+
}
|
|
92
|
+
get declaringNamespace() {
|
|
93
|
+
return this._declaringNamespace;
|
|
94
|
+
}
|
|
95
|
+
get declaringFile() {
|
|
96
|
+
return this._declaringFile;
|
|
97
|
+
}
|
|
85
98
|
getLocals() {
|
|
86
99
|
return this.arkValueTransformer.getLocals();
|
|
87
100
|
}
|
|
@@ -168,7 +181,7 @@ class ArkIRTransformer {
|
|
|
168
181
|
}
|
|
169
182
|
this.mapStmtsToTsStmt(stmts, node);
|
|
170
183
|
if (stmts.length > 0) {
|
|
171
|
-
IRUtils_1.IRUtils.setComments(stmts[0], node, this.sourceFile, this.
|
|
184
|
+
IRUtils_1.IRUtils.setComments(stmts[0], node, this.sourceFile, this.declaringFile.getScene().getOptions());
|
|
172
185
|
}
|
|
173
186
|
return stmts;
|
|
174
187
|
}
|
|
@@ -176,27 +189,30 @@ class ArkIRTransformer {
|
|
|
176
189
|
return this.arkValueTransformer.tsNodeToValueAndStmts(node);
|
|
177
190
|
}
|
|
178
191
|
functionDeclarationToStmts(functionDeclarationNode) {
|
|
179
|
-
const
|
|
180
|
-
const arkMethod = new ArkMethod_1.ArkMethod();
|
|
192
|
+
const arkMethod = new ArkMethod_1.ArkMethod(this.declaringClass.getClassSigID());
|
|
181
193
|
if (this.builderMethodContextFlag) {
|
|
182
194
|
ModelUtils_1.ModelUtils.implicitArkUIBuilderMethods.add(arkMethod);
|
|
183
195
|
}
|
|
184
|
-
(0, ArkMethodBuilder_1.buildArkMethodFromArkClass)(functionDeclarationNode, declaringClass, arkMethod, this.sourceFile, this.declaringMethod);
|
|
196
|
+
(0, ArkMethodBuilder_1.buildArkMethodFromArkClass)(functionDeclarationNode, this.declaringClass, arkMethod, this.sourceFile, this.declaringMethod);
|
|
185
197
|
return [];
|
|
186
198
|
}
|
|
187
199
|
classDeclarationToStmts(node) {
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
if (declaringArkNamespace) {
|
|
191
|
-
cls.setDeclaringArkNamespace(declaringArkNamespace);
|
|
192
|
-
}
|
|
193
|
-
cls.setDeclaringArkFile(this.declaringMethod.getDeclaringArkFile());
|
|
200
|
+
var _a;
|
|
201
|
+
const cls = new ArkClass_1.ArkClass(this.declaringFile.getFileSigID(), (_a = this.declaringNamespace) === null || _a === void 0 ? void 0 : _a.getNamespaceSigID());
|
|
194
202
|
(0, ArkClassBuilder_1.buildNormalArkClassFromArkMethod)(node, cls, this.sourceFile, this.declaringMethod);
|
|
203
|
+
// Register the bare source name → ClassSigID binding on the declaring method so that
|
|
204
|
+
// references (new / type annotation) resolve deterministically along the method scope
|
|
205
|
+
// chain during inference, instead of relying on file-level fuzzy prefix matching over
|
|
206
|
+
// the composed name (`Local$Outer-m`). The map key is the bare source name; the class
|
|
207
|
+
// model itself keeps the composed name.
|
|
208
|
+
if (node.name) {
|
|
209
|
+
this.declaringMethod.registerLocalClass((0, StringUtils_1.cloneText)(node.name.text), cls.getClassSigID());
|
|
210
|
+
}
|
|
195
211
|
return [];
|
|
196
212
|
}
|
|
197
213
|
// This is only used to add class property assign stmts into constructor when it is with parameter property.
|
|
198
214
|
parameterPropertyToStmts(paramNode) {
|
|
199
|
-
var _a, _b, _c;
|
|
215
|
+
var _a, _b, _c, _d;
|
|
200
216
|
let stmts = [];
|
|
201
217
|
let fieldName;
|
|
202
218
|
if (ts.isIdentifier(paramNode.name)) {
|
|
@@ -216,8 +232,7 @@ class ArkIRTransformer {
|
|
|
216
232
|
if (paramNode.modifiers === undefined || !ts.isIdentifier(paramNode.name)) {
|
|
217
233
|
return [];
|
|
218
234
|
}
|
|
219
|
-
const
|
|
220
|
-
const fieldSignature = (_a = arkClass.getFieldWithName(fieldName)) === null || _a === void 0 ? void 0 : _a.getSignature();
|
|
235
|
+
const fieldSignature = (_a = this.declaringClass.getFieldWithName(fieldName)) === null || _a === void 0 ? void 0 : _a.getSignature();
|
|
221
236
|
const paramLocal = Array.from(this.getLocals()).find(local => local.getName() === fieldName);
|
|
222
237
|
if (fieldSignature === undefined || paramLocal === undefined) {
|
|
223
238
|
return [];
|
|
@@ -226,8 +241,8 @@ class ArkIRTransformer {
|
|
|
226
241
|
const fieldAssignStmt = new Stmt_1.ArkAssignStmt(leftOp, paramLocal);
|
|
227
242
|
fieldAssignStmt.setOperandOriginalPositions([Position_1.FullPosition.DEFAULT, Position_1.FullPosition.DEFAULT, Position_1.FullPosition.DEFAULT]);
|
|
228
243
|
// If the parameter has initializer, the related stmts should be added into class instance init method.
|
|
229
|
-
const instInitMethodCfg = (_b =
|
|
230
|
-
const instInitStmts = (
|
|
244
|
+
const instInitMethodCfg = (_c = (_b = this.declaringClass.getInstanceInitMethodOrNull()) === null || _b === void 0 ? void 0 : _b.getBody()) === null || _c === void 0 ? void 0 : _c.getCfg();
|
|
245
|
+
const instInitStmts = (_d = instInitMethodCfg === null || instInitMethodCfg === void 0 ? void 0 : instInitMethodCfg.getStartingBlock()) === null || _d === void 0 ? void 0 : _d.getStmts();
|
|
231
246
|
if (paramNode.initializer && instInitStmts && instInitMethodCfg) {
|
|
232
247
|
const { value: instanceInitValue, valueOriginalPositions: instanceInitPositions, stmts: instanceInitStmts, } = this.tsNodeToValueAndStmts(paramNode.initializer);
|
|
233
248
|
const instanceAssignStmt = new Stmt_1.ArkAssignStmt(leftOp, instanceInitValue);
|
|
@@ -283,14 +298,13 @@ class ArkIRTransformer {
|
|
|
283
298
|
}
|
|
284
299
|
handleExpressionValueWithTempVarIfNeeded(value, positions, stmts) {
|
|
285
300
|
if (IRUtils_1.IRUtils.moreThanOneAddress(value)) {
|
|
286
|
-
|
|
287
|
-
tempStmts.forEach(stmt => stmts.push(stmt));
|
|
288
|
-
return { value: tempValue, positions: tempPositions };
|
|
301
|
+
return this.generateAssignStmtForValueInto(value, positions, stmts);
|
|
289
302
|
}
|
|
290
303
|
return { value, positions };
|
|
291
304
|
}
|
|
292
305
|
returnStatementToStmts(returnStatement) {
|
|
293
306
|
const stmts = [];
|
|
307
|
+
let returnType;
|
|
294
308
|
if (returnStatement.expression) {
|
|
295
309
|
let { value: exprValue, valueOriginalPositions: exprPositions, stmts: exprStmts } = this.tsNodeToValueAndStmts(returnStatement.expression);
|
|
296
310
|
exprStmts.forEach(stmt => stmts.push(stmt));
|
|
@@ -298,24 +312,24 @@ class ArkIRTransformer {
|
|
|
298
312
|
const returnStmt = new Stmt_1.ArkReturnStmt(processedValue);
|
|
299
313
|
returnStmt.setOperandOriginalPositions(processedPositions);
|
|
300
314
|
stmts.push(returnStmt);
|
|
301
|
-
|
|
302
|
-
this.declaringMethod.getSubSignature().setReturnType(processedValue.getType());
|
|
303
|
-
}
|
|
304
|
-
return stmts;
|
|
315
|
+
returnType = processedValue.getType();
|
|
305
316
|
}
|
|
306
|
-
|
|
307
|
-
|
|
317
|
+
else {
|
|
318
|
+
stmts.push(new Stmt_1.ArkReturnVoidStmt());
|
|
319
|
+
returnType = Type_1.VoidType.getInstance();
|
|
320
|
+
}
|
|
321
|
+
if (!(returnType instanceof Type_1.UnknownType) && this.declaringMethod.getSubSignature().getReturnType() instanceof Type_1.UnknownType) {
|
|
308
322
|
if (this.declaringMethod.containsModifier(ArkBaseModel_1.ModifierType.ASYNC)) {
|
|
309
|
-
const promise =
|
|
323
|
+
const promise = SdkUtils_1.SdkUtils.getSdkGlobal(TSConst_1.PROMISE);
|
|
310
324
|
if (promise instanceof ArkClass_1.ArkClass) {
|
|
311
|
-
this.declaringMethod.getSubSignature().setReturnType(new Type_1.ClassType(promise.getSignature()));
|
|
325
|
+
this.declaringMethod.getSubSignature().setReturnType(new Type_1.ClassType(promise.getSignature(), [returnType]));
|
|
312
326
|
}
|
|
313
327
|
else {
|
|
314
|
-
this.declaringMethod.getSubSignature().setReturnType(new Type_1.UnclearReferenceType(TSConst_1.PROMISE, [
|
|
328
|
+
this.declaringMethod.getSubSignature().setReturnType(new Type_1.UnclearReferenceType(TSConst_1.PROMISE, [returnType]));
|
|
315
329
|
}
|
|
316
330
|
}
|
|
317
331
|
else {
|
|
318
|
-
this.declaringMethod.getSubSignature().setReturnType(
|
|
332
|
+
this.declaringMethod.getSubSignature().setReturnType(returnType);
|
|
319
333
|
}
|
|
320
334
|
}
|
|
321
335
|
return stmts;
|
|
@@ -334,8 +348,7 @@ class ArkIRTransformer {
|
|
|
334
348
|
this.addInvokeStmts(exprValue, exprPositions, stmts);
|
|
335
349
|
}
|
|
336
350
|
else if (this.shouldGenerateExtraAssignStmt(exprNode)) {
|
|
337
|
-
|
|
338
|
-
exprStmts.forEach(stmt => stmts.push(stmt));
|
|
351
|
+
this.generateAssignStmtForValueInto(exprValue, exprPositions, stmts);
|
|
339
352
|
}
|
|
340
353
|
return stmts;
|
|
341
354
|
}
|
|
@@ -348,7 +361,7 @@ class ArkIRTransformer {
|
|
|
348
361
|
if (stmt instanceof Stmt_1.ArkAssignStmt && stmt.getRightOp() instanceof Expr_1.ArkStaticInvokeExpr) {
|
|
349
362
|
const rightOp = stmt.getRightOp();
|
|
350
363
|
if (rightOp.getMethodSignature().getMethodSubSignature().getMethodName() === EtsConst_1.COMPONENT_REPEAT) {
|
|
351
|
-
const createMethodSignature =
|
|
364
|
+
const createMethodSignature = ModelUtils_1.ModelUtils.getOrCreateComponentMethodSig(EtsConst_1.COMPONENT_REPEAT, EtsConst_1.COMPONENT_CREATE_FUNCTION);
|
|
352
365
|
const createInvokeExpr = new Expr_1.ArkStaticInvokeExpr(createMethodSignature, rightOp.getArgs());
|
|
353
366
|
stmt.setRightOp(createInvokeExpr);
|
|
354
367
|
hasRepeat = true;
|
|
@@ -449,7 +462,8 @@ class ArkIRTransformer {
|
|
|
449
462
|
// 对于type A = {x:1, y:2}语句,当前阶段即可精确获取ClassType类型,需找到对应的ArkClass作为originalObject
|
|
450
463
|
// 对于其他情况此处为UnclearReferenceTye并由类型推导进行查找和处理
|
|
451
464
|
if (rightType instanceof Type_1.ClassType) {
|
|
452
|
-
|
|
465
|
+
// TypeLiteral 的 ClassType 唯一生成路径是"构建即 addArkClass 注册、签名即归属",签名直查必命中,无需按名兜底
|
|
466
|
+
const classObject = SignatureCanonicalizerRegistry_1.SignatureCanonicalizerRegistry.getInstance().getClassBySig(rightType.getClassSignature());
|
|
453
467
|
if (classObject) {
|
|
454
468
|
expr.setOriginalObject(classObject);
|
|
455
469
|
}
|
|
@@ -471,17 +485,19 @@ class ArkIRTransformer {
|
|
|
471
485
|
}
|
|
472
486
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
473
487
|
importInfo.build(importClauseName, ArkImport_1.ImportType.TYPE_ALIAS_IMPORT, importFrom, Position_1.FullPosition.buildFromNode(importTypeNode, this.sourceFile), 0);
|
|
474
|
-
importInfo.setDeclaringArkFile(this.
|
|
488
|
+
importInfo.setDeclaringArkFile(this.declaringFile);
|
|
475
489
|
return new Expr_1.AliasTypeExpr(importInfo, importTypeNode.isTypeOf);
|
|
476
490
|
}
|
|
477
491
|
switchStatementToValueAndStmts(switchStatement) {
|
|
478
492
|
const valueAndStmtsOfSwitchAndCases = [];
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
|
|
493
|
+
const switchExprResult = this.tsNodeToValueAndStmts(switchStatement.expression);
|
|
494
|
+
const exprStmts = switchExprResult.stmts;
|
|
495
|
+
let exprValue = switchExprResult.value;
|
|
496
|
+
let exprPositions = switchExprResult.valueOriginalPositions;
|
|
482
497
|
if (IRUtils_1.IRUtils.moreThanOneAddress(exprValue)) {
|
|
483
|
-
|
|
484
|
-
|
|
498
|
+
const temp = this.generateAssignStmtForValueInto(exprValue, exprPositions, exprStmts);
|
|
499
|
+
exprValue = temp.value;
|
|
500
|
+
exprPositions = temp.positions;
|
|
485
501
|
}
|
|
486
502
|
valueAndStmtsOfSwitchAndCases.push({
|
|
487
503
|
value: exprValue,
|
|
@@ -543,20 +559,27 @@ class ArkIRTransformer {
|
|
|
543
559
|
} = this.generateAssignStmtForValue(iterableValue, iterablePositions));
|
|
544
560
|
iterableStmts.forEach(stmt => stmts.push(stmt));
|
|
545
561
|
}
|
|
562
|
+
// 教训存档(实证定案,勿再常量化):iterator/next stub 必须每循环 new 独立实例。共享实例(常量化)的断点在 ValueInference.preInfer 守卫——先推导的
|
|
563
|
+
// 循环 retireWithReplacement 共享 temp 行后,跟随循环的 expr 在 preInfer 时 getMethodSignature() 物化返回真实签名(lib.es2015)→
|
|
564
|
+
// needInfer(真实文件)=false 且 isUnclearType(IterableIterator<T>)=false(泛型实参不参与)→ 整个推导被跳过 → realGenericTypes 无人设置 → item
|
|
565
|
+
// 停留形式泛参 T → unknown。
|
|
566
|
+
// "待解析"是 per-expr 语义,共享 temp 行的"已解析"状态会传染给所有共享者——与 toString / 实例缓存同根因(归宿垄断)。
|
|
546
567
|
const iteratorMethodSubSignature = new ArkSignature_1.MethodSubSignature(Builtin_1.Builtin.ITERATOR_FUNCTION, [], Builtin_1.Builtin.ITERATOR_CLASS_TYPE);
|
|
547
|
-
const iteratorMethodSignature = new ArkSignature_1.MethodSignature(
|
|
568
|
+
const iteratorMethodSignature = new ArkSignature_1.MethodSignature(0, iteratorMethodSubSignature);
|
|
548
569
|
const iteratorInvokeExpr = new Expr_1.ArkInstanceInvokeExpr(iterableValue, iteratorMethodSignature, []);
|
|
549
570
|
const iteratorInvokeExprPositions = [iterablePositions[0], ...iterablePositions];
|
|
550
571
|
const { value: iterator, valueOriginalPositions: iteratorPositions, stmts: iteratorStmts, } = this.generateAssignStmtForValue(iteratorInvokeExpr, iteratorInvokeExprPositions);
|
|
551
572
|
iteratorStmts.forEach(stmt => stmts.push(stmt));
|
|
552
573
|
iterator.setType(Builtin_1.Builtin.ITERATOR_CLASS_TYPE);
|
|
553
|
-
const
|
|
554
|
-
const nextMethodSignature = new ArkSignature_1.MethodSignature(
|
|
574
|
+
const iteratorNextMethodSubSignature = new ArkSignature_1.MethodSubSignature(Builtin_1.Builtin.ITERATOR_NEXT, [], Builtin_1.Builtin.ITERATOR_RESULT_CLASS_TYPE);
|
|
575
|
+
const nextMethodSignature = new ArkSignature_1.MethodSignature(0, iteratorNextMethodSubSignature);
|
|
555
576
|
const iteratorNextInvokeExpr = new Expr_1.ArkInstanceInvokeExpr(iterator, nextMethodSignature, []);
|
|
556
577
|
const iteratorNextInvokeExprPositions = [iteratorPositions[0], ...iteratorPositions];
|
|
557
578
|
const { value: iteratorResult, valueOriginalPositions: iteratorResultPositions, stmts: iteratorResultStmts, } = this.generateAssignStmtForValue(iteratorNextInvokeExpr, iteratorNextInvokeExprPositions);
|
|
558
579
|
iteratorResultStmts.forEach(stmt => stmts.push(stmt));
|
|
559
580
|
iteratorResult.setType(Builtin_1.Builtin.ITERATOR_RESULT_CLASS_TYPE);
|
|
581
|
+
// Object path: the IteratorResult stub is unclear and is routed to the temp
|
|
582
|
+
// canonicalizer inside the constructor — no formal interning without a model.
|
|
560
583
|
const doneFieldSignature = new ArkSignature_1.FieldSignature(Builtin_1.Builtin.ITERATOR_RESULT_DONE, Builtin_1.Builtin.ITERATOR_RESULT_CLASS_SIGNATURE, Type_1.BooleanType.getInstance(), false);
|
|
561
584
|
const doneFieldRef = new Ref_1.ArkInstanceFieldRef(iteratorResult, doneFieldSignature);
|
|
562
585
|
const doneFieldRefPositions = [iteratorResultPositions[0], ...iteratorResultPositions];
|
|
@@ -618,16 +641,10 @@ class ArkIRTransformer {
|
|
|
618
641
|
if (this.inBuilderMethod) {
|
|
619
642
|
this.tsNodeToStmts(ifStatement.thenStatement).forEach(stmt => stmts.push(stmt));
|
|
620
643
|
if (ifStatement.elseStatement) {
|
|
621
|
-
|
|
622
|
-
const branchElseInvokeExpr = new Expr_1.ArkStaticInvokeExpr(branchElseMethodSignature, [ValueUtil_1.ValueUtil.getOrCreateNumberConst(1)]);
|
|
623
|
-
const branchElseInvokeExprPositions = [Position_1.FullPosition.buildFromNode(ifStatement.elseStatement, this.sourceFile), Position_1.FullPosition.DEFAULT];
|
|
624
|
-
const branchElseInvokeStmt = new Stmt_1.ArkInvokeStmt(branchElseInvokeExpr);
|
|
625
|
-
branchElseInvokeStmt.setOperandOriginalPositions(branchElseInvokeExprPositions);
|
|
626
|
-
stmts.push(branchElseInvokeStmt);
|
|
644
|
+
stmts.push(this.arkValueTransformer.generateBuilderIfBranch(1, Position_1.FullPosition.buildFromNode(ifStatement.elseStatement, this.sourceFile)));
|
|
627
645
|
this.tsNodeToStmts(ifStatement.elseStatement).forEach(stmt => stmts.push(stmt));
|
|
628
646
|
}
|
|
629
|
-
|
|
630
|
-
stmts.push(popInvokeStmt);
|
|
647
|
+
stmts.push(this.arkValueTransformer.generateComponentPopStmts(EtsConst_1.COMPONENT_IF));
|
|
631
648
|
}
|
|
632
649
|
return stmts;
|
|
633
650
|
}
|
|
@@ -661,26 +678,16 @@ class ArkIRTransformer {
|
|
|
661
678
|
}
|
|
662
679
|
conditionToStmts(expression) {
|
|
663
680
|
const stmts = [];
|
|
681
|
+
const { value: conditionExpr, valueOriginalPositions: conditionExprPositions, stmts: conditionStmts, } = this.arkValueTransformer.conditionToValueAndStmts(expression);
|
|
682
|
+
conditionStmts.forEach(stmt => stmts.push(stmt));
|
|
664
683
|
if (this.inBuilderMethod) {
|
|
665
|
-
const { value: conditionExpr, valueOriginalPositions: conditionExprPositions, stmts: conditionStmts, } = this.arkValueTransformer.conditionToValueAndStmts(expression);
|
|
666
|
-
conditionStmts.forEach(stmt => stmts.push(stmt));
|
|
667
|
-
const createMethodSignature = ArkSignatureBuilder_1.ArkSignatureBuilder.buildMethodSignatureFromClassNameAndMethodName(EtsConst_1.COMPONENT_IF, EtsConst_1.COMPONENT_CREATE_FUNCTION);
|
|
668
684
|
const { value: conditionLocal, valueOriginalPositions: conditionLocalPositions, stmts: assignConditionStmts, } = this.generateAssignStmtForValue(conditionExpr, conditionExprPositions);
|
|
669
685
|
assignConditionStmts.forEach(stmt => stmts.push(stmt));
|
|
670
|
-
const
|
|
671
|
-
const createInvokeExprPositions = [conditionLocalPositions[0], ...conditionLocalPositions];
|
|
672
|
-
const { stmts: createStmts } = this.generateAssignStmtForValue(createInvokeExpr, createInvokeExprPositions);
|
|
686
|
+
const { stmts: createStmts } = this.arkValueTransformer.generateComponentCreationStmts(EtsConst_1.COMPONENT_IF, [conditionLocal], conditionLocalPositions[0], conditionLocalPositions);
|
|
673
687
|
createStmts.forEach(stmt => stmts.push(stmt));
|
|
674
|
-
|
|
675
|
-
const branchInvokeExpr = new Expr_1.ArkStaticInvokeExpr(branchMethodSignature, [ValueUtil_1.ValueUtil.getOrCreateNumberConst(0)]);
|
|
676
|
-
const branchInvokeExprPositions = [conditionLocalPositions[0], Position_1.FullPosition.DEFAULT];
|
|
677
|
-
const branchInvokeStmt = new Stmt_1.ArkInvokeStmt(branchInvokeExpr);
|
|
678
|
-
branchInvokeStmt.setOperandOriginalPositions(branchInvokeExprPositions);
|
|
679
|
-
stmts.push(branchInvokeStmt);
|
|
688
|
+
stmts.push(this.arkValueTransformer.generateBuilderIfBranch(0, conditionLocalPositions[0]));
|
|
680
689
|
}
|
|
681
690
|
else {
|
|
682
|
-
const { value: conditionExpr, valueOriginalPositions: conditionExprPositions, stmts: conditionStmts, } = this.arkValueTransformer.conditionToValueAndStmts(expression);
|
|
683
|
-
conditionStmts.forEach(stmt => stmts.push(stmt));
|
|
684
691
|
const ifStmt = new Stmt_1.ArkIfStmt(conditionExpr);
|
|
685
692
|
ifStmt.setOperandOriginalPositions(conditionExprPositions);
|
|
686
693
|
stmts.push(ifStmt);
|
|
@@ -801,22 +808,34 @@ class ArkIRTransformer {
|
|
|
801
808
|
return null;
|
|
802
809
|
}
|
|
803
810
|
generateAssignStmtForValue(value, valueOriginalPositions) {
|
|
811
|
+
const stmts = [];
|
|
812
|
+
const temp = this.generateAssignStmtForValueInto(value, valueOriginalPositions, stmts);
|
|
813
|
+
return {
|
|
814
|
+
value: temp.value,
|
|
815
|
+
valueOriginalPositions: temp.positions,
|
|
816
|
+
stmts,
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Appends the temp-variable assignment (when one is needed) directly into `stmts` and
|
|
821
|
+
* returns the temp local with its position, skipping the ValueAndStmts wrapper and its
|
|
822
|
+
* single-element stmts array that generateAssignStmtForValue allocates per call.
|
|
823
|
+
*/
|
|
824
|
+
generateAssignStmtForValueInto(value, valueOriginalPositions, stmts) {
|
|
804
825
|
const leftOp = this.arkValueTransformer.generateTempLocal(value.getType());
|
|
805
826
|
if (valueOriginalPositions.length === 0) {
|
|
806
|
-
return {
|
|
807
|
-
value: leftOp,
|
|
808
|
-
valueOriginalPositions: [],
|
|
809
|
-
stmts: []
|
|
810
|
-
};
|
|
827
|
+
return { value: leftOp, positions: [] };
|
|
811
828
|
}
|
|
812
829
|
const leftOpPosition = valueOriginalPositions[0];
|
|
813
830
|
const assignStmt = new Stmt_1.ArkAssignStmt(leftOp, value);
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
valueOriginalPositions
|
|
818
|
-
|
|
819
|
-
|
|
831
|
+
const operandPositions = new Array(1 + valueOriginalPositions.length);
|
|
832
|
+
operandPositions[0] = leftOpPosition;
|
|
833
|
+
for (let i = 0; i < valueOriginalPositions.length; i++) {
|
|
834
|
+
operandPositions[i + 1] = valueOriginalPositions[i];
|
|
835
|
+
}
|
|
836
|
+
assignStmt.setOperandOriginalPositions(operandPositions);
|
|
837
|
+
stmts.push(assignStmt);
|
|
838
|
+
return { value: leftOp, positions: [leftOpPosition] };
|
|
820
839
|
}
|
|
821
840
|
generateIfStmtForValues(leftValue, leftOpOriginalPositions, rightValue, rightOpOriginalPositions) {
|
|
822
841
|
var _a;
|
|
@@ -3,11 +3,14 @@ import { Local } from '../base/Local';
|
|
|
3
3
|
import { FullPosition } from '../base/Position';
|
|
4
4
|
import { ArkAliasTypeDefineStmt, Stmt } from '../base/Stmt';
|
|
5
5
|
import { BinaryOperator } from '../base/Expr';
|
|
6
|
+
import { ArkClass } from '../model/ArkClass';
|
|
6
7
|
import { AliasType, Type } from '../base/Type';
|
|
7
8
|
import { Value } from '../base/Value';
|
|
8
9
|
import { GlobalRef } from '../base/Ref';
|
|
9
10
|
import { ArkMethod } from '../model/ArkMethod';
|
|
10
11
|
import { ArkIRTransformer, ValueAndStmts } from './ArkIRTransformer';
|
|
12
|
+
import { ArkNamespace } from '../model/ArkNamespace';
|
|
13
|
+
import { ArkFile } from '../model/ArkFile';
|
|
11
14
|
export declare class ArkValueTransformer {
|
|
12
15
|
conditionalOperatorNo: number;
|
|
13
16
|
protected tempLocalNo: number;
|
|
@@ -16,6 +19,9 @@ export declare class ArkValueTransformer {
|
|
|
16
19
|
protected globals?: Map<string, GlobalRef>;
|
|
17
20
|
protected thisLocal: Local;
|
|
18
21
|
protected declaringMethod: ArkMethod;
|
|
22
|
+
protected declaringClass: ArkClass;
|
|
23
|
+
protected declaringNamespace?: ArkNamespace;
|
|
24
|
+
protected declaringFile: ArkFile;
|
|
19
25
|
protected arkIRTransformer: ArkIRTransformer;
|
|
20
26
|
protected aliasTypeMap: Map<string, [AliasType, ArkAliasTypeDefineStmt]>;
|
|
21
27
|
protected builderMethodContextFlag: boolean;
|
|
@@ -31,6 +37,12 @@ export declare class ArkValueTransformer {
|
|
|
31
37
|
private thisExpressionToValueAndStmts;
|
|
32
38
|
private superExpressionToValueAndStmts;
|
|
33
39
|
private conditionalExpressionToValueAndStmts;
|
|
40
|
+
/**
|
|
41
|
+
* In ArkUI builder methods, lower `a ? b : c` like statement if:
|
|
42
|
+
* If.create / If.branch(0) / true / If.branch(1) / false / If.pop, still yielding a result local.
|
|
43
|
+
* Stays linear (no CFG diamond); ViewTree reads the If.create protocol.
|
|
44
|
+
*/
|
|
45
|
+
private builderConditionalExpressionToValueAndStmts;
|
|
34
46
|
private objectLiteralExpresionToValueAndStmts;
|
|
35
47
|
private appendObjectLiteralPropertyInitStmts;
|
|
36
48
|
private processObjectLiteralPropertyInitStmts;
|
|
@@ -39,7 +51,11 @@ export declare class ArkValueTransformer {
|
|
|
39
51
|
private getObjectLiteralFieldInitInfo;
|
|
40
52
|
private generateSystemComponentStmt;
|
|
41
53
|
private generateCustomViewStmt;
|
|
42
|
-
|
|
54
|
+
/** @internal Emit a component create invocation assigned to a temporary local. */
|
|
55
|
+
generateComponentCreationStmts(componentName: string, createArgs: Value[], componentExpressionPosition: FullPosition, createArgsPositionsAllFlat: FullPosition[]): ValueAndStmts;
|
|
56
|
+
/** @internal Emit an If.branch invocation for the given branch index. */
|
|
57
|
+
generateBuilderIfBranch(index: number, position?: FullPosition): Stmt;
|
|
58
|
+
/** @internal Emit a component pop invocation that closes the matching create. */
|
|
43
59
|
generateComponentPopStmts(componentName: string, componentExpressionPosition?: FullPosition): Stmt;
|
|
44
60
|
private etsComponentExpressionToValueAndStmts;
|
|
45
61
|
private classExpressionToValueAndStmts;
|
|
@@ -53,11 +69,13 @@ export declare class ArkValueTransformer {
|
|
|
53
69
|
private elementAccessExpressionToValueAndStmts;
|
|
54
70
|
private callExpressionToValueAndStmts;
|
|
55
71
|
private generateInvokeValueAndStmts;
|
|
56
|
-
private
|
|
72
|
+
private buildInvokeFullPosition;
|
|
73
|
+
private getCallNameNode;
|
|
74
|
+
private propertyAccessCalleeToInvoke;
|
|
75
|
+
private elementAccessCalleeToInvoke;
|
|
57
76
|
private handleLocalInvoke;
|
|
58
77
|
private isCustomViewCall;
|
|
59
78
|
private isSystemComponentCall;
|
|
60
|
-
private handleArrayRefInvoke;
|
|
61
79
|
private handleDefaultInvoke;
|
|
62
80
|
private parseArgumentsOfCallExpression;
|
|
63
81
|
private parseArguments;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkValueTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkValueTransformer.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArkValueTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkValueTransformer.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAA2C,IAAI,EAAE,MAAM,cAAc,CAAC;AACrG,OAAO,EAiBH,cAAc,EAGjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C,OAAO,EACH,SAAS,EAcT,IAAI,EAMP,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AActC,OAAO,EAAyE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/G,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,OAAO,EAAE,gBAAgB,EAAa,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIhF,OAAO,EAAE,YAAY,E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