@markw65/monkeyc-optimizer 1.0.44 → 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 +46 -0
- package/build/api.cjs +867 -4976
- package/build/optimizer.cjs +3637 -833
- package/build/sdk-util.cjs +80 -2
- package/build/src/api.d.ts +6 -3
- package/build/src/ast.d.ts +27 -0
- package/build/src/control-flow.d.ts +1 -1
- package/build/src/data-flow.d.ts +45 -0
- package/build/src/function-info.d.ts +2 -0
- package/build/src/inliner.d.ts +1 -2
- package/build/src/jungles.d.ts +2 -1
- package/build/src/manifest.d.ts +1 -0
- package/build/src/mc-rewrite.d.ts +1 -2
- package/build/src/optimizer-types.d.ts +23 -5
- package/build/src/pre.d.ts +1 -1
- package/build/src/projects.d.ts +2 -1
- package/build/src/type-flow.d.ts +3 -0
- package/build/src/util.d.ts +6 -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/build/util.cjs +58 -2
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -528,3 +528,49 @@ Bug Fixes
|
|
|
528
528
|
|
|
529
529
|
- Add more parsing of expressions embedded in resource files. This should now be complete, in that the analasis pass should see every symbol definition and reference from anywhere in the project.
|
|
530
530
|
- Generalize constant folding to (nearly) all supported types. We don't fold additions between Float or Double and String, because the exact behavior is [buggy and upredictable](https://forums.garmin.com/developer/connect-iq/i/bug-reports/sdk-4-1-7-constant-folds-floats-strings-incorrectly)
|
|
531
|
+
|
|
532
|
+
### 1.0.45
|
|
533
|
+
|
|
534
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.41](https://github.com/markw65/prettier-plugin-monkeyc#1041)
|
|
535
|
+
|
|
536
|
+
- Fixes a few parser edge cases
|
|
537
|
+
|
|
538
|
+
- Bug fixes
|
|
539
|
+
|
|
540
|
+
- Fix a bug constant folding == and !=
|
|
541
|
+
- Make sure to include all languages, even for devices that don't support them, because they're still supported in settings. Do this in a way that avoids creating warnings.
|
|
542
|
+
- Look at all build dependencies when deciding whether to regenerate the optimized files.
|
|
543
|
+
- Don't produce errors when "-" is used as the first character of an id in a resource file (although in most cases, this is not a good idea, and will fail at compile time)
|
|
544
|
+
|
|
545
|
+
- Improvements
|
|
546
|
+
- Better typing for resources
|
|
547
|
+
- Refactor PRE
|
|
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
|