@markw65/monkeyc-optimizer 1.1.23 → 1.1.24
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/README.md +15 -0
- package/build/api.cjs +34 -34
- package/build/{chunk-27ZJJM2Y.cjs → chunk-3HVXWNU4.cjs} +1435 -452
- package/build/{chunk-HHQDDCTP.cjs → chunk-QFQPBQSO.cjs} +4 -4
- package/build/optimizer.cjs +19 -19
- package/build/sdk-util.cjs +15 -15
- package/build/src/optimizer-types.d.ts +1 -0
- package/build/src/readprg/bytecode.d.ts +2 -0
- package/build/src/readprg/cflow.d.ts +2 -1
- package/build/src/readprg/emit.d.ts +10 -1
- package/build/src/readprg/interp.d.ts +1 -0
- package/build/src/readprg/opcodes.d.ts +18 -2
- package/build/src/readprg/pre.d.ts +2 -0
- package/build/src/readprg/symbols.d.ts +1 -0
- package/build/src/type-flow/interp.d.ts +1 -0
- package/build/util.cjs +24 -24
- package/build/worker-thread.cjs +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -828,3 +828,18 @@ Bug Fixes
|
|
|
828
828
|
### 1.1.23
|
|
829
829
|
|
|
830
830
|
No functional change, just fixes a typo that broke the typescript exports.
|
|
831
|
+
|
|
832
|
+
### 1.1.24
|
|
833
|
+
|
|
834
|
+
- Bug fixes
|
|
835
|
+
|
|
836
|
+
- Conversion of unary `-x` to `0 - x` was too restrictive, causing some missed optimization opportunities
|
|
837
|
+
|
|
838
|
+
- Post Build Optimizations
|
|
839
|
+
- Added a pass equivalent to `Minimize Locals` in the source-to-source optimizer. This pass can see and re-assign all the locals, so it does better than the source-to-source optimizer. In addition, it maintains the variable mapping, so the debugger still sees the original names. As a result, its probably best to disable the `Minimize Locals` pass if the post build optimizer is enabled.
|
|
840
|
+
- Added a pass similar to `Size Based PRE` in the source-to-source optimizer. Currently this only optimizes constants and Symbols, but it has visibility to a lot of things the source-to-source optimizer can't see; so the two passes are complementary. I've added an option in case it causes problems, but it's enabled by default when the post build optimizer is enabled.
|
|
841
|
+
- Added various new optimizations to the interp pass:
|
|
842
|
+
- Handles a few more byte codes
|
|
843
|
+
- Conditional branches that are known to be taken, or known to be not taken are converted to gotos (and the gotos will often be eliminated by re-ordering blocks)
|
|
844
|
+
- Conditional branches that would be known to be taken, or known to be not taken if evalated at the end of one of their predecessors will be bypassed from that predecessor. Amongst other things, this converts for and while loops, that can be proven to iterate at least once, into do-while loops.
|
|
845
|
+
- Improved the emitter's algorithm for ordering blocks to avoid some more gotos
|
package/build/api.cjs
CHANGED
|
@@ -18,42 +18,42 @@ 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
|
-
getApiFunctionInfo: () =>
|
|
31
|
-
getApiMapping: () =>
|
|
32
|
-
getSuperClasses: () =>
|
|
33
|
-
hasProperty: () =>
|
|
34
|
-
isClassVariable: () =>
|
|
35
|
-
isLocal: () =>
|
|
36
|
-
isLookupCandidate: () =>
|
|
37
|
-
isStateNode: () =>
|
|
38
|
-
lookupByFullName: () =>
|
|
39
|
-
lookupNext: () =>
|
|
40
|
-
lookupResultContains: () =>
|
|
41
|
-
lookupWithType: () =>
|
|
42
|
-
makeToyboxLink: () =>
|
|
43
|
-
mapVarDeclsByType: () =>
|
|
44
|
-
markInvokeClassMethod: () =>
|
|
45
|
-
parseSdkVersion: () =>
|
|
46
|
-
sameLookupResult: () =>
|
|
47
|
-
traverseAst: () =>
|
|
48
|
-
variableDeclarationName: () =>
|
|
49
|
-
visitReferences: () =>
|
|
50
|
-
visit_resources: () =>
|
|
51
|
-
visitorNode: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_3HVXWNU4.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_3HVXWNU4.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_3HVXWNU4.createDocumentationMap,
|
|
24
|
+
diagnostic: () => import_chunk_3HVXWNU4.diagnostic,
|
|
25
|
+
diagnosticHelper: () => import_chunk_3HVXWNU4.diagnosticHelper,
|
|
26
|
+
findNamesInScope: () => import_chunk_3HVXWNU4.findNamesInScope,
|
|
27
|
+
findUsingForNode: () => import_chunk_3HVXWNU4.findUsingForNode,
|
|
28
|
+
formatAst: () => import_chunk_3HVXWNU4.formatAst,
|
|
29
|
+
formatAstLongLines: () => import_chunk_3HVXWNU4.formatAstLongLines,
|
|
30
|
+
getApiFunctionInfo: () => import_chunk_3HVXWNU4.getApiFunctionInfo,
|
|
31
|
+
getApiMapping: () => import_chunk_3HVXWNU4.getApiMapping,
|
|
32
|
+
getSuperClasses: () => import_chunk_3HVXWNU4.getSuperClasses,
|
|
33
|
+
hasProperty: () => import_chunk_3HVXWNU4.hasProperty,
|
|
34
|
+
isClassVariable: () => import_chunk_3HVXWNU4.isClassVariable,
|
|
35
|
+
isLocal: () => import_chunk_3HVXWNU4.isLocal,
|
|
36
|
+
isLookupCandidate: () => import_chunk_3HVXWNU4.isLookupCandidate,
|
|
37
|
+
isStateNode: () => import_chunk_3HVXWNU4.isStateNode,
|
|
38
|
+
lookupByFullName: () => import_chunk_3HVXWNU4.lookupByFullName,
|
|
39
|
+
lookupNext: () => import_chunk_3HVXWNU4.lookupNext,
|
|
40
|
+
lookupResultContains: () => import_chunk_3HVXWNU4.lookupResultContains,
|
|
41
|
+
lookupWithType: () => import_chunk_3HVXWNU4.lookupWithType,
|
|
42
|
+
makeToyboxLink: () => import_chunk_3HVXWNU4.makeToyboxLink,
|
|
43
|
+
mapVarDeclsByType: () => import_chunk_3HVXWNU4.mapVarDeclsByType,
|
|
44
|
+
markInvokeClassMethod: () => import_chunk_3HVXWNU4.markInvokeClassMethod,
|
|
45
|
+
parseSdkVersion: () => import_chunk_3HVXWNU4.parseSdkVersion,
|
|
46
|
+
sameLookupResult: () => import_chunk_3HVXWNU4.sameLookupResult,
|
|
47
|
+
traverseAst: () => import_chunk_3HVXWNU4.traverseAst,
|
|
48
|
+
variableDeclarationName: () => import_chunk_3HVXWNU4.variableDeclarationName,
|
|
49
|
+
visitReferences: () => import_chunk_3HVXWNU4.visitReferences,
|
|
50
|
+
visit_resources: () => import_chunk_3HVXWNU4.visit_resources,
|
|
51
|
+
visitorNode: () => import_chunk_3HVXWNU4.visitorNode
|
|
52
52
|
});
|
|
53
53
|
module.exports = __toCommonJS(api_exports);
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
(0,
|
|
54
|
+
var import_chunk_3HVXWNU4 = require("./chunk-3HVXWNU4.cjs");
|
|
55
|
+
var import_chunk_QFQPBQSO = require("./chunk-QFQPBQSO.cjs");
|
|
56
|
+
(0, import_chunk_3HVXWNU4.init_api)();
|
|
57
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
58
|
0 && (module.exports = {
|
|
59
59
|
checkCompilerVersion,
|