| 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/v8.h" | 5 #include "src/v8.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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // static | 128 // static |
| 129 int TypeFeedbackVector::PushAppliedArgumentsIndex() { |
| 130 const int index_count = VectorICComputer::word_count(1); |
| 131 return kReservedIndexCount + index_count; |
| 132 } |
| 133 |
| 134 |
| 135 // static |
| 136 Handle<TypeFeedbackVector> TypeFeedbackVector::CreatePushAppliedArgumentsVector( |
| 137 Isolate* isolate) { |
| 138 Code::Kind kinds[] = {Code::KEYED_LOAD_IC}; |
| 139 FeedbackVectorSpec spec(0, 1, kinds); |
| 140 Handle<TypeFeedbackVector> feedback_vector = |
| 141 isolate->factory()->NewTypeFeedbackVector(&spec); |
| 142 DCHECK(PushAppliedArgumentsIndex() == |
| 143 feedback_vector->GetIndex(FeedbackVectorICSlot(0))); |
| 144 return feedback_vector; |
| 145 } |
| 146 |
| 147 |
| 148 // static |
| 129 Handle<TypeFeedbackVector> TypeFeedbackVector::Copy( | 149 Handle<TypeFeedbackVector> TypeFeedbackVector::Copy( |
| 130 Isolate* isolate, Handle<TypeFeedbackVector> vector) { | 150 Isolate* isolate, Handle<TypeFeedbackVector> vector) { |
| 131 Handle<TypeFeedbackVector> result; | 151 Handle<TypeFeedbackVector> result; |
| 132 result = Handle<TypeFeedbackVector>::cast( | 152 result = Handle<TypeFeedbackVector>::cast( |
| 133 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); | 153 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); |
| 134 return result; | 154 return result; |
| 135 } | 155 } |
| 136 | 156 |
| 137 | 157 |
| 138 bool TypeFeedbackVector::SpecDiffersFrom( | 158 bool TypeFeedbackVector::SpecDiffersFrom( |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 void StoreICNexus::Clear(Code* host) { | 703 void StoreICNexus::Clear(Code* host) { |
| 684 StoreIC::Clear(GetIsolate(), host, this); | 704 StoreIC::Clear(GetIsolate(), host, this); |
| 685 } | 705 } |
| 686 | 706 |
| 687 | 707 |
| 688 void KeyedStoreICNexus::Clear(Code* host) { | 708 void KeyedStoreICNexus::Clear(Code* host) { |
| 689 KeyedStoreIC::Clear(GetIsolate(), host, this); | 709 KeyedStoreIC::Clear(GetIsolate(), host, this); |
| 690 } | 710 } |
| 691 } // namespace internal | 711 } // namespace internal |
| 692 } // namespace v8 | 712 } // namespace v8 |
| OLD | NEW |