about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 4127Kartik K. Agaram2017-11-191-9/+9
|
* 4126Kartik K. Agaram2017-11-191-6/+1
|
* 4125Kartik K. Agaram2017-11-191-0/+15
|
* 4124Kartik K. Agaram2017-11-191-6/+3
|
* 4123Kartik K. Agaram2017-11-162-36/+18
|
* 4122Kartik K. Agaram2017-11-1513-1242/+1266
|
* 4121Kartik K. Agaram2017-11-151-0/+8
|
* 4120Kartik K. Agaram2017-11-101-0/+8
| | | | Support explicit conversions from number to character.
* 4119Kartik K. Agaram2017-11-104-4/+12
| | | | Running example programs after a long time.
* 4118Kartik K. Agaram2017-11-062-291/+293
|
* 4117 - done with delimited continuationsKartik K. Agaram2017-11-0616-842/+1019
| | | | | At least this particular implementation of them. Let's play with them now for a while, see if they're fully equivalent to shift/reduce.
* 4116 - support calling continuations with argumentsKartik K. Agaram2017-11-063-7/+45
| | | | | | Surprisingly small change, considering how long it took me and how mind-bending it was. 'return-continuation-until-mark' now behaves like both call and return instructions, which made it hard to reason about.
* 4115Kartik K. Agaram2017-11-061-3/+5
|
* 4114Kartik K. Agaram2017-11-051-59/+39
|
* 4113Kartik K. Agaram2017-11-052-288/+294
|
* 4112Kartik K. Agaram2017-11-052-26/+18
|
* 4111Kartik K. Agaram2017-11-051-0/+3
|
* 4110 - add continuations to docsKartik K. Agaram2017-11-056-5/+373
|
* 4109Kartik K. Agaram2017-11-0541-1091/+1222
|
* 4108Kartik K. Agaram2017-11-051-1/+2
|
* 4107Kartik K. Agaram2017-11-052-0/+75
| | | | Return other values along with the current continuation.
* 4106Kartik K. Agaram2017-11-0310-15/+14
|
* 4105Kartik K. Agaram2017-11-031-4/+4
|
* 4104Kartik K. Agaram2017-11-0323-73/+73
| | | | | Stop hardcoding Max_depth everywhere; we had a default value for a reason but then we forgot all about it.
* 4103 - continuations no longer cause memory corruptionKartik K. Agaram2017-11-034-5/+171
|
* 4102Kartik K. Agaram2017-11-0154-4738/+4816
|
* 4101Kartik K. Agaram2017-11-011-2/+2
|
* 4100Kartik K. Agaram2017-11-011-1/+1
|
* 4099Kartik K. Agaram2017-11-018-71/+128
| | | | | | | | | | | | | | Generalize commit 4089 to arbitrary closures, and not just the current 'space' or call frame. Now we should be treating spaces just like any other data structure, and reclaiming all addresses inside them when we need to. The cost: all spaces must now specify what recipe generated them (so they know how to interpret the array of locations) using the /names property. We can probably make this ergonomic with a little 'type inference'. But at least things are safe now.
* 4098Kartik K. Agaram2017-10-303-8/+63
| | | | | | | | | Finally, make the seemingly-trivial change to buffer methods that I was envisioning 2 days ago. I still have zero confidence in our heuristic for picking the generic method to specialize for a call-site. Waiting for issues to reveal themselves.
* 4097Kartik K. Agaram2017-10-301-21/+34
| | | | | | | Don't silently ignore ties we failed to break when matching generic functions to calls. Now we can start working on the bug that triggered commits 4092-4097.
* 4096Kartik K. Agaram2017-10-301-6/+6
|
* 4095Kartik K. Agaram2017-10-301-1/+1
|
* 4094Kartik K. Agaram2017-10-301-3/+7
|
* 4093Kartik K. Agaram2017-10-301-6/+2
|
* 4092Kartik K. Agaram2017-10-302-6/+8
| | | | Some cleanup as I remind myself of how generic functions work in Mu.
* 4091Kartik K. Agaram2017-10-291-1/+1
|
* 4090Kartik K. Agaram2017-10-261-4/+4
|
* 4089Kartik K. Agaram2017-10-2212-118/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up how we reclaim local scopes. It used to work like this (commit 3216): 1. Update refcounts of products after every instruction, EXCEPT: a) when instruction is a non-primitive and the callee starts with 'local-scope' (because it's already not decremented in 'return') OR: b) when instruction is primitive 'next-ingredient' or 'next-ingredient-without-typechecking', and its result is saved to a variable in the default space (because it's already incremented at the time of the call) 2. If a function starts with 'local-scope', force it to be reclaimed before each return. However, since locals may be returned, *very carefully* don't reclaim those. (See the logic in the old `escaping` and `should_update_refcount` functions.) However, this approach had issues. We needed two separate commands for 'local-scope' (reclaim locals on exit) and 'new-default-space' (programmer takes charge of reclaiming locals). The hard-coded reclamation duplicated refcounting logic. In addition to adding complexity, this implementation failed to work if a function overwrites default-space after setting up a local-scope (the old default-space is leaked). It also fails in the presence of continuations. Calling a continuation more than once was guaranteed to corrupt memory (commit 3986). After this commit, reclaiming local scopes now works like this: Update refcounts of products for every PRIMITIVE instruction. For non-primitive instructions, all the work happens in the `return` instruction: increment refcount of ingredients to `return` (unless -- one last bit of ugliness -- they aren't saved in the caller) decrement the refcount of the default-space use existing infrastructure for reclaiming as necessary if reclaiming default-space, first decrement refcount of each local again, use existing infrastructure for reclaiming as necessary This commit (finally!) completes the bulk[1] of step 2 of the plan in commit 3991. It was very hard until I gave up trying to tweak the existing implementation and just test-drove layer 43 from scratch. [1] There's still potential for memory corruption if we abuse `default-space`. I should probably try to add warnings about that at some point (todo in layer 45).
* 4088Kartik K. Agaram2017-10-211-1/+1
| | | | | I no longer remember why we were disabling memory reclamation inside sandboxes. Everything seems to be working. Just take it out.
* 4087Kartik K. Agaram2017-10-212-24/+27
| | | | | Clean up the narrative of spaces as I struggle to reimplement `local-scope` by the plan of commit 3992.
* 4086 - back to cleaning up delimited continuationsKartik K. Agaram2017-10-186-6/+10
|
* 4085 - done with first cut of the SubX VMKartik K. Agaram2017-10-184-6/+226
| | | | subx: 'call' and 'return' instructions
* 4084Kartik K. Agaram2017-10-185-120/+118
| | | | | subx: extract helpers for 'push' and 'pop'. We will be using them in 'call' and 'ret' as well.
* 4083Kartik K. Agaram2017-10-184-2/+120
| | | | subx: 'pop'
* 4082Kartik K. Agaram2017-10-184-55/+67
| | | | | subx: correct a 'copy' ('mov') instruction as well to get its operand right from the opcode.
* 4081Kartik K. Agaram2017-10-182-238/+230
|
* 4080Kartik K. Agaram2017-10-182-17/+29
| | | | | | | | subx: correct 'push' register. It gets its operand right from the opcode, not a new modrm byte. Have I misinterpreted any other instructions in this manner (`+rd` in the Intel manual)?
* 4079Kartik K. Agaram2017-10-186-33/+183
| | | | subx: 'pop'
* 4078Kartik K. Agaram2017-10-177-450/+454
|