about summary refs log tree commit diff stats
path: root/010vm.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-05-17 12:35:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-05-17 12:50:43 -0700
commit51b53b13f9d88b42ca81510b41a91340bab72ccc (patch)
tree31083eaa868d2ee8b409fff9b11055e87d44d7cf /010vm.cc
parentcaa4275c9a56f4e64ea3bcaf572f76445d305d93 (diff)
downloadmu-51b53b13f9d88b42ca81510b41a91340bab72ccc.tar.gz
2968
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.
Diffstat (limited to '010vm.cc')
-rw-r--r--010vm.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc
index 7c2ccba1..ee18a171 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -98,6 +98,8 @@ struct string_tree {
   string_tree(string_tree* l, string_tree* r) :left(l), right(r) {}
 };
 
+// End type_tree Definition
+
 :(before "End Globals")
 // Locations refer to a common 'memory'. Each location can store a number.
 map<int, double> Memory;