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

Side by Side Diff: src/type-feedback-vector.cc

Issue 1314433004: Vector ICs: Stop iterating the heap to clear keyed store ics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code review. Created 5 years, 3 months 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/type-feedback-vector.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/type-feedback-vector.h" 5 #include "src/type-feedback-vector.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/ic/ic.h" 8 #include "src/ic/ic.h"
9 #include "src/ic/ic-state.h" 9 #include "src/ic/ic-state.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 DCHECK(FLAG_vector_stores); 217 DCHECK(FLAG_vector_stores);
218 KeyedStoreICNexus nexus(this, slot); 218 KeyedStoreICNexus nexus(this, slot);
219 nexus.Clear(host); 219 nexus.Clear(host);
220 } 220 }
221 } 221 }
222 } 222 }
223 } 223 }
224 224
225 225
226 // static 226 // static
227 void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) {
228 DCHECK(FLAG_vector_stores);
229 SharedFunctionInfo::Iterator iterator(isolate);
230 SharedFunctionInfo* shared;
231 while ((shared = iterator.Next())) {
232 TypeFeedbackVector* vector = shared->feedback_vector();
233 vector->ClearKeyedStoreICs(shared);
234 }
235 }
236
237
238 void TypeFeedbackVector::ClearKeyedStoreICs(SharedFunctionInfo* shared) {
239 Heap* heap = GetIsolate()->heap();
240
241 int slots = ICSlots();
242 Code* host = shared->code();
243 Object* uninitialized_sentinel =
244 TypeFeedbackVector::RawUninitializedSentinel(heap);
245 for (int i = 0; i < slots; i++) {
246 FeedbackVectorICSlot slot(i);
247 Object* obj = Get(slot);
248 if (obj != uninitialized_sentinel) {
249 Code::Kind kind = GetKind(slot);
250 if (kind == Code::KEYED_STORE_IC) {
251 DCHECK(FLAG_vector_stores);
252 KeyedStoreICNexus nexus(this, slot);
253 nexus.Clear(host);
254 }
255 }
256 }
257 }
258
259
260 // static
227 Handle<TypeFeedbackVector> TypeFeedbackVector::DummyVector(Isolate* isolate) { 261 Handle<TypeFeedbackVector> TypeFeedbackVector::DummyVector(Isolate* isolate) {
228 return Handle<TypeFeedbackVector>::cast(isolate->factory()->dummy_vector()); 262 return Handle<TypeFeedbackVector>::cast(isolate->factory()->dummy_vector());
229 } 263 }
230 264
231 265
232 Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) { 266 Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) {
233 Isolate* isolate = GetIsolate(); 267 Isolate* isolate = GetIsolate();
234 Handle<Object> feedback = handle(GetFeedback(), isolate); 268 Handle<Object> feedback = handle(GetFeedback(), isolate);
235 if (!feedback->IsFixedArray() || 269 if (!feedback->IsFixedArray() ||
236 FixedArray::cast(*feedback)->length() != length) { 270 FixedArray::cast(*feedback)->length() != length) {
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 void StoreICNexus::Clear(Code* host) { 717 void StoreICNexus::Clear(Code* host) {
684 StoreIC::Clear(GetIsolate(), host, this); 718 StoreIC::Clear(GetIsolate(), host, this);
685 } 719 }
686 720
687 721
688 void KeyedStoreICNexus::Clear(Code* host) { 722 void KeyedStoreICNexus::Clear(Code* host) {
689 KeyedStoreIC::Clear(GetIsolate(), host, this); 723 KeyedStoreIC::Clear(GetIsolate(), host, this);
690 } 724 }
691 } // namespace internal 725 } // namespace internal
692 } // namespace v8 726 } // namespace v8
OLDNEW
« no previous file with comments | « src/type-feedback-vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698