Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index a5b2b352d79174ac87f08b4f6bc2d6e5f349f3a9..d4a068202fa578bed64ebbe434aca5b231e3dce9 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -719,6 +719,9 @@ bool Object::IsDescriptorArray() const { |
| } |
| +bool Object::IsArrayList() const { return IsFixedArray(); } |
| + |
| + |
| bool Object::IsLayoutDescriptor() const { |
| return IsSmi() || IsFixedTypedArrayBase(); |
| } |
| @@ -2401,6 +2404,39 @@ void WeakFixedArray::set_last_used_index(int index) { |
| } |
|
Hannes Payer (out of office)
2015/03/05 21:12:28
Should we DCHECK for wrong input values? Negative
ulan
2015/03/06 10:16:34
Fixed array getters and setters check the index.
|
| +int ArrayList::Length() { |
| + if (FixedArray::cast(this)->length() == 0) return 0; |
| + return Smi::cast(FixedArray::cast(this)->get(kLengthIndex))->value(); |
| +} |
| + |
| + |
| +void ArrayList::SetLength(int length) { |
| + return FixedArray::cast(this)->set(kLengthIndex, Smi::FromInt(length)); |
| +} |
| + |
| + |
| +Object* ArrayList::Get(int index) { |
| + return FixedArray::cast(this)->get(kFirstIndex + index); |
| +} |
| + |
| + |
| +Object** ArrayList::Slot(int index) { |
| + return data_start() + kFirstIndex + index; |
| +} |
| + |
| + |
| +void ArrayList::Set(int index, Object* obj) { |
| + FixedArray::cast(this)->set(kFirstIndex + index, obj); |
| +} |
| + |
| + |
| +void ArrayList::Clear(int index, Object* undefined) { |
| + DCHECK(undefined->IsUndefined()); |
| + FixedArray::cast(this) |
| + ->set(kFirstIndex + index, undefined, SKIP_WRITE_BARRIER); |
| +} |
| + |
| + |
| void ConstantPoolArray::NumberOfEntries::increment(Type type) { |
| DCHECK(type < NUMBER_OF_TYPES); |
| element_counts_[type]++; |
| @@ -3299,6 +3335,7 @@ void SeededNumberDictionary::set_requires_slow_elements() { |
| CAST_ACCESSOR(AccessorInfo) |
| +CAST_ACCESSOR(ArrayList) |
| CAST_ACCESSOR(ByteArray) |
| CAST_ACCESSOR(Cell) |
| CAST_ACCESSOR(Code) |