Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ic/ic.h" | 7 #include "src/ic/ic.h" |
| 8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 #include "src/type-feedback-vector-inl.h" | 10 #include "src/type-feedback-vector-inl.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 Handle<TypeFeedbackVector> result; | 126 Handle<TypeFeedbackVector> result; |
| 127 result = Handle<TypeFeedbackVector>::cast( | 127 result = Handle<TypeFeedbackVector>::cast( |
| 128 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); | 128 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); |
| 129 return result; | 129 return result; |
| 130 } | 130 } |
| 131 | 131 |
| 132 | 132 |
| 133 // This logic is copied from | 133 // This logic is copied from |
| 134 // StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget. | 134 // StaticMarkingVisitor<StaticVisitor>::VisitCodeTarget. |
| 135 static bool ClearLogic(Heap* heap, int ic_age) { | 135 static bool ClearLogic(Heap* heap, int ic_age) { |
| 136 if (FLAG_cleanup_code_caches_at_gc && | 136 return FLAG_cleanup_code_caches_at_gc && |
| 137 (heap->flush_monomorphic_ics() || | 137 heap->isolate()->serializer_enabled(); |
| 138 // TODO(mvstanton): is this ic_age granular enough? it comes from | |
|
ulan
2015/02/05 09:44:15
I am going to remove clearing based on ic_age in a
| |
| 139 // the SharedFunctionInfo which may change on a different schedule | |
| 140 // than ic targets. | |
| 141 // ic_age != heap->global_ic_age() || | |
| 142 // is_invalidated_weak_stub || | |
| 143 heap->isolate()->serializer_enabled())) { | |
| 144 return true; | |
| 145 } | |
| 146 return false; | |
| 147 } | 138 } |
| 148 | 139 |
| 149 | 140 |
| 150 void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) { | 141 void TypeFeedbackVector::ClearSlots(SharedFunctionInfo* shared) { |
| 151 int slots = Slots(); | 142 int slots = Slots(); |
| 152 Isolate* isolate = GetIsolate(); | 143 Isolate* isolate = GetIsolate(); |
| 153 Object* uninitialized_sentinel = | 144 Object* uninitialized_sentinel = |
| 154 TypeFeedbackVector::RawUninitializedSentinel(isolate->heap()); | 145 TypeFeedbackVector::RawUninitializedSentinel(isolate->heap()); |
| 155 | 146 |
| 156 for (int i = 0; i < slots; i++) { | 147 for (int i = 0; i < slots; i++) { |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 if (feedback->IsFixedArray()) { | 495 if (feedback->IsFixedArray()) { |
| 505 FixedArray* array = FixedArray::cast(feedback); | 496 FixedArray* array = FixedArray::cast(feedback); |
| 506 DCHECK(array->length() >= 3); | 497 DCHECK(array->length() >= 3); |
| 507 Object* name = array->get(0); | 498 Object* name = array->get(0); |
| 508 if (name->IsName()) return Name::cast(name); | 499 if (name->IsName()) return Name::cast(name); |
| 509 } | 500 } |
| 510 return NULL; | 501 return NULL; |
| 511 } | 502 } |
| 512 } | 503 } |
| 513 } // namespace v8::internal | 504 } // namespace v8::internal |
| OLD | NEW |