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/elements.h" | 5 #include "src/elements.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/factory.h" | 9 #include "src/factory.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 544 matching lines...) Loading... | |
555 uint32_t entry) { | 555 uint32_t entry) { |
556 uint32_t index = GetIndexForEntryImpl(*backing_store, entry); | 556 uint32_t index = GetIndexForEntryImpl(*backing_store, entry); |
557 return BackingStore::get(Handle<BackingStore>::cast(backing_store), index); | 557 return BackingStore::get(Handle<BackingStore>::cast(backing_store), index); |
558 } | 558 } |
559 | 559 |
560 virtual void Set(FixedArrayBase* backing_store, uint32_t entry, | 560 virtual void Set(FixedArrayBase* backing_store, uint32_t entry, |
561 Object* value) final { | 561 Object* value) final { |
562 ElementsAccessorSubclass::SetImpl(backing_store, entry, value); | 562 ElementsAccessorSubclass::SetImpl(backing_store, entry, value); |
563 } | 563 } |
564 | 564 |
565 static void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | 565 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, |
566 Object* value) { | 566 Object* value) { |
567 BackingStore::cast(backing_store)->SetValue(entry, value); | 567 UNREACHABLE(); |
568 } | |
569 | |
570 | |
571 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
572 Object* value, WriteBarrierMode mode) { | |
Camillo Bruni
2015/09/01 12:04:51
I am still keeping this version as it makes a smal
| |
573 UNREACHABLE(); | |
568 } | 574 } |
569 | 575 |
570 virtual void Reconfigure(Handle<JSObject> object, | 576 virtual void Reconfigure(Handle<JSObject> object, |
571 Handle<FixedArrayBase> store, uint32_t entry, | 577 Handle<FixedArrayBase> store, uint32_t entry, |
572 Handle<Object> value, | 578 Handle<Object> value, |
573 PropertyAttributes attributes) final { | 579 PropertyAttributes attributes) final { |
574 ElementsAccessorSubclass::ReconfigureImpl(object, store, entry, value, | 580 ElementsAccessorSubclass::ReconfigureImpl(object, store, entry, value, |
575 attributes); | 581 attributes); |
576 } | 582 } |
577 | 583 |
(...skipping 24 matching lines...) Loading... | |
602 push_size, direction); | 608 push_size, direction); |
603 } | 609 } |
604 | 610 |
605 static uint32_t PushImpl(Handle<JSArray> receiver, | 611 static uint32_t PushImpl(Handle<JSArray> receiver, |
606 Handle<FixedArrayBase> elms_obj, Object** objects, | 612 Handle<FixedArrayBase> elms_obj, Object** objects, |
607 uint32_t push_size, int direction) { | 613 uint32_t push_size, int direction) { |
608 UNREACHABLE(); | 614 UNREACHABLE(); |
609 return 0; | 615 return 0; |
610 } | 616 } |
611 | 617 |
618 virtual uint32_t Unshift(Handle<JSArray> receiver, | |
619 Handle<FixedArrayBase> backing_store, | |
620 Arguments* args, uint32_t unshift_size) final { | |
621 return ElementsAccessorSubclass::UnshiftImpl(receiver, backing_store, args, | |
622 unshift_size); | |
623 } | |
624 | |
625 static uint32_t UnshiftImpl(Handle<JSArray> receiver, | |
626 Handle<FixedArrayBase> elms_obj, Arguments* args, | |
627 uint32_t unshift_size) { | |
628 UNREACHABLE(); | |
629 return 0; | |
630 } | |
631 | |
612 virtual Handle<JSArray> Slice(Handle<JSObject> receiver, | 632 virtual Handle<JSArray> Slice(Handle<JSObject> receiver, |
613 Handle<FixedArrayBase> backing_store, | 633 Handle<FixedArrayBase> backing_store, |
614 uint32_t start, uint32_t end) final { | 634 uint32_t start, uint32_t end) final { |
615 return ElementsAccessorSubclass::SliceImpl(receiver, backing_store, start, | 635 return ElementsAccessorSubclass::SliceImpl(receiver, backing_store, start, |
616 end); | 636 end); |
617 } | 637 } |
618 | 638 |
619 static Handle<JSArray> SliceImpl(Handle<JSObject> receiver, | 639 static Handle<JSArray> SliceImpl(Handle<JSObject> receiver, |
620 Handle<FixedArrayBase> backing_store, | 640 Handle<FixedArrayBase> backing_store, |
621 uint32_t start, uint32_t end) { | 641 uint32_t start, uint32_t end) { |
(...skipping 33 matching lines...) Loading... | |
655 handle(array->elements())); | 675 handle(array->elements())); |
656 } | 676 } |
657 | 677 |
658 static void SetLengthImpl(Handle<JSArray> array, uint32_t length, | 678 static void SetLengthImpl(Handle<JSArray> array, uint32_t length, |
659 Handle<FixedArrayBase> backing_store); | 679 Handle<FixedArrayBase> backing_store); |
660 | 680 |
661 static Handle<FixedArrayBase> ConvertElementsWithCapacity( | 681 static Handle<FixedArrayBase> ConvertElementsWithCapacity( |
662 Handle<JSObject> object, Handle<FixedArrayBase> old_elements, | 682 Handle<JSObject> object, Handle<FixedArrayBase> old_elements, |
663 ElementsKind from_kind, uint32_t capacity) { | 683 ElementsKind from_kind, uint32_t capacity) { |
664 return ConvertElementsWithCapacity( | 684 return ConvertElementsWithCapacity( |
665 object, old_elements, from_kind, capacity, | 685 object, old_elements, from_kind, capacity, 0, 0, |
666 ElementsAccessor::kCopyToEndAndInitializeToHole); | 686 ElementsAccessor::kCopyToEndAndInitializeToHole); |
667 } | 687 } |
668 | 688 |
669 static Handle<FixedArrayBase> ConvertElementsWithCapacity( | 689 static Handle<FixedArrayBase> ConvertElementsWithCapacity( |
670 Handle<JSObject> object, Handle<FixedArrayBase> old_elements, | 690 Handle<JSObject> object, Handle<FixedArrayBase> old_elements, |
671 ElementsKind from_kind, uint32_t capacity, int copy_size) { | 691 ElementsKind from_kind, uint32_t capacity, int copy_size) { |
692 return ConvertElementsWithCapacity(object, old_elements, from_kind, | |
693 capacity, 0, 0, copy_size); | |
694 } | |
695 | |
696 static Handle<FixedArrayBase> ConvertElementsWithCapacity( | |
697 Handle<JSObject> object, Handle<FixedArrayBase> old_elements, | |
698 ElementsKind from_kind, uint32_t capacity, uint32_t src_index, | |
699 uint32_t dst_index, int copy_size) { | |
672 Isolate* isolate = object->GetIsolate(); | 700 Isolate* isolate = object->GetIsolate(); |
673 Handle<FixedArrayBase> new_elements; | 701 Handle<FixedArrayBase> new_elements; |
674 if (IsFastDoubleElementsKind(kind())) { | 702 if (IsFastDoubleElementsKind(kind())) { |
675 new_elements = isolate->factory()->NewFixedDoubleArray(capacity); | 703 new_elements = isolate->factory()->NewFixedDoubleArray(capacity); |
676 } else { | 704 } else { |
677 new_elements = isolate->factory()->NewUninitializedFixedArray(capacity); | 705 new_elements = isolate->factory()->NewUninitializedFixedArray(capacity); |
678 } | 706 } |
679 | 707 |
680 int packed_size = kPackedSizeNotKnown; | 708 int packed_size = kPackedSizeNotKnown; |
681 if (IsFastPackedElementsKind(from_kind) && object->IsJSArray()) { | 709 if (IsFastPackedElementsKind(from_kind) && object->IsJSArray()) { |
682 packed_size = Smi::cast(JSArray::cast(*object)->length())->value(); | 710 packed_size = Smi::cast(JSArray::cast(*object)->length())->value(); |
683 } | 711 } |
684 | 712 |
685 ElementsAccessorSubclass::CopyElementsImpl( | 713 ElementsAccessorSubclass::CopyElementsImpl( |
686 *old_elements, 0, *new_elements, from_kind, 0, packed_size, copy_size); | 714 *old_elements, src_index, *new_elements, from_kind, dst_index, |
715 packed_size, copy_size); | |
687 | 716 |
688 return new_elements; | 717 return new_elements; |
689 } | 718 } |
690 | 719 |
691 static void GrowCapacityAndConvertImpl(Handle<JSObject> object, | 720 static void GrowCapacityAndConvertImpl(Handle<JSObject> object, |
692 uint32_t capacity) { | 721 uint32_t capacity) { |
693 ElementsKind from_kind = object->GetElementsKind(); | 722 ElementsKind from_kind = object->GetElementsKind(); |
694 if (IsFastSmiOrObjectElementsKind(from_kind)) { | 723 if (IsFastSmiOrObjectElementsKind(from_kind)) { |
695 // Array optimizations rely on the prototype lookups of Array objects | 724 // Array optimizations rely on the prototype lookups of Array objects |
696 // always returning undefined. If there is a store to the initial | 725 // always returning undefined. If there is a store to the initial |
(...skipping 297 matching lines...) Loading... | |
994 static Object* GetRaw(FixedArrayBase* store, uint32_t entry) { | 1023 static Object* GetRaw(FixedArrayBase* store, uint32_t entry) { |
995 SeededNumberDictionary* backing_store = SeededNumberDictionary::cast(store); | 1024 SeededNumberDictionary* backing_store = SeededNumberDictionary::cast(store); |
996 return backing_store->ValueAt(entry); | 1025 return backing_store->ValueAt(entry); |
997 } | 1026 } |
998 | 1027 |
999 static Handle<Object> GetImpl(Handle<FixedArrayBase> store, uint32_t entry) { | 1028 static Handle<Object> GetImpl(Handle<FixedArrayBase> store, uint32_t entry) { |
1000 Isolate* isolate = store->GetIsolate(); | 1029 Isolate* isolate = store->GetIsolate(); |
1001 return handle(GetRaw(*store, entry), isolate); | 1030 return handle(GetRaw(*store, entry), isolate); |
1002 } | 1031 } |
1003 | 1032 |
1004 static void SetImpl(FixedArrayBase* store, uint32_t entry, Object* value) { | 1033 static inline void SetImpl(FixedArrayBase* store, uint32_t entry, |
1034 Object* value) { | |
1005 SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(store); | 1035 SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(store); |
1006 dictionary->ValueAtPut(entry, value); | 1036 dictionary->ValueAtPut(entry, value); |
1007 } | 1037 } |
1008 | 1038 |
1009 static void ReconfigureImpl(Handle<JSObject> object, | 1039 static void ReconfigureImpl(Handle<JSObject> object, |
1010 Handle<FixedArrayBase> store, uint32_t entry, | 1040 Handle<FixedArrayBase> store, uint32_t entry, |
1011 Handle<Object> value, | 1041 Handle<Object> value, |
1012 PropertyAttributes attributes) { | 1042 PropertyAttributes attributes) { |
1013 SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(*store); | 1043 SeededNumberDictionary* dictionary = SeededNumberDictionary::cast(*store); |
1014 if (attributes != NONE) object->RequireSlowElements(dictionary); | 1044 if (attributes != NONE) object->RequireSlowElements(dictionary); |
(...skipping 268 matching lines...) Loading... | |
1283 } | 1313 } |
1284 if (!new_elms.is_identical_to(backing_store)) { | 1314 if (!new_elms.is_identical_to(backing_store)) { |
1285 receiver->set_elements(*new_elms); | 1315 receiver->set_elements(*new_elms); |
1286 } | 1316 } |
1287 DCHECK(*new_elms == receiver->elements()); | 1317 DCHECK(*new_elms == receiver->elements()); |
1288 // Set the length. | 1318 // Set the length. |
1289 receiver->set_length(Smi::FromInt(new_length)); | 1319 receiver->set_length(Smi::FromInt(new_length)); |
1290 return new_length; | 1320 return new_length; |
1291 } | 1321 } |
1292 | 1322 |
1323 static uint32_t UnshiftImpl(Handle<JSArray> receiver, | |
1324 Handle<FixedArrayBase> backing_store, | |
1325 Arguments* args, uint32_t unshift_size) { | |
1326 uint32_t len = Smi::cast(receiver->length())->value(); | |
1327 if (unshift_size == 0) { | |
1328 return len; | |
1329 } | |
1330 uint32_t elms_len = backing_store->length(); | |
1331 // Currently fixed arrays cannot grow too big, so | |
1332 // we should never hit this case. | |
1333 DCHECK(unshift_size <= static_cast<uint32_t>(Smi::kMaxValue - len)); | |
1334 uint32_t new_length = len + unshift_size; | |
1335 | |
1336 if (new_length > elms_len) { | |
1337 // New backing storage is needed. | |
1338 uint32_t capacity = new_length + (new_length >> 1) + 16; | |
1339 backing_store = FastElementsAccessorSubclass::ConvertElementsWithCapacity( | |
1340 receiver, backing_store, KindTraits::Kind, capacity, 0, unshift_size, | |
1341 ElementsAccessor::kCopyToEndAndInitializeToHole); | |
1342 DisallowHeapAllocation no_gc; | |
1343 receiver->set_elements(*backing_store); | |
1344 } else { | |
1345 // unshift_size is > 0 and new_length <= elms_len, so backing_store cannot | |
1346 // be the empty_fixed_array. | |
1347 DisallowHeapAllocation no_gc; | |
1348 Isolate* isolate = receiver->GetIsolate(); | |
1349 FastElementsAccessorSubclass::MoveElements(isolate->heap(), backing_store, | |
1350 unshift_size, 0, len, 0, 0); | |
1351 } | |
1352 | |
1353 // Add the provided values. | |
1354 DisallowHeapAllocation no_gc; | |
1355 FixedArrayBase* raw_backing_store = *backing_store; | |
1356 WriteBarrierMode mode = raw_backing_store->GetWriteBarrierMode(no_gc); | |
1357 for (uint32_t index = 0; index < unshift_size; index++) { | |
1358 FastElementsAccessorSubclass::SetImpl(raw_backing_store, index, | |
1359 (*args)[index + 1], mode); | |
1360 } | |
1361 // Set the length. | |
1362 receiver->set_length(Smi::FromInt(new_length)); | |
1363 return new_length; | |
1364 } | |
1365 | |
1293 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, | 1366 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, |
1294 int dst_index, int src_index, int len, | 1367 int dst_index, int src_index, int len, |
1295 int hole_start, int hole_end) { | 1368 int hole_start, int hole_end) { |
1296 UNREACHABLE(); | 1369 UNREACHABLE(); |
1297 } | 1370 } |
1298 | 1371 |
1299 static Handle<JSArray> SliceImpl(Handle<JSObject> receiver, | 1372 static Handle<JSArray> SliceImpl(Handle<JSObject> receiver, |
1300 Handle<FixedArrayBase> backing_store, | 1373 Handle<FixedArrayBase> backing_store, |
1301 uint32_t start, uint32_t end) { | 1374 uint32_t start, uint32_t end) { |
1302 Isolate* isolate = receiver->GetIsolate(); | 1375 Isolate* isolate = receiver->GetIsolate(); |
(...skipping 125 matching lines...) Loading... | |
1428 | 1501 |
1429 template<typename FastElementsAccessorSubclass, | 1502 template<typename FastElementsAccessorSubclass, |
1430 typename KindTraits> | 1503 typename KindTraits> |
1431 class FastSmiOrObjectElementsAccessor | 1504 class FastSmiOrObjectElementsAccessor |
1432 : public FastElementsAccessor<FastElementsAccessorSubclass, KindTraits> { | 1505 : public FastElementsAccessor<FastElementsAccessorSubclass, KindTraits> { |
1433 public: | 1506 public: |
1434 explicit FastSmiOrObjectElementsAccessor(const char* name) | 1507 explicit FastSmiOrObjectElementsAccessor(const char* name) |
1435 : FastElementsAccessor<FastElementsAccessorSubclass, | 1508 : FastElementsAccessor<FastElementsAccessorSubclass, |
1436 KindTraits>(name) {} | 1509 KindTraits>(name) {} |
1437 | 1510 |
1511 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1512 Object* value) { | |
1513 FixedArray::cast(backing_store)->set(entry, value); | |
1514 } | |
1515 | |
1516 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1517 Object* value, WriteBarrierMode mode) { | |
1518 FixedArray::cast(backing_store)->set(entry, value, mode); | |
1519 } | |
1520 | |
1438 static Object* GetRaw(FixedArray* backing_store, uint32_t entry) { | 1521 static Object* GetRaw(FixedArray* backing_store, uint32_t entry) { |
1439 uint32_t index = FastElementsAccessorSubclass::GetIndexForEntryImpl( | 1522 uint32_t index = FastElementsAccessorSubclass::GetIndexForEntryImpl( |
1440 backing_store, entry); | 1523 backing_store, entry); |
1441 return backing_store->get(index); | 1524 return backing_store->get(index); |
1442 } | 1525 } |
1443 | 1526 |
1444 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, | 1527 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, |
1445 int dst_index, int src_index, int len, | 1528 int dst_index, int src_index, int len, |
1446 int hole_start, int hole_end) { | 1529 int hole_start, int hole_end) { |
1447 Handle<FixedArray> dst_elms = Handle<FixedArray>::cast(backing_store); | 1530 Handle<FixedArray> dst_elms = Handle<FixedArray>::cast(backing_store); |
(...skipping 99 matching lines...) Loading... | |
1547 | 1630 |
1548 template<typename FastElementsAccessorSubclass, | 1631 template<typename FastElementsAccessorSubclass, |
1549 typename KindTraits> | 1632 typename KindTraits> |
1550 class FastDoubleElementsAccessor | 1633 class FastDoubleElementsAccessor |
1551 : public FastElementsAccessor<FastElementsAccessorSubclass, KindTraits> { | 1634 : public FastElementsAccessor<FastElementsAccessorSubclass, KindTraits> { |
1552 public: | 1635 public: |
1553 explicit FastDoubleElementsAccessor(const char* name) | 1636 explicit FastDoubleElementsAccessor(const char* name) |
1554 : FastElementsAccessor<FastElementsAccessorSubclass, | 1637 : FastElementsAccessor<FastElementsAccessorSubclass, |
1555 KindTraits>(name) {} | 1638 KindTraits>(name) {} |
1556 | 1639 |
1640 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1641 Object* value) { | |
1642 FixedDoubleArray::cast(backing_store)->set(entry, value->Number()); | |
1643 } | |
1644 | |
1645 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1646 Object* value, WriteBarrierMode mode) { | |
1647 FixedDoubleArray::cast(backing_store)->set(entry, value->Number()); | |
1648 } | |
1649 | |
1557 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, | 1650 static void MoveElements(Heap* heap, Handle<FixedArrayBase> backing_store, |
1558 int dst_index, int src_index, int len, | 1651 int dst_index, int src_index, int len, |
1559 int hole_start, int hole_end) { | 1652 int hole_start, int hole_end) { |
1560 Handle<FixedDoubleArray> dst_elms = | 1653 Handle<FixedDoubleArray> dst_elms = |
1561 Handle<FixedDoubleArray>::cast(backing_store); | 1654 Handle<FixedDoubleArray>::cast(backing_store); |
1562 if (len != 0) { | 1655 if (len != 0) { |
1563 MemMove(dst_elms->data_start() + dst_index, | 1656 MemMove(dst_elms->data_start() + dst_index, |
1564 dst_elms->data_start() + src_index, len * kDoubleSize); | 1657 dst_elms->data_start() + src_index, len * kDoubleSize); |
1565 } | 1658 } |
1566 if (hole_start != hole_end) { | 1659 if (hole_start != hole_end) { |
(...skipping 70 matching lines...) Loading... | |
1637 : public ElementsAccessorBase<TypedElementsAccessor<Kind>, | 1730 : public ElementsAccessorBase<TypedElementsAccessor<Kind>, |
1638 ElementsKindTraits<Kind> > { | 1731 ElementsKindTraits<Kind> > { |
1639 public: | 1732 public: |
1640 explicit TypedElementsAccessor(const char* name) | 1733 explicit TypedElementsAccessor(const char* name) |
1641 : ElementsAccessorBase<AccessorClass, | 1734 : ElementsAccessorBase<AccessorClass, |
1642 ElementsKindTraits<Kind> >(name) {} | 1735 ElementsKindTraits<Kind> >(name) {} |
1643 | 1736 |
1644 typedef typename ElementsKindTraits<Kind>::BackingStore BackingStore; | 1737 typedef typename ElementsKindTraits<Kind>::BackingStore BackingStore; |
1645 typedef TypedElementsAccessor<Kind> AccessorClass; | 1738 typedef TypedElementsAccessor<Kind> AccessorClass; |
1646 | 1739 |
1740 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1741 Object* value) { | |
1742 BackingStore::cast(backing_store)->SetValue(entry, value); | |
1743 } | |
1744 | |
1745 static inline void SetImpl(FixedArrayBase* backing_store, uint32_t entry, | |
1746 Object* value, WriteBarrierMode mode) { | |
1747 BackingStore::cast(backing_store)->SetValue(entry, value); | |
1748 } | |
1749 | |
1647 static Handle<Object> GetImpl(Handle<FixedArrayBase> backing_store, | 1750 static Handle<Object> GetImpl(Handle<FixedArrayBase> backing_store, |
1648 uint32_t entry) { | 1751 uint32_t entry) { |
1649 uint32_t index = GetIndexForEntryImpl(*backing_store, entry); | 1752 uint32_t index = GetIndexForEntryImpl(*backing_store, entry); |
1650 return BackingStore::get(Handle<BackingStore>::cast(backing_store), index); | 1753 return BackingStore::get(Handle<BackingStore>::cast(backing_store), index); |
1651 } | 1754 } |
1652 | 1755 |
1653 static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store, | 1756 static PropertyDetails GetDetailsImpl(FixedArrayBase* backing_store, |
1654 uint32_t entry) { | 1757 uint32_t entry) { |
1655 return PropertyDetails(DONT_DELETE, DATA, 0, PropertyCellType::kNoCell); | 1758 return PropertyDetails(DONT_DELETE, DATA, 0, PropertyCellType::kNoCell); |
1656 } | 1759 } |
(...skipping 80 matching lines...) Loading... | |
1737 } | 1840 } |
1738 return result; | 1841 return result; |
1739 } | 1842 } |
1740 } | 1843 } |
1741 | 1844 |
1742 static void GrowCapacityAndConvertImpl(Handle<JSObject> object, | 1845 static void GrowCapacityAndConvertImpl(Handle<JSObject> object, |
1743 uint32_t capacity) { | 1846 uint32_t capacity) { |
1744 UNREACHABLE(); | 1847 UNREACHABLE(); |
1745 } | 1848 } |
1746 | 1849 |
1747 static void SetImpl(FixedArrayBase* store, uint32_t entry, Object* value) { | 1850 static inline void SetImpl(FixedArrayBase* store, uint32_t entry, |
1851 Object* value) { | |
1748 FixedArray* parameter_map = FixedArray::cast(store); | 1852 FixedArray* parameter_map = FixedArray::cast(store); |
1749 uint32_t length = parameter_map->length() - 2; | 1853 uint32_t length = parameter_map->length() - 2; |
1750 if (entry < length) { | 1854 if (entry < length) { |
1751 Object* probe = parameter_map->get(entry + 2); | 1855 Object* probe = parameter_map->get(entry + 2); |
1752 Context* context = Context::cast(parameter_map->get(0)); | 1856 Context* context = Context::cast(parameter_map->get(0)); |
1753 int context_entry = Smi::cast(probe)->value(); | 1857 int context_entry = Smi::cast(probe)->value(); |
1754 DCHECK(!context->get(context_entry)->IsTheHole()); | 1858 DCHECK(!context->get(context_entry)->IsTheHole()); |
1755 context->set(context_entry, value); | 1859 context->set(context_entry, value); |
1756 } else { | 1860 } else { |
1757 FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); | 1861 FixedArray* arguments = FixedArray::cast(parameter_map->get(1)); |
(...skipping 459 matching lines...) Loading... | |
2217 | 2321 |
2218 | 2322 |
2219 void ElementsAccessor::TearDown() { | 2323 void ElementsAccessor::TearDown() { |
2220 if (elements_accessors_ == NULL) return; | 2324 if (elements_accessors_ == NULL) return; |
2221 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; | 2325 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind]; |
2222 ELEMENTS_LIST(ACCESSOR_DELETE) | 2326 ELEMENTS_LIST(ACCESSOR_DELETE) |
2223 #undef ACCESSOR_DELETE | 2327 #undef ACCESSOR_DELETE |
2224 elements_accessors_ = NULL; | 2328 elements_accessors_ = NULL; |
2225 } | 2329 } |
2226 | 2330 |
2227 | |
2228 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; | 2331 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; |
2229 } // namespace internal | 2332 } // namespace internal |
2230 } // namespace v8 | 2333 } // namespace v8 |
OLD | NEW |