| 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/v8.h" | 5 #include "src/v8.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/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); | 1001 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state); | 1004 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 | 1007 |
| 1008 Handle<Code> LoadIC::initialize_stub_in_optimized_code( | 1008 Handle<Code> LoadIC::initialize_stub_in_optimized_code( |
| 1009 Isolate* isolate, ExtraICState extra_state) { | 1009 Isolate* isolate, ExtraICState extra_state) { |
| 1010 if (FLAG_vector_ics) { | 1010 if (FLAG_vector_ics) { |
| 1011 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode(); | 1011 if (FLAG_hydrogen_vector_dispatcher) { |
| 1012 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode(); |
| 1013 } |
| 1014 return VectorRawLoadStub(isolate, LoadICState(extra_state)).GetCode(); |
| 1012 } | 1015 } |
| 1013 return initialize_stub(isolate, extra_state); | 1016 return initialize_stub(isolate, extra_state); |
| 1014 } | 1017 } |
| 1015 | 1018 |
| 1016 | 1019 |
| 1017 Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) { | 1020 Handle<Code> KeyedLoadIC::initialize_stub(Isolate* isolate) { |
| 1018 if (FLAG_vector_ics) { | 1021 if (FLAG_vector_ics) { |
| 1019 return KeyedLoadICTrampolineStub(isolate).GetCode(); | 1022 return KeyedLoadICTrampolineStub(isolate).GetCode(); |
| 1020 } | 1023 } |
| 1021 | 1024 |
| 1022 return isolate->builtins()->KeyedLoadIC_Initialize(); | 1025 return isolate->builtins()->KeyedLoadIC_Initialize(); |
| 1023 } | 1026 } |
| 1024 | 1027 |
| 1025 | 1028 |
| 1026 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(Isolate* isolate) { | 1029 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code(Isolate* isolate) { |
| 1027 if (FLAG_vector_ics) { | 1030 if (FLAG_vector_ics) { |
| 1028 return VectorKeyedLoadStub(isolate).GetCode(); | 1031 if (FLAG_hydrogen_vector_dispatcher) { |
| 1032 return VectorKeyedLoadStub(isolate).GetCode(); |
| 1033 } |
| 1034 return VectorRawKeyedLoadStub(isolate).GetCode(); |
| 1029 } | 1035 } |
| 1030 return initialize_stub(isolate); | 1036 return initialize_stub(isolate); |
| 1031 } | 1037 } |
| 1032 | 1038 |
| 1033 | 1039 |
| 1034 Handle<Code> LoadIC::megamorphic_stub() { | 1040 Handle<Code> LoadIC::megamorphic_stub() { |
| 1035 if (kind() == Code::LOAD_IC) { | 1041 if (kind() == Code::LOAD_IC) { |
| 1036 MegamorphicLoadStub stub(isolate(), LoadICState(extra_ic_state())); | 1042 MegamorphicLoadStub stub(isolate(), LoadICState(extra_ic_state())); |
| 1037 return stub.GetCode(); | 1043 return stub.GetCode(); |
| 1038 } else { | 1044 } else { |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 // Used from ic-<arch>.cc. | 2313 // Used from ic-<arch>.cc. |
| 2308 RUNTIME_FUNCTION(LoadIC_Miss) { | 2314 RUNTIME_FUNCTION(LoadIC_Miss) { |
| 2309 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2315 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2310 HandleScope scope(isolate); | 2316 HandleScope scope(isolate); |
| 2311 Handle<Object> receiver = args.at<Object>(0); | 2317 Handle<Object> receiver = args.at<Object>(0); |
| 2312 Handle<Name> key = args.at<Name>(1); | 2318 Handle<Name> key = args.at<Name>(1); |
| 2313 Handle<Object> result; | 2319 Handle<Object> result; |
| 2314 | 2320 |
| 2315 if (FLAG_vector_ics) { | 2321 if (FLAG_vector_ics) { |
| 2316 DCHECK(args.length() == 4); | 2322 DCHECK(args.length() == 4); |
| 2323 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2317 Handle<Smi> slot = args.at<Smi>(2); | 2324 Handle<Smi> slot = args.at<Smi>(2); |
| 2318 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | |
| 2319 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); | 2325 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); |
| 2320 LoadICNexus nexus(vector, vector_slot); | 2326 if (vector->GetKind(vector_slot) == Code::LOAD_IC) { |
| 2321 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2327 LoadICNexus nexus(vector, vector_slot); |
| 2322 ic.UpdateState(receiver, key); | 2328 LoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2323 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2329 ic.UpdateState(receiver, key); |
| 2330 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2331 ic.Load(receiver, key)); |
| 2332 } else { |
| 2333 DCHECK(vector->GetKind(vector_slot) == Code::KEYED_LOAD_IC); |
| 2334 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2335 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2336 ic.UpdateState(receiver, key); |
| 2337 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2338 ic.Load(receiver, key)); |
| 2339 } |
| 2324 } else { | 2340 } else { |
| 2325 DCHECK(args.length() == 2); | 2341 DCHECK(args.length() == 2); |
| 2326 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); | 2342 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
| 2327 ic.UpdateState(receiver, key); | 2343 ic.UpdateState(receiver, key); |
| 2328 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2344 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2329 } | 2345 } |
| 2330 return *result; | 2346 return *result; |
| 2331 } | 2347 } |
| 2332 | 2348 |
| 2333 | 2349 |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2955 HandleScope scope(isolate); | 2971 HandleScope scope(isolate); |
| 2956 Handle<Object> receiver = args.at<Object>(0); | 2972 Handle<Object> receiver = args.at<Object>(0); |
| 2957 Handle<Name> key = args.at<Name>(1); | 2973 Handle<Name> key = args.at<Name>(1); |
| 2958 Handle<Object> result; | 2974 Handle<Object> result; |
| 2959 | 2975 |
| 2960 if (FLAG_vector_ics) { | 2976 if (FLAG_vector_ics) { |
| 2961 DCHECK(args.length() == 4); | 2977 DCHECK(args.length() == 4); |
| 2962 Handle<Smi> slot = args.at<Smi>(2); | 2978 Handle<Smi> slot = args.at<Smi>(2); |
| 2963 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2979 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
| 2964 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); | 2980 FeedbackVectorICSlot vector_slot = vector->ToICSlot(slot->value()); |
| 2965 LoadICNexus nexus(vector, vector_slot); | 2981 if (vector->GetKind(vector_slot) == Code::LOAD_IC) { |
| 2966 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2982 LoadICNexus nexus(vector, vector_slot); |
| 2967 ic.UpdateState(receiver, key); | 2983 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2968 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2984 ic.UpdateState(receiver, key); |
| 2985 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2986 ic.Load(receiver, key)); |
| 2987 } else { |
| 2988 DCHECK(vector->GetKind(vector_slot) == Code::KEYED_LOAD_IC); |
| 2989 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2990 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2991 ic.UpdateState(receiver, key); |
| 2992 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 2993 ic.Load(receiver, key)); |
| 2994 } |
| 2969 } else { | 2995 } else { |
| 2970 DCHECK(args.length() == 2); | 2996 DCHECK(args.length() == 2); |
| 2971 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2997 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate); |
| 2972 ic.UpdateState(receiver, key); | 2998 ic.UpdateState(receiver, key); |
| 2973 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2999 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2974 } | 3000 } |
| 2975 | 3001 |
| 2976 return *result; | 3002 return *result; |
| 2977 } | 3003 } |
| 2978 | 3004 |
| 2979 | 3005 |
| 2980 static const Address IC_utilities[] = { | 3006 static const Address IC_utilities[] = { |
| 2981 #define ADDR(name) FUNCTION_ADDR(name), | 3007 #define ADDR(name) FUNCTION_ADDR(name), |
| 2982 IC_UTIL_LIST(ADDR) NULL | 3008 IC_UTIL_LIST(ADDR) NULL |
| 2983 #undef ADDR | 3009 #undef ADDR |
| 2984 }; | 3010 }; |
| 2985 | 3011 |
| 2986 | 3012 |
| 2987 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3013 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
| 2988 } | 3014 } |
| 2989 } // namespace v8::internal | 3015 } // namespace v8::internal |
| OLD | NEW |