@@ -17,7 +17,7 @@ pub struct Stack {
1717 /// On a read, we need to disable all `Unique` above the granting item. We can avoid most of
1818 /// this scan by keeping track of the region of the borrow stack that may contain `Unique`s.
1919 unique_range : Range < usize > ,
20- validate_cache : bool ,
20+ verify_cache : bool ,
2121}
2222
2323#[ derive( Clone , Debug ) ]
@@ -49,7 +49,7 @@ impl Stack {
4949 /// - The StackCache indices don't refer to the parallel tags,
5050 /// - If top_untagged is Some it is the topmost Untagged
5151 /// - There are no Unique tags outside of first_unique..last_unique
52- fn check_cache_validity ( & self ) {
52+ fn verify_cache_consistency ( & self ) {
5353 for ( tag, stack_idx) in self . cache . tags . iter ( ) . zip ( self . cache . idx . iter ( ) ) {
5454 assert_eq ! ( self . borrows[ * stack_idx] . tag, * tag) ;
5555 }
@@ -72,8 +72,8 @@ impl Stack {
7272 /// Find the item granting the given kind of access to the given tag, and return where
7373 /// it is on the stack.
7474 pub fn find_granting ( & mut self , access : AccessKind , tag : SbTag ) -> Option < usize > {
75- if self . validate_cache {
76- self . check_cache_validity ( ) ;
75+ if self . verify_cache {
76+ self . verify_cache_consistency ( ) ;
7777 }
7878
7979 match tag {
@@ -111,8 +111,8 @@ impl Stack {
111111 }
112112
113113 pub fn insert ( & mut self , new_idx : usize , new : Item ) {
114- if self . validate_cache {
115- self . check_cache_validity ( ) ;
114+ if self . verify_cache {
115+ self . verify_cache_consistency ( ) ;
116116 }
117117
118118 self . borrows . insert ( new_idx, new) ;
@@ -152,13 +152,13 @@ impl Stack {
152152 }
153153 }
154154
155- pub fn new ( item : Item ) -> Self {
155+ pub fn new ( item : Item , verify : bool ) -> Self {
156156 Stack {
157157 borrows : vec ! [ item] ,
158158 cache : StackCache { idx : [ 0 ; CACHE_LEN ] , tags : [ item. tag ; CACHE_LEN ] } ,
159159 unique_range : if item. perm == Permission :: Unique { 0 ..1 } else { 0 ..0 } ,
160160 top_untagged : None ,
161- validate_cache : false ,
161+ verify_cache : verify ,
162162 }
163163 }
164164
@@ -175,8 +175,8 @@ impl Stack {
175175 granting_idx : usize ,
176176 mut visitor : V ,
177177 ) -> crate :: InterpResult < ' static > {
178- if self . validate_cache {
179- self . check_cache_validity ( ) ;
178+ if self . verify_cache {
179+ self . verify_cache_consistency ( ) ;
180180 }
181181
182182 if granting_idx < self . unique_range . end {
@@ -205,8 +205,8 @@ impl Stack {
205205 }
206206
207207 pub fn drain_rev ( & mut self , range : std:: ops:: Range < usize > ) -> DrainRev < ' _ > {
208- if self . validate_cache {
209- self . check_cache_validity ( ) ;
208+ if self . verify_cache {
209+ self . verify_cache_consistency ( ) ;
210210 }
211211
212212 DrainRev { start : range. start , stack : self , cursor : range. end - 1 }
0 commit comments