OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (q->key == NULL) { | 122 if (q->key == NULL) { |
123 break; | 123 break; |
124 } | 124 } |
125 | 125 |
126 // Find the initial position for the entry at position q. | 126 // Find the initial position for the entry at position q. |
127 Entry* r = map_ + (q->hash & (capacity_ - 1)); | 127 Entry* r = map_ + (q->hash & (capacity_ - 1)); |
128 | 128 |
129 // If the entry at position q has its initial position outside the range | 129 // If the entry at position q has its initial position outside the range |
130 // between p and q it can be moved forward to position p and will still be | 130 // between p and q it can be moved forward to position p and will still be |
131 // found. There is now a new candidate entry for clearing. | 131 // found. There is now a new candidate entry for clearing. |
132 if (q > p && (r <= p || r > q) || | 132 if ((q > p && (r <= p || r > q)) || |
133 q < p && (r <= p && r > q)) { | 133 (q < p && (r <= p && r > q))) { |
134 *p = *q; | 134 *p = *q; |
135 p = q; | 135 p = q; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 // Clear the entry which is allowed to en emptied. | 139 // Clear the entry which is allowed to en emptied. |
140 p->key = NULL; | 140 p->key = NULL; |
141 occupancy_--; | 141 occupancy_--; |
142 } | 142 } |
143 | 143 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 n--; | 212 n--; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 // Delete old map. | 216 // Delete old map. |
217 allocator_->Delete(map); | 217 allocator_->Delete(map); |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 } } // namespace v8::internal | 221 } } // namespace v8::internal |
OLD | NEW |