| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); | 115 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); |
| 116 | 116 |
| 117 if (kind != other_spec->GetKind(slot)) { | 117 if (kind != other_spec->GetKind(slot)) { |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| 120 i += entry_size; | 120 i += entry_size; |
| 121 } | 121 } |
| 122 return false; | 122 return false; |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool TypeFeedbackMetadata::DiffersFrom( | |
| 126 const TypeFeedbackMetadata* other_metadata) const { | |
| 127 if (other_metadata->slot_count() != slot_count()) { | |
| 128 return true; | |
| 129 } | |
| 130 | |
| 131 int slots = slot_count(); | |
| 132 for (int i = 0; i < slots;) { | |
| 133 FeedbackVectorSlot slot(i); | |
| 134 FeedbackVectorSlotKind kind = GetKind(slot); | |
| 135 int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); | |
| 136 if (GetKind(slot) != other_metadata->GetKind(slot)) { | |
| 137 return true; | |
| 138 } | |
| 139 i += entry_size; | |
| 140 } | |
| 141 return false; | |
| 142 } | |
| 143 | 125 |
| 144 const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) { | 126 const char* TypeFeedbackMetadata::Kind2String(FeedbackVectorSlotKind kind) { |
| 145 switch (kind) { | 127 switch (kind) { |
| 146 case FeedbackVectorSlotKind::INVALID: | 128 case FeedbackVectorSlotKind::INVALID: |
| 147 return "INVALID"; | 129 return "INVALID"; |
| 148 case FeedbackVectorSlotKind::CALL_IC: | 130 case FeedbackVectorSlotKind::CALL_IC: |
| 149 return "CALL_IC"; | 131 return "CALL_IC"; |
| 150 case FeedbackVectorSlotKind::LOAD_IC: | 132 case FeedbackVectorSlotKind::LOAD_IC: |
| 151 return "LOAD_IC"; | 133 return "LOAD_IC"; |
| 152 case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: | 134 case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic( | 1028 void StoreDataPropertyInLiteralICNexus::ConfigureMonomorphic( |
| 1047 Handle<Name> name, Handle<Map> receiver_map) { | 1029 Handle<Name> name, Handle<Map> receiver_map) { |
| 1048 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); | 1030 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); |
| 1049 | 1031 |
| 1050 SetFeedback(*cell); | 1032 SetFeedback(*cell); |
| 1051 SetFeedbackExtra(*name); | 1033 SetFeedbackExtra(*name); |
| 1052 } | 1034 } |
| 1053 | 1035 |
| 1054 } // namespace internal | 1036 } // namespace internal |
| 1055 } // namespace v8 | 1037 } // namespace v8 |
| OLD | NEW |