Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | 5984 - start labeling all blocks | Kartik Agaram | 2020-02-05 | 2 | -165/+289 |
| | | | | | | | | This will come in handy for the remaining cases where we need to clean up locals on the stack: loop after var non-local break with vars in intervening blocks non-local loop with vars in intervening blocks | ||||
* | 5983 - fix an emulator bounds-check bug | Kartik Agaram | 2020-02-05 | 5 | -7/+7 |
| | | | | | | It was possible for an instruction to write out of bounds of the memory data structure. Most of the time this worked fine. However if the block ever got resized and moved the out-of-bounds bytes no longer went along. | ||||
* | 5982 - start putting block labels on the var stack | Kartik Agaram | 2020-02-05 | 2 | -26/+41 |
| | | | | | | | | | | | | | | | | | | | | | Before: we detected labels using a '$' at the start of an arg, and turned them into literals. After: we put labels on the var stack and let the regular lookup of the var stack handle labels. This adds complexity in one place and removes it from another. The crucial benefit is that it allows us to store a block depth for each label. That will come in handy later. All this works only because of a salubrious coincidence: Mu labels are always at the start of a block, and jumps always refer to the name at the start of a block, even when the jump is in the forwards direction. So we never see label uses before definitions. Note on CI: this currently only works natively, not emulated. | ||||
* | 5981 - decompose block cleanup into two traversals | Kartik Agaram | 2020-02-02 | 2 | -35/+113 |
| | | | | | Momentarily less efficient, but we will soon need the ability to emit cleanup code without losing all our state. | ||||
* | 5980 | Kartik Agaram | 2020-02-02 | 1 | -3/+3 |
| | |||||
* | 5979 | Kartik Agaram | 2020-02-02 | 1 | -2/+3 |
| | | | | | | | Continuing to think about how to translate vars in a block when they're followed by early exits. To clean up everything between a statement and a target label, we need to know somehow the depth the target is defined at. | ||||
* | 5978 | Kartik Agaram | 2020-02-02 | 1 | -1/+4 |
| | |||||
* | 5977 | Kartik Agaram | 2020-02-02 | 2 | -4/+5 |
| | |||||
* | 5976 | Kartik Agaram | 2020-02-02 | 1 | -3/+3 |
| | |||||
* | 5975 | Kartik Agaram | 2020-02-02 | 1 | -7427/+7137 |
| | |||||
* | 5974 - support for simple early exits | Kartik Agaram | 2020-02-02 | 2 | -1/+84 |
| | | | | | | | | | | | | | | | So far we only handle unlabeled break instructions correctly. That part is elegance itself. But the rest will need more work: a) For labeled breaks we need to insert code to unwind all intervening blocks. b) For unlabeled loops we need to insert code to unwind the current block and then loop. c) For labeled loops we need to insert code to unwind all intervening blocks and then loop. Is this even worth doing? I think so. It's pretty common for a conditional block inside a loop to 'continue'. That requires looping to somewhere non-local. | ||||
* | 5973 | Kartik Agaram | 2020-02-02 | 1 | -369/+1 |
| | |||||
* | 5972 | Kartik Agaram | 2020-02-01 | 1 | -6480/+6703 |
| | |||||
* | 5971 - emit code with indentation | Kartik Agaram | 2020-02-01 | 2 | -256/+309 |
| | | | | This is easy now that we're tracking block depths everywhere. | ||||
* | 5970 - support block-scoped variables | Kartik Agaram | 2020-02-01 | 2 | -6/+186 |
| | |||||
* | 5969 | Kartik Agaram | 2020-02-01 | 1 | -27/+26 |
| | |||||
* | 5968 | Kartik Agaram | 2020-02-01 | 4 | -33/+225 |
| | |||||
* | 5967 | Kartik Agaram | 2020-02-01 | 1 | -0/+6 |
| | |||||
* | 5966 - document all supported Mu instructions | Kartik Agaram | 2020-01-31 | 7 | -22/+209 |
| | |||||
* | 5965 | Kartik Agaram | 2020-01-31 | 2 | -10/+1 |
| | |||||
* | 5964 | Kartik Agaram | 2020-01-30 | 1 | -3/+3 |
| | |||||
* | 5963 | Kartik Agaram | 2020-01-30 | 1 | -3956/+3992 |
| | |||||
* | 5962 - string literals | Kartik Agaram | 2020-01-30 | 2 | -6/+43 |
| | |||||
* | 5961 | Kartik Agaram | 2020-01-30 | 2 | -3/+2 |
| | |||||
* | 5960 | Kartik Agaram | 2020-01-30 | 1 | -0/+1 |
| | |||||
* | 5959 | Kartik Agaram | 2020-01-30 | 1 | -1/+1 |
| | |||||
* | 5958 | Kartik Agaram | 2020-01-30 | 4 | -2848/+2871 |
| | |||||
* | 5957 - bootstrap: stale checks for 2-byte opcodes | Kartik Agaram | 2020-01-30 | 1 | -2/+14 |
| | |||||
* | 5956 | Kartik Agaram | 2020-01-29 | 1 | -27/+9 |
| | |||||
* | 5955 - error messages when translating Mu programs | Kartik Agaram | 2020-01-29 | 1 | -1/+1 |
| | |||||
* | 5954 - 'factorial' working! | Kartik Agaram | 2020-01-29 | 2 | -0/+98 |
| | |||||
* | 5953 - 'multiply' instruction | Kartik Agaram | 2020-01-29 | 2 | -0/+13 |
| | |||||
* | 5952 | Kartik Agaram | 2020-01-29 | 1 | -2231/+2573 |
| | |||||
* | 5951 - 'compare' instructions | Kartik Agaram | 2020-01-29 | 2 | -9/+376 |
| | |||||
* | 5950 | Kartik Agaram | 2020-01-29 | 2 | -0/+189 |
| | |||||
* | 5949 | Kartik Agaram | 2020-01-29 | 4 | -6505/+7312 |
| | |||||
* | 5948 - branching to named blocks | Kartik Agaram | 2020-01-29 | 16 | -32/+476 |
| | |||||
* | 5947 - add a new field to primitives | Kartik Agaram | 2020-01-29 | 2 | -4/+92 |
| | | | | For supporting branches with a target. | ||||
* | 5946 | Kartik Agaram | 2020-01-29 | 2 | -6/+6 |
| | |||||
* | 5945 - branches | Kartik Agaram | 2020-01-28 | 2 | -0/+285 |
| | |||||
* | 5944 | Kartik Agaram | 2020-01-28 | 1 | -5289/+5461 |
| | |||||
* | 5943 - initial support for named blocks | Kartik Agaram | 2020-01-28 | 2 | -132/+245 |
| | |||||
* | 5942 - initial support for blocks | Kartik Agaram | 2020-01-28 | 2 | -8/+77 |
| | | | | This was too easy. But there are dragons ahead. | ||||
* | 5941 | Kartik Agaram | 2020-01-27 | 1 | -5176/+5289 |
| | |||||
* | 5940 - local vars in registers starting to work | Kartik Agaram | 2020-01-27 | 2 | -31/+151 |
| | |||||
* | 5939 | Kartik Agaram | 2020-01-27 | 1 | -3/+0 |
| | |||||
* | 5938 | Kartik Agaram | 2020-01-27 | 1 | -0/+1 |
| | |||||
* | 5937 | Kartik Agaram | 2020-01-27 | 2 | -3231/+3271 |
| | |||||
* | 5936 - permit commas everywhere | Kartik Agaram | 2020-01-27 | 3 | -12/+52 |
| | |||||
* | 5935 | Kartik Agaram | 2020-01-27 | 1 | -1/+17 |
| | | | | A new error message: for unclosed string literals. |