Chromium Code Reviews| Index: src/type-feedback-vector.cc |
| diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc |
| index 6653bea0eeecd71e31b8fbc4f5e1cd474a91916a..47f89782b006c281e5341941303385df4cf91f4e 100644 |
| --- a/src/type-feedback-vector.cc |
| +++ b/src/type-feedback-vector.cc |
| @@ -139,18 +139,21 @@ Handle<TypeFeedbackVector> TypeFeedbackVector::Copy( |
| // This logic is copied from |
| // StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget. |
| -static bool ClearLogic(Heap* heap, int ic_age) { |
| +static bool ClearLogic(Heap* heap) { |
| return FLAG_cleanup_code_caches_at_gc && |
| heap->isolate()->serializer_enabled(); |
| } |
| -void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) { |
| +void TypeFeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared, |
| + bool force_clear) { |
| int slots = Slots(); |
| - Isolate* isolate = GetIsolate(); |
| - Object* uninitialized_sentinel = |
| - TypeFeedbackVector::RawUninitializedSentinel(isolate->heap()); |
| + Heap* heap = GetIsolate()->heap(); |
| + |
| + if (!force_clear && !ClearLogic(heap)) return; |
| + Object* uninitialized_sentinel = |
| + TypeFeedbackVector::RawUninitializedSentinel(heap); |
| for (int i = 0; i < slots; i++) { |
| FeedbackVectorSlot slot(i); |
| Object* obj = Get(slot); |
| @@ -161,7 +164,9 @@ void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) { |
| // or Code pointers which can cause memory leaks if not cleared |
| // regularly. |
| if (instance_type != ALLOCATION_SITE_TYPE) { |
| + // if (instance_type != WEAK_CELL_TYPE || force_clear) { |
|
Toon Verwaest
2015/03/25 15:25:51
Remove debugging-comment
mvstanton
2015/03/26 15:28:53
Done.
|
| Set(slot, uninitialized_sentinel, SKIP_WRITE_BARRIER); |
| + // } |
| } |
| } |
| } |
| @@ -172,10 +177,7 @@ void TypeFeedbackVector::ClearICSlotsImpl(SharedFunctionInfo* shared, |
| bool force_clear) { |
| Heap* heap = GetIsolate()->heap(); |
| - // I'm not sure yet if this ic age is the correct one. |
| - int ic_age = shared->ic_age(); |
| - |
| - if (!force_clear && !ClearLogic(heap, ic_age)) return; |
| + if (!force_clear && !ClearLogic(heap)) return; |
| int slots = ICSlots(); |
| Code* host = shared->code(); |