@markw65/monkeyc-optimizer 1.1.93 → 1.1.95
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/CHANGELOG.md +15 -0
- package/build/api.cjs +39 -39
- package/build/{chunk-BPXB3WQQ.cjs → chunk-LUAKJ7GM.cjs} +72 -22
- package/build/optimizer.cjs +18 -18
- package/build/sdk-util.cjs +14 -14
- package/build/src/function-info.d.ts +1 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.95
|
|
6
|
+
|
|
7
|
+
- Fix a regression introduced in `1.1.94`
|
|
8
|
+
- Fix lookup of calls in data flow to ignore locals
|
|
9
|
+
- Revert a fix I put in to match [a Garmin bug](https://forums.garmin.com/developer/connect-iq/i/bug-reports/relative-paths-in-local-variables-in-jungle-files-are-resolved-incorrectly) since that bug was fixed in `Sdk-8.0.0`.
|
|
10
|
+
|
|
11
|
+
### 1.1.94
|
|
12
|
+
|
|
13
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.65](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1065)
|
|
14
|
+
- Fix an issue that prevented a blank line after a catch block being preserved
|
|
15
|
+
- Replace a horribly inefficient regex with a loop to avoid stack overflows when `@markw65/monkeyc-optimizer` tries to write large files.
|
|
16
|
+
|
|
17
|
+
- Compute and use FunctionInfo during analysis pass
|
|
18
|
+
- Better interference analysis for computed MemberDeclarations
|
|
19
|
+
|
|
5
20
|
### 1.1.93
|
|
6
21
|
|
|
7
22
|
- Update to [@markw65/prettier-plugin-monkeyc@1.0.64](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1064)
|
package/build/api.cjs
CHANGED
|
@@ -18,52 +18,52 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var api_exports = {};
|
|
20
20
|
__export(api_exports, {
|
|
21
|
-
checkCompilerVersion: () =>
|
|
22
|
-
clearDiagnostics: () =>
|
|
23
|
-
collectNamespaces: () =>
|
|
24
|
-
createDocumentationMap: () =>
|
|
25
|
-
declKey: () =>
|
|
26
|
-
diagnostic: () =>
|
|
27
|
-
diagnosticHelper: () =>
|
|
28
|
-
findNamesInScope: () =>
|
|
29
|
-
findUsingForNode: () =>
|
|
30
|
-
formatAst: () =>
|
|
31
|
-
formatAstLongLines: () =>
|
|
32
|
-
formatScopedName: () =>
|
|
33
|
-
getApiFunctionInfo: () =>
|
|
34
|
-
getApiMapping: () =>
|
|
35
|
-
getSuperClasses: () =>
|
|
36
|
-
handleImportUsing: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_LUAKJ7GM.checkCompilerVersion,
|
|
22
|
+
clearDiagnostics: () => import_chunk_LUAKJ7GM.clearDiagnostics,
|
|
23
|
+
collectNamespaces: () => import_chunk_LUAKJ7GM.collectNamespaces,
|
|
24
|
+
createDocumentationMap: () => import_chunk_LUAKJ7GM.createDocumentationMap,
|
|
25
|
+
declKey: () => import_chunk_LUAKJ7GM.declKey,
|
|
26
|
+
diagnostic: () => import_chunk_LUAKJ7GM.diagnostic,
|
|
27
|
+
diagnosticHelper: () => import_chunk_LUAKJ7GM.diagnosticHelper,
|
|
28
|
+
findNamesInScope: () => import_chunk_LUAKJ7GM.findNamesInScope,
|
|
29
|
+
findUsingForNode: () => import_chunk_LUAKJ7GM.findUsingForNode,
|
|
30
|
+
formatAst: () => import_chunk_LUAKJ7GM.formatAst,
|
|
31
|
+
formatAstLongLines: () => import_chunk_LUAKJ7GM.formatAstLongLines,
|
|
32
|
+
formatScopedName: () => import_chunk_LUAKJ7GM.formatScopedName,
|
|
33
|
+
getApiFunctionInfo: () => import_chunk_LUAKJ7GM.getApiFunctionInfo,
|
|
34
|
+
getApiMapping: () => import_chunk_LUAKJ7GM.getApiMapping,
|
|
35
|
+
getSuperClasses: () => import_chunk_LUAKJ7GM.getSuperClasses,
|
|
36
|
+
handleImportUsing: () => import_chunk_LUAKJ7GM.handleImportUsing,
|
|
37
37
|
hasProperty: () => import_chunk_UBAYZSM3.hasProperty,
|
|
38
|
-
isClassVariable: () =>
|
|
39
|
-
isLocal: () =>
|
|
40
|
-
isLookupCandidate: () =>
|
|
41
|
-
isStateNode: () =>
|
|
42
|
-
lookupByFullName: () =>
|
|
43
|
-
lookupNext: () =>
|
|
44
|
-
lookupResultContains: () =>
|
|
45
|
-
lookupWithType: () =>
|
|
46
|
-
makeToyboxLink: () =>
|
|
47
|
-
mapVarDeclsByType: () =>
|
|
48
|
-
markInvokeClassMethod: () =>
|
|
49
|
-
parseSdkVersion: () =>
|
|
50
|
-
popRootNode: () =>
|
|
51
|
-
pushRootNode: () =>
|
|
52
|
-
resolveDiagnostics: () =>
|
|
53
|
-
resolveDiagnosticsMap: () =>
|
|
54
|
-
sameLookupResult: () =>
|
|
38
|
+
isClassVariable: () => import_chunk_LUAKJ7GM.isClassVariable,
|
|
39
|
+
isLocal: () => import_chunk_LUAKJ7GM.isLocal,
|
|
40
|
+
isLookupCandidate: () => import_chunk_LUAKJ7GM.isLookupCandidate,
|
|
41
|
+
isStateNode: () => import_chunk_LUAKJ7GM.isStateNode,
|
|
42
|
+
lookupByFullName: () => import_chunk_LUAKJ7GM.lookupByFullName,
|
|
43
|
+
lookupNext: () => import_chunk_LUAKJ7GM.lookupNext,
|
|
44
|
+
lookupResultContains: () => import_chunk_LUAKJ7GM.lookupResultContains,
|
|
45
|
+
lookupWithType: () => import_chunk_LUAKJ7GM.lookupWithType,
|
|
46
|
+
makeToyboxLink: () => import_chunk_LUAKJ7GM.makeToyboxLink,
|
|
47
|
+
mapVarDeclsByType: () => import_chunk_LUAKJ7GM.mapVarDeclsByType,
|
|
48
|
+
markInvokeClassMethod: () => import_chunk_LUAKJ7GM.markInvokeClassMethod,
|
|
49
|
+
parseSdkVersion: () => import_chunk_LUAKJ7GM.parseSdkVersion,
|
|
50
|
+
popRootNode: () => import_chunk_LUAKJ7GM.popRootNode,
|
|
51
|
+
pushRootNode: () => import_chunk_LUAKJ7GM.pushRootNode,
|
|
52
|
+
resolveDiagnostics: () => import_chunk_LUAKJ7GM.resolveDiagnostics,
|
|
53
|
+
resolveDiagnosticsMap: () => import_chunk_LUAKJ7GM.resolveDiagnosticsMap,
|
|
54
|
+
sameLookupResult: () => import_chunk_LUAKJ7GM.sameLookupResult,
|
|
55
55
|
traverseAst: () => import_chunk_UBAYZSM3.traverseAst,
|
|
56
|
-
variableDeclarationName: () =>
|
|
57
|
-
visitReferences: () =>
|
|
58
|
-
visit_resources: () =>
|
|
59
|
-
visitorNode: () =>
|
|
56
|
+
variableDeclarationName: () => import_chunk_LUAKJ7GM.variableDeclarationName,
|
|
57
|
+
visitReferences: () => import_chunk_LUAKJ7GM.visitReferences,
|
|
58
|
+
visit_resources: () => import_chunk_LUAKJ7GM.visit_resources,
|
|
59
|
+
visitorNode: () => import_chunk_LUAKJ7GM.visitorNode
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(api_exports);
|
|
62
|
-
var
|
|
62
|
+
var import_chunk_LUAKJ7GM = require("./chunk-LUAKJ7GM.cjs");
|
|
63
63
|
var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
|
|
64
64
|
var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
|
|
65
65
|
var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
|
|
66
|
-
(0,
|
|
66
|
+
(0, import_chunk_LUAKJ7GM.init_api)();
|
|
67
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
68
68
|
0 && (module.exports = {
|
|
69
69
|
checkCompilerVersion,
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_LUAKJ7GM_exports = {};
|
|
30
|
+
__export(chunk_LUAKJ7GM_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -140,7 +140,7 @@ __export(chunk_BPXB3WQQ_exports, {
|
|
|
140
140
|
visitorNode: () => visitorNode,
|
|
141
141
|
xml_util_exports: () => xml_util_exports
|
|
142
142
|
});
|
|
143
|
-
module.exports = __toCommonJS(
|
|
143
|
+
module.exports = __toCommonJS(chunk_LUAKJ7GM_exports);
|
|
144
144
|
var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
|
|
145
145
|
var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
|
|
146
146
|
var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
|
|
@@ -3506,7 +3506,7 @@ function recordCalledFunc(func, callee) {
|
|
|
3506
3506
|
return null;
|
|
3507
3507
|
}
|
|
3508
3508
|
function recordCalledFuncs(func, callees) {
|
|
3509
|
-
|
|
3509
|
+
(0, import_chunk_IJS7AYMN.forEach)(callees, (callee) => {
|
|
3510
3510
|
recordCalledFunc(func, callee);
|
|
3511
3511
|
});
|
|
3512
3512
|
}
|
|
@@ -3594,6 +3594,7 @@ var init_function_info = (0, import_chunk_VS2QQHAK.__esm)({
|
|
|
3594
3594
|
"src/function-info.ts"() {
|
|
3595
3595
|
"use strict";
|
|
3596
3596
|
(0, import_chunk_UBAYZSM3.init_ast)();
|
|
3597
|
+
(0, import_chunk_IJS7AYMN.init_util)();
|
|
3597
3598
|
}
|
|
3598
3599
|
});
|
|
3599
3600
|
var buildConfigDescription;
|
|
@@ -11653,6 +11654,10 @@ function updateAffected(blockState, objectType, baseDecl, assignedPath, affected
|
|
|
11653
11654
|
function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStores, logThisRun) {
|
|
11654
11655
|
const order = getPostOrder(graph).reverse();
|
|
11655
11656
|
const queue = new DataflowQueue();
|
|
11657
|
+
const rootFunc = root.type === "FunctionDeclaration" ? root : null;
|
|
11658
|
+
if (rootFunc) {
|
|
11659
|
+
delete rootFunc.next_info;
|
|
11660
|
+
}
|
|
11656
11661
|
const isStatic = !!(root.attributes & 8);
|
|
11657
11662
|
const klass = root.stack?.[root.stack?.length - 1].sn;
|
|
11658
11663
|
const selfClassDecl = klass && klass.type === "ClassDeclaration" ? klass : null;
|
|
@@ -12029,10 +12034,29 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12029
12034
|
root,
|
|
12030
12035
|
dependencies
|
|
12031
12036
|
};
|
|
12032
|
-
const modifiableDecl = (decls, callees) =>
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
12037
|
+
const modifiableDecl = (decls, callees, node) => {
|
|
12038
|
+
if (!callees) {
|
|
12039
|
+
const lv = node.type === "AssignmentExpression" ? node.left : node.type === "UpdateExpression" ? node.argument : null;
|
|
12040
|
+
if (lv?.type === "MemberExpression" && lv.computed) {
|
|
12041
|
+
if (lv.property.type === "Literal") {
|
|
12042
|
+
return false;
|
|
12043
|
+
}
|
|
12044
|
+
if ((lv.property.type !== "UnaryExpression" || lv.property.operator !== ":") && !couldBe(
|
|
12045
|
+
{
|
|
12046
|
+
type: 131072
|
|
12047
|
+
/* Symbol */
|
|
12048
|
+
},
|
|
12049
|
+
evaluate(istate, lv.property).value
|
|
12050
|
+
)) {
|
|
12051
|
+
return false;
|
|
12052
|
+
}
|
|
12053
|
+
}
|
|
12054
|
+
}
|
|
12055
|
+
return (0, import_chunk_IJS7AYMN.some)(
|
|
12056
|
+
decls,
|
|
12057
|
+
(decl) => decl.type === "VariableDeclarator" && decl.node.kind === "var" && !isLocal(decl) && (!callees || (0, import_chunk_IJS7AYMN.some)(callees, (callee) => functionMayModify(state, callee, decl)))
|
|
12058
|
+
);
|
|
12059
|
+
};
|
|
12036
12060
|
const mergeSuccState = (top, curState) => {
|
|
12037
12061
|
top.succs?.forEach((succ) => {
|
|
12038
12062
|
if (succ.order == null) {
|
|
@@ -12457,6 +12481,13 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12457
12481
|
(0, import_chunk_IJS7AYMN.log)(describeEvent(event).then((eventStr) => ` ${eventStr}`));
|
|
12458
12482
|
}
|
|
12459
12483
|
modInterference(curState, event, true, (callees, calleeObj) => {
|
|
12484
|
+
if (rootFunc) {
|
|
12485
|
+
if (callees) {
|
|
12486
|
+
recordCalledFuncs(rootFunc, callees);
|
|
12487
|
+
} else {
|
|
12488
|
+
recordModifiedUnknown(rootFunc);
|
|
12489
|
+
}
|
|
12490
|
+
}
|
|
12460
12491
|
clearRelatedCopyPropEvents(curState, null, nodeCopyProp);
|
|
12461
12492
|
if (calleeObj) {
|
|
12462
12493
|
const objType = getStateType(curState, calleeObj);
|
|
@@ -12485,7 +12516,7 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12485
12516
|
if ((type.value == null || !(type.type & (32768 | 512 | 1024))) && !(0, import_chunk_IJS7AYMN.some)(decl, (d) => d.type === "VariableDeclarator" && !isLocal(d))) {
|
|
12486
12517
|
return;
|
|
12487
12518
|
}
|
|
12488
|
-
if (modifiableDecl(decl, callees)) {
|
|
12519
|
+
if (modifiableDecl(decl, callees, event.node)) {
|
|
12489
12520
|
if (tsv.equivSet) {
|
|
12490
12521
|
removeEquiv(curState.map, decl);
|
|
12491
12522
|
}
|
|
@@ -12519,6 +12550,26 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12519
12550
|
break;
|
|
12520
12551
|
}
|
|
12521
12552
|
case "def": {
|
|
12553
|
+
if (rootFunc) {
|
|
12554
|
+
(0, import_chunk_IJS7AYMN.forEach)(event.decl, (decl) => {
|
|
12555
|
+
if (decl.type === "VariableDeclarator") {
|
|
12556
|
+
if (decl.node.kind !== "var") return;
|
|
12557
|
+
if (isLocal(decl)) return;
|
|
12558
|
+
recordModifiedDecl(rootFunc, decl);
|
|
12559
|
+
return;
|
|
12560
|
+
}
|
|
12561
|
+
if (decl.type === "MemberDecl") {
|
|
12562
|
+
const name = isLookupCandidate(decl.node);
|
|
12563
|
+
if (name) {
|
|
12564
|
+
recordModifiedName(rootFunc, name.name);
|
|
12565
|
+
return;
|
|
12566
|
+
}
|
|
12567
|
+
} else if (decl.type !== "Unknown") {
|
|
12568
|
+
return;
|
|
12569
|
+
}
|
|
12570
|
+
recordModifiedUnknown(rootFunc);
|
|
12571
|
+
});
|
|
12572
|
+
}
|
|
12522
12573
|
const lval = event.node.type === "UpdateExpression" ? event.node.argument : event.node.type === "AssignmentExpression" ? event.node.left : null;
|
|
12523
12574
|
if (lval) {
|
|
12524
12575
|
if (nodeCopyProp.size && lval.type === "MemberExpression") {
|
|
@@ -13089,6 +13140,9 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
13089
13140
|
}
|
|
13090
13141
|
);
|
|
13091
13142
|
}
|
|
13143
|
+
if (rootFunc) {
|
|
13144
|
+
rootFunc.info = rootFunc.next_info ?? false;
|
|
13145
|
+
}
|
|
13092
13146
|
return {
|
|
13093
13147
|
istate,
|
|
13094
13148
|
nodeEquivs,
|
|
@@ -18693,16 +18747,18 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
|
|
|
18693
18747
|
}
|
|
18694
18748
|
return canon;
|
|
18695
18749
|
};
|
|
18696
|
-
const findDecl = (node) => {
|
|
18750
|
+
const findDecl = (node, nonLocal = false) => {
|
|
18697
18751
|
const path8 = [];
|
|
18752
|
+
const root2 = node;
|
|
18698
18753
|
while (node.type === "MemberExpression" && (wantsAllRefs || !node.computed)) {
|
|
18699
18754
|
path8.unshift(node);
|
|
18700
18755
|
node = node.object;
|
|
18756
|
+
nonLocal = false;
|
|
18701
18757
|
}
|
|
18702
18758
|
if (node.type !== "Identifier" && node.type !== "ThisExpression") {
|
|
18703
18759
|
return null;
|
|
18704
18760
|
}
|
|
18705
|
-
let [, results] = state.lookup(node);
|
|
18761
|
+
let [, results] = nonLocal ? state.lookupNonlocal(node) : state.lookup(node);
|
|
18706
18762
|
if (!results) {
|
|
18707
18763
|
return wantsAllRefs ? { type: "Unknown", node: path8.pop() } : null;
|
|
18708
18764
|
}
|
|
@@ -18724,7 +18780,7 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
|
|
|
18724
18780
|
)) {
|
|
18725
18781
|
return {
|
|
18726
18782
|
type: "MemberDecl",
|
|
18727
|
-
node,
|
|
18783
|
+
node: root2,
|
|
18728
18784
|
base: decl,
|
|
18729
18785
|
path: path8
|
|
18730
18786
|
};
|
|
@@ -18958,7 +19014,7 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
|
|
|
18958
19014
|
case "CallExpression": {
|
|
18959
19015
|
liveDef(null, stmt);
|
|
18960
19016
|
if (wantsAllRefs) {
|
|
18961
|
-
const calleeDecl = findDecl(node.callee);
|
|
19017
|
+
const calleeDecl = findDecl(node.callee, true);
|
|
18962
19018
|
if (calleeDecl) {
|
|
18963
19019
|
const mod = {
|
|
18964
19020
|
type: "mod",
|
|
@@ -25824,13 +25880,7 @@ function evaluate_locals(assignments) {
|
|
|
25824
25880
|
while (true) {
|
|
25825
25881
|
assignments = assignments.filter((a) => {
|
|
25826
25882
|
if (a.names.length === 1 && a.values.every((v) => v.type === "Literal")) {
|
|
25827
|
-
locals[a.names[0]] = a.values
|
|
25828
|
-
if ("source" in v) {
|
|
25829
|
-
v = { ...v };
|
|
25830
|
-
delete v.source;
|
|
25831
|
-
}
|
|
25832
|
-
return v;
|
|
25833
|
-
});
|
|
25883
|
+
locals[a.names[0]] = a.values;
|
|
25834
25884
|
return false;
|
|
25835
25885
|
}
|
|
25836
25886
|
return true;
|
|
@@ -27387,7 +27437,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
27387
27437
|
const opt_time = await (0, import_chunk_IJS7AYMN.first_modified)(
|
|
27388
27438
|
Object.values(fnMap).map((v) => v.output)
|
|
27389
27439
|
);
|
|
27390
|
-
if (source_time < opt_time &&
|
|
27440
|
+
if (source_time < opt_time && 1769898389896 < opt_time) {
|
|
27391
27441
|
return {
|
|
27392
27442
|
hasTests,
|
|
27393
27443
|
diagnostics: prevDiagnostics,
|
|
@@ -27425,7 +27475,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
27425
27475
|
hasTests: hasTests2,
|
|
27426
27476
|
diagnostics,
|
|
27427
27477
|
sdkVersion,
|
|
27428
|
-
optimizerVersion: "1.1.
|
|
27478
|
+
optimizerVersion: "1.1.95",
|
|
27429
27479
|
...Object.fromEntries(
|
|
27430
27480
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
27431
27481
|
)
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,30 +18,30 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var optimizer_exports = {};
|
|
20
20
|
__export(optimizer_exports, {
|
|
21
|
-
StateNodeAttributes: () =>
|
|
22
|
-
buildConfigDescription: () =>
|
|
23
|
-
buildOptimizedProject: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_LUAKJ7GM.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_LUAKJ7GM.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_LUAKJ7GM.buildOptimizedProject,
|
|
24
24
|
copyRecursiveAsNeeded: () => import_chunk_IJS7AYMN.copyRecursiveAsNeeded,
|
|
25
|
-
defaultConfig: () =>
|
|
26
|
-
display: () =>
|
|
27
|
-
generateOneConfig: () =>
|
|
28
|
-
generateOptimizedProject: () =>
|
|
29
|
-
getConfig: () =>
|
|
30
|
-
getFnMapAnalysis: () =>
|
|
31
|
-
getProjectAnalysis: () =>
|
|
32
|
-
get_jungle: () =>
|
|
33
|
-
isErrorWithLocation: () =>
|
|
34
|
-
launchSimulator: () =>
|
|
35
|
-
manifestProducts: () =>
|
|
36
|
-
mctree: () =>
|
|
37
|
-
simulateProgram: () =>
|
|
25
|
+
defaultConfig: () => import_chunk_LUAKJ7GM.defaultConfig,
|
|
26
|
+
display: () => import_chunk_LUAKJ7GM.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_LUAKJ7GM.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_LUAKJ7GM.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_LUAKJ7GM.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_LUAKJ7GM.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_LUAKJ7GM.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_LUAKJ7GM.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_LUAKJ7GM.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_LUAKJ7GM.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_LUAKJ7GM.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_LUAKJ7GM.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_LUAKJ7GM.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_LUAKJ7GM = require("./chunk-LUAKJ7GM.cjs");
|
|
41
41
|
var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
|
|
42
42
|
var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
|
|
43
43
|
var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
|
|
44
|
-
(0,
|
|
44
|
+
(0, import_chunk_LUAKJ7GM.init_optimizer)();
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
46
|
0 && (module.exports = {
|
|
47
47
|
StateNodeAttributes,
|
package/build/sdk-util.cjs
CHANGED
|
@@ -18,25 +18,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var sdk_util_exports = {};
|
|
20
20
|
__export(sdk_util_exports, {
|
|
21
|
-
SectionKinds: () =>
|
|
22
|
-
appSupport: () =>
|
|
23
|
-
connectiq: () =>
|
|
24
|
-
getDeviceInfo: () =>
|
|
25
|
-
getFunctionDocumentation: () =>
|
|
26
|
-
getLanguages: () =>
|
|
27
|
-
getSdkPath: () =>
|
|
28
|
-
isWin: () =>
|
|
29
|
-
optimizeProgram: () =>
|
|
30
|
-
readPrg: () =>
|
|
31
|
-
readPrgWithOffsets: () =>
|
|
32
|
-
xmlUtil: () =>
|
|
21
|
+
SectionKinds: () => import_chunk_LUAKJ7GM.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_LUAKJ7GM.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_LUAKJ7GM.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_LUAKJ7GM.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_LUAKJ7GM.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_LUAKJ7GM.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_LUAKJ7GM.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_LUAKJ7GM.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_LUAKJ7GM.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_LUAKJ7GM.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_LUAKJ7GM.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_LUAKJ7GM.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_LUAKJ7GM = require("./chunk-LUAKJ7GM.cjs");
|
|
36
36
|
var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
|
|
37
37
|
var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
|
|
38
38
|
var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
|
|
39
|
-
(0,
|
|
39
|
+
(0, import_chunk_LUAKJ7GM.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
|
@@ -7,7 +7,7 @@ export declare function recordModifiedDecls(func: FunctionStateNode, lookupDefs:
|
|
|
7
7
|
export declare function recordModifiedName(func: FunctionStateNode, name: string): void;
|
|
8
8
|
export declare function recordModifiedUnknown(func: FunctionStateNode): void;
|
|
9
9
|
export declare function recordCalledFunc(func: FunctionStateNode, callee: FunctionStateNode): null;
|
|
10
|
-
export declare function recordCalledFuncs(func: FunctionStateNode, callees: FunctionStateNode[]): void;
|
|
10
|
+
export declare function recordCalledFuncs(func: FunctionStateNode, callees: FunctionStateNode | FunctionStateNode[]): void;
|
|
11
11
|
export declare function functionMayModify(state: ProgramStateAnalysis, func: FunctionStateNode, decl: VariableStateNode): boolean;
|
|
12
12
|
export declare function findCallees(lookupDefs: LookupDefinition[]): FunctionStateNode[] | null;
|
|
13
13
|
export declare function findCalleesForNew(lookupDefs: LookupDefinition[]): FunctionStateNode[];
|
package/build/worker-thread.cjs
CHANGED
|
@@ -21,17 +21,17 @@ __export(worker_thread_exports, {
|
|
|
21
21
|
default: () => worker_thread_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(worker_thread_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_LUAKJ7GM = require("./chunk-LUAKJ7GM.cjs");
|
|
25
25
|
var import_chunk_IJS7AYMN = require("./chunk-IJS7AYMN.cjs");
|
|
26
26
|
var import_chunk_UBAYZSM3 = require("./chunk-UBAYZSM3.cjs");
|
|
27
27
|
var import_chunk_VS2QQHAK = require("./chunk-VS2QQHAK.cjs");
|
|
28
28
|
var import_node_worker_threads = require("node:worker_threads");
|
|
29
29
|
var require_worker_thread = (0, import_chunk_VS2QQHAK.__commonJS)({
|
|
30
30
|
"src/worker-thread.ts"() {
|
|
31
|
-
(0,
|
|
31
|
+
(0, import_chunk_LUAKJ7GM.init_worker_task)();
|
|
32
32
|
if (import_node_worker_threads.parentPort) {
|
|
33
33
|
import_node_worker_threads.parentPort.on("message", async (task) => {
|
|
34
|
-
return import_node_worker_threads.parentPort.postMessage(await (0,
|
|
34
|
+
return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_LUAKJ7GM.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markw65/monkeyc-optimizer",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.95",
|
|
5
5
|
"description": "Source to source optimizer for Garmin Monkey C code",
|
|
6
6
|
"main": "build/optimizer.cjs",
|
|
7
7
|
"types": "build/src/optimizer.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"author": "markw65",
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@markw65/prettier-plugin-monkeyc": "^1.0.
|
|
59
|
+
"@markw65/prettier-plugin-monkeyc": "^1.0.65",
|
|
60
60
|
"7z-wasm": "^1.2.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|