Index: src/type-feedback-vector.cc |
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
index 6aa4712682733538345657ecf2bc190201a99336..fd49513026d5f43c49b5f16cdc2da1ea24ec62c8 100644 |
--- a/src/type-feedback-vector.cc |
+++ b/src/type-feedback-vector.cc |
@@ -224,6 +224,40 @@ void TypeFeedbackVector::ClearICSlotsImpl(SharedFunctionInfo* shared, |
// static |
+void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) { |
+ DCHECK(FLAG_vector_stores); |
+ SharedFunctionInfo::Iterator iterator(isolate); |
+ SharedFunctionInfo* shared; |
+ while ((shared = iterator.Next())) { |
+ TypeFeedbackVector* vector = shared->feedback_vector(); |
+ vector->ClearKeyedStoreICs(shared); |
+ } |
+} |
+ |
+ |
+void TypeFeedbackVector::ClearKeyedStoreICs(SharedFunctionInfo* shared) { |
+ Heap* heap = GetIsolate()->heap(); |
+ |
+ int slots = ICSlots(); |
+ Code* host = shared->code(); |
+ Object* uninitialized_sentinel = |
+ TypeFeedbackVector::RawUninitializedSentinel(heap); |
+ for (int i = 0; i < slots; i++) { |
+ FeedbackVectorICSlot slot(i); |
+ Object* obj = Get(slot); |
+ if (obj != uninitialized_sentinel) { |
+ Code::Kind kind = GetKind(slot); |
+ if (kind == Code::KEYED_STORE_IC) { |
+ DCHECK(FLAG_vector_stores); |
+ KeyedStoreICNexus nexus(this, slot); |
+ nexus.Clear(host); |
+ } |
+ } |
+ } |
+} |
+ |
+ |
+// static |
Handle<TypeFeedbackVector> TypeFeedbackVector::DummyVector(Isolate* isolate) { |
return Handle<TypeFeedbackVector>::cast(isolate->factory()->dummy_vector()); |
} |