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-arguments-inl.h" | 8 #include "src/api-arguments-inl.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 if (stub.state() != CompareICState::KNOWN_RECEIVER) return; | 494 if (stub.state() != CompareICState::KNOWN_RECEIVER) return; |
495 SetTargetAtAddress(address, GetRawUninitialized(isolate, stub.op()), | 495 SetTargetAtAddress(address, GetRawUninitialized(isolate, stub.op()), |
496 constant_pool); | 496 constant_pool); |
497 PatchInlinedSmiCode(isolate, address, DISABLE_INLINED_SMI_CHECK); | 497 PatchInlinedSmiCode(isolate, address, DISABLE_INLINED_SMI_CHECK); |
498 } | 498 } |
499 | 499 |
500 | 500 |
501 // static | 501 // static |
502 Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate, | 502 Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate, |
503 ExtraICState extra_state) { | 503 ExtraICState extra_state) { |
| 504 // TODO(ishell): remove extra_ic_state |
504 if (FLAG_compiled_keyed_generic_loads) { | 505 if (FLAG_compiled_keyed_generic_loads) { |
505 return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode(); | 506 return KeyedLoadGenericStub(isolate).GetCode(); |
506 } else { | 507 } else { |
507 return isolate->builtins()->KeyedLoadIC_Megamorphic(); | 508 return isolate->builtins()->KeyedLoadIC_Megamorphic(); |
508 } | 509 } |
509 } | 510 } |
510 | 511 |
511 | 512 |
512 static bool MigrateDeprecated(Handle<Object> object) { | 513 static bool MigrateDeprecated(Handle<Object> object) { |
513 if (!object->IsJSObject()) return false; | 514 if (!object->IsJSObject()) return false; |
514 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 515 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
515 if (!receiver->map()->is_deprecated()) return false; | 516 if (!receiver->map()->is_deprecated()) return false; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // Indicate that we've handled this case. | 827 // Indicate that we've handled this case. |
827 DCHECK(UseVector()); | 828 DCHECK(UseVector()); |
828 vector_set_ = true; | 829 vector_set_ = true; |
829 break; | 830 break; |
830 case GENERIC: | 831 case GENERIC: |
831 UNREACHABLE(); | 832 UNREACHABLE(); |
832 break; | 833 break; |
833 } | 834 } |
834 } | 835 } |
835 | 836 |
836 Handle<Code> LoadIC::initialize_stub_in_optimized_code( | 837 Handle<Code> LoadIC::initialize_stub_in_optimized_code(Isolate* isolate) { |
837 Isolate* isolate, ExtraICState extra_state) { | |
838 if (FLAG_tf_load_ic_stub) { | 838 if (FLAG_tf_load_ic_stub) { |
839 return LoadICTFStub(isolate, LoadICState(extra_state)).GetCode(); | 839 return LoadICTFStub(isolate).GetCode(); |
840 } | 840 } |
841 return LoadICStub(isolate, LoadICState(extra_state)).GetCode(); | 841 return LoadICStub(isolate).GetCode(); |
842 } | 842 } |
843 | 843 |
844 Handle<Code> LoadGlobalIC::initialize_stub_in_optimized_code( | 844 Handle<Code> LoadGlobalIC::initialize_stub_in_optimized_code( |
845 Isolate* isolate, ExtraICState extra_state) { | 845 Isolate* isolate, ExtraICState extra_state) { |
846 return LoadGlobalICStub(isolate, LoadICState(extra_state)).GetCode(); | 846 return LoadGlobalICStub(isolate, LoadGlobalICState(extra_state)).GetCode(); |
847 } | 847 } |
848 | 848 |
849 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code( | 849 Handle<Code> KeyedLoadIC::initialize_stub_in_optimized_code( |
850 Isolate* isolate, ExtraICState extra_state) { | 850 Isolate* isolate, ExtraICState extra_state) { |
851 return KeyedLoadICStub(isolate, LoadICState(extra_state)).GetCode(); | 851 // TODO(ishell): remove extra_ic_state |
| 852 return KeyedLoadICStub(isolate).GetCode(); |
852 } | 853 } |
853 | 854 |
854 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( | 855 Handle<Code> KeyedStoreIC::initialize_stub_in_optimized_code( |
855 Isolate* isolate, LanguageMode language_mode) { | 856 Isolate* isolate, LanguageMode language_mode) { |
856 StoreICState state = StoreICState(language_mode); | 857 StoreICState state = StoreICState(language_mode); |
857 return VectorKeyedStoreICStub(isolate, state).GetCode(); | 858 return VectorKeyedStoreICStub(isolate, state).GetCode(); |
858 } | 859 } |
859 | 860 |
860 | 861 |
861 Handle<Code> KeyedStoreIC::ChooseMegamorphicStub(Isolate* isolate, | 862 Handle<Code> KeyedStoreIC::ChooseMegamorphicStub(Isolate* isolate, |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 3017 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
3017 vector->GetKind(vector_slot)); | 3018 vector->GetKind(vector_slot)); |
3018 KeyedLoadICNexus nexus(vector, vector_slot); | 3019 KeyedLoadICNexus nexus(vector, vector_slot); |
3019 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3020 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3020 ic.UpdateState(receiver, key); | 3021 ic.UpdateState(receiver, key); |
3021 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3022 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
3022 } | 3023 } |
3023 } | 3024 } |
3024 } // namespace internal | 3025 } // namespace internal |
3025 } // namespace v8 | 3026 } // namespace v8 |
OLD | NEW |