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 27 matching lines...) Expand all Loading... |
38 case MONOMORPHIC: | 38 case MONOMORPHIC: |
39 return '1'; | 39 return '1'; |
40 case RECOMPUTE_HANDLER: | 40 case RECOMPUTE_HANDLER: |
41 return '^'; | 41 return '^'; |
42 case POLYMORPHIC: | 42 case POLYMORPHIC: |
43 return 'P'; | 43 return 'P'; |
44 case MEGAMORPHIC: | 44 case MEGAMORPHIC: |
45 return 'N'; | 45 return 'N'; |
46 case GENERIC: | 46 case GENERIC: |
47 return 'G'; | 47 return 'G'; |
48 | |
49 // We never see the debugger states here, because the state is | |
50 // computed from the original code - not the patched code. Let | |
51 // these cases fall through to the unreachable code below. | |
52 case DEBUG_STUB: | |
53 break; | |
54 } | 48 } |
55 UNREACHABLE(); | 49 UNREACHABLE(); |
56 return 0; | 50 return 0; |
57 } | 51 } |
58 | 52 |
59 | 53 |
60 const char* GetTransitionMarkModifier(KeyedAccessStoreMode mode) { | 54 const char* GetTransitionMarkModifier(KeyedAccessStoreMode mode) { |
61 if (mode == STORE_NO_TRANSITION_HANDLE_COW) return ".COW"; | 55 if (mode == STORE_NO_TRANSITION_HANDLE_COW) return ".COW"; |
62 if (mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { | 56 if (mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
63 return ".IGNORE_OOB"; | 57 return ".IGNORE_OOB"; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 break; | 346 break; |
353 case MEGAMORPHIC: | 347 case MEGAMORPHIC: |
354 case GENERIC: | 348 case GENERIC: |
355 if (new_state == MEGAMORPHIC || new_state == GENERIC) break; | 349 if (new_state == MEGAMORPHIC || new_state == GENERIC) break; |
356 *generic_delta = -1; | 350 *generic_delta = -1; |
357 if (new_state == MONOMORPHIC || new_state == POLYMORPHIC) { | 351 if (new_state == MONOMORPHIC || new_state == POLYMORPHIC) { |
358 *polymorphic_delta = 1; | 352 *polymorphic_delta = 1; |
359 } | 353 } |
360 break; | 354 break; |
361 case RECOMPUTE_HANDLER: | 355 case RECOMPUTE_HANDLER: |
362 case DEBUG_STUB: | |
363 UNREACHABLE(); | 356 UNREACHABLE(); |
364 } | 357 } |
365 } | 358 } |
366 | 359 |
367 // static | 360 // static |
368 void IC::OnTypeFeedbackChanged(Isolate* isolate, Code* host) { | 361 void IC::OnTypeFeedbackChanged(Isolate* isolate, Code* host) { |
369 if (host->kind() != Code::FUNCTION) return; | 362 if (host->kind() != Code::FUNCTION) return; |
370 | 363 |
371 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(host->type_feedback_info()); | 364 TypeFeedbackInfo* info = TypeFeedbackInfo::cast(host->type_feedback_info()); |
372 info->change_own_type_change_checksum(); | 365 info->change_own_type_change_checksum(); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 } | 785 } |
793 DCHECK(UseVector()); | 786 DCHECK(UseVector()); |
794 ConfigureVectorState(MEGAMORPHIC, name); | 787 ConfigureVectorState(MEGAMORPHIC, name); |
795 // Fall through. | 788 // Fall through. |
796 case MEGAMORPHIC: | 789 case MEGAMORPHIC: |
797 UpdateMegamorphicCache(*receiver_map(), *name, *code); | 790 UpdateMegamorphicCache(*receiver_map(), *name, *code); |
798 // Indicate that we've handled this case. | 791 // Indicate that we've handled this case. |
799 DCHECK(UseVector()); | 792 DCHECK(UseVector()); |
800 vector_set_ = true; | 793 vector_set_ = true; |
801 break; | 794 break; |
802 case DEBUG_STUB: | |
803 break; | |
804 case GENERIC: | 795 case GENERIC: |
805 UNREACHABLE(); | 796 UNREACHABLE(); |
806 break; | 797 break; |
807 } | 798 } |
808 } | 799 } |
809 | 800 |
810 Handle<Code> LoadIC::initialize_stub_in_optimized_code( | 801 Handle<Code> LoadIC::initialize_stub_in_optimized_code( |
811 Isolate* isolate, ExtraICState extra_state) { | 802 Isolate* isolate, ExtraICState extra_state) { |
812 if (FLAG_tf_load_ic_stub) { | 803 if (FLAG_tf_load_ic_stub) { |
813 return LoadICTFStub(isolate, LoadICState(extra_state)).GetCode(); | 804 return LoadICTFStub(isolate, LoadICState(extra_state)).GetCode(); |
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2943 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2934 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
2944 vector->GetKind(vector_slot)); | 2935 vector->GetKind(vector_slot)); |
2945 KeyedLoadICNexus nexus(vector, vector_slot); | 2936 KeyedLoadICNexus nexus(vector, vector_slot); |
2946 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2937 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2947 ic.UpdateState(receiver, key); | 2938 ic.UpdateState(receiver, key); |
2948 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2939 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2949 } | 2940 } |
2950 } | 2941 } |
2951 } // namespace internal | 2942 } // namespace internal |
2952 } // namespace v8 | 2943 } // namespace v8 |
OLD | NEW |