@markw65/monkeyc-optimizer 1.0.45 → 1.1.1
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 +32 -0
- package/build/api.cjs +448 -4794
- package/build/optimizer.cjs +3243 -690
- package/build/sdk-util.cjs +22 -2
- package/build/src/api.d.ts +5 -3
- package/build/src/ast.d.ts +1 -0
- package/build/src/control-flow.d.ts +1 -1
- package/build/src/data-flow.d.ts +1 -1
- package/build/src/inliner.d.ts +1 -2
- package/build/src/mc-rewrite.d.ts +1 -2
- package/build/src/optimizer-types.d.ts +11 -2
- package/build/src/type-flow/could-be.d.ts +2 -0
- package/build/src/{interp-binary.d.ts → type-flow/interp-binary.d.ts} +1 -1
- package/build/src/type-flow/interp-call.d.ts +4 -0
- package/build/src/{interp.d.ts → type-flow/interp.d.ts} +4 -4
- package/build/src/type-flow/intersection-type.d.ts +4 -0
- package/build/src/type-flow/optimize.d.ts +6 -0
- package/build/src/type-flow/sub-type.d.ts +2 -0
- package/build/src/{mc-types.d.ts → type-flow/types.d.ts} +43 -8
- package/build/src/type-flow/union-type.d.ts +3 -0
- package/build/src/type-flow.d.ts +0 -1
- package/build/src/worker-pool.d.ts +1 -1
- package/build/src/worker-task.d.ts +49 -18
- package/build/src/worker-thread.d.ts +1 -0
- package/package.json +8 -3
- package/build/src/interp-call.d.ts +0 -3
package/README.md
CHANGED
|
@@ -546,3 +546,35 @@ 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
|
|
577
|
+
|
|
578
|
+
### 1.1.1
|
|
579
|
+
|
|
580
|
+
- Fix the package spec to include the new .d.ts files
|