From 0c4e0fdfae2fad4a132bdfef3cb856ec5dde84c9 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 23 Sep 2011 16:51:50 -0700 Subject: rt: Get rid of the hack that looks for captured type descriptors adjacent to the root one for functions and objects --- src/rt/rust_cc.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/rt/rust_cc.cpp') diff --git a/src/rt/rust_cc.cpp b/src/rt/rust_cc.cpp index 4befb36d819..146c1f514ba 100644 --- a/src/rt/rust_cc.cpp +++ b/src/rt/rust_cc.cpp @@ -169,7 +169,6 @@ irc::compute_ircs(rust_task *task, irc_map &ircs) { begin(task->local_allocs.begin()), end(task->local_allocs.end()); while (begin != end) { uint8_t *p = reinterpret_cast(begin->first); - p += sizeof(uintptr_t); // Skip over the reference count. const type_desc *tydesc = begin->second; @@ -178,9 +177,9 @@ irc::compute_ircs(rust_task *task, irc_map &ircs) { shape::arena arena; shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); - irc irc(task, true, tydesc->shape, params, tydesc->shape_tables, p, - ircs); + shape::type_param::from_tydesc_and_data(tydesc, p, arena); + irc irc(task, true, tydesc->shape, params, tydesc->shape_tables, + p + sizeof(uintptr_t), ircs); irc.walk(); #if 0 @@ -374,26 +373,25 @@ mark::do_mark(rust_task *task, const std::vector &roots, if (marked.find(alloc) == marked.end()) { marked.insert(alloc); - uint8_t *p = reinterpret_cast(alloc); - p += sizeof(uintptr_t); // Skip over the reference count. - - const type_desc *tydesc = task->local_allocs[*begin]; + const type_desc *tydesc = task->local_allocs[alloc]; //DPRINT("marking: %p, tydesc=%p\n", p, tydesc); + uint8_t *p = reinterpret_cast(alloc); shape::arena arena; shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); + shape::type_param::from_tydesc_and_data(tydesc, p, arena); -#if 0 + // We skip over the reference count here. shape::log log(task, true, tydesc->shape, params, - tydesc->shape_tables, p, std::cerr); + tydesc->shape_tables, p + sizeof(uintptr_t), + std::cerr); log.walk(); DPRINT("\n"); -#endif + // We skip over the reference count here. mark mark(task, true, tydesc->shape, params, tydesc->shape_tables, - p, marked); + p + sizeof(uintptr_t), marked); mark.walk(); } -- cgit 1.4.1-3-g733a5