about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:20:21 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-08-25 14:21:05 -0700
commit8bd019bdc868e9d563aa72acbb0307deaeca919f (patch)
treedeadfaf2682bb480816d56526d7113a7be7ea3e2 /src/rt
parent608f7ccded67fd65d5e12ef2c0601170fb3345ed (diff)
downloadrust-8bd019bdc868e9d563aa72acbb0307deaeca919f.tar.gz
rust-8bd019bdc868e9d563aa72acbb0307deaeca919f.zip
rt: Remember the number of captured type descriptors for objects in the type descriptor crate cache
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_crate_cache.cpp5
-rw-r--r--src/rt/rust_shape.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/rust_crate_cache.cpp b/src/rt/rust_crate_cache.cpp
index ba5a104b024..035715d219f 100644
--- a/src/rt/rust_crate_cache.cpp
+++ b/src/rt/rust_crate_cache.cpp
@@ -1,5 +1,6 @@
 
 #include "rust_internal.h"
+#include <algorithm>
 
 type_desc *
 rust_crate_cache::get_type_desc(size_t size,
@@ -14,6 +15,10 @@ rust_crate_cache::get_type_desc(size_t size,
     HASH_FIND(hh, this->type_descs, descs, keysz, td);
     if (td) {
         DLOG(sched, cache, "rust_crate_cache::get_type_desc hit");
+
+        // FIXME: This is a gross hack.
+        td->n_obj_params = std::max(td->n_obj_params, n_obj_params);
+
         return td;
     }
     DLOG(sched, cache, "rust_crate_cache::get_type_desc miss");
diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h
index 0302338e26d..e8a30d5874a 100644
--- a/src/rt/rust_shape.h
+++ b/src/rt/rust_shape.h
@@ -259,6 +259,9 @@ public:
     // Creates type parameters from a type descriptor.
     static inline type_param *from_tydesc(const type_desc *tydesc,
                                           arena &arena) {
+        if (tydesc->n_obj_params) {
+            // TODO
+        }
         return make(tydesc->first_param, tydesc->n_params, arena);
     }
 };