| 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 <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/api-arguments-inl.h" | 10 #include "src/api-arguments-inl.h" |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 if (std::isnan(value)) { | 1572 if (std::isnan(value)) { |
| 1573 key = isolate->factory()->nan_string(); | 1573 key = isolate->factory()->nan_string(); |
| 1574 } else { | 1574 } else { |
| 1575 int int_value = FastD2I(value); | 1575 int int_value = FastD2I(value); |
| 1576 if (value == int_value && Smi::IsValid(int_value)) { | 1576 if (value == int_value && Smi::IsValid(int_value)) { |
| 1577 key = handle(Smi::FromInt(int_value), isolate); | 1577 key = handle(Smi::FromInt(int_value), isolate); |
| 1578 } | 1578 } |
| 1579 } | 1579 } |
| 1580 } else if (key->IsUndefined(isolate)) { | 1580 } else if (key->IsUndefined(isolate)) { |
| 1581 key = isolate->factory()->undefined_string(); | 1581 key = isolate->factory()->undefined_string(); |
| 1582 } else if (key->IsString()) { |
| 1583 key = isolate->factory()->InternalizeString(Handle<String>::cast(key)); |
| 1582 } | 1584 } |
| 1583 return key; | 1585 return key; |
| 1584 } | 1586 } |
| 1585 | 1587 |
| 1586 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { | 1588 void KeyedLoadIC::UpdateLoadElement(Handle<HeapObject> receiver) { |
| 1587 Handle<Map> receiver_map(receiver->map(), isolate()); | 1589 Handle<Map> receiver_map(receiver->map(), isolate()); |
| 1588 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && | 1590 DCHECK(receiver_map->instance_type() != JS_VALUE_TYPE && |
| 1589 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. | 1591 receiver_map->instance_type() != JS_PROXY_TYPE); // Checked by caller. |
| 1590 MapHandleList target_receiver_maps; | 1592 MapHandleList target_receiver_maps; |
| 1591 TargetMaps(&target_receiver_maps); | 1593 TargetMaps(&target_receiver_maps); |
| (...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3215 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); | 3217 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); |
| 3216 it.Next(); | 3218 it.Next(); |
| 3217 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 3219 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 3218 Object::GetProperty(&it)); | 3220 Object::GetProperty(&it)); |
| 3219 } | 3221 } |
| 3220 | 3222 |
| 3221 return *result; | 3223 return *result; |
| 3222 } | 3224 } |
| 3223 } // namespace internal | 3225 } // namespace internal |
| 3224 } // namespace v8 | 3226 } // namespace v8 |
| OLD | NEW |