@markw65/monkeyc-optimizer 1.1.59 → 1.1.61
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 +34 -34
- package/build/{chunk-53Q62QUI.cjs → chunk-KCCFA2PP.cjs} +67 -29
- package/build/optimizer.cjs +16 -16
- package/build/sdk-util.cjs +14 -14
- package/build/src/optimizer-types.d.ts +1 -0
- package/build/worker-thread.cjs +3 -3
- package/package.json +7 -3
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.61
|
|
6
|
+
|
|
7
|
+
- Disable more post-build optimizations to allow apps to verify.
|
|
8
|
+
- Add an `allowForbiddenOpts` option to re-enable the optimizations in simulator or device build mode.
|
|
9
|
+
|
|
10
|
+
### 1.1.60
|
|
11
|
+
|
|
12
|
+
- Disable the "remove argc" optimization, as it's going to start breaking verification in the app store.
|
|
13
|
+
|
|
5
14
|
### 1.1.59
|
|
6
15
|
|
|
7
16
|
- Getv and Putv can directly access local 0 (Fixes #34)
|
package/build/api.cjs
CHANGED
|
@@ -18,47 +18,47 @@ 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
|
-
collectNamespaces: () =>
|
|
23
|
-
createDocumentationMap: () =>
|
|
24
|
-
diagnostic: () =>
|
|
25
|
-
diagnosticHelper: () =>
|
|
26
|
-
findNamesInScope: () =>
|
|
27
|
-
findUsingForNode: () =>
|
|
28
|
-
formatAst: () =>
|
|
29
|
-
formatAstLongLines: () =>
|
|
30
|
-
formatScopedName: () =>
|
|
31
|
-
getApiFunctionInfo: () =>
|
|
32
|
-
getApiMapping: () =>
|
|
33
|
-
getSuperClasses: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_KCCFA2PP.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_KCCFA2PP.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_KCCFA2PP.createDocumentationMap,
|
|
24
|
+
diagnostic: () => import_chunk_KCCFA2PP.diagnostic,
|
|
25
|
+
diagnosticHelper: () => import_chunk_KCCFA2PP.diagnosticHelper,
|
|
26
|
+
findNamesInScope: () => import_chunk_KCCFA2PP.findNamesInScope,
|
|
27
|
+
findUsingForNode: () => import_chunk_KCCFA2PP.findUsingForNode,
|
|
28
|
+
formatAst: () => import_chunk_KCCFA2PP.formatAst,
|
|
29
|
+
formatAstLongLines: () => import_chunk_KCCFA2PP.formatAstLongLines,
|
|
30
|
+
formatScopedName: () => import_chunk_KCCFA2PP.formatScopedName,
|
|
31
|
+
getApiFunctionInfo: () => import_chunk_KCCFA2PP.getApiFunctionInfo,
|
|
32
|
+
getApiMapping: () => import_chunk_KCCFA2PP.getApiMapping,
|
|
33
|
+
getSuperClasses: () => import_chunk_KCCFA2PP.getSuperClasses,
|
|
34
34
|
hasProperty: () => import_chunk_MBTLUWXR.hasProperty,
|
|
35
|
-
isClassVariable: () =>
|
|
36
|
-
isLocal: () =>
|
|
37
|
-
isLookupCandidate: () =>
|
|
38
|
-
isStateNode: () =>
|
|
39
|
-
lookupByFullName: () =>
|
|
40
|
-
lookupNext: () =>
|
|
41
|
-
lookupResultContains: () =>
|
|
42
|
-
lookupWithType: () =>
|
|
43
|
-
makeToyboxLink: () =>
|
|
44
|
-
mapVarDeclsByType: () =>
|
|
45
|
-
markInvokeClassMethod: () =>
|
|
46
|
-
parseSdkVersion: () =>
|
|
47
|
-
resolveDiagnostics: () =>
|
|
48
|
-
resolveDiagnosticsMap: () =>
|
|
49
|
-
sameLookupResult: () =>
|
|
35
|
+
isClassVariable: () => import_chunk_KCCFA2PP.isClassVariable,
|
|
36
|
+
isLocal: () => import_chunk_KCCFA2PP.isLocal,
|
|
37
|
+
isLookupCandidate: () => import_chunk_KCCFA2PP.isLookupCandidate,
|
|
38
|
+
isStateNode: () => import_chunk_KCCFA2PP.isStateNode,
|
|
39
|
+
lookupByFullName: () => import_chunk_KCCFA2PP.lookupByFullName,
|
|
40
|
+
lookupNext: () => import_chunk_KCCFA2PP.lookupNext,
|
|
41
|
+
lookupResultContains: () => import_chunk_KCCFA2PP.lookupResultContains,
|
|
42
|
+
lookupWithType: () => import_chunk_KCCFA2PP.lookupWithType,
|
|
43
|
+
makeToyboxLink: () => import_chunk_KCCFA2PP.makeToyboxLink,
|
|
44
|
+
mapVarDeclsByType: () => import_chunk_KCCFA2PP.mapVarDeclsByType,
|
|
45
|
+
markInvokeClassMethod: () => import_chunk_KCCFA2PP.markInvokeClassMethod,
|
|
46
|
+
parseSdkVersion: () => import_chunk_KCCFA2PP.parseSdkVersion,
|
|
47
|
+
resolveDiagnostics: () => import_chunk_KCCFA2PP.resolveDiagnostics,
|
|
48
|
+
resolveDiagnosticsMap: () => import_chunk_KCCFA2PP.resolveDiagnosticsMap,
|
|
49
|
+
sameLookupResult: () => import_chunk_KCCFA2PP.sameLookupResult,
|
|
50
50
|
traverseAst: () => import_chunk_MBTLUWXR.traverseAst,
|
|
51
|
-
variableDeclarationName: () =>
|
|
52
|
-
visitReferences: () =>
|
|
53
|
-
visit_resources: () =>
|
|
54
|
-
visitorNode: () =>
|
|
51
|
+
variableDeclarationName: () => import_chunk_KCCFA2PP.variableDeclarationName,
|
|
52
|
+
visitReferences: () => import_chunk_KCCFA2PP.visitReferences,
|
|
53
|
+
visit_resources: () => import_chunk_KCCFA2PP.visit_resources,
|
|
54
|
+
visitorNode: () => import_chunk_KCCFA2PP.visitorNode
|
|
55
55
|
});
|
|
56
56
|
module.exports = __toCommonJS(api_exports);
|
|
57
|
-
var
|
|
57
|
+
var import_chunk_KCCFA2PP = require("./chunk-KCCFA2PP.cjs");
|
|
58
58
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
59
59
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
60
60
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
61
|
-
(0,
|
|
61
|
+
(0, import_chunk_KCCFA2PP.init_api)();
|
|
62
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
63
63
|
0 && (module.exports = {
|
|
64
64
|
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_KCCFA2PP_exports = {};
|
|
30
|
+
__export(chunk_KCCFA2PP_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -133,7 +133,7 @@ __export(chunk_53Q62QUI_exports, {
|
|
|
133
133
|
visitorNode: () => visitorNode,
|
|
134
134
|
xml_util_exports: () => xml_util_exports
|
|
135
135
|
});
|
|
136
|
-
module.exports = __toCommonJS(
|
|
136
|
+
module.exports = __toCommonJS(chunk_KCCFA2PP_exports);
|
|
137
137
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
138
138
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
139
139
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -22067,7 +22067,7 @@ function localDCE(func, context) {
|
|
|
22067
22067
|
switch (bytecode.op) {
|
|
22068
22068
|
case 19: {
|
|
22069
22069
|
const liveLocal = dceInfo.locals.has(bytecode.arg);
|
|
22070
|
-
if (!liveLocal) {
|
|
22070
|
+
if (!liveLocal && (bytecode.arg || context.config.allowForbiddenOpts)) {
|
|
22071
22071
|
(0, import_chunk_SG7ODKRM.logger)(
|
|
22072
22072
|
"dce",
|
|
22073
22073
|
2,
|
|
@@ -22344,17 +22344,22 @@ function minimizeLocals2(func, equivSets, context) {
|
|
|
22344
22344
|
locals.forEach((local, key) => {
|
|
22345
22345
|
if (key.op !== 19)
|
|
22346
22346
|
return;
|
|
22347
|
-
let
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22347
|
+
let lowest = context.config.allowForbiddenOpts ? 0 : 1;
|
|
22348
|
+
if (key.arg === 0 && !context.config.allowForbiddenOpts) {
|
|
22349
|
+
lowest = 0;
|
|
22350
|
+
} else {
|
|
22351
|
+
let inUse = 0n;
|
|
22352
|
+
local.conflicts.forEach((conflict) => {
|
|
22353
|
+
const color = colors.get(conflict);
|
|
22354
|
+
if (color != null) {
|
|
22355
|
+
inUse |= 1n << BigInt(color);
|
|
22356
|
+
}
|
|
22357
|
+
});
|
|
22358
|
+
inUse >>= BigInt(lowest);
|
|
22359
|
+
while (inUse & 1n) {
|
|
22360
|
+
lowest++;
|
|
22361
|
+
inUse >>= 1n;
|
|
22352
22362
|
}
|
|
22353
|
-
});
|
|
22354
|
-
let lowest = 0;
|
|
22355
|
-
while (inUse & 1n) {
|
|
22356
|
-
lowest++;
|
|
22357
|
-
inUse >>= 1n;
|
|
22358
22363
|
}
|
|
22359
22364
|
colors.set(key, lowest);
|
|
22360
22365
|
if (!merge[lowest]) {
|
|
@@ -22403,7 +22408,7 @@ function minimizeLocals2(func, equivSets, context) {
|
|
|
22403
22408
|
(0, import_node_assert9.default)(color != null);
|
|
22404
22409
|
let name = null;
|
|
22405
22410
|
Array.from(value2.live).some((bc) => {
|
|
22406
|
-
if (
|
|
22411
|
+
if ("range" in bc && bc.range) {
|
|
22407
22412
|
if (!name) {
|
|
22408
22413
|
name = bc.range.name;
|
|
22409
22414
|
} else if (name !== bc.range.name) {
|
|
@@ -22420,11 +22425,18 @@ function minimizeLocals2(func, equivSets, context) {
|
|
|
22420
22425
|
name = Array.from(name).join("_");
|
|
22421
22426
|
}
|
|
22422
22427
|
range = { name, id: context.nextLocalId++ };
|
|
22423
|
-
if (key.op
|
|
22428
|
+
if (key.op !== 19) {
|
|
22424
22429
|
range.isParam = true;
|
|
22425
22430
|
}
|
|
22426
22431
|
}
|
|
22427
|
-
value2.live.forEach((bc) =>
|
|
22432
|
+
value2.live.forEach((bc) => {
|
|
22433
|
+
if (bc.op === 19 ? bc.arg === 0 : opReadsLocal(bc) === 0) {
|
|
22434
|
+
if (color !== 0) {
|
|
22435
|
+
console.log("oops");
|
|
22436
|
+
}
|
|
22437
|
+
}
|
|
22438
|
+
fixupMap.set(bc, { color, range });
|
|
22439
|
+
});
|
|
22428
22440
|
});
|
|
22429
22441
|
func.blocks.forEach((block) => {
|
|
22430
22442
|
let filter = false;
|
|
@@ -22622,7 +22634,12 @@ function mergeSplitRanges(splitRanges) {
|
|
|
22622
22634
|
(count, set) => count + (set.has(key) ? 1 : 0),
|
|
22623
22635
|
0
|
|
22624
22636
|
);
|
|
22625
|
-
|
|
22637
|
+
if (num === 0) {
|
|
22638
|
+
(0, import_node_assert9.default)(x.live.size === 0);
|
|
22639
|
+
putvSets.add(/* @__PURE__ */ new Set([key]));
|
|
22640
|
+
} else {
|
|
22641
|
+
(0, import_node_assert9.default)(num === 1);
|
|
22642
|
+
}
|
|
22626
22643
|
});
|
|
22627
22644
|
const newRange = /* @__PURE__ */ new Map();
|
|
22628
22645
|
putvSets.forEach((pvSet) => {
|
|
@@ -23123,7 +23140,8 @@ function optimizeFunc(func, context) {
|
|
|
23123
23140
|
if (sizeBasedPRE2(func, context))
|
|
23124
23141
|
continue;
|
|
23125
23142
|
}
|
|
23126
|
-
|
|
23143
|
+
changes = minimizeLocals2(func, equivSets, context) || changes;
|
|
23144
|
+
if (!changes) {
|
|
23127
23145
|
return;
|
|
23128
23146
|
}
|
|
23129
23147
|
}
|
|
@@ -23163,12 +23181,21 @@ function simpleOpts(func, context) {
|
|
|
23163
23181
|
return Array.from(func.blocks.values()).reduce((changes, block) => {
|
|
23164
23182
|
for (let i = block.bytecodes.length; i--; ) {
|
|
23165
23183
|
const cur = block.bytecodes[i];
|
|
23166
|
-
if (cur.op === 0 || cur.op === 1 && cur.arg === 0 || context.config.removeArgc &&
|
|
23184
|
+
if (cur.op === 0 || cur.op === 1 && cur.arg === 0 || cur.op === 53 && context.config.removeArgc && context.config.allowForbiddenOpts) {
|
|
23167
23185
|
block.bytecodes.splice(i, 1);
|
|
23168
23186
|
changes = true;
|
|
23169
23187
|
if (logging3) {
|
|
23170
23188
|
(0, import_chunk_SG7ODKRM.log)(`${func.name}: deleting ${bytecodeToString(cur, null)}`);
|
|
23171
23189
|
}
|
|
23190
|
+
} else if (cur.op === 74 && context.config.removeArgc && context.config.allowForbiddenOpts) {
|
|
23191
|
+
const arg = cur.arg.incsp;
|
|
23192
|
+
const incsp = cur;
|
|
23193
|
+
incsp.op = 1;
|
|
23194
|
+
incsp.arg = arg;
|
|
23195
|
+
changes = true;
|
|
23196
|
+
if (logging3) {
|
|
23197
|
+
(0, import_chunk_SG7ODKRM.log)(`${func.name}: argcincsp => incsp`);
|
|
23198
|
+
}
|
|
23172
23199
|
} else if (i && cur.op === 39 && cur.arg === equalsSym) {
|
|
23173
23200
|
changes = equalSymbolToEq(block, i) || changes;
|
|
23174
23201
|
} else if (i && cur.op === 10) {
|
|
@@ -23714,14 +23741,17 @@ function getLocalsInfo(func) {
|
|
|
23714
23741
|
(block) => new Map(liveOutLocals.get(block.offset)),
|
|
23715
23742
|
(block, bc, locals) => {
|
|
23716
23743
|
switch (bc.op) {
|
|
23744
|
+
case 70:
|
|
23717
23745
|
case 18: {
|
|
23718
23746
|
const range = bc.range;
|
|
23719
23747
|
if (range) {
|
|
23720
|
-
|
|
23748
|
+
const localNum = opReadsLocal(bc);
|
|
23749
|
+
(0, import_node_assert13.default)(localNum != null);
|
|
23750
|
+
locals.set(localNum, {
|
|
23721
23751
|
name: range.name,
|
|
23722
23752
|
id: range.id,
|
|
23723
23753
|
isParam: range.isParam === true,
|
|
23724
|
-
slot:
|
|
23754
|
+
slot: localNum
|
|
23725
23755
|
});
|
|
23726
23756
|
}
|
|
23727
23757
|
break;
|
|
@@ -24056,8 +24086,9 @@ function markLocals(context) {
|
|
|
24056
24086
|
e.push(localInfo.sid);
|
|
24057
24087
|
}
|
|
24058
24088
|
});
|
|
24059
|
-
if (bc.op === 18 || bc.op ===
|
|
24060
|
-
const
|
|
24089
|
+
if (bc.op === 19 || bc.op === 18 || bc.op === 70) {
|
|
24090
|
+
const localNum = bc.op === 70 ? bc.arg.local : bc.arg;
|
|
24091
|
+
const local = live.get(localNum);
|
|
24061
24092
|
if (local) {
|
|
24062
24093
|
const range2 = { name: local.name, id: local.range };
|
|
24063
24094
|
if (local.arg) {
|
|
@@ -24311,7 +24342,7 @@ function bytecodeToString(bytecode, symbolTable) {
|
|
|
24311
24342
|
arg = offsetToString(bytecode.arg);
|
|
24312
24343
|
break;
|
|
24313
24344
|
case 70:
|
|
24314
|
-
arg = `${bytecode.range ? `${bytecode.range.name} ${bytecode.arg}${bytecode.range.isParam ? " (param)" : ""}` : bytecode.arg.local} ${symbol(bytecode.arg.var)}`;
|
|
24345
|
+
arg = `${bytecode.range ? `${bytecode.range.name} ${bytecode.arg.local}${bytecode.range.isParam ? " (param)" : ""}` : bytecode.arg.local} ${symbol(bytecode.arg.var)}`;
|
|
24315
24346
|
break;
|
|
24316
24347
|
case 69:
|
|
24317
24348
|
arg = `${symbol(bytecode.arg.module)} ${symbol(bytecode.arg.var)}`;
|
|
@@ -24439,8 +24470,12 @@ function findFunctions({
|
|
|
24439
24470
|
continue;
|
|
24440
24471
|
}
|
|
24441
24472
|
func.set(next2, block);
|
|
24442
|
-
if (func.size === 1 && block.bytecodes.length
|
|
24443
|
-
|
|
24473
|
+
if (func.size === 1 && block.bytecodes.length) {
|
|
24474
|
+
if (block.bytecodes[0].op === 53) {
|
|
24475
|
+
argc = block.bytecodes[0].arg;
|
|
24476
|
+
} else if (block.bytecodes[0].op === 74) {
|
|
24477
|
+
argc = block.bytecodes[0].arg.argc;
|
|
24478
|
+
}
|
|
24444
24479
|
}
|
|
24445
24480
|
blocks.delete(next2);
|
|
24446
24481
|
if (block.exsucc != null) {
|
|
@@ -29146,7 +29181,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29146
29181
|
const opt_time = await (0, import_chunk_SG7ODKRM.first_modified)(
|
|
29147
29182
|
Object.values(fnMap).map((v) => v.output)
|
|
29148
29183
|
);
|
|
29149
|
-
if (source_time < opt_time &&
|
|
29184
|
+
if (source_time < opt_time && 1715644798288 < opt_time) {
|
|
29150
29185
|
return {
|
|
29151
29186
|
hasTests,
|
|
29152
29187
|
diagnostics: prevDiagnostics,
|
|
@@ -29185,7 +29220,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
29185
29220
|
hasTests: hasTests2,
|
|
29186
29221
|
diagnostics,
|
|
29187
29222
|
sdkVersion,
|
|
29188
|
-
optimizerVersion: "1.1.
|
|
29223
|
+
optimizerVersion: "1.1.61",
|
|
29189
29224
|
...Object.fromEntries(
|
|
29190
29225
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
29191
29226
|
)
|
|
@@ -29701,6 +29736,9 @@ function optimizePackage(filepath, devKey, output, config) {
|
|
|
29701
29736
|
if (!devKey) {
|
|
29702
29737
|
throw new Error(`Can't sign ${filepath} without a developer key`);
|
|
29703
29738
|
}
|
|
29739
|
+
if (config?.allowForbiddenOpts) {
|
|
29740
|
+
config = { ...config, allowForbiddenOpts: false };
|
|
29741
|
+
}
|
|
29704
29742
|
const inBase = path5.basename(filepath, ".iq");
|
|
29705
29743
|
if (!output) {
|
|
29706
29744
|
output = path5.join(path5.dirname(filepath), inBase) + ".opt.iq";
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,28 +18,28 @@ 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
|
-
buildOptimizedProject: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_KCCFA2PP.StateNodeAttributes,
|
|
22
|
+
buildOptimizedProject: () => import_chunk_KCCFA2PP.buildOptimizedProject,
|
|
23
23
|
copyRecursiveAsNeeded: () => import_chunk_SG7ODKRM.copyRecursiveAsNeeded,
|
|
24
|
-
defaultConfig: () =>
|
|
25
|
-
display: () =>
|
|
26
|
-
generateOneConfig: () =>
|
|
27
|
-
generateOptimizedProject: () =>
|
|
28
|
-
getConfig: () =>
|
|
29
|
-
getProjectAnalysis: () =>
|
|
30
|
-
get_jungle: () =>
|
|
31
|
-
isErrorWithLocation: () =>
|
|
32
|
-
launchSimulator: () =>
|
|
33
|
-
manifestProducts: () =>
|
|
34
|
-
mctree: () =>
|
|
35
|
-
simulateProgram: () =>
|
|
24
|
+
defaultConfig: () => import_chunk_KCCFA2PP.defaultConfig,
|
|
25
|
+
display: () => import_chunk_KCCFA2PP.display,
|
|
26
|
+
generateOneConfig: () => import_chunk_KCCFA2PP.generateOneConfig,
|
|
27
|
+
generateOptimizedProject: () => import_chunk_KCCFA2PP.generateOptimizedProject,
|
|
28
|
+
getConfig: () => import_chunk_KCCFA2PP.getConfig,
|
|
29
|
+
getProjectAnalysis: () => import_chunk_KCCFA2PP.getProjectAnalysis,
|
|
30
|
+
get_jungle: () => import_chunk_KCCFA2PP.get_jungle,
|
|
31
|
+
isErrorWithLocation: () => import_chunk_KCCFA2PP.isErrorWithLocation,
|
|
32
|
+
launchSimulator: () => import_chunk_KCCFA2PP.launchSimulator,
|
|
33
|
+
manifestProducts: () => import_chunk_KCCFA2PP.manifestProducts,
|
|
34
|
+
mctree: () => import_chunk_KCCFA2PP.mctree,
|
|
35
|
+
simulateProgram: () => import_chunk_KCCFA2PP.simulateProgram
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(optimizer_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_chunk_KCCFA2PP = require("./chunk-KCCFA2PP.cjs");
|
|
39
39
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
40
40
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
41
41
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
42
|
-
(0,
|
|
42
|
+
(0, import_chunk_KCCFA2PP.init_optimizer)();
|
|
43
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
44
|
0 && (module.exports = {
|
|
45
45
|
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_KCCFA2PP.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_KCCFA2PP.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_KCCFA2PP.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_KCCFA2PP.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_KCCFA2PP.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_KCCFA2PP.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_KCCFA2PP.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_KCCFA2PP.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_KCCFA2PP.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_KCCFA2PP.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_KCCFA2PP.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_KCCFA2PP.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_KCCFA2PP = require("./chunk-KCCFA2PP.cjs");
|
|
36
36
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
37
37
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
38
38
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
39
|
-
(0,
|
|
39
|
+
(0, import_chunk_KCCFA2PP.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
|
@@ -47,6 +47,7 @@ export type BuildConfig = {
|
|
|
47
47
|
checkTypes?: DiagnosticType | "OFF";
|
|
48
48
|
removeArgc?: boolean;
|
|
49
49
|
postBuildPRE?: boolean;
|
|
50
|
+
allowForbiddenOpts?: boolean;
|
|
50
51
|
};
|
|
51
52
|
export type StateNodeDecl = StateNode | mctree.EnumStringMember | mctree.TypedIdentifier;
|
|
52
53
|
export type StateNodeDecls = {
|
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_KCCFA2PP = require("./chunk-KCCFA2PP.cjs");
|
|
25
25
|
var import_chunk_SG7ODKRM = require("./chunk-SG7ODKRM.cjs");
|
|
26
26
|
var import_chunk_MBTLUWXR = require("./chunk-MBTLUWXR.cjs");
|
|
27
27
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
28
28
|
var import_node_worker_threads = require("node:worker_threads");
|
|
29
29
|
var require_worker_thread = (0, import_chunk_ABYVSU2C.__commonJS)({
|
|
30
30
|
"src/worker-thread.ts"() {
|
|
31
|
-
(0,
|
|
31
|
+
(0, import_chunk_KCCFA2PP.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_KCCFA2PP.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.61",
|
|
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",
|
|
@@ -25,8 +25,12 @@
|
|
|
25
25
|
"test": "npm run test-mocha && npm run test-analysis && npm run test-optimized && npm run test-unopt && npm run test-post-only && npm run test-tiny && npm run test-remote && npm run test-remote-tests && npm run test-personality",
|
|
26
26
|
"test-mocha": "npx mocha --timeout 999999 build/mocha.cjs",
|
|
27
27
|
"test-remote": "node ./test/test.js --showInfo --postOptimize --product=pick-one --github",
|
|
28
|
-
"test-remote-tests": "node ./test/test.js --showInfo --postOptimize --product=pick-one --run-tests --github",
|
|
29
|
-
"test-
|
|
28
|
+
"test-remote-tests-default": "node ./test/test.js --showInfo --postOptimize --product=pick-one --run-tests --github",
|
|
29
|
+
"test-remote-tests-with-forbidden": "npm run test-remote-tests-default -- --allowForbiddenOpts",
|
|
30
|
+
"test-remote-tests": "npm run test-remote-tests-default && npm run test-remote-tests-with-forbidden",
|
|
31
|
+
"test-optimized-default": "node test/test.js --showInfo --postOptimize --typeCheckLevel Strict --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
32
|
+
"test-optimized-with-forbidden": "npm run test-optimized-default -- --allowForbiddenOpts",
|
|
33
|
+
"test-optimized": "npm run test-optimized-default && npm run test-optimized-with-forbidden",
|
|
30
34
|
"test-unopt": "node test/test.js --typeCheckLevel Strict --skipOptimization --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
31
35
|
"test-post-only": "node test/test.js --showInfo --typeCheckLevel Strict --skipOptimization --postOptimize --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|
|
32
36
|
"test-garmin-opt": "node test/test.js --typeCheckLevel Strict --skipOptimization --garminOptLevel=2 --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
|