Commit Graph

566 Commits

Author SHA1 Message Date
Kartik Agaram ea8a64cfb0 7232 - mu.subx: more checks for byte types 2020-11-12 23:56:41 -08:00
Kartik Agaram 165ed256a3 7230 - mu.subx: some more checks for stmt outputs 2020-11-12 23:13:48 -08:00
Kartik Agaram 148f2c9b65 7217 2020-11-08 11:31:54 -08:00
Kartik Agaram 2be7af86db 7216
In addition to fixing a segfault, the realization here is that we don't
always have a type name. Error messages need to take that into account.
2020-11-08 09:43:35 -08:00
Kartik Agaram 494eb64aaf 7192 - more checks around literals
We can copy non-zero literals only to non-addr non-offset scalars.

This change is surprisingly short for the magnitude of the limb I felt
myself going out on for it. Surprising that there were no unpleasant discoveries.
2020-11-05 23:50:12 -08:00
Kartik Agaram bdb48b5211 7191 2020-11-05 21:03:57 -08:00
Kartik Agaram ed146be6bc 7190
Training sights now on some gaps with offset types.
2020-11-05 20:49:00 -08:00
Kartik Agaram 4b41663394 7189 - some validations on function name
Mu has no overloading or static dispatch for now.
2020-11-05 20:10:46 -08:00
Kartik Agaram 7a25625c43 7188 - raise error on deref of var on stack 2020-11-05 19:08:44 -08:00
Kartik Agaram c31d1d3a3d 7185 - type checks for 'populate-stream'
Lots of copy-pasta.
2020-11-05 16:35:47 -08:00
Kartik Agaram 2ea3107c21 7184 - type checks for 'populate' 2020-11-05 16:27:46 -08:00
Kartik Agaram 6017f1e240 7183 - type checks for 'allocate' 2020-11-05 15:06:25 -08:00
Kartik Agaram 9b91efeadd 7182 - type checks for 'copy-object' 2020-11-05 01:20:23 -08:00
Kartik Agaram 686b87cc06 7181 - type checks for 'address' instruction 2020-11-05 00:51:15 -08:00
Kartik Agaram cc356b35bf 7180
More bugfixes, now all apps are working.

In the process of fixing the bugs in translating apps/browse, I found a
typo in apps/tile that just happened to accidentally be compiling fine.
2020-11-04 22:58:13 -08:00
Kartik Agaram 8767e709c5 7179
After this bugfix, apps/tile/ is now working.

apps/browse/ is still failing.
2020-11-04 22:38:39 -08:00
Kartik Agaram 940dad03c2 7178 - type checks for 'compare' instruction 2020-11-04 20:34:43 -08:00
Kartik Agaram 179d26ae8e 7177 - type checks for 'copy-to' instruction 2020-11-04 19:04:43 -08:00
Kartik Agaram 0102aa377a 7176 - type checks for 'copy' instruction 2020-11-04 19:04:15 -08:00
Kartik Agaram 768aeffbbe 7174 - function returns should now be safe 2020-11-03 22:32:50 -08:00
Kartik Agaram bd57b37fc5 7173
All tests passing again.
2020-11-03 21:31:48 -08:00
Kartik Agaram da2dc3ee9d 7172 2020-11-03 20:37:26 -08:00
Kartik Agaram c623ff2975 7171 2020-11-03 20:23:39 -08:00
Kartik Agaram 71d21ae662 7170
One more test.
2020-11-03 20:13:41 -08:00
Kartik Agaram aa36ee1cdf 7169
Now test-return-unavailable-value is passing,
but test-convert-return-with-duplicate-values is failing.

Time to think.
2020-11-03 20:13:02 -08:00
Kartik Agaram ec638f029d 7168 - snapshot
2 new tests:
  test-return-unavailable-value - currently failing
  test-convert-return-with-duplicate-values - currently passing

