| 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" |
| 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 // static | 16 // static |
| 17 TypeFeedbackVector::VectorICKind TypeFeedbackVector::FromCodeKind( | 17 TypeFeedbackVector::VectorICKind TypeFeedbackVector::FromCodeKind( |
| 18 Code::Kind kind) { | 18 Code::Kind kind) { |
| 19 switch (kind) { | 19 switch (kind) { |
| 20 case Code::CALL_IC: | 20 case Code::CALL_IC: |
| 21 return KindCallIC; | 21 return KindCallIC; |
| 22 case Code::LOAD_IC: | 22 case Code::LOAD_IC: |
| 23 return KindLoadIC; | 23 return KindLoadIC; |
| 24 case Code::KEYED_LOAD_IC: | 24 case Code::KEYED_LOAD_IC: |
| 25 return KindKeyedLoadIC; | 25 return KindKeyedLoadIC; |
| 26 case Code::STORE_IC: | 26 case Code::STORE_IC: |
| 27 DCHECK(FLAG_vector_stores); | |
| 28 return KindStoreIC; | 27 return KindStoreIC; |
| 29 case Code::KEYED_STORE_IC: | 28 case Code::KEYED_STORE_IC: |
| 30 DCHECK(FLAG_vector_stores); | |
| 31 return KindKeyedStoreIC; | 29 return KindKeyedStoreIC; |
| 32 default: | 30 default: |
| 33 // Shouldn't get here. | 31 // Shouldn't get here. |
| 34 UNREACHABLE(); | 32 UNREACHABLE(); |
| 35 } | 33 } |
| 36 | 34 |
| 37 return KindUnused; | 35 return KindUnused; |
| 38 } | 36 } |
| 39 | 37 |
| 40 | 38 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } else if (kind == Code::KEYED_STORE_IC) { | 216 } else if (kind == Code::KEYED_STORE_IC) { |
| 219 DCHECK(FLAG_vector_stores); | 217 DCHECK(FLAG_vector_stores); |
| 220 KeyedStoreICNexus nexus(this, slot); | 218 KeyedStoreICNexus nexus(this, slot); |
| 221 nexus.Clear(host); | 219 nexus.Clear(host); |
| 222 } | 220 } |
| 223 } | 221 } |
| 224 } | 222 } |
| 225 } | 223 } |
| 226 | 224 |
| 227 | 225 |
| 226 // static |
| 227 Handle<TypeFeedbackVector> TypeFeedbackVector::DummyVector(Isolate* isolate) { |
| 228 return Handle<TypeFeedbackVector>::cast(isolate->factory()->dummy_vector()); |
| 229 } |
| 230 |
| 231 |
| 228 Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) { | 232 Handle<FixedArray> FeedbackNexus::EnsureArrayOfSize(int length) { |
| 229 Isolate* isolate = GetIsolate(); | 233 Isolate* isolate = GetIsolate(); |
| 230 Handle<Object> feedback = handle(GetFeedback(), isolate); | 234 Handle<Object> feedback = handle(GetFeedback(), isolate); |
| 231 if (!feedback->IsFixedArray() || | 235 if (!feedback->IsFixedArray() || |
| 232 FixedArray::cast(*feedback)->length() != length) { | 236 FixedArray::cast(*feedback)->length() != length) { |
| 233 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length); | 237 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length); |
| 234 SetFeedback(*array); | 238 SetFeedback(*array); |
| 235 return array; | 239 return array; |
| 236 } | 240 } |
| 237 return Handle<FixedArray>::cast(feedback); | 241 return Handle<FixedArray>::cast(feedback); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 void StoreICNexus::Clear(Code* host) { | 683 void StoreICNexus::Clear(Code* host) { |
| 680 StoreIC::Clear(GetIsolate(), host, this); | 684 StoreIC::Clear(GetIsolate(), host, this); |
| 681 } | 685 } |
| 682 | 686 |
| 683 | 687 |
| 684 void KeyedStoreICNexus::Clear(Code* host) { | 688 void KeyedStoreICNexus::Clear(Code* host) { |
| 685 KeyedStoreIC::Clear(GetIsolate(), host, this); | 689 KeyedStoreIC::Clear(GetIsolate(), host, this); |
| 686 } | 690 } |
| 687 } // namespace internal | 691 } // namespace internal |
| 688 } // namespace v8 | 692 } // namespace v8 |
| OLD | NEW |