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/ic/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-arguments-inl.h" | 8 #include "src/api-arguments-inl.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 | 1419 |
1420 uint32_t index; | 1420 uint32_t index; |
1421 if ((key->IsInternalizedString() && | 1421 if ((key->IsInternalizedString() && |
1422 !String::cast(*key)->AsArrayIndex(&index)) || | 1422 !String::cast(*key)->AsArrayIndex(&index)) || |
1423 key->IsSymbol()) { | 1423 key->IsSymbol()) { |
1424 ASSIGN_RETURN_ON_EXCEPTION(isolate(), load_handle, | 1424 ASSIGN_RETURN_ON_EXCEPTION(isolate(), load_handle, |
1425 LoadIC::Load(object, Handle<Name>::cast(key)), | 1425 LoadIC::Load(object, Handle<Name>::cast(key)), |
1426 Object); | 1426 Object); |
1427 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded() && | 1427 } else if (FLAG_use_ic && !object->IsAccessCheckNeeded() && |
1428 !object->IsJSValue()) { | 1428 !object->IsJSValue()) { |
1429 if (object->IsJSObject() || (object->IsString() && key->IsNumber())) { | 1429 if ((object->IsJSObject() && key->IsSmi()) || |
1430 Handle<HeapObject> receiver = Handle<HeapObject>::cast(object); | 1430 (object->IsString() && key->IsNumber())) { |
1431 if (object->IsString() || key->IsSmi()) UpdateLoadElement(receiver); | 1431 UpdateLoadElement(Handle<HeapObject>::cast(object)); |
| 1432 TRACE_IC("LoadIC", key); |
1432 } | 1433 } |
1433 } | 1434 } |
1434 | 1435 |
1435 if (!is_vector_set()) { | 1436 if (!is_vector_set()) { |
1436 ConfigureVectorState(MEGAMORPHIC, key); | 1437 ConfigureVectorState(MEGAMORPHIC, key); |
1437 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); | 1438 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); |
1438 } | 1439 } |
1439 TRACE_IC("LoadIC", key); | |
1440 | 1440 |
1441 if (!load_handle.is_null()) return load_handle; | 1441 if (!load_handle.is_null()) return load_handle; |
1442 | 1442 |
1443 Handle<Object> result; | 1443 Handle<Object> result; |
1444 ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, | 1444 ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, |
1445 Runtime::GetObjectProperty(isolate(), object, key), | 1445 Runtime::GetObjectProperty(isolate(), object, key), |
1446 Object); | 1446 Object); |
1447 return result; | 1447 return result; |
1448 } | 1448 } |
1449 | 1449 |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2997 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2997 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
2998 vector->GetKind(vector_slot)); | 2998 vector->GetKind(vector_slot)); |
2999 KeyedLoadICNexus nexus(vector, vector_slot); | 2999 KeyedLoadICNexus nexus(vector, vector_slot); |
3000 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3000 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3001 ic.UpdateState(receiver, key); | 3001 ic.UpdateState(receiver, key); |
3002 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3002 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
3003 } | 3003 } |
3004 } | 3004 } |
3005 } // namespace internal | 3005 } // namespace internal |
3006 } // namespace v8 | 3006 } // namespace v8 |
OLD | NEW |