about summary refs log tree commit diff stats
path: root/037abandon.cc
Commit message (Collapse)AuthorAgeFilesLines
* 3202 - bugfix: 'start-running' and refcountsKartik K. Agaram2016-08-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | When you pass an ingredient to a recipe using 'start-running' it mostly behaves identically to performing a regular function call. However, if the calling function completed before the new routine had a chance to run, the ingredients passed in ran the risk of being reclaimed. In response, let's always increment refcounts at the time of a function call rather than when the ingredients are read inside the callee. Now the summary of commit 3197 is modified to this: 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'
* 3070Kartik K. Agaram2016-06-281-9/+4
| | | | | Extract out the implementation of 'allocate' so other instructions (ahem, deep-copy) can use it.
* 2972 - abandon recursive containersKartik K. Agaram2016-05-171-7/+114
|
* 2970Kartik K. Agaram2016-05-171-4/+4
|
* 2968Kartik K. Agaram2016-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | More reorganization in preparation for implementing recursive abandon(). Refcounts are getting incredibly hairy. I need to juggle containers containing other containers, and containers *pointing* to other containers. For a while I considered getting rid of address_element_info entirely and just going by types for every single update_refcount. But that's definitely more work, and it's unclear that things will be cleaner/shorter/simpler. I haven't measured the speedup, but it seems worth optimizing every pointer copy to make sure we aren't manipulating types at runtime. The key insight now is a) to continue to compute information about nested containers at load time, because that's the common case when updating refcounts, but b) to compute information about *pointed* values at run-time, because that's the uncommon case. As a result, we're going to cheat in the interpreter and use type information at runtime just for abandon(), just because the corresponding task when we get to a compiler will be radically different. It will still be tractable, though.
* 2961Kartik K. Agaram2016-05-151-1/+1
|
* 2927Kartik K. Agaram2016-05-051-6/+9
|
* 2922Kartik K. Agaram2016-05-041-20/+4
| | | | | | | | | A better primitive: manage refcounts for an assignment without actually doing the assignment itself. This way we can add refcounts as a new, independent bit of bookkeeping without littering early returns and duplicate code paths. (OCD: commit number.)
* 2898 - start filling in missing refcountsKartik K. Agaram2016-05-031-0/+1
| | | | | | | This commit covers instructions 'put', 'put-index' and 'maybe-convert'. Next up are the harder ones: 'copy' and 'merge'. In these cases there's a non-scalar being copied, and we need to figure out which locations within it need to update their refcount.
* 2897Kartik K. Agaram2016-05-031-0/+143