@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 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: () => import_chunk_27ZJJM2Y.checkCompilerVersion,
22
- collectNamespaces: () => import_chunk_27ZJJM2Y.collectNamespaces,
23
- createDocumentationMap: () => import_chunk_27ZJJM2Y.createDocumentationMap,
24
- diagnostic: () => import_chunk_27ZJJM2Y.diagnostic,
25
- diagnosticHelper: () => import_chunk_27ZJJM2Y.diagnosticHelper,
26
- findNamesInScope: () => import_chunk_27ZJJM2Y.findNamesInScope,
27
- findUsingForNode: () => import_chunk_27ZJJM2Y.findUsingForNode,
28
- formatAst: () => import_chunk_27ZJJM2Y.formatAst,
29
- formatAstLongLines: () => import_chunk_27ZJJM2Y.formatAstLongLines,
30
- getApiFunctionInfo: () => import_chunk_27ZJJM2Y.getApiFunctionInfo,
31
- getApiMapping: () => import_chunk_27ZJJM2Y.getApiMapping,
32
- getSuperClasses: () => import_chunk_27ZJJM2Y.getSuperClasses,
33
- hasProperty: () => import_chunk_27ZJJM2Y.hasProperty,
34
- isClassVariable: () => import_chunk_27ZJJM2Y.isClassVariable,
35
- isLocal: () => import_chunk_27ZJJM2Y.isLocal,
36
- isLookupCandidate: () => import_chunk_27ZJJM2Y.isLookupCandidate,
37
- isStateNode: () => import_chunk_27ZJJM2Y.isStateNode,
38
- lookupByFullName: () => import_chunk_27ZJJM2Y.lookupByFullName,
39
- lookupNext: () => import_chunk_27ZJJM2Y.lookupNext,
40
- lookupResultContains: () => import_chunk_27ZJJM2Y.lookupResultContains,
41
- lookupWithType: () => import_chunk_27ZJJM2Y.lookupWithType,
42
- makeToyboxLink: () => import_chunk_27ZJJM2Y.makeToyboxLink,
43
- mapVarDeclsByType: () => import_chunk_27ZJJM2Y.mapVarDeclsByType,
44
- markInvokeClassMethod: () => import_chunk_27ZJJM2Y.markInvokeClassMethod,
45
- parseSdkVersion: () => import_chunk_27ZJJM2Y.parseSdkVersion,
46
- sameLookupResult: () => import_chunk_27ZJJM2Y.sameLookupResult,
47
- traverseAst: () => import_chunk_27ZJJM2Y.traverseAst,
48
- variableDeclarationName: () => import_chunk_27ZJJM2Y.variableDeclarationName,
49
- visitReferences: () => import_chunk_27ZJJM2Y.visitReferences,
50
- visit_resources: () => import_chunk_27ZJJM2Y.visit_resources,
51
- visitorNode: () => import_chunk_27ZJJM2Y.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 import_chunk_27ZJJM2Y = require("./chunk-27ZJJM2Y.cjs");
55
- var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
56
- (0, import_chunk_27ZJJM2Y.init_api)();
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,