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

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

Issue 816653002: Monomorphic and polymorphic ICs with cleared maps should not go megamorphic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 IsTransitionOfMonomorphicTarget(*current_type->AsClass()->Map(), 825 IsTransitionOfMonomorphicTarget(*current_type->AsClass()->Map(),
826 *type->AsClass()->Map())) { 826 *type->AsClass()->Map())) {
827 handler_to_overwrite = i; 827 handler_to_overwrite = i;
828 } 828 }
829 } 829 }
830 830
831 int number_of_valid_types = 831 int number_of_valid_types =
832 number_of_types - deprecated_types - (handler_to_overwrite != -1); 832 number_of_types - deprecated_types - (handler_to_overwrite != -1);
833 833
834 if (number_of_valid_types >= 4) return false; 834 if (number_of_valid_types >= 4) return false;
835 if (number_of_types == 0) return false; 835 if (number_of_types == 0 && state() != MONOMORPHIC &&
836 state() != POLYMORPHIC) {
837 return false;
838 }
836 if (UseVector()) { 839 if (UseVector()) {
837 if (!nexus()->FindHandlers(&handlers, types.length())) return false; 840 if (!nexus()->FindHandlers(&handlers, types.length())) return false;
838 } else { 841 } else {
839 if (!target()->FindHandlers(&handlers, types.length())) return false; 842 if (!target()->FindHandlers(&handlers, types.length())) return false;
840 } 843 }
841 844
842 number_of_valid_types++; 845 number_of_valid_types++;
843 if (number_of_valid_types > 1 && target()->is_keyed_stub()) return false; 846 if (number_of_valid_types > 1 && target()->is_keyed_stub()) return false;
844 Handle<Code> ic; 847 Handle<Code> ic;
845 if (number_of_valid_types == 1) { 848 if (number_of_valid_types == 1) {
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
3005 static const Address IC_utilities[] = { 3008 static const Address IC_utilities[] = {
3006 #define ADDR(name) FUNCTION_ADDR(name), 3009 #define ADDR(name) FUNCTION_ADDR(name),
3007 IC_UTIL_LIST(ADDR) NULL 3010 IC_UTIL_LIST(ADDR) NULL
3008 #undef ADDR 3011 #undef ADDR
3009 }; 3012 };
3010 3013
3011 3014
3012 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3015 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3013 } 3016 }
3014 } // namespace v8::internal 3017 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698