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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 Handle<Code> stub = generic_stub(); | 1089 Handle<Code> stub = generic_stub(); |
1090 | 1090 |
1091 // Check for non-string values that can be converted into an | 1091 // Check for non-string values that can be converted into an |
1092 // internalized string directly or is representable as a smi. | 1092 // internalized string directly or is representable as a smi. |
1093 key = TryConvertKey(key, isolate()); | 1093 key = TryConvertKey(key, isolate()); |
1094 | 1094 |
1095 if (key->IsInternalizedString()) { | 1095 if (key->IsInternalizedString()) { |
1096 maybe_object = LoadIC::Load(object, Handle<String>::cast(key)); | 1096 maybe_object = LoadIC::Load(object, Handle<String>::cast(key)); |
1097 if (maybe_object->IsFailure()) return maybe_object; | 1097 if (maybe_object->IsFailure()) return maybe_object; |
1098 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { | 1098 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded()) { |
1099 ASSERT(!object->IsAccessCheckNeeded()); | |
1100 if (object->IsString() && key->IsNumber()) { | 1099 if (object->IsString() && key->IsNumber()) { |
1101 if (state() == UNINITIALIZED) stub = string_stub(); | 1100 if (state() == UNINITIALIZED) stub = string_stub(); |
1102 } else if (object->IsJSObject()) { | 1101 } else if (object->IsJSObject()) { |
1103 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1102 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1104 if (receiver->elements()->map() == | 1103 if (receiver->elements()->map() == |
1105 isolate()->heap()->sloppy_arguments_elements_map()) { | 1104 isolate()->heap()->sloppy_arguments_elements_map()) { |
1106 stub = sloppy_arguments_stub(); | 1105 stub = sloppy_arguments_stub(); |
1107 } else if (receiver->HasIndexedInterceptor()) { | 1106 } else if (receiver->HasIndexedInterceptor()) { |
1108 stub = indexed_interceptor_stub(); | 1107 stub = indexed_interceptor_stub(); |
1109 } else if (!key->ToSmi()->IsFailure() && | 1108 } else if (!key->ToSmi()->IsFailure() && |
1110 (!target().is_identical_to(sloppy_arguments_stub()))) { | 1109 (!target().is_identical_to(sloppy_arguments_stub()))) { |
1111 stub = LoadElementStub(receiver); | 1110 stub = LoadElementStub(receiver); |
1112 } | 1111 } |
1113 } | 1112 } |
1114 } | 1113 } |
1115 | 1114 |
1116 if (!is_target_set()) { | 1115 if (!is_target_set()) { |
1117 if (*stub == *generic_stub()) { | 1116 if (*stub == *generic_stub()) { |
1118 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); | 1117 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); |
1119 } | 1118 } |
1120 ASSERT(!stub.is_null()); | |
1121 set_target(*stub); | 1119 set_target(*stub); |
1122 TRACE_IC("LoadIC", key); | 1120 TRACE_IC("LoadIC", key); |
1123 } | 1121 } |
1124 | 1122 |
1125 if (maybe_object != NULL) return maybe_object; | 1123 if (maybe_object != NULL) return maybe_object; |
1126 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); | 1124 return Runtime::GetObjectPropertyOrFail(isolate(), object, key); |
1127 } | 1125 } |
1128 | 1126 |
1129 | 1127 |
1130 static bool LookupForWrite(Handle<JSObject> receiver, | 1128 static bool LookupForWrite(Handle<JSObject> receiver, |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2835 #undef ADDR | 2833 #undef ADDR |
2836 }; | 2834 }; |
2837 | 2835 |
2838 | 2836 |
2839 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2837 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2840 return IC_utilities[id]; | 2838 return IC_utilities[id]; |
2841 } | 2839 } |
2842 | 2840 |
2843 | 2841 |
2844 } } // namespace v8::internal | 2842 } } // namespace v8::internal |
OLD | NEW |