OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 return generic_stub(); | 1075 return generic_stub(); |
1076 } | 1076 } |
1077 | 1077 |
1078 return isolate()->stub_cache()->ComputeLoadElementPolymorphic( | 1078 return isolate()->stub_cache()->ComputeLoadElementPolymorphic( |
1079 &target_receiver_maps); | 1079 &target_receiver_maps); |
1080 } | 1080 } |
1081 | 1081 |
1082 | 1082 |
1083 MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) { | 1083 MaybeObject* KeyedLoadIC::Load(Handle<Object> object, Handle<Object> key) { |
1084 if (MigrateDeprecated(object)) { | 1084 if (MigrateDeprecated(object)) { |
1085 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1085 Handle<Object> result = Runtime::GetObjectProperty(isolate(), object, key); |
| 1086 RETURN_IF_EMPTY_HANDLE(isolate(), result); |
| 1087 return *result; |
1086 } | 1088 } |
1087 | 1089 |
1088 MaybeObject* maybe_object = NULL; | 1090 MaybeObject* maybe_object = NULL; |
1089 Handle<Code> stub = generic_stub(); | 1091 Handle<Code> stub = generic_stub(); |
1090 | 1092 |
1091 // Check for non-string values that can be converted into an | 1093 // Check for non-string values that can be converted into an |
1092 // internalized string directly or is representable as a smi. | 1094 // internalized string directly or is representable as a smi. |
1093 key = TryConvertKey(key, isolate()); | 1095 key = TryConvertKey(key, isolate()); |
1094 | 1096 |
1095 if (key->IsInternalizedString()) { | 1097 if (key->IsInternalizedString()) { |
(...skipping 18 matching lines...) Expand all Loading... |
1114 | 1116 |
1115 if (!is_target_set()) { | 1117 if (!is_target_set()) { |
1116 if (*stub == *generic_stub()) { | 1118 if (*stub == *generic_stub()) { |
1117 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); | 1119 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); |
1118 } | 1120 } |
1119 set_target(*stub); | 1121 set_target(*stub); |
1120 TRACE_IC("LoadIC", key); | 1122 TRACE_IC("LoadIC", key); |
1121 } | 1123 } |
1122 | 1124 |
1123 if (maybe_object != NULL) return maybe_object; | 1125 if (maybe_object != NULL) return maybe_object; |
1124 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1126 Handle<Object> result = Runtime::GetObjectProperty(isolate(), object, key); |
| 1127 RETURN_IF_EMPTY_HANDLE(isolate(), result); |
| 1128 return *result; |
1125 } | 1129 } |
1126 | 1130 |
1127 | 1131 |
1128 static bool LookupForWrite(Handle<JSObject> receiver, | 1132 static bool LookupForWrite(Handle<JSObject> receiver, |
1129 Handle<String> name, | 1133 Handle<String> name, |
1130 Handle<Object> value, | 1134 Handle<Object> value, |
1131 LookupResult* lookup, | 1135 LookupResult* lookup, |
1132 IC* ic) { | 1136 IC* ic) { |
1133 Handle<JSObject> holder = receiver; | 1137 Handle<JSObject> holder = receiver; |
1134 receiver->Lookup(*name, lookup); | 1138 receiver->Lookup(*name, lookup); |
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2834 #undef ADDR | 2838 #undef ADDR |
2835 }; | 2839 }; |
2836 | 2840 |
2837 | 2841 |
2838 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2842 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2839 return IC_utilities[id]; | 2843 return IC_utilities[id]; |
2840 } | 2844 } |
2841 | 2845 |
2842 | 2846 |
2843 } } // namespace v8::internal | 2847 } } // namespace v8::internal |
OLD | NEW |