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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2028 return result; | 2028 return result; |
2029 } | 2029 } |
2030 | 2030 |
2031 // Check for non-string values that can be converted into an | 2031 // Check for non-string values that can be converted into an |
2032 // internalized string directly or is representable as a smi. | 2032 // internalized string directly or is representable as a smi. |
2033 key = TryConvertKey(key, isolate()); | 2033 key = TryConvertKey(key, isolate()); |
2034 | 2034 |
2035 Handle<Object> store_handle; | 2035 Handle<Object> store_handle; |
2036 Handle<Code> stub = megamorphic_stub(); | 2036 Handle<Code> stub = megamorphic_stub(); |
2037 | 2037 |
2038 if (key->IsInternalizedString()) { | 2038 if (key->IsInternalizedString() || key->IsSymbol()) { |
2039 ASSIGN_RETURN_ON_EXCEPTION( | 2039 ASSIGN_RETURN_ON_EXCEPTION( |
2040 isolate(), store_handle, | 2040 isolate(), store_handle, |
2041 StoreIC::Store(object, Handle<String>::cast(key), value, | 2041 StoreIC::Store(object, Handle<Name>::cast(key), value, |
2042 JSReceiver::MAY_BE_STORE_FROM_KEYED), | 2042 JSReceiver::MAY_BE_STORE_FROM_KEYED), |
2043 Object); | 2043 Object); |
2044 if (!is_target_set()) { | 2044 if (!is_target_set()) { |
2045 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", | 2045 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", |
2046 "unhandled internalized string key"); | 2046 "unhandled internalized string key"); |
2047 TRACE_IC("StoreIC", key); | 2047 TRACE_IC("StoreIC", key); |
2048 set_target(*stub); | 2048 set_target(*stub); |
2049 } | 2049 } |
2050 return store_handle; | 2050 return store_handle; |
2051 } | 2051 } |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2969 static const Address IC_utilities[] = { | 2969 static const Address IC_utilities[] = { |
2970 #define ADDR(name) FUNCTION_ADDR(name), | 2970 #define ADDR(name) FUNCTION_ADDR(name), |
2971 IC_UTIL_LIST(ADDR) NULL | 2971 IC_UTIL_LIST(ADDR) NULL |
2972 #undef ADDR | 2972 #undef ADDR |
2973 }; | 2973 }; |
2974 | 2974 |
2975 | 2975 |
2976 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 2976 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
2977 } | 2977 } |
2978 } // namespace v8::internal | 2978 } // namespace v8::internal |
OLD | NEW |