Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: src/ic/ic.cc

Issue 767743002: Hydrogen code stubs for vector-based ICs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment response. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 nexus->ConfigureMegamorphic(); 658 nexus->ConfigureMegamorphic();
659 } else { 659 } else {
660 UNREACHABLE(); 660 UNREACHABLE();
661 } 661 }
662 } else if (kind() == Code::KEYED_LOAD_IC) { 662 } else if (kind() == Code::KEYED_LOAD_IC) {
663 KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>(); 663 KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
664 if (new_state == GENERIC) { 664 if (new_state == GENERIC) {
665 nexus->ConfigureGeneric(); 665 nexus->ConfigureGeneric();
666 } else if (new_state == PREMONOMORPHIC) { 666 } else if (new_state == PREMONOMORPHIC) {
667 nexus->ConfigurePremonomorphic(); 667 nexus->ConfigurePremonomorphic();
668 } else if (new_state == MEGAMORPHIC) {
669 nexus->ConfigureMegamorphic();
670 } else { 668 } else {
671 UNREACHABLE(); 669 UNREACHABLE();
672 } 670 }
673 } else { 671 } else {
674 UNREACHABLE(); 672 UNREACHABLE();
675 } 673 }
676 674
677 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(), 675 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(),
678 new_state); 676 new_state);
679 } 677 }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 case PROTOTYPE_FAILURE: 962 case PROTOTYPE_FAILURE:
965 case MONOMORPHIC: 963 case MONOMORPHIC:
966 case POLYMORPHIC: 964 case POLYMORPHIC:
967 if (!target()->is_keyed_stub() || state() == PROTOTYPE_FAILURE) { 965 if (!target()->is_keyed_stub() || state() == PROTOTYPE_FAILURE) {
968 if (UpdatePolymorphicIC(name, code)) break; 966 if (UpdatePolymorphicIC(name, code)) break;
969 // For keyed stubs, we can't know whether old handlers were for the 967 // For keyed stubs, we can't know whether old handlers were for the
970 // same key. 968 // same key.
971 CopyICToMegamorphicCache(name); 969 CopyICToMegamorphicCache(name);
972 } 970 }
973 if (UseVector()) { 971 if (UseVector()) {
974 ConfigureVectorState(MEGAMORPHIC); 972 ConfigureVectorState(kind() == Code::KEYED_LOAD_IC ? GENERIC
973 : MEGAMORPHIC);
975 } else { 974 } else {
976 set_target(*megamorphic_stub()); 975 set_target(*megamorphic_stub());
977 } 976 }
978 // Fall through. 977 // Fall through.
979 case MEGAMORPHIC: 978 case MEGAMORPHIC:
980 UpdateMegamorphicCache(*receiver_type(), *name, *code); 979 UpdateMegamorphicCache(*receiver_type(), *name, *code);
981 // Indicate that we've handled this case. 980 // Indicate that we've handled this case.
982 target_set_ = true; 981 target_set_ = true;
983 break; 982 break;
984 case DEBUG_STUB: 983 case DEBUG_STUB:
(...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 static const Address IC_utilities[] = { 2979 static const Address IC_utilities[] = {
2981 #define ADDR(name) FUNCTION_ADDR(name), 2980 #define ADDR(name) FUNCTION_ADDR(name),
2982 IC_UTIL_LIST(ADDR) NULL 2981 IC_UTIL_LIST(ADDR) NULL
2983 #undef ADDR 2982 #undef ADDR
2984 }; 2983 };
2985 2984
2986 2985
2987 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 2986 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
2988 } 2987 }
2989 } // namespace v8::internal 2988 } // namespace v8::internal
OLDNEW
« src/code-stubs-hydrogen.cc ('K') | « src/ic/ic.h ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698