@markw65/monkeyc-optimizer 1.0.45 → 1.1.0

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
@@ -546,3 +546,31 @@ Bug Fixes
546
546
  - Better typing for resources
547
547
  - Refactor PRE
548
548
  - Improve accuracy of whether or not a function can modify a particular global (resulting in better PRE)
549
+
550
+ ### 1.1.0
551
+
552
+ - Implements a type analyzer, to enable better optimizations
553
+
554
+ - adds options `trustDeclaredTypes` and `propagateTypes`. See https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis
555
+
556
+ - Improved optimizations
557
+
558
+ - SizeBasedPRE now has finer granularity, making it generally find more opportunities
559
+ - Lots of improvements to binary operators, and folding. Subject to suitable type checks,
560
+ - `(x + K1) + K2` => `x + (K1 + K2)`
561
+ - `(x + K1) + (y + K2)` => `(x + y) + (K1 + K2)`
562
+ - `(x + K1) + y` => `(x + y) + K1`, so that `((x + K1) + y) + K2` => `(x + y) + (K1 + K2)`
563
+ - `(x + -y)` and `(-y + x)` => `x - y`
564
+ - `x + 0` => `x`
565
+ - `x * 0` => `0`
566
+ - Various boolean optimizations:
567
+ - `!x ? y : z` => `x ? z : y`
568
+ - `x ? true : false` => `x`
569
+ - `x ? false : true` => `!x`
570
+ - `x && true` => `x`, `y || false` => `y`
571
+ - constant propagation
572
+ - `var x = 42; ...; foo(x)` => `...; foo(42)`
573
+
574
+ - Bug fixes
575
+ - Fixes a bug that could ignore side effects from Method.invoke
576
+ - Fixes a crash in the inliner, when trying to inline a function with multiple returns