| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This commit reimplements commit 6515 to happen during type-checking rather
than as early as possible. That way we naturally get a more informative
error message.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Small change to mu.subx to keep the treeshaker working with it. That's
currently the only place where we prevent jumps across 'functions'.
|
|
|
|
|
| |
All tests now passing, and factorial.mu and all other apps now working.
The new checks caught one problem in a few prototypes.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
I need to pass the function around to fix the failing test; might as well
fix the error messages while I'm at it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The desire captured by a test is often hard to verbalize, path-dependent
and more fertile for the future than its original impulse. On some level,
someone wanting to rip out features has to just ask for each scenario,
"what do I want to happen here?" And nobody's gonna do that. At best, somebody
may be trying to rip out some complex feature, and run into some collateral
damage around the edges that they have to inspect more closely. "Do I care
about preserving this behavior?"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Test `test-shadow-name-2` shows that we aren't popping off more than one
variable from each block that we exit.
|
| |
|
| |
|
|
|
|
| |
I'm still tracking down at least one bug in how that stack is managed.
|
|
|
|
|
| |
Now all tests passing again. In the process I found a bug where one of
my tests actually generated incorrect code.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
There were a couple of benign type errors in arith.mu but nowhere else.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Still some issues; add some tests. I have more that were passing a couple
of days ago but aren't currently.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
More fucking amateur hour.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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'.
|