@markw65/monkeyc-optimizer 1.1.33 → 1.1.35
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/CHANGELOG.md +959 -0
- package/README.md +7 -930
- package/build/api.cjs +31 -31
- package/build/{chunk-7ANQTFGD.cjs → chunk-Q5WTV4CN.cjs} +1090 -2277
- package/build/optimizer.cjs +17 -17
- package/build/sdk-util.cjs +14 -14
- package/build/src/readprg.d.ts +0 -6
- package/build/src/type-flow/interp.d.ts +3 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +2 -1
- package/build/src/readprg/switch.d.ts +0 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,959 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
|
+
|
|
5
|
+
### 1.1.35
|
|
6
|
+
|
|
7
|
+
- Infrastructure
|
|
8
|
+
|
|
9
|
+
- Optimize the xml parser to speed up compilation/analysis
|
|
10
|
+
|
|
11
|
+
- Type Checker
|
|
12
|
+
- More accurate tracking of Array and Dictionary types
|
|
13
|
+
|
|
14
|
+
### 1.1.34
|
|
15
|
+
|
|
16
|
+
- Optimizations
|
|
17
|
+
|
|
18
|
+
- Add a few more peephole optimizations to the post build optimizer
|
|
19
|
+
- `incsp 0;` => `nop`
|
|
20
|
+
- `ipush 0; shlv` => `nop`
|
|
21
|
+
- `ipush 1; shlv` => `dup 0; addv`
|
|
22
|
+
|
|
23
|
+
- Type checker
|
|
24
|
+
- Add warnings for incorrect assignments to Arrays and ByteArrays
|
|
25
|
+
- Properly type the elements of ByteArrays (always Number)
|
|
26
|
+
- Never warn about casts to `Object?`, even if the source type might not be an `Object?`
|
|
27
|
+
|
|
28
|
+
### 1.1.33
|
|
29
|
+
|
|
30
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.51](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1051)
|
|
31
|
+
|
|
32
|
+
- Makes it compatible with prettier@3.0.0
|
|
33
|
+
|
|
34
|
+
- Bug fixes
|
|
35
|
+
|
|
36
|
+
- Fix a problem that could incorrectly optimize an array-init
|
|
37
|
+
|
|
38
|
+
- Optimizations
|
|
39
|
+
|
|
40
|
+
- Enable the array-init optimization in a few more cases
|
|
41
|
+
|
|
42
|
+
### 1.1.32
|
|
43
|
+
|
|
44
|
+
- Bug fixes
|
|
45
|
+
|
|
46
|
+
- Don't optimize `do { BODY } while (false);` to `{ BODY }` if `BODY` contains `break` or `continue`
|
|
47
|
+
- In some circumstances, a comparison between a known `Long` and a known `Char` could be inferred to be false, regardless of the values (eg `42l == '*'` which should be `true`). It would eventually be folded to the correct value, but in some circumstances, an incorrect warning could be issued, or an incorrect optimization could have already been performed.
|
|
48
|
+
|
|
49
|
+
- Fixes for sdk-6.2.x
|
|
50
|
+
|
|
51
|
+
- sdk-6.2.x fixes [this finally bug](https://forums.garmin.com/developer/connect-iq/i/bug-reports/finally-doesn-t-work-as-expected), so that now all the examples work correctly (ie the `finally` block always executes, as expected, no matter how you exit the `try` or `catch` blocks). I've updated the way the control flow graph is built to match this behavior.
|
|
52
|
+
|
|
53
|
+
- sdk-6.2.x fixes [this continue in switch issue](https://forums.garmin.com/developer/connect-iq/i/bug-reports/continue-in-a-switch-statement-behaves-surprisingly), by making `continue` in a `switch` continue the loop containing the switch (or its a compile time error if there's no loop). This matches the behavior of C and C++, for example. I've updated the optimizer to interpret `continue` appropriately, depending on the sdk version.
|
|
54
|
+
|
|
55
|
+
### 1.1.31
|
|
56
|
+
|
|
57
|
+
- Better error reporting when getApiMapping fails
|
|
58
|
+
- Update getApiMapping to handle api.mir from sdk-6.2.0
|
|
59
|
+
- Update various tests to work with sdk-6.2.0 (including marking one test as an expected failure)
|
|
60
|
+
- Add a test to catch the export-project-using-barrels bug that was fixed in 1.1.30
|
|
61
|
+
|
|
62
|
+
### 1.1.30
|
|
63
|
+
|
|
64
|
+
- Bug fixes
|
|
65
|
+
- Fixes an issue where exporting a project that uses barrels could fail.
|
|
66
|
+
- Fixes a type analysis bug that could result in the type checker incorrectly thinking two types were disjoint.
|
|
67
|
+
|
|
68
|
+
### 1.1.29
|
|
69
|
+
|
|
70
|
+
- Bug fixes
|
|
71
|
+
|
|
72
|
+
- Fixes an issue where a value could incorrectly be inferred to be true-ish when its declared type was known to be an object of class type. This is not of itself incorrect, but some Toybox APIs are declared as returning an Object of a class, but may in fact return null - so we can't treat them as non-null.
|
|
73
|
+
|
|
74
|
+
- Enhancements
|
|
75
|
+
- various methods used by the extension for completion and hover info have been updated to give more accurate results.
|
|
76
|
+
|
|
77
|
+
### 1.1.28
|
|
78
|
+
|
|
79
|
+
- Bug fixes
|
|
80
|
+
|
|
81
|
+
- Fixes an issue in the post build optimizer which could cause a pre-definition to be inserted just prior to an `frpush`, which could result in the wrong value of `self` being passed to a call
|
|
82
|
+
- Don't add personality paths to the generated jungle file if the sdk is prior to 4.2.1
|
|
83
|
+
- Fixes a bug in the source-to-source optimizer that could incorrectly infer that an `if` block was never entered when the if's comparison was between a primitive type, and a plain `Object`
|
|
84
|
+
|
|
85
|
+
- Improved optimizations
|
|
86
|
+
- Constant folding between `Char` and types other than `Number` is now handled (previously such comparisons were just left for Garmin's compiler to handle). This works around a [bug in Garmin's optimizer](https://forums.garmin.com/developer/connect-iq/i/bug-reports/the-optimizer-constant-folds-char-comparisons-incorrectly) by (correctly) resolving the comparisons before Garmin's optimizer can do the wrong thing.
|
|
87
|
+
|
|
88
|
+
### 1.1.27
|
|
89
|
+
|
|
90
|
+
- Bug fixes
|
|
91
|
+
|
|
92
|
+
- Fixes an incorrect type check warning when an assignment to a local was incompatible with the type of a same-named non-local variable. This only affects the warning; it did not result in incorrect optimizations.
|
|
93
|
+
|
|
94
|
+
- New features
|
|
95
|
+
- Adds a [standalone script](https://github.com/markw65/monkeyc-optimizer/wiki/Garmin-Font-Analyzer) to analyze .cft (font) files.
|
|
96
|
+
|
|
97
|
+
### 1.1.26
|
|
98
|
+
|
|
99
|
+
- Bug fixes
|
|
100
|
+
|
|
101
|
+
- fixes an issue in the post build optimizer which could cause pre variables to be inserted too late in a block that could throw (so that if the variable was used in, or after the catch block, it might not have been set).
|
|
102
|
+
- fixes an issue with references in resource files, that could result in some references not being reported to the extension (only affects `Goto References` and `Goto Definition`)
|
|
103
|
+
- fixes some issues converting the system function documentation to markdown (for the Hover, Completion and Signature providers in the extension).
|
|
104
|
+
|
|
105
|
+
- New features
|
|
106
|
+
|
|
107
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.49](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1049) (including [#1.0.48](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1048) and [#1.0.47](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1047))
|
|
108
|
+
- adds support for parsing (but not formatting) .mss files
|
|
109
|
+
- Adds full support for personalities in `.jungle` and `.mss` files, including reading the per-device `personality.mss` files
|
|
110
|
+
- Adds support for `project.typecheck` in `.jungle` files
|
|
111
|
+
- Adds support for `project.optimization` in `.jungle` files
|
|
112
|
+
|
|
113
|
+
- Tests
|
|
114
|
+
- Adds a new project to test `.mss` files, and references to personalities from `.mc` files
|
|
115
|
+
|
|
116
|
+
### 1.1.25
|
|
117
|
+
|
|
118
|
+
- Bug fixes
|
|
119
|
+
- fixes a copy paste error that could cause strange results in the interpreter, possibly leading to incorrect optimizations.
|
|
120
|
+
|
|
121
|
+
### 1.1.24
|
|
122
|
+
|
|
123
|
+
- Bug fixes
|
|
124
|
+
|
|
125
|
+
- Conversion of unary `-x` to `0 - x` was too restrictive, causing some missed optimization opportunities
|
|
126
|
+
|
|
127
|
+
- Post Build Optimizations
|
|
128
|
+
- Added a pass equivalent to `Minimize Locals` in the source-to-source optimizer. This pass can see and re-assign all the locals, so it does better than the source-to-source optimizer. In addition, it maintains the variable mapping, so the debugger still sees the original names. As a result, its probably best to disable the `Minimize Locals` pass if the post build optimizer is enabled.
|
|
129
|
+
- Added a pass similar to `Size Based PRE` in the source-to-source optimizer. Currently this only optimizes constants and Symbols, but it has visibility to a lot of things the source-to-source optimizer can't see; so the two passes are complementary. I've added an option in case it causes problems, but it's enabled by default when the post build optimizer is enabled.
|
|
130
|
+
- Added various new optimizations to the interp pass:
|
|
131
|
+
- Handles a few more byte codes
|
|
132
|
+
- Conditional branches that are known to be taken, or known to be not taken are converted to gotos (and the gotos will often be eliminated by re-ordering blocks)
|
|
133
|
+
- Conditional branches that would be known to be taken, or known to be not taken if evaluated at the end of one of their predecessors will be bypassed from that predecessor. Amongst other things, this converts for and while loops, that can be proven to iterate at least once, into do-while loops.
|
|
134
|
+
- Improved the emitter's algorithm for ordering blocks to avoid some more gotos
|
|
135
|
+
|
|
136
|
+
### 1.1.23
|
|
137
|
+
|
|
138
|
+
No functional change, just fixes a typo that broke the typescript exports.
|
|
139
|
+
|
|
140
|
+
### 1.1.22
|
|
141
|
+
|
|
142
|
+
- Bug fixes
|
|
143
|
+
|
|
144
|
+
- [Fixes a bug in Single Use Copy Prop](https://github.com/markw65/prettier-extension-monkeyc/issues/8)
|
|
145
|
+
|
|
146
|
+
- Post Build Optimizations
|
|
147
|
+
- Updates the array-init optimizations to include `ByteArray`s
|
|
148
|
+
- Integrate the array-init optimization with the new interp pass, so that changes made by interp don't interfere with array-init
|
|
149
|
+
- Handle more bytecodes in interp
|
|
150
|
+
- If an array is initialized to its default value, drop the initializers
|
|
151
|
+
- Add an option to [remove argc bytecodes](https://github.com/markw65/monkeyc-optimizer/wiki/Post-Build-Optimizer#remove-argc)
|
|
152
|
+
|
|
153
|
+
### 1.1.21
|
|
154
|
+
|
|
155
|
+
- Bug fixes
|
|
156
|
+
|
|
157
|
+
- 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.
|
|
158
|
+
|
|
159
|
+
- Source to Source Optimizations
|
|
160
|
+
|
|
161
|
+
- 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.
|
|
162
|
+
- convert `-x` to `0 - x`. Again, Garmin's compiler generates exactly the same code, but being explicit makes the `0` available to `sizeBasedPRE`.
|
|
163
|
+
- rewrite some optimizations so that `-x` and `0-x` are treated identically. eg `(0-x) + y` => `y - x` (for suitably typed `x` and `y`).
|
|
164
|
+
- 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)
|
|
165
|
+
|
|
166
|
+
- Post Build Optimizations
|
|
167
|
+
- Keep better track of exceptional edges in dce, allowing it to be more aggressive.
|
|
168
|
+
- 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.
|
|
169
|
+
- 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).
|
|
170
|
+
|
|
171
|
+
### 1.1.20
|
|
172
|
+
|
|
173
|
+
- Bug fixes
|
|
174
|
+
|
|
175
|
+
- Fix a bug that could cause the optimizer to incorrectly substitute one local for another.
|
|
176
|
+
|
|
177
|
+
- Optimizations
|
|
178
|
+
- Improve dce in the post build optimizer a little, by computing which locals are live out of each block.
|
|
179
|
+
|
|
180
|
+
### 1.1.19
|
|
181
|
+
|
|
182
|
+
- Bug fixes
|
|
183
|
+
|
|
184
|
+
- Fix "Minimize Modules" in background/glance scopes
|
|
185
|
+
- due to a [bug in the monkeyc compiler](https://forums.garmin.com/developer/connect-iq/i/bug-reports/import-rez-or-using-rez-breaks-background-resources), adding "using Rez;" when a resource may be loaded by a background or glance app causes it to crash. This release won't import Rez into anything marked :background or :glance. This fixes [prettier-extension-monkeyc#7](https://github.com/markw65/prettier-extension-monkeyc/issues/7)
|
|
186
|
+
- Update background and glance offsets in the program header. I had assumed these offsets were obtained from the symbols, which already get updated, but it turns out they're stored as offsets in the header. This didn't break anything, but it did mean that the background and glance code sizes were unchanged, even though the post build optimizer had in fact made them smaller.
|
|
187
|
+
|
|
188
|
+
- Optimizations
|
|
189
|
+
- better optimization for arrays whose elements are all initialized to the same value (eg `[42, 42, 42, 42]`)
|
|
190
|
+
- more efficient tests for symbols in case statements (ie `case: :foo`)
|
|
191
|
+
- parallelize the post build optimizer when exporting a project
|
|
192
|
+
|
|
193
|
+
### 1.1.18
|
|
194
|
+
|
|
195
|
+
- add missing `worker-thread.cjs` and `worker-pool.cjs` files to the package.
|
|
196
|
+
|
|
197
|
+
### 1.1.17 (this package is missing two files)
|
|
198
|
+
|
|
199
|
+
- Project infrastructure
|
|
200
|
+
|
|
201
|
+
- Use worker threads to speed up exporting a .iq file. With an 8 core (16 with hyperthreading) system, my project goes from taking 28 seconds to generate the optimized source to less than 10. It still takes garmin's compiler nearly 3 minutes to compile though.
|
|
202
|
+
|
|
203
|
+
- Bug fixes
|
|
204
|
+
- When running the post build optimizer, the `*-settings.json` and `*-fit_contributions.json` need to be generated too.
|
|
205
|
+
|
|
206
|
+
### 1.1.16
|
|
207
|
+
|
|
208
|
+
- Project infrastructure
|
|
209
|
+
|
|
210
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.46](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1046)
|
|
211
|
+
- no functional change.
|
|
212
|
+
- switch from webpack to esbuild, for faster builds, and better packaging.
|
|
213
|
+
- mark the package as `commonjs` so that prettier-extension-monkeyc can set `moduleResolution: nodenext`
|
|
214
|
+
|
|
215
|
+
- Optimizations
|
|
216
|
+
- Make local dce smarter
|
|
217
|
+
- all locals are dead at function exits
|
|
218
|
+
- Make block sharing smarter
|
|
219
|
+
- allow partial blocks to be merged
|
|
220
|
+
- better heuristics for when its advantageous to merge small blocks
|
|
221
|
+
- Better control flow optimizations
|
|
222
|
+
- Merge "linear" blocks, where the first has a single successor, and the second has a single predecessor
|
|
223
|
+
- Avoid `goto` when the target is fewer than 3 bytes
|
|
224
|
+
- Optimize array initialization by using a loop
|
|
225
|
+
- Identify arrays that are unused, and make it possible for dce to clean up their initializers.
|
|
226
|
+
|
|
227
|
+
### 1.1.15
|
|
228
|
+
|
|
229
|
+
- Post build optimizer improvements
|
|
230
|
+
|
|
231
|
+
- Simplify LogicalExpressions. This generally saves 3 bytes per `&&` or `||`, and also makes them faster
|
|
232
|
+
- Adds a simple code sharing pass. If multiple code paths converge to the same point (or leave the function via return) and they end with the same sequence of bytecode, they're merged into one.
|
|
233
|
+
- Flips branch-true to branch-false or vice versa if the fall through block has multiple predecessors, and the target block has just one. This often leads to better control flow, reducing the number of "goto" bytecodes required.
|
|
234
|
+
|
|
235
|
+
- Source to Source Optimizer improvements
|
|
236
|
+
- Adds an `Iterate Optimizer` option that causes the optimizer to keep re-running until it finds nothing to remove. Defaults to false.
|
|
237
|
+
|
|
238
|
+
### 1.1.14
|
|
239
|
+
|
|
240
|
+
- Fixes a bug that could crash the optimizer if it tried to inline a function in a non-local variable's initializer.
|
|
241
|
+
- Adds a post build optimizer. This step takes the built .prg file, and optimizes the bytecode. Currently the optimizations are:
|
|
242
|
+
- Remove unreachable code
|
|
243
|
+
- simplify control flow by removing branches to branches
|
|
244
|
+
- Remove empty "finally" handlers (every try/catch gets an empty finally handler)
|
|
245
|
+
- Remove stores to dead locals
|
|
246
|
+
- Remove side-effect free code that produces an unused result
|
|
247
|
+
- Optimize shift left by constant to multiply, since the bytecode is smaller (this seems to be a bug in the garmin tools; they consider shift left and shift right to have an 8-bit argument, but its always zero, and the simulator and devices treat it as a one byte shift instruction, followed by a one byte nop).
|
|
248
|
+
|
|
249
|
+
### 1.1.13
|
|
250
|
+
|
|
251
|
+
- Adds a new [Minimize Modules](https://github.com/markw65/monkeyc-optimizer/wiki/Optimizing-module-imports#minimize-modules) pass, which attempts to ensure that every module referenced by the program is imported.
|
|
252
|
+
|
|
253
|
+
### 1.1.12
|
|
254
|
+
|
|
255
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.45](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1045)
|
|
256
|
+
- fixes some bugs that could cause comments to go missing, resulting in an internal error from the formatter
|
|
257
|
+
- Streamline some of the data structures used for `Minimize Locals` and `Single Copy Prop` to reduce memory use, and speed things up a little.
|
|
258
|
+
- Fix a bug that could cause incorrect copy propagation in loops
|
|
259
|
+
- Add support for update assignments in copy propagation (so that `var x = a; x += b; return x` goes to `return a + b`)
|
|
260
|
+
|
|
261
|
+
### 1.1.11
|
|
262
|
+
|
|
263
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.44](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1044)
|
|
264
|
+
|
|
265
|
+
- Fixes a parser bug relating to Methods returning Void, and a printer bug relating to nested Method declarations.
|
|
266
|
+
|
|
267
|
+
- Bug fixes
|
|
268
|
+
- Fixes an odd bug that could remove assignments to a global with the same name as an unused local, if the local was declared part way through a block, and the global was used before the declaration of the local.
|
|
269
|
+
- Fix some asserts related to complex member expressions that could fire in unusual circumstances
|
|
270
|
+
- New features
|
|
271
|
+
- Constant fold instanceof expressions
|
|
272
|
+
- Add more Toybox functions to sysCallInfo, so the optimizer knows they have no side effects
|
|
273
|
+
- Remove top level, side-effect free expressions
|
|
274
|
+
- Propagate any :typecheck annotations from inlined functions to their callers
|
|
275
|
+
- Fix some issues keeping track of function calls used as arguments to inlined functions, that could result in bogus diagnostics.
|
|
276
|
+
- Implement [Single Use Copy Propagation](https://github.com/markw65/monkeyc-optimizer/wiki/Local-variable-elimination#single-use-copy-propagation)
|
|
277
|
+
|
|
278
|
+
### 1.1.10
|
|
279
|
+
|
|
280
|
+
- Bug fixes
|
|
281
|
+
- Fix a bug that could cause inlined code to not get fully optimized
|
|
282
|
+
- Fix costs for pre of Long and Double constants, so that values that are used twice (rather than 3 times) will be subject to pre
|
|
283
|
+
- Fix some issues tracking the contents of Objects. In some circumstances, if two objects could be aliased, an assignment to a field of one of them might not be recognized as affecting the other.
|
|
284
|
+
- Don't warn about inlining failing if constant folding succeeds.
|
|
285
|
+
- In the vscode extension, in some cases `Go to Definition` worked for a resource (eg a Menu), but then `Go to References` said there were none. This was caused by incorrect source location in the (fake) resource code.
|
|
286
|
+
|
|
287
|
+
### 1.1.9
|
|
288
|
+
|
|
289
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.43](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1043)
|
|
290
|
+
|
|
291
|
+
- Bug fixes
|
|
292
|
+
|
|
293
|
+
- fix an interaction between inlining and removing unused local vars that could cause unlimited recursion leading to stack overflow
|
|
294
|
+
|
|
295
|
+
- New optimizations
|
|
296
|
+
- Adds a `minimizeLocals` pass which runs after `sizeBasedPRE` and attempts to re-use local variables in order to reduce the total number, and hence reduce the stack size.
|
|
297
|
+
|
|
298
|
+
### 1.1.8
|
|
299
|
+
|
|
300
|
+
- Bug fixes
|
|
301
|
+
|
|
302
|
+
- After making a non-modifying change to a variable, update the types of all equivalent variables. eg in `var x = y; if (y != null) { whatever }` we know that x is not null in `whatever`, even though we didn't explicitly test it.
|
|
303
|
+
- Fix an issue with `import` and `using`. If an import happened after the definition of an inline function, inlined copies of the function might incorrectly use those imports resulting in finding the wrong symbols. This was rare - most imports happen at the top of the file, and generally an import will simply make something work that would have failed, rather than changing the behavior of something that already works. But I added a test case that exhibits the problem.
|
|
304
|
+
|
|
305
|
+
- New features
|
|
306
|
+
- Add support for completion style lookups - find all the names available in the current context that fuzzy match a given string
|
|
307
|
+
- Add helpers to read the function documentation from api.debug.xml
|
|
308
|
+
- Add an option to visitReferences to only find a specific definition, rather than all definitions for that name in the current scope.
|
|
309
|
+
|
|
310
|
+
### 1.1.7
|
|
311
|
+
|
|
312
|
+
- Bug fixes
|
|
313
|
+
- Fix a problem with inlining that could inadvertently make locals from the callee function appear to belong to the callee's class or module. This could sometimes block optimizations, and also cause confusion for the type checker.
|
|
314
|
+
|
|
315
|
+
### 1.1.6
|
|
316
|
+
|
|
317
|
+
- Bug fixes
|
|
318
|
+
- Fix an issue in restrictByEquality when restricting a union including an Enum, to a specific value of the enum.
|
|
319
|
+
- Fix the display of Method types to match the syntax used in MonkeyC.
|
|
320
|
+
- Infer the type of `method(:symbol)` by looking up symbol.
|
|
321
|
+
|
|
322
|
+
### 1.1.5
|
|
323
|
+
|
|
324
|
+
- Bug fixes
|
|
325
|
+
- Always evaluate a constant's initializer to determine its type
|
|
326
|
+
- Fix a bug refining the object type based on the properties it accesses that could lose the type of the object.
|
|
327
|
+
|
|
328
|
+
### 1.1.4
|
|
329
|
+
|
|
330
|
+
- Optimizations
|
|
331
|
+
|
|
332
|
+
- Minor tweaks to dead store elimination
|
|
333
|
+
- Better type resolution for untyped code
|
|
334
|
+
|
|
335
|
+
- Enhancements
|
|
336
|
+
|
|
337
|
+
- Retain the type map in the analysis pass, so that it can be used to improve
|
|
338
|
+
the results in visitReferences
|
|
339
|
+
|
|
340
|
+
- Bug fixes
|
|
341
|
+
|
|
342
|
+
- When multiple diagnostics were reported for a single location, all but the last was lost
|
|
343
|
+
- Sometimes when evaluating MemberExpressions type-flow would give up too easily, resulting
|
|
344
|
+
in unknown types for the object, which then resulted in unexpected error messages from
|
|
345
|
+
the type checker, often involving seemingly unrelated classes.
|
|
346
|
+
- Inlining history was sometimes lost when further optimizations were performed.
|
|
347
|
+
|
|
348
|
+
- Code cleanup
|
|
349
|
+
- refactor some of the type code for better type safety
|
|
350
|
+
- turn on the eslint rule eqeqeq and fix all the issues
|
|
351
|
+
|
|
352
|
+
### 1.1.3
|
|
353
|
+
|
|
354
|
+
- Tweaks and fixes
|
|
355
|
+
|
|
356
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.42](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1042)
|
|
357
|
+
- Fixed an issue that cause inlining in return context to be too conservative
|
|
358
|
+
- 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.
|
|
359
|
+
- Update diagnostic api to optionally include a uri to more detailing information.
|
|
360
|
+
|
|
361
|
+
- Type Analysis
|
|
362
|
+
|
|
363
|
+
- 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.
|
|
364
|
+
- Added checkers for return types, call arguments, assignments and variable declarations.
|
|
365
|
+
- Automatically infer Array and Dictionary types
|
|
366
|
+
- Track equivalencies, and use them for various optimizations.
|
|
367
|
+
- Add support for "strong" and "weak" type checking.
|
|
368
|
+
- Add type analysis to getProgramAnalysis.
|
|
369
|
+
|
|
370
|
+
- Optimizations
|
|
371
|
+
- Eliminate self-assignments (eg `x = x;`, but also `x = a; y = a; ... y = x;`).
|
|
372
|
+
- Eliminate dead stores.
|
|
373
|
+
- Replace more expensive accesses by less expensive ones.
|
|
374
|
+
- Delete empty else blocks.
|
|
375
|
+
- Delete if statements with empty body and no else.
|
|
376
|
+
|
|
377
|
+
### 1.1.2
|
|
378
|
+
|
|
379
|
+
- Fix a couple of edge cases when constant folding == and !=
|
|
380
|
+
- Optimize `<boolean> && false`, and `<boolean> || true`, when `<boolean>` has no side effects
|
|
381
|
+
- Better optimization of inlined function bodies
|
|
382
|
+
- Analyze constants with casts to help with constant propagation
|
|
383
|
+
- Ignore widening casts (eg a cast that is given a `Number` and converts it to `Number or String`)
|
|
384
|
+
- 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.
|
|
385
|
+
|
|
386
|
+
### 1.1.1
|
|
387
|
+
|
|
388
|
+
- Fix the package spec to include the new .d.ts files
|
|
389
|
+
|
|
390
|
+
### 1.1.0
|
|
391
|
+
|
|
392
|
+
- Implements a type analyzer, to enable better optimizations
|
|
393
|
+
|
|
394
|
+
- adds options `trustDeclaredTypes` and `propagateTypes`. See https://github.com/markw65/monkeyc-optimizer/wiki/Type-and-Dataflow-analysis
|
|
395
|
+
|
|
396
|
+
- Improved optimizations
|
|
397
|
+
|
|
398
|
+
- SizeBasedPRE now has finer granularity, making it generally find more opportunities
|
|
399
|
+
- Lots of improvements to binary operators, and folding. Subject to suitable type checks,
|
|
400
|
+
- `(x + K1) + K2` => `x + (K1 + K2)`
|
|
401
|
+
- `(x + K1) + (y + K2)` => `(x + y) + (K1 + K2)`
|
|
402
|
+
- `(x + K1) + y` => `(x + y) + K1`, so that `((x + K1) + y) + K2` => `(x + y) + (K1 + K2)`
|
|
403
|
+
- `(x + -y)` and `(-y + x)` => `x - y`
|
|
404
|
+
- `x + 0` => `x`
|
|
405
|
+
- `x * 0` => `0`
|
|
406
|
+
- Various boolean optimizations:
|
|
407
|
+
- `!x ? y : z` => `x ? z : y`
|
|
408
|
+
- `x ? true : false` => `x`
|
|
409
|
+
- `x ? false : true` => `!x`
|
|
410
|
+
- `x && true` => `x`, `y || false` => `y`
|
|
411
|
+
- constant propagation
|
|
412
|
+
- `var x = 42; ...; foo(x)` => `...; foo(42)`
|
|
413
|
+
|
|
414
|
+
- Bug fixes
|
|
415
|
+
- Fixes a bug that could ignore side effects from Method.invoke
|
|
416
|
+
- Fixes a crash in the inliner, when trying to inline a function with multiple returns
|
|
417
|
+
|
|
418
|
+
### 1.0.45
|
|
419
|
+
|
|
420
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.41](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1041)
|
|
421
|
+
|
|
422
|
+
- Fixes a few parser edge cases
|
|
423
|
+
|
|
424
|
+
- Bug fixes
|
|
425
|
+
|
|
426
|
+
- Fix a bug constant folding == and !=
|
|
427
|
+
- 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.
|
|
428
|
+
- Look at all build dependencies when deciding whether to regenerate the optimized files.
|
|
429
|
+
- 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)
|
|
430
|
+
|
|
431
|
+
- Improvements
|
|
432
|
+
- Better typing for resources
|
|
433
|
+
- Refactor PRE
|
|
434
|
+
- Improve accuracy of whether or not a function can modify a particular global (resulting in better PRE)
|
|
435
|
+
|
|
436
|
+
### 1.0.44
|
|
437
|
+
|
|
438
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.40](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1040)
|
|
439
|
+
|
|
440
|
+
- Fixes location ranges associated with parenthesized expressions
|
|
441
|
+
- Fixes parsing of Lang.Char literals
|
|
442
|
+
|
|
443
|
+
- Add more parsing of expressions embedded in resource files. This should now be complete, in that the analysis pass should see every symbol definition and reference from anywhere in the project.
|
|
444
|
+
- 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 unpredictable](https://forums.garmin.com/developer/connect-iq/i/bug-reports/sdk-4-1-7-constant-folds-floats-strings-incorrectly)
|
|
445
|
+
|
|
446
|
+
### 1.0.43
|
|
447
|
+
|
|
448
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.39](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1039)
|
|
449
|
+
|
|
450
|
+
- Fixes issues parsing/printing/optimizing NaN
|
|
451
|
+
|
|
452
|
+
- Fix issues with windows paths introduced in 1.0.42
|
|
453
|
+
- Add Symbols (`:name`) to the list of things the inliner knows are constants
|
|
454
|
+
- Propagate `:typecheck(false)` to the caller when inlining
|
|
455
|
+
- Fix an issue with bogus undefined symbols being reported against manifest.xml in some projects that use barrels.
|
|
456
|
+
|
|
457
|
+
### 1.0.42
|
|
458
|
+
|
|
459
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.38](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1038)
|
|
460
|
+
|
|
461
|
+
- faster parsing
|
|
462
|
+
- supports parsing the attributes in api.mir, including sdk version etc.
|
|
463
|
+
|
|
464
|
+
- Performance
|
|
465
|
+
|
|
466
|
+
- Using the updated prettier-plugin-monkeyc halves the time spent in the parser
|
|
467
|
+
- There was some pathological behavior in the jungle processing. For most projects, it was quite fast (under 1s), but the worst project I found took nearly 5 minutes. I fixed a lot of redundant processing, which dropped most projects to under 500ms, with a worst case of 20s.
|
|
468
|
+
- I had some caching code to prevent reading the same resource file multiple times, but the cache didn't work properly because an async function ran in between the test of the cache, and the fill of the cache; which meant that lots of threads could test the cache and decide it needed to be filled. Fixed by caching Promises, rather than the promise results. Dropped the worst case 20s down to under 500ms, and the average down below 100ms.
|
|
469
|
+
- improved incremental builds (which helps with prettier-extension-monkeyc's live analysis)
|
|
470
|
+
|
|
471
|
+
- New features
|
|
472
|
+
- Resource files, and manifest.xml generate definitions and references so that prettier-extension-monkeyc can provide Goto Ref/Def between monkeyc, resource, and manifest files.
|
|
473
|
+
|
|
474
|
+
### 1.0.41
|
|
475
|
+
|
|
476
|
+
- Bug fixes
|
|
477
|
+
- The fix to avoid visiting definitions from visitReferences was incomplete
|
|
478
|
+
|
|
479
|
+
### 1.0.40
|
|
480
|
+
|
|
481
|
+
- Improvements
|
|
482
|
+
|
|
483
|
+
- Upgrade to [@markw65/prettier-plugin-monkeyc@1.0.37](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1037).
|
|
484
|
+
- Report locations of errors in manifest.xml (rather than just reporting an error somewhere in the file)
|
|
485
|
+
- Minor improvements to Goto References etc
|
|
486
|
+
- Keep a cache of parsed resource files, and update errors/warnings relating to resources as you type, rather than when the resource file is saved.
|
|
487
|
+
- Add diagnostics for known issues in sdk-4.1.6
|
|
488
|
+
- Add diagnostics for changes in behavior between compiler1 and compiler2
|
|
489
|
+
- Fix lookups to be aware of compiler1 vs compiler2. Add an option to always use compiler1 rules, or always use compiler2 rules.
|
|
490
|
+
- Fix lookups in static methods, under a new option that defaults to true.
|
|
491
|
+
|
|
492
|
+
- Testing
|
|
493
|
+
|
|
494
|
+
- Fix pragma checker to sort the diagnostics properly
|
|
495
|
+
- Allow specifying which test to run on the command line
|
|
496
|
+
- Update all tests to work with 4.1.6 and 4.1.7
|
|
497
|
+
|
|
498
|
+
- Bug fixes
|
|
499
|
+
- Fix optimization of `and` and `or` (alternate names for `&&` and `||`)
|
|
500
|
+
- Fix a bug that could sometimes prevent the `has` optimization from kicking in.
|
|
501
|
+
|
|
502
|
+
### 1.0.39
|
|
503
|
+
|
|
504
|
+
- Improvements
|
|
505
|
+
|
|
506
|
+
- Upgrade to [@markw65/prettier-plugin-monkeyc@1.0.36](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1036).
|
|
507
|
+
- Upgrade all other npm dependencies to the latest versions, and fix a few issues that showed up as a result.
|
|
508
|
+
- Report missing symbols after optimization, rather than before. Results in fewer false negatives. eg Given `if (foo has :bar) { return foo.bar; }`, where the compiler knows that foo.bar doesn't exist, the whole thing will be optimized away, rather than generate a diagnostic that foo.bar doesn't exist.
|
|
509
|
+
- Stop reporting `X has :Y` as a missing symbol, even when we know that X does not have Y.
|
|
510
|
+
- Implement our own xml parser. This was prompted by wanting to tag the parsed xml with source locations.
|
|
511
|
+
- Since we were already parsing all the resource files to look for `<build>` instructions, additionally identify all the symbols that will get generated. This allows us to detect references to undefined resources, and also makes `Goto Definition` just work for things like `Rez.Strings.foo`.
|
|
512
|
+
|
|
513
|
+
- Optimizations
|
|
514
|
+
|
|
515
|
+
- Optimize has expressions that are guaranteed to be false.
|
|
516
|
+
|
|
517
|
+
- Bugs
|
|
518
|
+
|
|
519
|
+
- Fix an issue with launchSimulator, which caused it to sometimes not bring the simulator window into focus when it should have done.
|
|
520
|
+
- Fix an issue that caused simulateProgram to fail on windows.
|
|
521
|
+
- Fix a bug looking up self when not part of a member-expression (this didn't happen until I added optimizations for "has" expressions, in this release)
|
|
522
|
+
- Add barrel sources to project analysis. This didn't affect optimization, which already included the sources, but did affect `Goto Definition` etc in the vscode extension, and caused lots of diagnostics about missing symbols.
|
|
523
|
+
- ciq-3.2.0 and later devices don't declare "widget" as a supported type, but the compiler does allow you to compile widget projects for them anyway. Fix that when determining the allowable devices in the manifest.
|
|
524
|
+
- Don't drop the `x` in `var x = new X();` even if `x` isn't used, because the monkeyc compiler doesn't generate any code for a bare `new X();`.
|
|
525
|
+
|
|
526
|
+
- Tests
|
|
527
|
+
- Better error reporting in the driver script.
|
|
528
|
+
- Handle relative jungle paths correctly.
|
|
529
|
+
- Add more tests for strange monkeyc behavior, pre and post compiler2
|
|
530
|
+
- Better identification of compilers that support compiler2
|
|
531
|
+
|
|
532
|
+
### 1.0.38
|
|
533
|
+
|
|
534
|
+
- Allow inlining the argument to an if-statement, with the same constraints as inlining in assignment context
|
|
535
|
+
- Expand `assignment`, `declaration` and `if` contexts to include (recursively) the left operand of any binary operator, the operand of any unary operator, the `test` operand of any conditional operator or the `object` of a member-expression. So now it will inline `inlinableFunction` in:
|
|
536
|
+
- `var x = !((inlinableFunction() + 4) == 42 ? foo() : bar());`
|
|
537
|
+
|
|
538
|
+
### 1.0.37
|
|
539
|
+
|
|
540
|
+
- Update the testing framework to launch the simulator before each test run, rather than start it once at the beginning. This is because the latest beta crashes after successfully completing.
|
|
541
|
+
- Update launchSimulator to check if the simulator is already running. This avoids lots of screen switching when the simulator is running on a separate desktop.
|
|
542
|
+
- Add optimizerVersion and extensionVersion to build-info.json.
|
|
543
|
+
|
|
544
|
+
### 1.0.36
|
|
545
|
+
|
|
546
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.35](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1035).
|
|
547
|
+
- Fixes [prettier-plugin-monkeyc#1](https://github.com/markw65/prettier-plugin-monkeyc/issues/1)
|
|
548
|
+
- Fixes [monkeyc-optimizer#1](https://github.com/markw65/monkeyc-optimizer/issues/1)
|
|
549
|
+
|
|
550
|
+
### 1.0.35
|
|
551
|
+
|
|
552
|
+
- Testing
|
|
553
|
+
|
|
554
|
+
- Add a new open source project
|
|
555
|
+
- Fixup tests to work with compiler2beta2
|
|
556
|
+
|
|
557
|
+
- Bug fixes
|
|
558
|
+
- Fixed a bug that caused the optimizer to fail if a top level variable declared in a case statement had an initializer with side effects. This didn't produce incorrect results, the optimizer simply bailed out with an obscure error, and refused to optimize the project.
|
|
559
|
+
|
|
560
|
+
### 1.0.34
|
|
561
|
+
|
|
562
|
+
- Bug fixes
|
|
563
|
+
|
|
564
|
+
- Fix parser to allow white space to separate attributes, in addition to comma
|
|
565
|
+
- Fix optimizer to respect prettier options when formatting the optimized code
|
|
566
|
+
|
|
567
|
+
- Testing
|
|
568
|
+
- rewrite test harness in typescript
|
|
569
|
+
- fix up tests to work with compiler2 again, and also with compiler2 at -O0
|
|
570
|
+
|
|
571
|
+
### 1.0.33
|
|
572
|
+
|
|
573
|
+
- New features
|
|
574
|
+
|
|
575
|
+
- Tagging a function with (:keep) will prevent the optimizer from removing it, even if it appears to be unused.
|
|
576
|
+
|
|
577
|
+
- Bug fixes
|
|
578
|
+
- Fix PRE to not merge values with different types. ie Number, Long, Float and Double literals should all be treated separately, even when the compare the same.
|
|
579
|
+
|
|
580
|
+
### 1.0.32
|
|
581
|
+
|
|
582
|
+
- Bug fixes
|
|
583
|
+
- Fixup the tests to run unoptimized again, and add running unoptimized to the standard test run
|
|
584
|
+
- Fix PRE to not merge Numbers and Floats (ie 1 is not the same thing as 1.0), and add a test
|
|
585
|
+
|
|
586
|
+
### 1.0.31
|
|
587
|
+
|
|
588
|
+
- Bug fixes
|
|
589
|
+
|
|
590
|
+
- Use withLocDeep on inline results
|
|
591
|
+
- Better tracking of state.inType
|
|
592
|
+
- Fix typo setting up the ProgramState
|
|
593
|
+
- Fix a glitch with the scope of for-statement variable declarations
|
|
594
|
+
- Fix some edge cases with pre
|
|
595
|
+
- Remove a check that crippled pre for literals
|
|
596
|
+
- I had forgotten to remove some code that I added to debug a problem
|
|
597
|
+
|
|
598
|
+
- Code cleanup
|
|
599
|
+
|
|
600
|
+
- Move all the global types to optimizer-types.ts, and explicitly import them
|
|
601
|
+
- Be more consistent about when assignment/update lhs is traversed
|
|
602
|
+
- Rework exposed flag
|
|
603
|
+
- Now it only holds the names of symbols (ie `:name`)
|
|
604
|
+
- There's a separate list of variables that shouldn't be removed
|
|
605
|
+
- There's a separate list of functions that shouldn't be removed
|
|
606
|
+
- Update to [@markw65/prettier-plugin-monkeyc@1.0.33](https://github.com/markw65/prettier-plugin-monkeyc/blob/main/CHANGELOG.md#1033)
|
|
607
|
+
- Update for BigInt literals, and cleanup folding code
|
|
608
|
+
|
|
609
|
+
- New features
|
|
610
|
+
|
|
611
|
+
- Support `obj[:key]` as alternate for obj.key in lookup
|
|
612
|
+
- `Find References`, and `Rename` will recognize these references now.
|
|
613
|
+
- Add an unused variable cleanup pass
|
|
614
|
+
- This will delete variables that are completely unreferenced.
|
|
615
|
+
|
|
616
|
+
- Analysis/Optimization
|
|
617
|
+
- Collect info about what each function may modify and call
|
|
618
|
+
- Better analysis of inline function bodies
|
|
619
|
+
- Update the StateNodeDecls when renaming locals
|
|
620
|
+
|
|
621
|
+
### 1.0.30
|
|
622
|
+
|
|
623
|
+
- Less greedy approach to finding candidate sets
|
|
624
|
+
- slightly better size reduction when globals maybe modified
|
|
625
|
+
- Fix the control flow after the test of a while loop
|
|
626
|
+
- one of the edges was in the wrong place, leading to suboptimal solutions in some cases
|
|
627
|
+
|
|
628
|
+
Bug Fixes
|
|
629
|
+
|
|
630
|
+
- Fix a bug that could lead to the optimizer never completing
|
|
631
|
+
- Fix a bug that prevented inlining functions that ended in a BlockStatement
|
|
632
|
+
- Fix a bug that could cause nested inlined functions inlined in declarations to not be removed
|
|
633
|
+
|
|
634
|
+
### 1.0.29
|
|
635
|
+
|
|
636
|
+
- Update to `@markw65/prettier-plugin-monkeyc@1.0.32`
|
|
637
|
+
|
|
638
|
+
- Fixes a parser issue where `x as Type ? a : b` would be parsed as `(x as Type?) a : b` which would then be reported as a syntax error.
|
|
639
|
+
|
|
640
|
+
- Bug fixes
|
|
641
|
+
|
|
642
|
+
- Fix a bug causing literal nodes to be shared. This was harmless prior to the implementation of the PRE pass
|
|
643
|
+
|
|
644
|
+
- Code cleanup
|
|
645
|
+
|
|
646
|
+
- Add `isStatement` and `isExpression` helpers
|
|
647
|
+
|
|
648
|
+
- New features
|
|
649
|
+
|
|
650
|
+
- Add constant folding for relational and logical operators
|
|
651
|
+
- Allow assignment-scope inlining in variable initializers
|
|
652
|
+
- Better cleanup of unused expressions
|
|
653
|
+
- Add a size based PRE pass. Currently limited to non-local variables, and literals
|
|
654
|
+
|
|
655
|
+
- Testing
|
|
656
|
+
- Ignore case of typeCheckLevel option
|
|
657
|
+
- Actually run the rest of the expected-to-crash tests
|
|
658
|
+
- Better error messages from pragma checker
|
|
659
|
+
- Better regex for filtering projects
|
|
660
|
+
|
|
661
|
+
### 1.0.28
|
|
662
|
+
|
|
663
|
+
- Bug fixes
|
|
664
|
+
- In some circumstances, while inlining, a parameter could be substituted, and then reprocessed. During reprocessing, it would attempt to lookup the replacement symbol, and if that was a local from the calling function it would fail (since an inline function never has access to the caller's locals). Prevent the reprocessing step from happening.
|
|
665
|
+
|
|
666
|
+
### 1.0.27
|
|
667
|
+
|
|
668
|
+
- Bug fixes
|
|
669
|
+
- Update to `@markw65/prettier-plugin-monkeyc@1.0.29` to fix certain obscure comment related bugs
|
|
670
|
+
- When replacing a node (especially when inlining), delete any comments contained in the old node.
|
|
671
|
+
|
|
672
|
+
### 1.0.26
|
|
673
|
+
|
|
674
|
+
- Bug fixes
|
|
675
|
+
- Use `self.` rather than `ClassName.` to qualify names that would otherwise collide with locals, since that works with both public and private variables
|
|
676
|
+
- Fix a bug that caused the inliner to fail to qualify certain names, even if there was a collision with an existing local variables
|
|
677
|
+
- Fix some name lookup issues relating to whether the lookup is done as a type or a value.
|
|
678
|
+
|
|
679
|
+
### 1.0.25
|
|
680
|
+
|
|
681
|
+
- Bug fix
|
|
682
|
+
- estree-types was missing the returnType on FunctionDeclaration. Update to latest prettier-plugin, and fix ast.ts.
|
|
683
|
+
|
|
684
|
+
### 1.0.24
|
|
685
|
+
|
|
686
|
+
- Bug fix
|
|
687
|
+
- The new ast.ts didn't pick up child elements that could be either a string or a node. This resulted in it missing the name in TypeSpecPart.
|
|
688
|
+
|
|
689
|
+
### 1.0.23
|
|
690
|
+
|
|
691
|
+
- Bug Fixes
|
|
692
|
+
|
|
693
|
+
- Don't treat parameters to Method types as undeclared variables
|
|
694
|
+
- eg `var x as (Method(a as Number, b as Number) as Void)` should not report that `a` and `b` are undeclared
|
|
695
|
+
|
|
696
|
+
- Tests
|
|
697
|
+
- Various new tests for module/class/local resolution of symbols
|
|
698
|
+
- Make tests fail by default if the optimizer reports any undefined symbols, and add `@expects` or `checkInvalidSymbols=WARNING` as needed to prevent test failures.
|
|
699
|
+
|
|
700
|
+
### 1.0.22
|
|
701
|
+
|
|
702
|
+
- Improvements
|
|
703
|
+
|
|
704
|
+
- Major rewrite of the symbol lookup mechanism, to match monkeyc as closely as possible
|
|
705
|
+
|
|
706
|
+
- Fix callee lookup to skip local variables
|
|
707
|
+
- Fix class lookup to first check all the super classes, then to check the context of each super class
|
|
708
|
+
- Fix module lookup to check both the module, and the context of the module
|
|
709
|
+
- Inject class and module names into themselves. So that Graphics.Graphics.COLOR_RED works.
|
|
710
|
+
|
|
711
|
+
- Add live diagnostics for missing symbols
|
|
712
|
+
|
|
713
|
+
- Bug fixes
|
|
714
|
+
|
|
715
|
+
- Recognize the the variable in a catch clause is a declaration
|
|
716
|
+
|
|
717
|
+
- Breaking change
|
|
718
|
+
- By popular demand, reversed the sense of `inline*foo`, so now it inlines when foo is _not_ declared as an excludeAnnotation
|
|
719
|
+
|
|
720
|
+
### 1.0.21
|
|
721
|
+
|
|
722
|
+
- Bug fixes
|
|
723
|
+
|
|
724
|
+
- Parameters from the calling function should be treated just line locals when inlining
|
|
725
|
+
- Upgrade to `@markw65/prettier-plugin-monkeyc@1.0.24`
|
|
726
|
+
- fixes crash with comments following an attribute: `(:foo) /* comment */ function foo() {}`
|
|
727
|
+
- Fix issues with recursive inlining
|
|
728
|
+
|
|
729
|
+
### 1.0.20
|
|
730
|
+
|
|
731
|
+
- Bug fixes
|
|
732
|
+
|
|
733
|
+
- Fix a bug marking unknown callees
|
|
734
|
+
- Fix a bug in test.js that didn't notice when tests failed, and fix a failing test
|
|
735
|
+
|
|
736
|
+
- Optimizer enhancements
|
|
737
|
+
|
|
738
|
+
- Re-run the main optimization step, to properly account for functions that are unused after optimization
|
|
739
|
+
- Call the optimizer on 'unused' nodes before returning them
|
|
740
|
+
|
|
741
|
+
- Code cleanup
|
|
742
|
+
- Called function cleanup
|
|
743
|
+
|
|
744
|
+
### 1.0.19
|
|
745
|
+
|
|
746
|
+
- Upgrade to `@markw65/prettier-plugin-monkeyc@1.0.22`
|
|
747
|
+
|
|
748
|
+
- fixes some minor typing issues for mctree
|
|
749
|
+
- special handling for certain parenthesized expressions.
|
|
750
|
+
|
|
751
|
+
- Optimizer
|
|
752
|
+
|
|
753
|
+
- Handle more unused expressions, add tests, and prettify the OptimizerTests project
|
|
754
|
+
- Allow statement-style inlining in assignment and return contexts
|
|
755
|
+
- Add diagnostics for failure to inline
|
|
756
|
+
|
|
757
|
+
- Tests
|
|
758
|
+
|
|
759
|
+
- More tweaks to pragma-checker
|
|
760
|
+
- Add launch and task configs for building/running tests
|
|
761
|
+
|
|
762
|
+
- Code cleanup
|
|
763
|
+
- Properly type the results of JSON.parse
|
|
764
|
+
- Switch over to using ParenthesizedExpression for formatAst (depends on `@markw65/prettier-plugin-monkeyc@1.0.22`)
|
|
765
|
+
|
|
766
|
+
### 1.0.18
|
|
767
|
+
|
|
768
|
+
- Bug Fixes
|
|
769
|
+
- The new inliner was too aggressive at constant propagating literal parameters to their point of use.
|
|
770
|
+
|
|
771
|
+
### 1.0.17
|
|
772
|
+
|
|
773
|
+
- New Features
|
|
774
|
+
|
|
775
|
+
- Extend the inliner to support more complex functions when called in a void context
|
|
776
|
+
- Cleanup unused expressions. `0;x;foo.bar;a+b` will all now be optimized away.
|
|
777
|
+
|
|
778
|
+
- Testing
|
|
779
|
+
|
|
780
|
+
- Rewrite the @match pragma implementation to have access to the next Node in the ast, rather than just the text of the remainder of the line.
|
|
781
|
+
- Add tests for the statement inliner, and the unused expression cleanup code.
|
|
782
|
+
|
|
783
|
+
- Bug Fixes
|
|
784
|
+
- Fix a bug affecting lookup of types, which could cause definitions, references and links to the api docs to be missed in the vscode extension
|
|
785
|
+
|
|
786
|
+
### 1.0.16
|
|
787
|
+
|
|
788
|
+
- Bug fixes
|
|
789
|
+
|
|
790
|
+
- Fix off-by-one in removeNodeComments
|
|
791
|
+
- Fix lookup to consistently lookup types or values.
|
|
792
|
+
- Fix lookup of superclass names
|
|
793
|
+
|
|
794
|
+
- New Features
|
|
795
|
+
|
|
796
|
+
- Add a simple inliner
|
|
797
|
+
- Add support for conditional inlining based on excludeAnnotations
|
|
798
|
+
|
|
799
|
+
- Testing
|
|
800
|
+
- Add support for @match pragmas to check the optimization results
|
|
801
|
+
- Add a test project, with some inlining tests
|
|
802
|
+
|
|
803
|
+
### 1.0.15
|
|
804
|
+
|
|
805
|
+
- Bug fixes
|
|
806
|
+
- Inject the superclass name into the classes namespace
|
|
807
|
+
- Separate type vs value lookup, and use the correct one based on context.
|
|
808
|
+
|
|
809
|
+
### 1.0.14
|
|
810
|
+
|
|
811
|
+
- Bug fixes
|
|
812
|
+
|
|
813
|
+
- When reading a barrel project with no products, add all products by default
|
|
814
|
+
- Only set language specific paths for languages that are supported by the device
|
|
815
|
+
- Remove comments that are completely contained within removed nodes
|
|
816
|
+
|
|
817
|
+
- Code cleanup
|
|
818
|
+
- Upgrade to `@markw65/prettier-plugin-monkeyc@1.0.21` for some typescript fixes
|
|
819
|
+
- npm upgrade to pickup ts 4.7.2
|
|
820
|
+
- Add types to package exports for ts 4.7.2
|
|
821
|
+
- Better handling of program-logic errors
|
|
822
|
+
|
|
823
|
+
### 1.0.13
|
|
824
|
+
|
|
825
|
+
- Improvements
|
|
826
|
+
|
|
827
|
+
- Add displayName to deviceInfo (for getTargetDevices in prettier-extension-monkeyc)
|
|
828
|
+
- Throw a better error when we fail to read a jungle file
|
|
829
|
+
- Don't try to optimize barrel projects
|
|
830
|
+
|
|
831
|
+
- Code cleanup
|
|
832
|
+
|
|
833
|
+
- Update to `@markw65/prettier-plugin-monkeyc@1.0.20` for mctree fixes
|
|
834
|
+
- Enable typescript strict checks
|
|
835
|
+
- Turn off synthetic default imports, and fix issues
|
|
836
|
+
- Better manifest typing
|
|
837
|
+
|
|
838
|
+
- Tests
|
|
839
|
+
- Add date/time to test logging
|
|
840
|
+
|
|
841
|
+
### 1.0.12
|
|
842
|
+
|
|
843
|
+
- Fix connectiq and vscode paths on linux, and better error reporting when they're missing
|
|
844
|
+
|
|
845
|
+
### 1.0.11
|
|
846
|
+
|
|
847
|
+
- Improvements
|
|
848
|
+
|
|
849
|
+
- Add option to run tests (for projects that have them)
|
|
850
|
+
- Add getProjectAnalysis api, to support various language features in `@markw65/prettier-extension-monkeyc`
|
|
851
|
+
|
|
852
|
+
- Bug fixes
|
|
853
|
+
|
|
854
|
+
- Fix lookup of self/me
|
|
855
|
+
|
|
856
|
+
- Code cleanup
|
|
857
|
+
- More typing. Check that build options match previous ones before re-using the optimized files
|
|
858
|
+
- Move everything over to typescript
|
|
859
|
+
- The project was becoming hard to maintain due to too much ad-hoc dynamic typing. This should allow easier/safer refactors and code cleanup.
|
|
860
|
+
- Refactoring to make analysis available in prettier-extension-monkeyc
|
|
861
|
+
- Generate .d.ts, and drop unneeded paths/resolve.alias
|
|
862
|
+
- Pull in a typed version of `@markw65/prettier-plugin-monkeyc`
|
|
863
|
+
|
|
864
|
+
### 1.0.10
|
|
865
|
+
|
|
866
|
+
- Add --execute option to test.js to run the projects after building them
|
|
867
|
+
- Add support for optimizing barrels
|
|
868
|
+
- Add some typing via jsdoc, and turn on ts validation in vscode
|
|
869
|
+
- Bump to `@markw65/prettier-plugin-monkeyc:1.0.16` so ts recognizes its exports
|
|
870
|
+
- Add [garmin/connectiq-apps](https://github.com/garmin/connectiq-apps) and fix some minor issues it revealed
|
|
871
|
+
|
|
872
|
+
### 1.0.9
|
|
873
|
+
|
|
874
|
+
- Only generate the parts of the jungle we're going to use
|
|
875
|
+
- Also publish sdk-util.cjs
|
|
876
|
+
- Bump to `@markw65/prettier-plugin-monkeyc:1.0.15`
|
|
877
|
+
- Fixes a bug that dropped attributes on modules
|
|
878
|
+
- LiteralIntegerRe should be case insensitive
|
|
879
|
+
- Proper fix for promiseAll
|
|
880
|
+
- Auto-include barrels.jungle when its present
|
|
881
|
+
|
|
882
|
+
### 1.0.8
|
|
883
|
+
|
|
884
|
+
- Improvements
|
|
885
|
+
|
|
886
|
+
- Update to `@markw65/prettier-plugin-monkeyc:1.0.14`
|
|
887
|
+
- Parse and respect \<build\> instructions in resource files
|
|
888
|
+
- Add minimal barrel support
|
|
889
|
+
- Better checking for whether the optimized source is up to date
|
|
890
|
+
- Rename locals which would be marked re-declaring
|
|
891
|
+
|
|
892
|
+
- Bug Fixes
|
|
893
|
+
|
|
894
|
+
- Generate the default jungle dynamically, since sdk/bin/default.jungle is generated lazily, and may not exist in newly installed sdks, or may be out of date after device installations.
|
|
895
|
+
- Fix a bug generating language settings in optimized jungle
|
|
896
|
+
- Fix a bug introduced by pick-one: don't modify a shared array
|
|
897
|
+
- Don't allow src paths to navigate out of the optimized directory
|
|
898
|
+
- Fix some windows paths issues
|
|
899
|
+
|
|
900
|
+
- Tests
|
|
901
|
+
- More parallelism while fetching remote projects for testing
|
|
902
|
+
- Add option to build the original project, rather than the optimized one
|
|
903
|
+
- Add support for overriding build options on a per project basis
|
|
904
|
+
- Add an option so we only 'fix' the manifest when running remote projects
|
|
905
|
+
- Check the manifest's application id, and throw in a valid one if necessary
|
|
906
|
+
- Allow project specific overrides for the generated monkey.jungle files, and use it to fix some projects
|
|
907
|
+
- Add patches for some broken projects
|
|
908
|
+
|
|
909
|
+
### 1.0.7
|
|
910
|
+
|
|
911
|
+
More fixes found via open source projects.
|
|
912
|
+
|
|
913
|
+
- Fix parsing of quoted strings in jungle files
|
|
914
|
+
- Better error messages from the test framework
|
|
915
|
+
- Lazier handling of variables in jungle files
|
|
916
|
+
- Fix handling of negative enums that get completely removed
|
|
917
|
+
- Fix a bug analyzing empty classes
|
|
918
|
+
- Fix a typo that could result in consts being incorrectly eliminated
|
|
919
|
+
- Fix an edge case handling local jungle variables
|
|
920
|
+
- More test options, and add filters for some of the remote projects
|
|
921
|
+
- Try to clean up broken jungles and manifests
|
|
922
|
+
- Fix handling of unnamed callees
|
|
923
|
+
- Drop unrecognized devices
|
|
924
|
+
- Add support for a 'pick-one' device to aid testing
|
|
925
|
+
- Add a flag to remote projects to prevent trying to build them (some projects are broken to start with)
|
|
926
|
+
|
|
927
|
+
### 1.0.6
|
|
928
|
+
|
|
929
|
+
- Bump to version 1.0.12 of `@markw65/prettier-plugin-monkeyc` to fix multiple parser bugs
|
|
930
|
+
- Add lots of open source projects as tests. For now, just verify that optimizing the sources succeeds, not that the generated source is actually correct.
|
|
931
|
+
|
|
932
|
+
### 1.0.5
|
|
933
|
+
|
|
934
|
+
- Bump to version 1.0.11 of `@markw65/prettier-plugin-monkeyc` to fix an ObjectLiteral parsing issue.
|
|
935
|
+
|
|
936
|
+
### 1.0.4
|
|
937
|
+
|
|
938
|
+
- Fix a bug resulting in a failure to fully optimize constants initialized by constant conditional expressions
|
|
939
|
+
- Make the generated .cjs files work better with es modules (vscode doesn't work with es modules, so prettier-extension-monkeyc doesn't care - but for other projects importing this package it improves the behavior)
|
|
940
|
+
- Generate separate debug/release jungle files.
|
|
941
|
+
|
|
942
|
+
### 1.0.3
|
|
943
|
+
|
|
944
|
+
- Split the build into release and debug, so we can exclude code based on (:release) and (:debug)
|
|
945
|
+
- Optimize away `if (constant)`, `while (false)` and `constant ? E1 : E2`. Convert `do BODY while(false)` to `BODY`
|
|
946
|
+
|
|
947
|
+
#### 1.0.2
|
|
948
|
+
|
|
949
|
+
- Better error reporting when something goes wrong internally
|
|
950
|
+
- Fix an order dependency when processing imports. Previously, if the import statement was seen before the module being imported, we would fail to properly handle the import.
|
|
951
|
+
|
|
952
|
+
#### 1.0.1
|
|
953
|
+
|
|
954
|
+
- Make a better attempt to fix all the negative constants in api.mir
|
|
955
|
+
- Make export explicitly do a release build by default.
|
|
956
|
+
|
|
957
|
+
#### 1.0.0
|
|
958
|
+
|
|
959
|
+
Initial release
|