@markw65/monkeyc-optimizer 1.1.20 → 1.1.22

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
@@ -793,3 +793,34 @@ Bug Fixes
793
793
 
794
794
  - Optimizations
795
795
  - Improve dce in the post build optimizer a little, by computing which locals are live out of each block.
796
+
797
+ ### 1.1.21
798
+
799
+ - Bug fixes
800
+
801
+ - fixed a bug that could cause dead-store elimination to delete stores that might be used if an exception was thrown. eg `try { x=1; foo(); x=2; } catch (ex) { System.println(x); x=3; }` could delete the first store to `x`, breaking the println if `foo` actually throws.
802
+
803
+ - Source to Source Optimizations
804
+
805
+ - convert `++` and `--` to `+= 1` and `-= 1`. Garmin's compiler generates exactly the same code for both, but when the `1` is written explicitly, its available for `sizeBasedPRE` to optimize.
806
+ - convert `-x` to `0 - x`. Again, Garmin's compiler generates exactly the same code, but being explicit makes the `0` available to `sizeBasedPRE`.
807
+ - rewrite some optimizations so that `-x` and `0-x` are treated identically. eg `(0-x) + y` => `y - x` (for suitably typed `x` and `y`).
808
+ - optimize `-1 - x` to `~x` (for suitably typed x), saving 5 bytes (or 2 if pre was going to replace the -1 with a local)
809
+
810
+ - Post Build Optimizations
811
+ - Keep better track of exceptional edges in dce, allowing it to be more aggressive.
812
+ - Add a (very simple) bytecode interpreter which keeps track of the values in locals, and on the stack. This allows us to opportunistically replace constants (typically 5+ bytes) with a 2 byte load from a register, or from a stack location. This (together with dce) will form the infrastructure for a future minimize-locals pass.
813
+ - when replacing constants with locals/stack accesses, look for uses of `~`. Eg if the value `2` is in the local `x`, and we need to produce the value `-3`, we can use `~x` (costing 3 bytes, instead of 5).
814
+
815
+ ### 1.1.22
816
+
817
+ - Bug fixes
818
+
819
+ - [Fixes a bug in Single Use Copy Prop](https://github.com/markw65/prettier-extension-monkeyc/issues/8)
820
+
821
+ - Post Build Optimizations
822
+ - Updates the array-init optimizations to include `ByteArray`s
823
+ - Integrate the array-init optimization with the new interp pass, so that changes made by interp don't interfere with array-init
824
+ - Handle more bytecodes in interp
825
+ - If an array is initialized to its default value, drop the initializers
826
+ - Add an option to [remove argc bytecodes](https://github.com/markw65/monkeyc-optimizer/wiki/Post-Build-Optimizer#remove-argc)
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_DCGJCC63.checkCompilerVersion,
22
- collectNamespaces: () => import_chunk_DCGJCC63.collectNamespaces,
23
- createDocumentationMap: () => import_chunk_DCGJCC63.createDocumentationMap,
24
- diagnostic: () => import_chunk_DCGJCC63.diagnostic,
25
- diagnosticHelper: () => import_chunk_DCGJCC63.diagnosticHelper,
26
- findNamesInScope: () => import_chunk_DCGJCC63.findNamesInScope,
27
- findUsingForNode: () => import_chunk_DCGJCC63.findUsingForNode,
28
- formatAst: () => import_chunk_DCGJCC63.formatAst,
29
- formatAstLongLines: () => import_chunk_DCGJCC63.formatAstLongLines,
30
- getApiFunctionInfo: () => import_chunk_DCGJCC63.getApiFunctionInfo,
31
- getApiMapping: () => import_chunk_DCGJCC63.getApiMapping,
32
- getSuperClasses: () => import_chunk_DCGJCC63.getSuperClasses,
33
- hasProperty: () => import_chunk_DCGJCC63.hasProperty,
34
- isClassVariable: () => import_chunk_DCGJCC63.isClassVariable,
35
- isLocal: () => import_chunk_DCGJCC63.isLocal,
36
- isLookupCandidate: () => import_chunk_DCGJCC63.isLookupCandidate,
37
- isStateNode: () => import_chunk_DCGJCC63.isStateNode,
38
- lookupByFullName: () => import_chunk_DCGJCC63.lookupByFullName,
39
- lookupNext: () => import_chunk_DCGJCC63.lookupNext,
40
- lookupResultContains: () => import_chunk_DCGJCC63.lookupResultContains,
41
- lookupWithType: () => import_chunk_DCGJCC63.lookupWithType,
42
- makeToyboxLink: () => import_chunk_DCGJCC63.makeToyboxLink,
43
- mapVarDeclsByType: () => import_chunk_DCGJCC63.mapVarDeclsByType,
44
- markInvokeClassMethod: () => import_chunk_DCGJCC63.markInvokeClassMethod,
45
- parseSdkVersion: () => import_chunk_DCGJCC63.parseSdkVersion,
46
- sameLookupResult: () => import_chunk_DCGJCC63.sameLookupResult,
47
- traverseAst: () => import_chunk_DCGJCC63.traverseAst,
48
- variableDeclarationName: () => import_chunk_DCGJCC63.variableDeclarationName,
49
- visitReferences: () => import_chunk_DCGJCC63.visitReferences,
50
- visit_resources: () => import_chunk_DCGJCC63.visit_resources,
51
- visitorNode: () => import_chunk_DCGJCC63.visitorNode
21
+ checkCompilerVersion: () => import_chunk_563GVBVT.checkCompilerVersion,
22
+ collectNamespaces: () => import_chunk_563GVBVT.collectNamespaces,
23
+ createDocumentationMap: () => import_chunk_563GVBVT.createDocumentationMap,
24
+ diagnostic: () => import_chunk_563GVBVT.diagnostic,
25
+ diagnosticHelper: () => import_chunk_563GVBVT.diagnosticHelper,
26
+ findNamesInScope: () => import_chunk_563GVBVT.findNamesInScope,
27
+ findUsingForNode: () => import_chunk_563GVBVT.findUsingForNode,
28
+ formatAst: () => import_chunk_563GVBVT.formatAst,
29
+ formatAstLongLines: () => import_chunk_563GVBVT.formatAstLongLines,
30
+ getApiFunctionInfo: () => import_chunk_563GVBVT.getApiFunctionInfo,
31
+ getApiMapping: () => import_chunk_563GVBVT.getApiMapping,
32
+ getSuperClasses: () => import_chunk_563GVBVT.getSuperClasses,
33
+ hasProperty: () => import_chunk_563GVBVT.hasProperty,
34
+ isClassVariable: () => import_chunk_563GVBVT.isClassVariable,
35
+ isLocal: () => import_chunk_563GVBVT.isLocal,
36
+ isLookupCandidate: () => import_chunk_563GVBVT.isLookupCandidate,
37
+ isStateNode: () => import_chunk_563GVBVT.isStateNode,
38
+ lookupByFullName: () => import_chunk_563GVBVT.lookupByFullName,
39
+ lookupNext: () => import_chunk_563GVBVT.lookupNext,
40
+ lookupResultContains: () => import_chunk_563GVBVT.lookupResultContains,
41
+ lookupWithType: () => import_chunk_563GVBVT.lookupWithType,
42
+ makeToyboxLink: () => import_chunk_563GVBVT.makeToyboxLink,
43
+ mapVarDeclsByType: () => import_chunk_563GVBVT.mapVarDeclsByType,
44
+ markInvokeClassMethod: () => import_chunk_563GVBVT.markInvokeClassMethod,
45
+ parseSdkVersion: () => import_chunk_563GVBVT.parseSdkVersion,
46
+ sameLookupResult: () => import_chunk_563GVBVT.sameLookupResult,
47
+ traverseAst: () => import_chunk_563GVBVT.traverseAst,
48
+ variableDeclarationName: () => import_chunk_563GVBVT.variableDeclarationName,
49
+ visitReferences: () => import_chunk_563GVBVT.visitReferences,
50
+ visit_resources: () => import_chunk_563GVBVT.visit_resources,
51
+ visitorNode: () => import_chunk_563GVBVT.visitorNode
52
52
  });
53
53
  module.exports = __toCommonJS(api_exports);
54
- var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
55
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
56
- (0, import_chunk_DCGJCC63.init_api)();
54
+ var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
55
+ var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
56
+ (0, import_chunk_563GVBVT.init_api)();
57
57
  // Annotate the CommonJS export names for ESM import in node:
58
58
  0 && (module.exports = {
59
59
  checkCompilerVersion,