Skip to content

Commit e015bee

Browse files
pcwaltonemberian
authored andcommitted
Rewrite each_path to allow performance improvements in the future.
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
1 parent 89eb995 commit e015bee

File tree

17 files changed

+574
-360
lines changed

17 files changed

+574
-360
lines changed

src/libextra/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl Sem<~[Waitqueue]> {
381381
// The only other places that condvars get built are rwlock.write_cond()
382382
// and rwlock_write_mode.
383383
pub fn access_cond<U>(&self, blk: &fn(c: &Condvar) -> U) -> U {
384-
do self.access {
384+
do self.access_waitqueue {
385385
blk(&Condvar { sem: self, order: Nothing })
386386
}
387387
}

src/librustc/metadata/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ pub static tag_item_method_tps: uint = 0x7b;
176176
pub static tag_item_method_fty: uint = 0x7c;
177177
pub static tag_item_method_transformed_self_ty: uint = 0x7d;
178178

179+
pub static tag_mod_child: uint = 0x7e;
180+
pub static tag_misc_info: uint = 0x7f;
181+
pub static tag_misc_info_crate_items: uint = 0x80;
182+
179183
pub struct LinkMeta {
180184
name: @str,
181185
vers: @str,

src/librustc/metadata/csearch.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,14 @@ pub fn get_enum_variants(tcx: ty::ctxt, def: ast::def_id)
9797
return decoder::get_enum_variants(cstore.intr, cdata, def.node, tcx)
9898
}
9999

100-
pub fn get_impls_for_mod(cstore: @mut cstore::CStore, def: ast::def_id,
101-
name: Option<ast::ident>)
102-
-> @~[@resolve::Impl] {
103-
let cdata = cstore::get_crate_data(cstore, def.crate);
104-
do decoder::get_impls_for_mod(cstore.intr, cdata, def.node, name) |cnum| {
105-
cstore::get_crate_data(cstore, cnum)
106-
}
100+
/// Returns information about the given implementation.
101+
pub fn get_impl(cstore: @mut cstore::CStore, impl_def_id: ast::def_id)
102+
-> resolve::Impl {
103+
let cdata = cstore::get_crate_data(cstore, impl_def_id.crate);
104+
decoder::get_impl(cstore.intr, cdata, impl_def_id.node)
107105
}
108106

109-
pub fn get_method(tcx: ty::ctxt,
110-
def: ast::def_id) -> ty::Method
111-
{
107+
pub fn get_method(tcx: ty::ctxt, def: ast::def_id) -> ty::Method {
112108
let cdata = cstore::get_crate_data(tcx.cstore, def.crate);
113109
decoder::get_method(tcx.cstore.intr, cdata, def.node, tcx)
114110
}

0 commit comments

Comments
 (0)