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.h" | 8 #include "src/ic/ic.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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // static | 355 // static |
356 void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) { | 356 void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) { |
357 SharedFunctionInfo::Iterator iterator(isolate); | 357 SharedFunctionInfo::Iterator iterator(isolate); |
358 SharedFunctionInfo* shared; | 358 SharedFunctionInfo* shared; |
359 while ((shared = iterator.Next())) { | 359 while ((shared = iterator.Next())) { |
360 if (!shared->OptimizedCodeMapIsCleared()) { | 360 if (!shared->OptimizedCodeMapIsCleared()) { |
361 FixedArray* optimized_code_map = shared->optimized_code_map(); | 361 FixedArray* optimized_code_map = shared->optimized_code_map(); |
362 int length = optimized_code_map->length(); | 362 int length = optimized_code_map->length(); |
363 for (int i = SharedFunctionInfo::kEntriesStart; i < length; | 363 for (int i = SharedFunctionInfo::kEntriesStart; i < length; |
364 i += SharedFunctionInfo::kEntryLength) { | 364 i += SharedFunctionInfo::kEntryLength) { |
365 Object* lits = | 365 WeakCell* cell = WeakCell::cast( |
366 optimized_code_map->get(i + SharedFunctionInfo::kLiteralsOffset); | 366 optimized_code_map->get(i + SharedFunctionInfo::kLiteralsOffset)); |
367 TypeFeedbackVector* vector = nullptr; | 367 if (cell->value()->IsLiteralsArray()) { |
368 if (lits->IsWeakCell()) { | 368 TypeFeedbackVector* vector = |
369 WeakCell* cell = WeakCell::cast(lits); | 369 LiteralsArray::cast(cell->value())->feedback_vector(); |
370 if (cell->value()->IsLiteralsArray()) { | |
371 vector = LiteralsArray::cast(cell->value())->feedback_vector(); | |
372 } | |
373 } else { | |
374 DCHECK(lits->IsLiteralsArray()); | |
375 vector = LiteralsArray::cast(lits)->feedback_vector(); | |
376 } | |
377 if (vector != nullptr) { | |
378 vector->ClearKeyedStoreICs(shared); | 370 vector->ClearKeyedStoreICs(shared); |
379 } | 371 } |
380 } | 372 } |
381 } | 373 } |
382 } | 374 } |
383 } | 375 } |
384 | 376 |
385 | 377 |
386 void TypeFeedbackVector::ClearKeyedStoreICs(SharedFunctionInfo* shared) { | 378 void TypeFeedbackVector::ClearKeyedStoreICs(SharedFunctionInfo* shared) { |
387 Isolate* isolate = GetIsolate(); | 379 Isolate* isolate = GetIsolate(); |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 | 1001 |
1010 IcCheckType KeyedStoreICNexus::GetKeyType() const { | 1002 IcCheckType KeyedStoreICNexus::GetKeyType() const { |
1011 Object* feedback = GetFeedback(); | 1003 Object* feedback = GetFeedback(); |
1012 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) { | 1004 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) { |
1013 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value()); | 1005 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value()); |
1014 } | 1006 } |
1015 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; | 1007 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; |
1016 } | 1008 } |
1017 } // namespace internal | 1009 } // namespace internal |
1018 } // namespace v8 | 1010 } // namespace v8 |
OLD | NEW |