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/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 case MEGAMORPHIC: | 40 case MEGAMORPHIC: |
41 return 'N'; | 41 return 'N'; |
42 case GENERIC: | 42 case GENERIC: |
43 return 'G'; | 43 return 'G'; |
44 | 44 |
45 // We never see the debugger states here, because the state is | 45 // We never see the debugger states here, because the state is |
46 // computed from the original code - not the patched code. Let | 46 // computed from the original code - not the patched code. Let |
47 // these cases fall through to the unreachable code below. | 47 // these cases fall through to the unreachable code below. |
48 case DEBUG_STUB: | 48 case DEBUG_STUB: |
49 break; | 49 break; |
50 // Type-vector-based ICs resolve state to one of the above. | |
51 case DEFAULT: | |
52 break; | |
53 } | 50 } |
54 UNREACHABLE(); | 51 UNREACHABLE(); |
55 return 0; | 52 return 0; |
56 } | 53 } |
57 | 54 |
58 | 55 |
59 const char* GetTransitionMarkModifier(KeyedAccessStoreMode mode) { | 56 const char* GetTransitionMarkModifier(KeyedAccessStoreMode mode) { |
60 if (mode == STORE_NO_TRANSITION_HANDLE_COW) return ".COW"; | 57 if (mode == STORE_NO_TRANSITION_HANDLE_COW) return ".COW"; |
61 if (mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { | 58 if (mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
62 return ".IGNORE_OOB"; | 59 return ".IGNORE_OOB"; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 case MEGAMORPHIC: | 378 case MEGAMORPHIC: |
382 case GENERIC: | 379 case GENERIC: |
383 if (new_state == MEGAMORPHIC || new_state == GENERIC) break; | 380 if (new_state == MEGAMORPHIC || new_state == GENERIC) break; |
384 *generic_delta = -1; | 381 *generic_delta = -1; |
385 if (new_state == MONOMORPHIC || new_state == POLYMORPHIC) { | 382 if (new_state == MONOMORPHIC || new_state == POLYMORPHIC) { |
386 *polymorphic_delta = 1; | 383 *polymorphic_delta = 1; |
387 } | 384 } |
388 break; | 385 break; |
389 case PROTOTYPE_FAILURE: | 386 case PROTOTYPE_FAILURE: |
390 case DEBUG_STUB: | 387 case DEBUG_STUB: |
391 case DEFAULT: | |
392 UNREACHABLE(); | 388 UNREACHABLE(); |
393 } | 389 } |
394 } | 390 } |
395 | 391 |
396 | 392 |
397 void IC::OnTypeFeedbackChanged(Isolate* isolate, Address address, | 393 void IC::OnTypeFeedbackChanged(Isolate* isolate, Address address, |
398 State old_state, State new_state, | 394 State old_state, State new_state, |
399 bool target_remains_ic_stub) { | 395 bool target_remains_ic_stub) { |
400 Code* host = | 396 Code* host = |
401 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; | 397 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 UpdateMegamorphicCache(*receiver_map(), *name, *code); | 907 UpdateMegamorphicCache(*receiver_map(), *name, *code); |
912 // Indicate that we've handled this case. | 908 // Indicate that we've handled this case. |
913 if (UseVector()) { | 909 if (UseVector()) { |
914 vector_set_ = true; | 910 vector_set_ = true; |
915 } else { | 911 } else { |
916 target_set_ = true; | 912 target_set_ = true; |
917 } | 913 } |
918 break; | 914 break; |
919 case DEBUG_STUB: | 915 case DEBUG_STUB: |
920 break; | 916 break; |
921 case DEFAULT: | |
922 case GENERIC: | 917 case GENERIC: |
923 UNREACHABLE(); | 918 UNREACHABLE(); |
924 break; | 919 break; |
925 } | 920 } |
926 } | 921 } |
927 | 922 |
928 | 923 |
929 Handle<Code> LoadIC::initialize_stub(Isolate* isolate, | 924 Handle<Code> LoadIC::initialize_stub(Isolate* isolate, |
930 ExtraICState extra_state) { | 925 ExtraICState extra_state) { |
931 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); | 926 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); |
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 KeyedLoadICNexus nexus(vector, vector_slot); | 3144 KeyedLoadICNexus nexus(vector, vector_slot); |
3150 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3145 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3151 ic.UpdateState(receiver, key); | 3146 ic.UpdateState(receiver, key); |
3152 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 3147 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
3153 } | 3148 } |
3154 | 3149 |
3155 return *result; | 3150 return *result; |
3156 } | 3151 } |
3157 } // namespace internal | 3152 } // namespace internal |
3158 } // namespace v8 | 3153 } // namespace v8 |
OLD | NEW |