Skip to content

Commit dd3867b

Browse files
committed
---
yaml --- r: 88893 b: refs/heads/snap-stage3 c: 13f85cb h: refs/heads/master i: 88891: 286274e v: v3
1 parent 665b695 commit dd3867b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5dcc5165a6cabbe5dc28c6564464e655b6b43638
4+
refs/heads/snap-stage3: 13f85cb097725a13ae24a6564c71597243b91c3d
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub struct CrateContext {
6969
monomorphized: RefCell<HashMap<mono_id, ValueRef>>,
7070
monomorphizing: RefCell<HashMap<ast::DefId, uint>>,
7171
// Cache generated vtables
72-
vtables: HashMap<(ty::t, mono_id), ValueRef>,
72+
vtables: RefCell<HashMap<(ty::t, mono_id), ValueRef>>,
7373
// Cache of constant strings,
7474
const_cstr_cache: HashMap<@str, ValueRef>,
7575

@@ -196,7 +196,7 @@ impl CrateContext {
196196
non_inlineable_statics: HashSet::new(),
197197
monomorphized: RefCell::new(HashMap::new()),
198198
monomorphizing: RefCell::new(HashMap::new()),
199-
vtables: HashMap::new(),
199+
vtables: RefCell::new(HashMap::new()),
200200
const_cstr_cache: HashMap::new(),
201201
const_globals: HashMap::new(),
202202
const_values: HashMap::new(),

branches/snap-stage3/src/librustc/middle/trans/meth.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,12 @@ pub fn get_vtable(bcx: @Block,
539539

540540
// Check the cache.
541541
let hash_id = (self_ty, vtable_id(ccx, &origins[0]));
542-
match ccx.vtables.find(&hash_id) {
543-
Some(&val) => { return val }
544-
None => { }
542+
{
543+
let vtables = ccx.vtables.borrow();
544+
match vtables.get().find(&hash_id) {
545+
Some(&val) => { return val }
546+
None => { }
547+
}
545548
}
546549

547550
// Not in the cache. Actually build it.
@@ -559,7 +562,9 @@ pub fn get_vtable(bcx: @Block,
559562
glue::lazily_emit_all_tydesc_glue(ccx, tydesc);
560563

561564
let vtable = make_vtable(ccx, tydesc, methods);
562-
ccx.vtables.insert(hash_id, vtable);
565+
566+
let mut vtables = ccx.vtables.borrow_mut();
567+
vtables.get().insert(hash_id, vtable);
563568
return vtable;
564569
}
565570

0 commit comments

Comments
 (0)