@markw65/monkeyc-optimizer 1.1.93 → 1.1.94
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 +9 -0
- package/build/api.cjs +39 -39
- package/build/{chunk-BPXB3WQQ.cjs → chunk-5SB3QASN.cjs} +70 -12
- 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,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.94
|
|
6
|
+
|
|
7
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.65](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1065)
|
|
8
|
+
- Fix an issue that prevented a blank line after a catch block being preserved
|
|
9
|
+
- Replace a horribly inefficient regex with a loop to avoid stack overflows when `@markw65/monkeyc-optimizer` tries to write large files.
|
|
10
|
+
|
|
11
|
+
- Compute and use FunctionInfo during analysis pass
|
|
12
|
+
- Better interference analysis for computed MemberDeclarations
|
|
13
|
+
|
|
5
14
|
### 1.1.93
|
|
6
15
|
|
|
7
16
|
- 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_5SB3QASN.checkCompilerVersion,
|
|
22
|
+
clearDiagnostics: () => import_chunk_5SB3QASN.clearDiagnostics,
|
|
23
|
+
collectNamespaces: () => import_chunk_5SB3QASN.collectNamespaces,
|
|
24
|
+
createDocumentationMap: () => import_chunk_5SB3QASN.createDocumentationMap,
|
|
25
|
+
declKey: () => import_chunk_5SB3QASN.declKey,
|
|
26
|
+
diagnostic: () => import_chunk_5SB3QASN.diagnostic,
|
|
27
|
+
diagnosticHelper: () => import_chunk_5SB3QASN.diagnosticHelper,
|
|
28
|
+
findNamesInScope: () => import_chunk_5SB3QASN.findNamesInScope,
|
|
29
|
+
findUsingForNode: () => import_chunk_5SB3QASN.findUsingForNode,
|
|
30
|
+
formatAst: () => import_chunk_5SB3QASN.formatAst,
|
|
31
|
+
formatAstLongLines: () => import_chunk_5SB3QASN.formatAstLongLines,
|
|
32
|
+
formatScopedName: () => import_chunk_5SB3QASN.formatScopedName,
|
|
33
|
+
getApiFunctionInfo: () => import_chunk_5SB3QASN.getApiFunctionInfo,
|
|
34
|
+
getApiMapping: () => import_chunk_5SB3QASN.getApiMapping,
|
|
35
|
+
getSuperClasses: () => import_chunk_5SB3QASN.getSuperClasses,
|
|
36
|
+
handleImportUsing: () => import_chunk_5SB3QASN.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_5SB3QASN.isClassVariable,
|
|
39
|
+
isLocal: () => import_chunk_5SB3QASN.isLocal,
|
|
40
|
+
isLookupCandidate: () => import_chunk_5SB3QASN.isLookupCandidate,
|
|
41
|
+
isStateNode: () => import_chunk_5SB3QASN.isStateNode,
|
|
42
|
+
lookupByFullName: () => import_chunk_5SB3QASN.lookupByFullName,
|
|
43
|
+
lookupNext: () => import_chunk_5SB3QASN.lookupNext,
|
|
44
|
+
lookupResultContains: () => import_chunk_5SB3QASN.lookupResultContains,
|
|
45
|
+
lookupWithType: () => import_chunk_5SB3QASN.lookupWithType,
|
|
46
|
+
makeToyboxLink: () => import_chunk_5SB3QASN.makeToyboxLink,
|
|
47
|
+
mapVarDeclsByType: () => import_chunk_5SB3QASN.mapVarDeclsByType,
|
|
48
|
+
markInvokeClassMethod: () => import_chunk_5SB3QASN.markInvokeClassMethod,
|
|
49
|
+
parseSdkVersion: () => import_chunk_5SB3QASN.parseSdkVersion,
|
|
50
|
+
popRootNode: () => import_chunk_5SB3QASN.popRootNode,
|
|
51
|
+
pushRootNode: () => import_chunk_5SB3QASN.pushRootNode,
|
|
52
|
+
resolveDiagnostics: () => import_chunk_5SB3QASN.resolveDiagnostics,
|
|
53
|
+
resolveDiagnosticsMap: () => import_chunk_5SB3QASN.resolveDiagnosticsMap,
|
|
54
|
+
sameLookupResult: () => import_chunk_5SB3QASN.sameLookupResult,
|
|
55
55
|
traverseAst: () => import_chunk_UBAYZSM3.traverseAst,
|
|
56
|
-
variableDeclarationName: () =>
|
|
57
|
-
visitReferences: () =>
|
|
58
|
-
visit_resources: () =>
|
|
59
|
-
visitorNode: () =>
|
|
56
|
+
variableDeclarationName: () => import_chunk_5SB3QASN.variableDeclarationName,
|
|
57
|
+
visitReferences: () => import_chunk_5SB3QASN.visitReferences,
|
|
58
|
+
visit_resources: () => import_chunk_5SB3QASN.visit_resources,
|
|
59
|
+
visitorNode: () => import_chunk_5SB3QASN.visitorNode
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(api_exports);
|
|
62
|
-
var
|
|
62
|
+
var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.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_5SB3QASN.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_5SB3QASN_exports = {};
|
|
30
|
+
__export(chunk_5SB3QASN_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_5SB3QASN_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,32 @@ 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) return true;
|
|
12041
|
+
if (lv.type === "MemberExpression") {
|
|
12042
|
+
if (lv.computed) {
|
|
12043
|
+
if (lv.property.type === "Literal") {
|
|
12044
|
+
return false;
|
|
12045
|
+
}
|
|
12046
|
+
if ((lv.property.type !== "UnaryExpression" || lv.property.operator !== ":") && !couldBe(
|
|
12047
|
+
{
|
|
12048
|
+
type: 131072
|
|
12049
|
+
/* Symbol */
|
|
12050
|
+
},
|
|
12051
|
+
evaluate(istate, lv.property).value
|
|
12052
|
+
)) {
|
|
12053
|
+
return false;
|
|
12054
|
+
}
|
|
12055
|
+
}
|
|
12056
|
+
}
|
|
12057
|
+
}
|
|
12058
|
+
return (0, import_chunk_IJS7AYMN.some)(
|
|
12059
|
+
decls,
|
|
12060
|
+
(decl) => decl.type === "VariableDeclarator" && decl.node.kind === "var" && !isLocal(decl) && (0, import_chunk_IJS7AYMN.some)(callees, (callee) => functionMayModify(state, callee, decl))
|
|
12061
|
+
);
|
|
12062
|
+
};
|
|
12036
12063
|
const mergeSuccState = (top, curState) => {
|
|
12037
12064
|
top.succs?.forEach((succ) => {
|
|
12038
12065
|
if (succ.order == null) {
|
|
@@ -12457,6 +12484,13 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12457
12484
|
(0, import_chunk_IJS7AYMN.log)(describeEvent(event).then((eventStr) => ` ${eventStr}`));
|
|
12458
12485
|
}
|
|
12459
12486
|
modInterference(curState, event, true, (callees, calleeObj) => {
|
|
12487
|
+
if (rootFunc) {
|
|
12488
|
+
if (callees) {
|
|
12489
|
+
recordCalledFuncs(rootFunc, callees);
|
|
12490
|
+
} else {
|
|
12491
|
+
recordModifiedUnknown(rootFunc);
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12460
12494
|
clearRelatedCopyPropEvents(curState, null, nodeCopyProp);
|
|
12461
12495
|
if (calleeObj) {
|
|
12462
12496
|
const objType = getStateType(curState, calleeObj);
|
|
@@ -12485,7 +12519,7 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12485
12519
|
if ((type.value == null || !(type.type & (32768 | 512 | 1024))) && !(0, import_chunk_IJS7AYMN.some)(decl, (d) => d.type === "VariableDeclarator" && !isLocal(d))) {
|
|
12486
12520
|
return;
|
|
12487
12521
|
}
|
|
12488
|
-
if (modifiableDecl(decl, callees)) {
|
|
12522
|
+
if (modifiableDecl(decl, callees, event.node)) {
|
|
12489
12523
|
if (tsv.equivSet) {
|
|
12490
12524
|
removeEquiv(curState.map, decl);
|
|
12491
12525
|
}
|
|
@@ -12519,6 +12553,26 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
12519
12553
|
break;
|
|
12520
12554
|
}
|
|
12521
12555
|
case "def": {
|
|
12556
|
+
if (rootFunc) {
|
|
12557
|
+
(0, import_chunk_IJS7AYMN.forEach)(event.decl, (decl) => {
|
|
12558
|
+
if (decl.type === "VariableDeclarator") {
|
|
12559
|
+
if (decl.node.kind !== "var") return;
|
|
12560
|
+
if (isLocal(decl)) return;
|
|
12561
|
+
recordModifiedDecl(rootFunc, decl);
|
|
12562
|
+
return;
|
|
12563
|
+
}
|
|
12564
|
+
if (decl.type === "MemberDecl") {
|
|
12565
|
+
const name = isLookupCandidate(decl.node);
|
|
12566
|
+
if (name) {
|
|
12567
|
+
recordModifiedName(rootFunc, name.name);
|
|
12568
|
+
return;
|
|
12569
|
+
}
|
|
12570
|
+
} else if (decl.type !== "Unknown") {
|
|
12571
|
+
return;
|
|
12572
|
+
}
|
|
12573
|
+
recordModifiedUnknown(rootFunc);
|
|
12574
|
+
});
|
|
12575
|
+
}
|
|
12522
12576
|
const lval = event.node.type === "UpdateExpression" ? event.node.argument : event.node.type === "AssignmentExpression" ? event.node.left : null;
|
|
12523
12577
|
if (lval) {
|
|
12524
12578
|
if (nodeCopyProp.size && lval.type === "MemberExpression") {
|
|
@@ -13089,6 +13143,9 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
13089
13143
|
}
|
|
13090
13144
|
);
|
|
13091
13145
|
}
|
|
13146
|
+
if (rootFunc) {
|
|
13147
|
+
rootFunc.info = rootFunc.next_info ?? false;
|
|
13148
|
+
}
|
|
13092
13149
|
return {
|
|
13093
13150
|
istate,
|
|
13094
13151
|
nodeEquivs,
|
|
@@ -18695,6 +18752,7 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
|
|
|
18695
18752
|
};
|
|
18696
18753
|
const findDecl = (node) => {
|
|
18697
18754
|
const path8 = [];
|
|
18755
|
+
const root2 = node;
|
|
18698
18756
|
while (node.type === "MemberExpression" && (wantsAllRefs || !node.computed)) {
|
|
18699
18757
|
path8.unshift(node);
|
|
18700
18758
|
node = node.object;
|
|
@@ -18724,7 +18782,7 @@ function buildDataFlowGraph(state, root, wantsLiteral, trackInsertionPoints, wan
|
|
|
18724
18782
|
)) {
|
|
18725
18783
|
return {
|
|
18726
18784
|
type: "MemberDecl",
|
|
18727
|
-
node,
|
|
18785
|
+
node: root2,
|
|
18728
18786
|
base: decl,
|
|
18729
18787
|
path: path8
|
|
18730
18788
|
};
|
|
@@ -27387,7 +27445,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
27387
27445
|
const opt_time = await (0, import_chunk_IJS7AYMN.first_modified)(
|
|
27388
27446
|
Object.values(fnMap).map((v) => v.output)
|
|
27389
27447
|
);
|
|
27390
|
-
if (source_time < opt_time &&
|
|
27448
|
+
if (source_time < opt_time && 1769823563413 < opt_time) {
|
|
27391
27449
|
return {
|
|
27392
27450
|
hasTests,
|
|
27393
27451
|
diagnostics: prevDiagnostics,
|
|
@@ -27425,7 +27483,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
27425
27483
|
hasTests: hasTests2,
|
|
27426
27484
|
diagnostics,
|
|
27427
27485
|
sdkVersion,
|
|
27428
|
-
optimizerVersion: "1.1.
|
|
27486
|
+
optimizerVersion: "1.1.94",
|
|
27429
27487
|
...Object.fromEntries(
|
|
27430
27488
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
27431
27489
|
)
|
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_5SB3QASN.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_5SB3QASN.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_5SB3QASN.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_5SB3QASN.defaultConfig,
|
|
26
|
+
display: () => import_chunk_5SB3QASN.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_5SB3QASN.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_5SB3QASN.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_5SB3QASN.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_5SB3QASN.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_5SB3QASN.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_5SB3QASN.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_5SB3QASN.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_5SB3QASN.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_5SB3QASN.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_5SB3QASN.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_5SB3QASN.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.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_5SB3QASN.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_5SB3QASN.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_5SB3QASN.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_5SB3QASN.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_5SB3QASN.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_5SB3QASN.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_5SB3QASN.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_5SB3QASN.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_5SB3QASN.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_5SB3QASN.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_5SB3QASN.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_5SB3QASN.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_5SB3QASN.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_5SB3QASN = require("./chunk-5SB3QASN.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_5SB3QASN.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_5SB3QASN = require("./chunk-5SB3QASN.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_5SB3QASN.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_5SB3QASN.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.94",
|
|
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": {
|