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/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 Handle<JSObject> obj, | 1459 Handle<JSObject> obj, |
1460 uint32_t key, | 1460 uint32_t key, |
1461 Handle<FixedArrayBase> store) { | 1461 Handle<FixedArrayBase> store) { |
1462 Handle<SeededNumberDictionary> backing_store = | 1462 Handle<SeededNumberDictionary> backing_store = |
1463 Handle<SeededNumberDictionary>::cast(store); | 1463 Handle<SeededNumberDictionary>::cast(store); |
1464 Isolate* isolate = backing_store->GetIsolate(); | 1464 Isolate* isolate = backing_store->GetIsolate(); |
1465 int entry = backing_store->FindEntry(key); | 1465 int entry = backing_store->FindEntry(key); |
1466 if (entry != SeededNumberDictionary::kNotFound) { | 1466 if (entry != SeededNumberDictionary::kNotFound) { |
1467 Handle<Object> element(backing_store->ValueAt(entry), isolate); | 1467 Handle<Object> element(backing_store->ValueAt(entry), isolate); |
1468 PropertyDetails details = backing_store->DetailsAt(entry); | 1468 PropertyDetails details = backing_store->DetailsAt(entry); |
1469 if (details.type() == CALLBACKS) { | 1469 if (details.type() == ACCESSOR_CONSTANT) { |
1470 return JSObject::GetElementWithCallback( | 1470 return JSObject::GetElementWithCallback( |
1471 obj, receiver, element, key, obj); | 1471 obj, receiver, element, key, obj); |
1472 } else { | 1472 } else { |
1473 return element; | 1473 return element; |
1474 } | 1474 } |
1475 } | 1475 } |
1476 return isolate->factory()->the_hole_value(); | 1476 return isolate->factory()->the_hole_value(); |
1477 } | 1477 } |
1478 | 1478 |
1479 MUST_USE_RESULT static PropertyAttributes GetAttributesImpl( | 1479 MUST_USE_RESULT static PropertyAttributes GetAttributesImpl( |
(...skipping 12 matching lines...) Expand all Loading... |
1492 | 1492 |
1493 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetAccessorPairImpl( | 1493 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetAccessorPairImpl( |
1494 Handle<Object> receiver, | 1494 Handle<Object> receiver, |
1495 Handle<JSObject> obj, | 1495 Handle<JSObject> obj, |
1496 uint32_t key, | 1496 uint32_t key, |
1497 Handle<FixedArrayBase> store) { | 1497 Handle<FixedArrayBase> store) { |
1498 Handle<SeededNumberDictionary> backing_store = | 1498 Handle<SeededNumberDictionary> backing_store = |
1499 Handle<SeededNumberDictionary>::cast(store); | 1499 Handle<SeededNumberDictionary>::cast(store); |
1500 int entry = backing_store->FindEntry(key); | 1500 int entry = backing_store->FindEntry(key); |
1501 if (entry != SeededNumberDictionary::kNotFound && | 1501 if (entry != SeededNumberDictionary::kNotFound && |
1502 backing_store->DetailsAt(entry).type() == CALLBACKS && | 1502 backing_store->DetailsAt(entry).type() == ACCESSOR_CONSTANT && |
1503 backing_store->ValueAt(entry)->IsAccessorPair()) { | 1503 backing_store->ValueAt(entry)->IsAccessorPair()) { |
1504 return handle(AccessorPair::cast(backing_store->ValueAt(entry))); | 1504 return handle(AccessorPair::cast(backing_store->ValueAt(entry))); |
1505 } | 1505 } |
1506 return MaybeHandle<AccessorPair>(); | 1506 return MaybeHandle<AccessorPair>(); |
1507 } | 1507 } |
1508 | 1508 |
1509 static bool HasElementImpl(Handle<Object> receiver, | 1509 static bool HasElementImpl(Handle<Object> receiver, |
1510 Handle<JSObject> holder, | 1510 Handle<JSObject> holder, |
1511 uint32_t key, | 1511 uint32_t key, |
1512 Handle<FixedArrayBase> store) { | 1512 Handle<FixedArrayBase> store) { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 UNREACHABLE(); | 1885 UNREACHABLE(); |
1886 break; | 1886 break; |
1887 } | 1887 } |
1888 | 1888 |
1889 array->set_elements(*elms); | 1889 array->set_elements(*elms); |
1890 array->set_length(Smi::FromInt(number_of_elements)); | 1890 array->set_length(Smi::FromInt(number_of_elements)); |
1891 return array; | 1891 return array; |
1892 } | 1892 } |
1893 | 1893 |
1894 } } // namespace v8::internal | 1894 } } // namespace v8::internal |
OLD | NEW |