OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 case DEBUG_STUB: | 799 case DEBUG_STUB: |
800 break; | 800 break; |
801 case GENERIC: | 801 case GENERIC: |
802 UNREACHABLE(); | 802 UNREACHABLE(); |
803 break; | 803 break; |
804 } | 804 } |
805 } | 805 } |
806 | 806 |
807 Handle<Code> LoadIC::initialize_stub_in_optimized_code( | 807 Handle<Code> LoadIC::initialize_stub_in_optimized_code( |
808 Isolate* isolate, ExtraICState extra_state) { | 808 Isolate* isolate, ExtraICState extra_state) { |
| 809 if (FLAG_tf_load_ic_stub) { |
| 810 return LoadICTFStub(isolate, LoadICState(extra_state)).GetCode(); |
| 811 } |
809 return LoadICStub(isolate, LoadICState(extra_state)).GetCode(); | 812 return LoadICStub(isolate, LoadICState(extra_state)).GetCode(); |
810 } | 813 } |
811 | 814 |
812 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code( | 815 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code( |
813 Isolate* isolate, ExtraICState extra_state) { | 816 Isolate* isolate, ExtraICState extra_state) { |
814 return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode(); | 817 return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode(); |
815 } | 818 } |
816 | 819 |
817 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( | 820 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( |
818 Isolate* isolate, LanguageMode language_mode) { | 821 Isolate* isolate, LanguageMode language_mode) { |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 | 2240 |
2238 | 2241 |
2239 // Used from ic-<arch>.cc. | 2242 // Used from ic-<arch>.cc. |
2240 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2243 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
2241 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2244 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2242 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2245 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2243 HandleScope scope(isolate); | 2246 HandleScope scope(isolate); |
2244 Handle<Object> receiver = args.at<Object>(0); | 2247 Handle<Object> receiver = args.at<Object>(0); |
2245 Handle<Name> key = args.at<Name>(1); | 2248 Handle<Name> key = args.at<Name>(1); |
2246 | 2249 |
2247 DCHECK(args.length() == 4); | 2250 DCHECK_EQ(4, args.length()); |
2248 Handle<Smi> slot = args.at<Smi>(2); | 2251 Handle<Smi> slot = args.at<Smi>(2); |
2249 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2252 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2250 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2253 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2251 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2254 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
2252 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2255 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
2253 // set up outside the IC, handle that here. | 2256 // set up outside the IC, handle that here. |
2254 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { | 2257 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { |
2255 LoadICNexus nexus(vector, vector_slot); | 2258 LoadICNexus nexus(vector, vector_slot); |
2256 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2259 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2257 ic.UpdateState(receiver, key); | 2260 ic.UpdateState(receiver, key); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2934 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2937 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
2935 vector->GetKind(vector_slot)); | 2938 vector->GetKind(vector_slot)); |
2936 KeyedLoadICNexus nexus(vector, vector_slot); | 2939 KeyedLoadICNexus nexus(vector, vector_slot); |
2937 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2940 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2938 ic.UpdateState(receiver, key); | 2941 ic.UpdateState(receiver, key); |
2939 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2942 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2940 } | 2943 } |
2941 } | 2944 } |
2942 } // namespace internal | 2945 } // namespace internal |
2943 } // namespace v8 | 2946 } // namespace v8 |
OLD | NEW |