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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 if (!handler.is_identical_to(code)) { | 1017 if (!handler.is_identical_to(code)) { |
1018 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); | 1018 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); |
1019 return code; | 1019 return code; |
1020 } | 1020 } |
1021 } else { | 1021 } else { |
1022 // maybe_handler_ is only populated for MONOMORPHIC and POLYMORPHIC ICs. | 1022 // maybe_handler_ is only populated for MONOMORPHIC and POLYMORPHIC ICs. |
1023 // In MEGAMORPHIC case, check if the handler in the megamorphic stub | 1023 // In MEGAMORPHIC case, check if the handler in the megamorphic stub |
1024 // cache (which just missed) is different from the cached handler. | 1024 // cache (which just missed) is different from the cached handler. |
1025 if (state() == MEGAMORPHIC && lookup->GetReceiver()->IsHeapObject()) { | 1025 if (state() == MEGAMORPHIC && lookup->GetReceiver()->IsHeapObject()) { |
1026 Map* map = Handle<HeapObject>::cast(lookup->GetReceiver())->map(); | 1026 Map* map = Handle<HeapObject>::cast(lookup->GetReceiver())->map(); |
1027 Code* megamorphic_cached_code = stub_cache()->Get(*lookup->name(), map); | 1027 Code* megamorphic_cached_code = |
| 1028 stub_cache()->Get(*lookup->name(), map, code->flags()); |
1028 if (megamorphic_cached_code != *code) { | 1029 if (megamorphic_cached_code != *code) { |
1029 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); | 1030 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); |
1030 return code; | 1031 return code; |
1031 } | 1032 } |
1032 } else { | 1033 } else { |
1033 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); | 1034 TRACE_HANDLER_STATS(isolate(), IC_HandlerCacheHit); |
1034 return code; | 1035 return code; |
1035 } | 1036 } |
1036 } | 1037 } |
1037 } | 1038 } |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3007 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 3008 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
3008 vector->GetKind(vector_slot)); | 3009 vector->GetKind(vector_slot)); |
3009 KeyedLoadICNexus nexus(vector, vector_slot); | 3010 KeyedLoadICNexus nexus(vector, vector_slot); |
3010 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3011 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3011 ic.UpdateState(receiver, key); | 3012 ic.UpdateState(receiver, key); |
3012 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3013 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
3013 } | 3014 } |
3014 } | 3015 } |
3015 } // namespace internal | 3016 } // namespace internal |
3016 } // namespace v8 | 3017 } // namespace v8 |
OLD | NEW |