Skip to content

Commit 6c87c34

Browse files
committed
Remove dead code from rt (debug_obj, rust_obj, rust_closure, rust_box_obj, rust_vtable)
1 parent 15df395 commit 6c87c34

File tree

4 files changed

+0
-58
lines changed

4 files changed

+0
-58
lines changed

src/libstd/dbg.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ native mod rustrt {
1414
fn debug_opaque<T>(td: *sys::type_desc, x: T);
1515
fn debug_box<T>(td: *sys::type_desc, x: @T);
1616
fn debug_tag<T>(td: *sys::type_desc, x: T);
17-
fn debug_obj<T>(td: *sys::type_desc, x: T,
18-
nmethods: ctypes::size_t, nbytes: ctypes::size_t);
1917
fn debug_fn<T>(td: *sys::type_desc, x: T);
2018
fn debug_ptrcast<T, U>(td: *sys::type_desc, x: @T) -> @U;
2119
}
@@ -36,20 +34,6 @@ fn debug_tag<T>(x: T) {
3634
rustrt::debug_tag::<T>(sys::get_type_desc::<T>(), x);
3735
}
3836

39-
40-
/**
41-
* `nmethods` is the number of methods we expect the object to have. The
42-
* runtime will print this many words of the obj vtbl).
43-
*
44-
* `nbytes` is the number of bytes of body data we expect the object to have.
45-
* The runtime will print this many bytes of the obj body. You probably want
46-
* this to at least be 4u, since an implicit captured tydesc pointer sits in
47-
* the front of any obj's data tuple.x
48-
*/
49-
fn debug_obj<T>(x: T, nmethods: uint, nbytes: uint) {
50-
rustrt::debug_obj::<T>(sys::get_type_desc::<T>(), x, nmethods, nbytes);
51-
}
52-
5337
fn debug_fn<T>(x: T) {
5438
rustrt::debug_fn::<T>(sys::get_type_desc::<T>(), x);
5539
}

src/rt/rust_builtin.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -268,28 +268,6 @@ debug_tag(type_desc *t, rust_tag *tag) {
268268
tag->variant[i]);
269269
}
270270

271-
struct rust_obj {
272-
uintptr_t *vtbl;
273-
rust_box *body;
274-
};
275-
276-
extern "C" CDECL void
277-
debug_obj(type_desc *t, rust_obj *obj, size_t nmethods, size_t nbytes) {
278-
rust_task *task = rust_task_thread::get_task();
279-
280-
LOG(task, stdlib, "debug_obj with %" PRIdPTR " methods", nmethods);
281-
debug_tydesc_helper(t);
282-
LOG(task, stdlib, " vtbl at 0x%" PRIxPTR, obj->vtbl);
283-
LOG(task, stdlib, " body at 0x%" PRIxPTR, obj->body);
284-
285-
for (uintptr_t *p = obj->vtbl; p < obj->vtbl + nmethods; ++p)
286-
LOG(task, stdlib, " vtbl word: 0x%" PRIxPTR, *p);
287-
288-
for (uintptr_t i = 0; i < nbytes; ++i)
289-
LOG(task, stdlib, " body byte %" PRIdPTR ": 0x%" PRIxPTR,
290-
i, obj->body->data[i]);
291-
}
292-
293271
struct rust_fn {
294272
uintptr_t *thunk;
295273
rust_box *closure;

src/rt/rust_shape.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -274,25 +274,6 @@ struct rust_fn {
274274
void *env;
275275
};
276276

277-
struct rust_closure {
278-
type_desc *tydesc;
279-
uint32_t target_0;
280-
uint32_t target_1;
281-
uint32_t bindings[0];
282-
283-
uint8_t *get_bindings() const { return (uint8_t *)bindings; }
284-
};
285-
286-
struct rust_obj_box {
287-
type_desc *tydesc;
288-
289-
uint8_t *get_bindings() const { return (uint8_t *)this; }
290-
};
291-
292-
struct rust_vtable {
293-
CDECL void (*dtor)(void *rv, rust_task *task, rust_obj obj);
294-
};
295-
296277
struct rust_obj {
297278
rust_vtable *vtable;
298279
void *box;

src/rt/rustrt.def.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ chan_id_send
22
check_claims
33
debug_box
44
debug_fn
5-
debug_obj
65
debug_opaque
76
del_port
87
debug_ptrcast

0 commit comments

Comments
 (0)