File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
branches/dist-snap/src/librustc Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: 2c3f92699e1f01301739cb78e3dd567363231d2c
9
+ refs/heads/dist-snap: ea5368ce6e5eb1c9b28e3e072dca4f0b063f15b2
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -380,15 +380,21 @@ fn parse_ty(st: &mut PState, conv: conv_did) -> ty::t {
380
380
let key = ty:: creader_cache_key { cnum : st. crate ,
381
381
pos : pos,
382
382
len : len } ;
383
- match st. tcx . rcache . find ( & key) {
384
- Some ( & tt) => return tt,
383
+
384
+ let tt_opt = {
385
+ let rcache = st. tcx . rcache . borrow ( ) ;
386
+ rcache. get ( ) . find_copy ( & key)
387
+ } ;
388
+ match tt_opt {
389
+ Some ( tt) => return tt,
385
390
None => {
386
391
let mut ps = PState {
387
392
pos : pos,
388
393
.. * st
389
394
} ;
390
395
let tt = parse_ty ( & mut ps, |x, y| conv ( x, y) ) ;
391
- st. tcx . rcache . insert ( key, tt) ;
396
+ let mut rcache = st. tcx . rcache . borrow_mut ( ) ;
397
+ rcache. get ( ) . insert ( key, tt) ;
392
398
return tt;
393
399
}
394
400
}
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ pub struct creader_cache_key {
174
174
len : uint
175
175
}
176
176
177
- type creader_cache = @ mut HashMap < creader_cache_key , t > ;
177
+ type creader_cache = RefCell < HashMap < creader_cache_key , t > > ;
178
178
179
179
struct intern_key {
180
180
sty : * sty ,
@@ -957,10 +957,6 @@ type type_cache = RefCell<HashMap<ast::DefId, ty_param_bounds_and_ty>>;
957
957
958
958
pub type node_type_table = @mut HashMap < uint , t > ;
959
959
960
- fn mk_rcache ( ) -> creader_cache {
961
- return @mut HashMap :: new ( ) ;
962
- }
963
-
964
960
pub fn mk_ctxt ( s : session:: Session ,
965
961
dm : resolve:: DefMap ,
966
962
named_region_map : @mut resolve_lifetime:: NamedRegionMap ,
@@ -987,7 +983,7 @@ pub fn mk_ctxt(s: session::Session,
987
983
intrinsic_defs : RefCell :: new ( HashMap :: new ( ) ) ,
988
984
freevars : freevars,
989
985
tcache : RefCell :: new ( HashMap :: new ( ) ) ,
990
- rcache : mk_rcache ( ) ,
986
+ rcache : RefCell :: new ( HashMap :: new ( ) ) ,
991
987
short_names_cache : RefCell :: new ( HashMap :: new ( ) ) ,
992
988
needs_unwind_cleanup_cache : RefCell :: new ( HashMap :: new ( ) ) ,
993
989
tc_cache : RefCell :: new ( HashMap :: new ( ) ) ,
You can’t perform that action at this time.
0 commit comments