| 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" |
| 11 #include "src/type-feedback-vector-inl.h" | 11 #include "src/type-feedback-vector-inl.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 | 16 |
| 17 static bool IsPropertyNameFeedback(Object* feedback) { | 17 static bool IsPropertyNameFeedback(Object* feedback) { |
| 18 return feedback->IsString() || | 18 if (feedback->IsString()) return true; |
| 19 (feedback->IsSymbol() && !Symbol::cast(feedback)->is_private()); | 19 if (!feedback->IsSymbol()) return false; |
| 20 Symbol* symbol = Symbol::cast(feedback); |
| 21 Heap* heap = symbol->GetHeap(); |
| 22 return symbol != heap->uninitialized_symbol() && |
| 23 symbol != heap->premonomorphic_symbol() && |
| 24 symbol != heap->megamorphic_symbol(); |
| 20 } | 25 } |
| 21 | 26 |
| 22 | 27 |
| 23 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind) { | 28 std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind) { |
| 24 return os << TypeFeedbackMetadata::Kind2String(kind); | 29 return os << TypeFeedbackMetadata::Kind2String(kind); |
| 25 } | 30 } |
| 26 | 31 |
| 27 | 32 |
| 28 FeedbackVectorSlotKind TypeFeedbackMetadata::GetKind( | 33 FeedbackVectorSlotKind TypeFeedbackMetadata::GetKind( |
| 29 FeedbackVectorSlot slot) const { | 34 FeedbackVectorSlot slot) const { |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 return mode; | 824 return mode; |
| 820 } | 825 } |
| 821 | 826 |
| 822 | 827 |
| 823 IcCheckType KeyedStoreICNexus::GetKeyType() const { | 828 IcCheckType KeyedStoreICNexus::GetKeyType() const { |
| 824 // The structure of the vector slots tells us the type. | 829 // The structure of the vector slots tells us the type. |
| 825 return GetFeedback()->IsName() ? PROPERTY : ELEMENT; | 830 return GetFeedback()->IsName() ? PROPERTY : ELEMENT; |
| 826 } | 831 } |
| 827 } // namespace internal | 832 } // namespace internal |
| 828 } // namespace v8 | 833 } // namespace v8 |
| OLD | NEW |