I don't yet know how to make both pass.
2020-11-03 19:15:32 -08:00
Kartik Agaram f7cd97c197 7167 2020-11-03 18:10:32 -08:00
Kartik Agaram f21c96203e 7166 2020-11-03 15:42:58 -08:00
Kartik Agaram da791479a0 7165
All tasks of https://github.com/akkartik/mu/issues/45#issuecomment-719990879
should now be complete.
2020-11-03 14:04:35 -08:00
Kartik Agaram 85a29a4e4e 7164 2020-11-03 13:37:32 -08:00
Kartik Agaram 65dcc74693 7163 - first type checks for 'return' statements 2020-11-03 13:29:09 -08:00
Kartik Agaram 571ad49190 7161 - stop processing function outputs
Assignments to them will no longer work, and they can never be live variables.

https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 3.
2020-11-02 21:03:03 -08:00
Kartik Agaram 95d89d1cc0 7160 2020-11-02 20:36:42 -08:00
Kartik Agaram cc7dcdc3b8 7153
Bugfix in computing the label a return should jump to.
2020-11-01 20:37:56 -08:00
Kartik Agaram ccadc6e604 7152 - 'return' instruction
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 1.

We don't have checking for it yet. Soon.
2020-11-01 18:02:02 -08:00
Kartik Agaram c694b8e2cb 7151
Drop pending tests for the old plan of liveness analysis.
2020-11-01 11:19:03 -08:00
Kartik Agaram 77687ba944 7148 2020-10-31 20:29:09 -07:00
Kartik Agaram 8c44afcccc 7145 - roll back to 7143 2020-10-30 20:23:56 -07:00
Kartik Agaram 264acd9ec9 7144 - tmp: redo checks for function outputs
This isn't done, but an intermediate snapshot seems worth capturing.

Back in March (commit 6082), I made a plan to check writes to function
outputs using liveness analysis. I've been shying away from actually acting
on this plan ever since. In recent weeks I've had this gap bite me three
times.

Returning to the problem now, I think I don't actually need to compute
variable liveness. The compiler can, I think, do the same thing for output
registers whether their variables are alive or dead. The new rule is this:

Once a register gets a function output written to it, no local is popped
into it. Instead of popping outer locals to the register, we simply increment
the stack and keep going.

Since the function output will continue to live on the vars stack past
this point (see clean-up-block), any attempts to read shadowed variables
will throw an error as usual.

This rule is also now easy to explain to people, I think. "You wrote the
function output. Now the register can't be used for anything else."

It's really cool that this works (if it does). Another fruit from "Mu's
lovely property."
2020-10-30 06:05:52 -07:00
Kartik Agaram 8fe51755bf 7143
Am I starting to have too much code duplication?
2020-10-29 22:06:50 -07:00
Kartik Agaram 2486881de0 7142 2020-10-29 21:36:33 -07:00
Kartik Agaram 0a5d247ba7 7141 2020-10-29 21:15:15 -07:00
Kartik Agaram 7521fcdc1e 7139 - type-check compute-offset 2020-10-29 00:34:00 -07:00
Kartik Agaram 4cbe0ba1ac 7138 - type-check array 'length' instruction 2020-10-29 00:03:19 -07:00
Kartik Agaram d3657eec0d 7137 2020-10-28 23:25:40 -07:00
Kartik Agaram 216af9cc1c 7136 2020-10-28 23:25:05 -07:00
Kartik Agaram 33b1e9a894 7135 - type-check write-to-stream
Lots of copy-pasta.
2020-10-28 22:39:14 -07:00
Kartik Agaram d648812c51 7134 - type-check read-from-stream 2020-10-28 22:35:35 -07:00
Kartik Agaram 6b218b8d62 7130 - back to the Mu compiler for a spell
Hacking on apps has created some urgency now for several additional safety
checks.
2020-10-27 21:22:18 -07:00
Kartik Agaram 0f9a65dc0d 7120 - tile: array of lines from file
Requires a quick hacky change to Mu compiler.
2020-10-26 23:45:40 -07:00