Lines Matching refs:index
67 Object FixedArray::get(int index) const {
69 return get(cage_base, index);
72 Object FixedArray::get(PtrComprCageBase cage_base, int index) const {
73 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
75 OffsetOfElementAt(index));
78 Handle<Object> FixedArray::get(FixedArray array, int index, Isolate* isolate) {
79 return handle(array.get(isolate, index), isolate);
82 bool FixedArray::is_the_hole(Isolate* isolate, int index) {
83 return get(isolate, index).IsTheHole(isolate);
87 void FixedArray::set(int index, Smi value) {
89 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
91 int offset = OffsetOfElementAt(index);
96 void FixedArray::set(int index, Object value) {
99 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
100 int offset = OffsetOfElementAt(index);
105 void FixedArray::set(int index, Object value, WriteBarrierMode mode) {
107 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
108 int offset = OffsetOfElementAt(index);
114 void FixedArray::NoWriteBarrierSet(FixedArray array, int index, Object value) {
116 DCHECK_LT(static_cast<unsigned>(index),
119 int offset = OffsetOfElementAt(index);
123 Object FixedArray::get(int index, RelaxedLoadTag) const {
125 return get(cage_base, index);
128 Object FixedArray::get(PtrComprCageBase cage_base, int index,
130 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
131 return RELAXED_READ_FIELD(*this, OffsetOfElementAt(index));
134 void FixedArray::set(int index, Object value, RelaxedStoreTag,
137 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
138 RELAXED_WRITE_FIELD(*this, OffsetOfElementAt(index), value);
139 CONDITIONAL_WRITE_BARRIER(*this, OffsetOfElementAt(index), value, mode);
142 void FixedArray::set(int index, Smi value, RelaxedStoreTag tag) {
144 set(index, value, tag, SKIP_WRITE_BARRIER);
147 Object FixedArray::get(int index, AcquireLoadTag) const {
149 return get(cage_base, index);
152 Object FixedArray::get(PtrComprCageBase cage_base, int index,
154 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
155 return ACQUIRE_READ_FIELD(*this, OffsetOfElementAt(index));
158 void FixedArray::set(int index, Object value, ReleaseStoreTag,
161 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
162 RELEASE_WRITE_FIELD(*this, OffsetOfElementAt(index), value);
163 CONDITIONAL_WRITE_BARRIER(*this, OffsetOfElementAt(index), value, mode);
166 void FixedArray::set(int index, Smi value, ReleaseStoreTag tag) {
168 set(index, value, tag, SKIP_WRITE_BARRIER);
171 void FixedArray::set_undefined(int index) {
172 set_undefined(GetReadOnlyRoots(), index);
175 void FixedArray::set_undefined(Isolate* isolate, int index) {
176 set_undefined(ReadOnlyRoots(isolate), index);
179 void FixedArray::set_undefined(ReadOnlyRoots ro_roots, int index) {
180 FixedArray::NoWriteBarrierSet(*this, index, ro_roots.undefined_value());
183 void FixedArray::set_null(int index) { set_null(GetReadOnlyRoots(), index); }
185 void FixedArray::set_null(Isolate* isolate, int index) {
186 set_null(ReadOnlyRoots(isolate), index);
189 void FixedArray::set_null(ReadOnlyRoots ro_roots, int index) {
190 FixedArray::NoWriteBarrierSet(*this, index, ro_roots.null_value());
193 void FixedArray::set_the_hole(int index) {
194 set_the_hole(GetReadOnlyRoots(), index);
197 void FixedArray::set_the_hole(Isolate* isolate, int index) {
198 set_the_hole(ReadOnlyRoots(isolate), index);
201 void FixedArray::set_the_hole(ReadOnlyRoots ro_roots, int index) {
202 FixedArray::NoWriteBarrierSet(*this, index, ro_roots.the_hole_value());
213 ObjectSlot FixedArray::RawFieldOfElementAt(int index) {
214 return RawField(OffsetOfElementAt(index));
258 // index). After doing the binary search and getting the correct internal
259 // index we check to have the index lower than valid_entries, if needed.
361 double FixedDoubleArray::get_scalar(int index) {
364 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
365 DCHECK(!is_the_hole(index));
366 return ReadField<double>(kHeaderSize + index * kDoubleSize);
369 uint64_t FixedDoubleArray::get_representation(int index) {
372 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
373 int offset = kHeaderSize + index * kDoubleSize;
378 Handle<Object> FixedDoubleArray::get(FixedDoubleArray array, int index,
380 if (array.is_the_hole(index)) {
383 return isolate->factory()->NewNumber(array.get_scalar(index));
387 void FixedDoubleArray::set(int index, double value) {
390 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
391 int offset = kHeaderSize + index * kDoubleSize;
397 DCHECK(!is_the_hole(index));
400 void FixedDoubleArray::set_the_hole(Isolate* isolate, int index) {
401 set_the_hole(index);
404 void FixedDoubleArray::set_the_hole(int index) {
407 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
408 int offset = kHeaderSize + index * kDoubleSize;
412 bool FixedDoubleArray::is_the_hole(Isolate* isolate, int index) {
413 return is_the_hole(index);
416 bool FixedDoubleArray::is_the_hole(int index) {
417 return get_representation(index) == kHoleNanInt64;
434 MaybeObject WeakFixedArray::Get(int index) const {
436 return Get(cage_base, index);
439 MaybeObject WeakFixedArray::Get(PtrComprCageBase cage_base, int index) const {
440 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
441 return objects(cage_base, index, kRelaxedLoad);
444 void WeakFixedArray::Set(int index, MaybeObject value, WriteBarrierMode mode) {
445 set_objects(index, value, mode);
462 MaybeObjectSlot WeakFixedArray::RawFieldOfElementAt(int index) {
463 return RawMaybeWeakField(OffsetOfElementAt(index));
479 MaybeObject WeakArrayList::Get(int index) const {
481 return Get(cage_base, index);
484 MaybeObject WeakArrayList::Get(PtrComprCageBase cage_base, int index) const {
485 DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(capacity()));
486 return objects(cage_base, index, kRelaxedLoad);
489 void WeakArrayList::Set(int index, MaybeObject value, WriteBarrierMode mode) {
490 set_objects(index, value, mode);
493 void WeakArrayList::Set(int index, Smi value) {
494 Set(index, MaybeObject::FromSmi(value), SKIP_WRITE_BARRIER);
535 Object ArrayList::Get(int index) const {
536 return FixedArray::cast(*this).get(kFirstIndex + index);
539 Object ArrayList::Get(PtrComprCageBase cage_base, int index) const {
540 return FixedArray::cast(*this).get(cage_base, kFirstIndex + index);
543 ObjectSlot ArrayList::Slot(int index) {
544 return RawField(OffsetOfElementAt(kFirstIndex + index));
547 void ArrayList::Set(int index, Object obj, WriteBarrierMode mode) {
548 FixedArray::cast(*this).set(kFirstIndex + index, obj, mode);
551 void ArrayList::Set(int index, Smi value) {
553 Set(index, value, SKIP_WRITE_BARRIER);
555 void ArrayList::Clear(int index, Object undefined) {
557 FixedArray::cast(*this).set(kFirstIndex + index, undefined,
563 byte ByteArray::get(int index) const {
564 DCHECK_GE(index, 0);
565 DCHECK_LT(index, length());
566 return ReadField<byte>(kHeaderSize + index * kCharSize);
569 void ByteArray::set(int index, byte value) {
570 DCHECK_GE(index, 0);
571 DCHECK_LT(index, length());
572 WriteField<byte>(kHeaderSize + index * kCharSize, value);
575 void ByteArray::copy_in(int index, const byte* buffer, int slice_length) {
576 DCHECK_GE(index, 0);
578 DCHECK_LE(slice_length, kMaxInt - index);
579 DCHECK_LE(index + slice_length, length());
580 Address dst_addr = field_address(kHeaderSize + index * kCharSize);
584 void ByteArray::copy_out(int index, byte* buffer, int slice_length) {
585 DCHECK_GE(index, 0);
587 DCHECK_LE(slice_length, kMaxInt - index);
588 DCHECK_LE(index + slice_length, length());
589 Address src_addr = field_address(kHeaderSize + index * kCharSize);
593 int ByteArray::get_int(int index) const {
594 DCHECK_GE(index, 0);
595 DCHECK_LT(index, length() / kIntSize);
596 return ReadField<int>(kHeaderSize + index * kIntSize);
599 void ByteArray::set_int(int index, int value) {
600 DCHECK_GE(index, 0);
601 DCHECK_LT(index, length() / kIntSize);
602 WriteField<int>(kHeaderSize + index * kIntSize, value);
605 uint32_t ByteArray::get_uint32(int index) const {
606 DCHECK_GE(index, 0);
607 DCHECK_LT(index, length() / kUInt32Size);
608 return ReadField<uint32_t>(kHeaderSize + index * kUInt32Size);
611 void ByteArray::set_uint32(int index, uint32_t value) {
612 DCHECK_GE(index, 0);
613 DCHECK_LT(index, length() / kUInt32Size);
614 WriteField<uint32_t>(kHeaderSize + index * kUInt32Size, value);
617 uint32_t ByteArray::get_uint32_relaxed(int index) const {
618 DCHECK_GE(index, 0);
619 DCHECK_LT(index, length() / kUInt32Size);
620 return RELAXED_READ_UINT32_FIELD(*this, kHeaderSize + index * kUInt32Size);
623 void ByteArray::set_uint32_relaxed(int index, uint32_t value) {
624 DCHECK_GE(index, 0);
625 DCHECK_LT(index, length() / kUInt32Size);
626 RELAXED_WRITE_UINT32_FIELD(*this, kHeaderSize + index * kUInt32Size, value);
629 uint16_t ByteArray::get_uint16(int index) const {
630 DCHECK_GE(index, 0);
631 DCHECK_LT(index, length() / kUInt16Size);
632 return ReadField<uint16_t>(kHeaderSize + index * kUInt16Size);
635 void ByteArray::set_uint16(int index, uint16_t value) {
636 DCHECK_GE(index, 0);
637 DCHECK_LT(index, length() / kUInt16Size);
638 WriteField<uint16_t>(kHeaderSize + index * kUInt16Size, value);
688 Object TemplateList::get(int index) const {
689 return FixedArray::cast(*this).get(kFirstElementIndex + index);
692 Object TemplateList::get(PtrComprCageBase cage_base, int index) const {
693 return FixedArray::cast(*this).get(cage_base, kFirstElementIndex + index);
696 void TemplateList::set(int index, Object value) {
697 FixedArray::cast(*this).set(kFirstElementIndex + index, value);