Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index b09e1a0530c5c4c9077ae4e01c0ea5c2db6b9135..d523d77856b098ef848ae4668ec389a1366c44c7 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11205,30 +11205,13 @@ void Code::ClearInlineCaches(Code::Kind* kind) { |
void SharedFunctionInfo::ClearTypeFeedbackInfo() { |
FixedArray* vector = feedback_vector(); |
Heap* heap = GetHeap(); |
- int length = vector->length(); |
- |
- for (int i = 0; i < length; i++) { |
+ for (int i = 0; i < vector->length(); i++) { |
Object* obj = vector->get(i); |
- if (obj->IsHeapObject()) { |
- InstanceType instance_type = |
- HeapObject::cast(obj)->map()->instance_type(); |
- switch (instance_type) { |
- case ALLOCATION_SITE_TYPE: |
- // AllocationSites are not cleared because they do not store |
- // information that leaks. |
- break; |
- case JS_FUNCTION_TYPE: |
- // No need to clear the native context array function. |
- if (obj == JSFunction::cast(obj)->context()->native_context()-> |
- get(Context::ARRAY_FUNCTION_INDEX)) { |
- break; |
- } |
- // Fall through... |
- |
- default: |
- vector->set(i, TypeFeedbackInfo::RawUninitializedSentinel(heap), |
- SKIP_WRITE_BARRIER); |
- } |
+ if (!obj->IsAllocationSite()) { |
+ vector->set( |
+ i, |
+ TypeFeedbackInfo::RawUninitializedSentinel(heap), |
+ SKIP_WRITE_BARRIER); |
} |
} |
} |