Remove unused shape fields from typedescs

This commit is contained in:
Philipp Brüschweiler 2013-06-20 14:45:10 +02:00
parent 179ce398ea
commit 8bf0033345
7 changed files with 11 additions and 27 deletions

View File

@ -49,9 +49,7 @@ pub static tydesc_field_take_glue: uint = 2u;
pub static tydesc_field_drop_glue: uint = 3u;
pub static tydesc_field_free_glue: uint = 4u;
pub static tydesc_field_visit_glue: uint = 5u;
pub static tydesc_field_shape: uint = 6u;
pub static tydesc_field_shape_tables: uint = 7u;
pub static n_tydesc_fields: uint = 8u;
pub static n_tydesc_fields: uint = 6u;
// The two halves of a closure: code and environment.
pub static fn_field_code: uint = 0u;

View File

@ -765,19 +765,13 @@ pub fn emit_tydescs(ccx: &mut CrateContext) {
}
};
let shape = C_null(Type::i8p());
let shape_tables = C_null(Type::i8p());
let tydesc = C_named_struct(ccx.tydesc_type,
[ti.size, // size
ti.align, // align
take_glue, // take_glue
drop_glue, // drop_glue
free_glue, // free_glue
visit_glue, // visit_glue
shape, // shape
shape_tables]); // shape_tables
[ti.size, // size
ti.align, // align
take_glue, // take_glue
drop_glue, // drop_glue
free_glue, // free_glue
visit_glue]); // visit_glue
unsafe {
let gvar = ti.tydesc;

View File

@ -211,8 +211,7 @@ impl Type {
let elems = [
int_ty, int_ty,
glue_fn_ty, glue_fn_ty, glue_fn_ty, glue_fn_ty,
pvoid, pvoid
glue_fn_ty, glue_fn_ty, glue_fn_ty, glue_fn_ty
];
tydesc.set_struct_body(elems, false);

View File

@ -48,8 +48,6 @@ pub struct TyDesc {
drop_glue: GlueFn,
free_glue: GlueFn,
visit_glue: GlueFn,
shape: *i8,
shape_tables: *i8
}
#[lang="opaque"]

View File

@ -732,10 +732,9 @@ rust_task_deref(rust_task *task) {
// Must call on rust stack.
extern "C" CDECL void
rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
void (*glue_fn)(void *, void *, void *) =
(void (*)(void *, void *, void *))tydesc[glue_index];
if (glue_fn)
glue_fn(0, 0, root);
glue_fn *fn = (glue_fn*) tydesc[glue_index];
if (fn)
fn(0, 0, root);
}
// Don't run on the Rust stack!

View File

@ -57,8 +57,6 @@ struct type_desc {
glue_fn *drop_glue;
glue_fn *free_glue;
glue_fn *visit_glue;
const uint8_t *unused;
const uint8_t *unused2;
};
extern "C" type_desc *rust_clone_type_desc(type_desc*);

View File

@ -21,8 +21,6 @@ struct type_desc str_body_tydesc = {
NULL, // drop_glue
NULL, // free_glue
NULL, // visit_glue
NULL, // shape
NULL, // shape_tables
};
//