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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |