Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 92e4dc4c8c9c98f03a6267e2f393dda5c4312803..b1251e11c98492307ca254f2f2e3da09916ff73c 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -10642,16 +10642,19 @@ void Code::ClearInlineCaches(Code::Kind* kind) { |
} |
-void SharedFunctionInfo::ClearTypeFeedbackInfo(Heap* heap) { |
- FixedArray* vector = feedback_vector(); |
- for (int i = 0; i < vector->length(); i++) { |
- Object* obj = vector->get(i); |
- if (!obj->IsAllocationSite()) { |
- // The assert verifies we can skip the write barrier. |
- ASSERT(heap->uninitialized_symbol() == |
- TypeFeedbackInfo::RawUninitializedSentinel(heap)); |
- vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap), |
- SKIP_WRITE_BARRIER); |
+void Code::ClearTypeFeedbackInfo(Heap* heap) { |
+ if (kind() != FUNCTION) return; |
+ Object* raw_info = type_feedback_info(); |
+ if (raw_info->IsTypeFeedbackInfo()) { |
+ FixedArray* feedback_vector = |
+ TypeFeedbackInfo::cast(raw_info)->feedback_vector(); |
+ for (int i = 0; i < feedback_vector->length(); i++) { |
+ Object* obj = feedback_vector->get(i); |
+ if (!obj->IsAllocationSite()) { |
+ // TODO(mvstanton): Can't I avoid a write barrier for this sentinel? |
+ feedback_vector->set(i, |
+ TypeFeedbackInfo::RawUninitializedSentinel(heap)); |
+ } |
} |
} |
} |