about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 6562Kartik Agaram2020-06-212-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | The new failing test is now passing, and so is this manual test that had been throwing a spurious error: fn foo { var a/eax: int <- copy 0 var b/ebx: int <- copy 0 { var a1/eax: int <- copy 0 var b1/ebx: int <- copy a1 } b <- copy a } However, factorial.mu is still throwing a spurious error. Some history on this commit's fix: When I moved stack-location tracking out of the parsing phase (commit 6116, Mar 10) I thoughtlessly moved block-depth tracking as well. And the reason that happened: I'd somehow gotten by without ever cleaning up vars from a block during parsing. For all my tests, this is a troubling sign that I'm not testing enough. The good news: clean-up-blocks works perfectly during parsing.
* 6561 - failing testKartik Agaram2020-06-211-8/+122
| | | | | Test `test-shadow-name-2` shows that we aren't popping off more than one variable from each block that we exit.
* 6560Kartik Agaram2020-06-201-10/+3
|
* 6559Kartik Agaram2020-06-201-0/+1
|
* 6558 - dump the stack of local varsKartik Agaram2020-06-201-68/+129
| | | | I'm still tracking down at least one bug in how that stack is managed.
* 6557 - fix a bug in pack.subxKartik Agaram2020-06-202-2/+94
| | | | | | | | | I was shifting bitfields around based on their width rather than the width of the field to their right. Kinda shocking that I haven't used the scale bits until now. I've been generating code that uses them in mu.subx tests, but apparently I haven't actually _run_ any such code before.
* 6556 - check for uses of clobbered varsKartik Agaram2020-06-192-18/+163
| | | | | Now all tests passing again. In the process I found a bug where one of my tests actually generated incorrect code.
* 6555 - fix one class of failing testsKartik Agaram2020-06-191-15/+78
| | | | | | | | | | Defining a new var in a register based on a previous var in the same register. Unfortunately I don't yet support such an instruction without getting into arrays. Ideally I want `y <- add x, 1` to convert to the same code as `x <- add x, 1` if `y` ends up in the same register. And so on. But I don't yet have a way to specify "output same register as inout 1" in my `Primitives` data structure.
* 6554 - snapshot: error on use of a clobbered varKartik Agaram2020-06-191-1/+111
| | | | | | | | | | | | When looking up a var, ensure that it's the var most recently written to its register. The new test passes, but a handful of tests now start failing when a new var in register X is initialized based on the old var in register X. The way we do lookups is not quite right. At the moment we perform lookups when we parse words. So we look up outputs of a statement before inputs. But old bindings are still valid for the entirety of a statement, and outputs should only take effect for the next statement.
* 6553 - Mu: disallow registers esp and ebpKartik Agaram2020-06-192-6/+24
|
* 6552Kartik Agaram2020-06-181-3/+5
|
* 6551Kartik Agaram2020-06-181-15313/+16102
|
* 6550 - type-checking for function callsKartik Agaram2020-06-183-30/+859
| | | | There were a couple of benign type errors in arith.mu but nowhere else.
* 6549 - starting on type checkingKartik Agaram2020-06-172-1/+1
|
* 6548Kartik Agaram2020-06-161-3/+3
|
* 6547Kartik Agaram2020-06-164-14732/+15852
|
* 6546Kartik Agaram2020-06-151-1/+1
|
* 6545Kartik Agaram2020-06-151-1/+0
|
* 6544 - arith: docKartik Agaram2020-06-151-1/+43
|
* 6543 - arith: cleanupKartik Agaram2020-06-151-17/+13
|
* 6542 - arith: bracketsKartik Agaram2020-06-151-6/+47
| | | | Ok, I think I'm done with this app for now.
* 6541 - arith: start on bracket supportKartik Agaram2020-06-151-2/+8
|
* 6540 - arith: mulKartik Agaram2020-06-151-0/+52
| | | | I forgot that Mu doesn't have div yet.
* 6539 - arith: start on mul/divKartik Agaram2020-06-151-2/+7
|
* 6538 - arith: multi-ary arithmeticKartik Agaram2020-06-151-25/+31
|
* 6537Kartik Agaram2020-06-151-21/+21
|
* 6536Kartik Agaram2020-06-151-8/+7
| | | | Cleaner way to handle EOF.
* 6535Kartik Agaram2020-06-151-36/+36
|
* 6534 - arith: add/subtractKartik Agaram2020-06-151-3/+37
|
* 6533 - arith: ignore spacesKartik Agaram2020-06-151-18/+49
|
* 6532 - arith: REPL converting ints to hexKartik Agaram2020-06-151-6/+18
| | | | | I'm using one character of lookahead, inspired by Crenshaw's "let's build a compiler".
* 6531Kartik Agaram2020-06-151-25/+17
|
* 6530Kartik Agaram2020-06-151-0/+40
| | | | | New prototype: a simple 4-operator calculator. Inspired (yet again) by Crenshaw.
* 6529 - don't let `addr`s escape functionsKartik Agaram2020-06-152-19/+24
| | | | | | | | | | | | | | | | | | I've gone back and forth on this. I initially disallowed this, then allowed it because I forgot why I disallowed it. The reason to disallow it: if you return an `addr` to a variable allocated on the stack, the space might be reused for a different type, which violates type-safety. And once you can reinterpret bits of one type as another you lose memory-safety as well. This has some interesting implications for Mu programs; certain kinds of helper functions become impossible to write. Now I find myself relying a lot more on scopes (and editor folding support) for abstracting details. And they won't help manage duplication. We'll see how this goes. While I'm being draconian about `addr`s on the stack, I'm still abusing `addr`s on the heap, with the expectation that future checks on reclamation will protect me. The boon and bane of stack space is that it's constantly reclaimed.
* 6528Kartik Agaram2020-06-1512-20/+147
|
* 6527 - increase stack limitsKartik Agaram2020-06-152-0/+6
| | | | | | We haven't run into this limit yet, but everytime I see a 'stream overflow' error I run into it while going over all the knobs in apps/subx-params.subx, if I increase Input-size (used by survey.subx) too much.
* 6526Kartik Agaram2020-06-151-1/+1
|
* 6525Kartik Agaram2020-06-152-11/+157
|
* 6524Kartik Agaram2020-06-152-7/+65
|
* 6523Kartik Agaram2020-06-152-0/+95
| | | | | Still some issues; add some tests. I have more that were passing a couple of days ago but aren't currently.
* 6522 - redo support for 'byte'Kartik Agaram2020-06-152-13/+81
| | | | | | | | | | | Before: bytes can't live on the stack, so size(byte) == 1 just for array elements. After: bytes mostly can't live on the stack except for function args (which seem too useful to disallow), so size(byte) == 4 except there's now a new primitive called element-size for array elements where size(byte) == 1. Now apps/browse.subx starts working again.
* 6521 - new primitive: array size in bytesKartik Agaram2020-06-142-0/+17
|
* 6520 - new app: parse-intKartik Agaram2020-06-1416-8/+290
| | | | | | Several bugs fixed in the process, and expectation of further bugs is growing. I'd somehow started assuming I don't need to have separate cases for rm32 as a register vs mem. That's not right. We might need more reg-reg Primitives.
* 6519Kartik Agaram2020-06-131-1/+47
| | | | More fucking amateur hour.
* 6518 - extra args through a whole swathe of placesKartik Agaram2020-06-132-7/+54
| | | | | | | | Most unbelievably, I'd forgotten to pass the output 'out' arg to 'lookup-var' long before the recent additions of 'err' and 'ed' args. But things continued to work because an earlier call just happened to leave the arg at just the right place on the stack. So we only caught all these places when we had to provide error messages.
* 6517Kartik Agaram2020-06-131-14034/+14335
|
* 6516 - operations on bytesKartik Agaram2020-06-134-11/+228
| | | | | | Byte-oriented addressing is only supported in a couple of instructions in SubX. As a result, variables of type 'byte' can't live on the stack, or in registers 'esi' and 'edi'.
* 6515 - error if 'get' on unknown fieldKartik Agaram2020-06-122-2/+117
| | | | We can't yet say in the error message precisely where the 'get' occurs.
* 6514Kartik Agaram2020-06-121-3/+3
|
* 6513Kartik Agaram2020-06-1267-25070/+25441
|