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/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 } | 118 } |
| 119 | 119 |
| 120 Handle<TypeFeedbackVector> vector = Handle<TypeFeedbackVector>::cast(array); | 120 Handle<TypeFeedbackVector> vector = Handle<TypeFeedbackVector>::cast(array); |
| 121 for (int i = 0; i < ic_slot_count; i++) { | 121 for (int i = 0; i < ic_slot_count; i++) { |
| 122 vector->SetKind(FeedbackVectorICSlot(i), spec->GetKind(i)); | 122 vector->SetKind(FeedbackVectorICSlot(i), spec->GetKind(i)); |
| 123 } | 123 } |
| 124 return vector; | 124 return vector; |
| 125 } | 125 } |
| 126 | 126 |
| 127 | 127 |
| 128 template int TypeFeedbackVector::GetIndexFromSpec(const ZoneFeedbackVectorSpec*, | |
| 129 FeedbackVectorICSlot); | |
| 130 template int TypeFeedbackVector::GetIndexFromSpec(const ZoneFeedbackVectorSpec*, | |
| 131 FeedbackVectorSlot); | |
| 132 | |
| 133 | |
| 134 // static | |
| 135 template <typename Spec> | |
| 136 int TypeFeedbackVector::GetIndexFromSpec(const Spec* spec, | |
|
Jakob Kummerow
2015/09/25 13:08:05
As discussed, I'd advocate to combine this with th
| |
| 137 FeedbackVectorSlot slot) { | |
| 138 const int ic_slot_count = spec->ic_slots(); | |
| 139 const int index_count = VectorICComputer::word_count(ic_slot_count); | |
| 140 return kReservedIndexCount + index_count + slot.ToInt(); | |
| 141 } | |
| 142 | |
| 143 | |
| 144 // static | |
| 145 template <typename Spec> | |
| 146 int TypeFeedbackVector::GetIndexFromSpec(const Spec* spec, | |
| 147 FeedbackVectorICSlot slot) { | |
| 148 const int slot_count = spec->slots(); | |
| 149 const int ic_slot_count = spec->ic_slots(); | |
| 150 const int index_count = VectorICComputer::word_count(ic_slot_count); | |
| 151 return kReservedIndexCount + index_count + slot_count + | |
| 152 slot.ToInt() * elements_per_ic_slot(); | |
| 153 } | |
| 154 | |
| 155 | |
| 128 // static | 156 // static |
| 129 int TypeFeedbackVector::PushAppliedArgumentsIndex() { | 157 int TypeFeedbackVector::PushAppliedArgumentsIndex() { |
| 130 const int index_count = VectorICComputer::word_count(1); | 158 const int index_count = VectorICComputer::word_count(1); |
| 131 return kReservedIndexCount + index_count; | 159 return kReservedIndexCount + index_count; |
| 132 } | 160 } |
| 133 | 161 |
| 134 | 162 |
| 135 // static | 163 // static |
| 136 Handle<TypeFeedbackVector> TypeFeedbackVector::CreatePushAppliedArgumentsVector( | 164 Handle<TypeFeedbackVector> TypeFeedbackVector::CreatePushAppliedArgumentsVector( |
| 137 Isolate* isolate) { | 165 Isolate* isolate) { |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 return mode; | 835 return mode; |
| 808 } | 836 } |
| 809 | 837 |
| 810 | 838 |
| 811 IcCheckType KeyedStoreICNexus::GetKeyType() const { | 839 IcCheckType KeyedStoreICNexus::GetKeyType() const { |
| 812 // The structure of the vector slots tells us the type. | 840 // The structure of the vector slots tells us the type. |
| 813 return GetFeedback()->IsName() ? PROPERTY : ELEMENT; | 841 return GetFeedback()->IsName() ? PROPERTY : ELEMENT; |
| 814 } | 842 } |
| 815 } // namespace internal | 843 } // namespace internal |
| 816 } // namespace v8 | 844 } // namespace v8 |
| OLD | NEW |