@markw65/monkeyc-optimizer 1.1.2 → 1.1.4
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 +49 -0
- package/build/api.cjs +7789 -250
- package/build/optimizer.cjs +4350 -1360
- package/build/sdk-util.cjs +24 -18
- package/build/src/api.d.ts +9 -4
- package/build/src/ast.d.ts +1 -1
- package/build/src/control-flow.d.ts +2 -1
- package/build/src/data-flow.d.ts +68 -4
- package/build/src/mc-rewrite.d.ts +1 -8
- package/build/src/optimizer-types.d.ts +24 -11
- package/build/src/optimizer.d.ts +4 -16
- package/build/src/projects.d.ts +1 -1
- package/build/src/type-flow/could-be.d.ts +1 -0
- package/build/src/type-flow/dead-store.d.ts +5 -0
- package/build/src/type-flow/interp-call.d.ts +15 -3
- package/build/src/type-flow/interp.d.ts +7 -1
- package/build/src/type-flow/optimize.d.ts +1 -0
- package/build/src/type-flow/type-flow-util.d.ts +16 -0
- package/build/src/type-flow/types.d.ts +48 -45
- package/build/src/type-flow/union-type.d.ts +1 -0
- package/build/src/type-flow.d.ts +11 -2
- package/build/src/unused-exprs.d.ts +1 -1
- package/build/src/util.d.ts +3 -2
- package/build/src/visitor.d.ts +2 -1
- package/build/src/worker-task.d.ts +2 -16
- package/build/util.cjs +11 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -587,3 +587,52 @@ Bug Fixes
|
|
|
587
587
|
- Analyze constants with casts to help with constant propagation
|
|
588
588
|
- Ignore widening casts (eg a cast that is given a `Number` and converts it to `Number or String`)
|
|
589
589
|
- More accurate deletion of unused constants. Sometimes a constant that was unused after the optimization phase ended, was still considered used because of references that were eventually deleted.
|
|
590
|
+
|
|
591
|
+
### 1.1.3
|
|
592
|
+
|
|
593
|
+
- Tweaks and fixes
|
|
594
|
+
|
|
595
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.42](https://github.com/markw65/prettier-plugin-monkeyc#1042)
|
|
596
|
+
- Fixed an issue that cause inlining in return context to be too conservative
|
|
597
|
+
- Update inliner to keep a stack of locations, so that error messages can show exactly where an error occurred, even in the presence of inlining.
|
|
598
|
+
- Update diagnostic api to optionally include a uri to more detailing information.
|
|
599
|
+
|
|
600
|
+
- Type Analysis
|
|
601
|
+
|
|
602
|
+
- Track type info through branch conditions, so that in `if (x != null) { A } else { B }`, the type checker knows that x is not null in A, and it is null in B.
|
|
603
|
+
- Added checkers for return types, call arguments, assignments and variable declarations.
|
|
604
|
+
- Automatically infer Array and Dictionary types
|
|
605
|
+
- Track equivalencies, and use them for various optimizations.
|
|
606
|
+
- Add support for "strong" and "weak" type checking.
|
|
607
|
+
- Add type analysis to getProgramAnalysis.
|
|
608
|
+
|
|
609
|
+
- Optimizations
|
|
610
|
+
- Eliminate self-assignments (eg `x = x;`, but also `x = a; y = a; ... y = x;`).
|
|
611
|
+
- Eliminate dead stores.
|
|
612
|
+
- Replace more expensive accesses by less expensive ones.
|
|
613
|
+
- Delete empty else blocks.
|
|
614
|
+
- Delete if statements with empty body and no else.
|
|
615
|
+
|
|
616
|
+
### 1.1.4
|
|
617
|
+
|
|
618
|
+
- Optimizations
|
|
619
|
+
|
|
620
|
+
- Minor tweaks to dead store elimination
|
|
621
|
+
- Better type resolution for untyped code
|
|
622
|
+
|
|
623
|
+
- Enhancements
|
|
624
|
+
|
|
625
|
+
- Retain the type map in the analysis pass, so that it can be used to improve
|
|
626
|
+
the results in visitReferences
|
|
627
|
+
|
|
628
|
+
- Bug fixes
|
|
629
|
+
|
|
630
|
+
- When multiple diagnostics were reported for a single location, all but the last was lost
|
|
631
|
+
- Sometimes when evaluating MemberExpressions type-flow would give up too easily, resulting
|
|
632
|
+
in unknown types for the object, which then resulted in unexpected error messages from
|
|
633
|
+
the type checker, often involving seemingly unrelated classes.
|
|
634
|
+
- Inlining history was sometimes lost when further optimizations were performed.
|
|
635
|
+
|
|
636
|
+
- Code cleanup
|
|
637
|
+
- refactor some of the type code for better type safety
|
|
638
|
+
- turn on the eslint rule eqeqeq and fix all the issues
|