Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(891)

Side by Side Diff: src/identity-map.cc

Issue 1423833003: Canonicalize handles for optimized compilation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/identity-map.h" 5 #include "src/identity-map.h"
6 6
7 #include "src/heap/heap.h" 7 #include "src/heap/heap.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 keys_[i] = not_mapped; 144 keys_[i] = not_mapped;
145 values_[i] = nullptr; 145 values_[i] = nullptr;
146 last_empty = i; 146 last_empty = i;
147 } 147 }
148 } 148 }
149 } 149 }
150 // Reinsert all the key/value pairs that were in the wrong place. 150 // Reinsert all the key/value pairs that were in the wrong place.
151 for (auto pair : reinsert) { 151 for (auto pair : reinsert) {
152 int index = InsertIndex(pair.first); 152 int index = InsertIndex(pair.first);
153 DCHECK_GE(index, 0); 153 DCHECK_GE(index, 0);
154 DCHECK_NULL(values_[index]); 154 DCHECK_NE(heap_->not_mapped_symbol(), values_[index]);
155 values_[index] = pair.second; 155 values_[index] = pair.second;
156 } 156 }
157 } 157 }
158 158
159 159
160 void IdentityMapBase::Resize() { 160 void IdentityMapBase::Resize() {
161 // Grow the internal storage and reinsert all the key/value pairs. 161 // Grow the internal storage and reinsert all the key/value pairs.
162 int old_size = size_; 162 int old_size = size_;
163 Object** old_keys = keys_; 163 Object** old_keys = keys_;
164 void** old_values = values_; 164 void** old_values = values_;
(...skipping 16 matching lines...) Expand all
181 DCHECK_GE(index, 0); 181 DCHECK_GE(index, 0);
182 values_[index] = old_values[i]; 182 values_[index] = old_values[i];
183 } 183 }
184 184
185 // Unregister old keys and register new keys. 185 // Unregister old keys and register new keys.
186 heap_->UnregisterStrongRoots(old_keys); 186 heap_->UnregisterStrongRoots(old_keys);
187 heap_->RegisterStrongRoots(keys_, keys_ + size_); 187 heap_->RegisterStrongRoots(keys_, keys_ + size_);
188 } 188 }
189 } // namespace internal 189 } // namespace internal
190 } // namespace v8 190 } // namespace v8
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698