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/type-feedback-vector.h" | 5 #include "src/type-feedback-vector.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/ic/ic-inl.h" | 8 #include "src/ic/ic-inl.h" |
9 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 case FeedbackVectorSlotKind::KEYED_LOAD_IC: | 154 case FeedbackVectorSlotKind::KEYED_LOAD_IC: |
155 return "KEYED_LOAD_IC"; | 155 return "KEYED_LOAD_IC"; |
156 case FeedbackVectorSlotKind::STORE_IC: | 156 case FeedbackVectorSlotKind::STORE_IC: |
157 return "STORE_IC"; | 157 return "STORE_IC"; |
158 case FeedbackVectorSlotKind::KEYED_STORE_IC: | 158 case FeedbackVectorSlotKind::KEYED_STORE_IC: |
159 return "KEYED_STORE_IC"; | 159 return "KEYED_STORE_IC"; |
160 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: | 160 case FeedbackVectorSlotKind::INTERPRETER_BINARYOP_IC: |
161 return "INTERPRETER_BINARYOP_IC"; | 161 return "INTERPRETER_BINARYOP_IC"; |
162 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: | 162 case FeedbackVectorSlotKind::INTERPRETER_COMPARE_IC: |
163 return "INTERPRETER_COMPARE_IC"; | 163 return "INTERPRETER_COMPARE_IC"; |
| 164 case FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: |
| 165 return "STORE_DATA_PROPERTY_IN_LITERAL_IC"; |
164 case FeedbackVectorSlotKind::GENERAL: | 166 case FeedbackVectorSlotKind::GENERAL: |
165 return "STUB"; | 167 return "STUB"; |
166 case FeedbackVectorSlotKind::KINDS_NUMBER: | 168 case FeedbackVectorSlotKind::KINDS_NUMBER: |
167 break; | 169 break; |
168 } | 170 } |
169 UNREACHABLE(); | 171 UNREACHABLE(); |
170 return "?"; | 172 return "?"; |
171 } | 173 } |
172 | 174 |
173 FeedbackVectorSlotKind TypeFeedbackVector::GetKind( | 175 FeedbackVectorSlotKind TypeFeedbackVector::GetKind( |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 HeapObject::cast(obj)->map()->instance_type(); | 311 HeapObject::cast(obj)->map()->instance_type(); |
310 // AllocationSites are exempt from clearing. They don't store Maps | 312 // AllocationSites are exempt from clearing. They don't store Maps |
311 // or Code pointers which can cause memory leaks if not cleared | 313 // or Code pointers which can cause memory leaks if not cleared |
312 // regularly. | 314 // regularly. |
313 if (instance_type != ALLOCATION_SITE_TYPE) { | 315 if (instance_type != ALLOCATION_SITE_TYPE) { |
314 Set(slot, uninitialized_sentinel, SKIP_WRITE_BARRIER); | 316 Set(slot, uninitialized_sentinel, SKIP_WRITE_BARRIER); |
315 } | 317 } |
316 } | 318 } |
317 break; | 319 break; |
318 } | 320 } |
| 321 case FeedbackVectorSlotKind::STORE_DATA_PROPERTY_IN_LITERAL_IC: { |
| 322 StoreDataPropertyInLiteralICNexus nexus(this, slot); |
| 323 nexus.Clear(shared->code()); |
| 324 break; |
| 325 } |
319 case FeedbackVectorSlotKind::INVALID: | 326 case FeedbackVectorSlotKind::INVALID: |
320 case FeedbackVectorSlotKind::KINDS_NUMBER: | 327 case FeedbackVectorSlotKind::KINDS_NUMBER: |
321 UNREACHABLE(); | 328 UNREACHABLE(); |
322 break; | 329 break; |
323 } | 330 } |
324 } | 331 } |
325 } | 332 } |
326 } | 333 } |
327 | 334 |
328 | 335 |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 BinaryOperationHint BinaryOpICNexus::GetBinaryOperationFeedback() const { | 987 BinaryOperationHint BinaryOpICNexus::GetBinaryOperationFeedback() const { |
981 int feedback = Smi::cast(GetFeedback())->value(); | 988 int feedback = Smi::cast(GetFeedback())->value(); |
982 return BinaryOperationHintFromFeedback(feedback); | 989 return BinaryOperationHintFromFeedback(feedback); |
983 } | 990 } |
984 | 991 |
985 CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const { | 992 CompareOperationHint CompareICNexus::GetCompareOperationFeedback() const { |
986 int feedback = Smi::cast(GetFeedback())->value(); | 993 int feedback = Smi::cast(GetFeedback())->value(); |
987 return CompareOperationHintFromFeedback(feedback); | 994 return CompareOperationHintFromFeedback(feedback); |
988 } | 995 } |
989 | 996 |
| 997 InlineCacheState StoreDataPropertyInLiteralICNexus::StateFromFeedback() const { |
| 998 Isolate* isolate = GetIsolate(); |
| 999 Object* feedback = GetFeedback(); |
| 1000 |
| 1001 if (feedback == *TypeFeedbackVector::UninitializedSentinel(isolate)) { |
| 1002 return UNINITIALIZED; |
| 1003 } else if (feedback->IsWeakCell()) { |
| 1004 // Don't check if the map is cleared. |
| 1005 return MONOMORPHIC; |
| 1006 } |
| 1007 |
| 1008 return MEGAMORPHIC; |
| 1009 } |
| 1010 |
| 1011 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic( |
| 1012 Handle<Name> name, Handle<Map> receiver_map) { |
| 1013 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); |
| 1014 |
| 1015 SetFeedback(*cell); |
| 1016 SetFeedbackExtra(*name); |
| 1017 } |
| 1018 |
990 } // namespace internal | 1019 } // namespace internal |
991 } // namespace v8 | 1020 } // namespace v8 |
OLD | NEW |