Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 3d82bf8205a895693d45fc1d1a27e3118c8959ec..2e115f9b8c7d6ce24979c918a59ab1a3ada98d9a 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -709,6 +709,8 @@ bool HeapObject::IsJSCollection() const { return IsJSMap() || IsJSSet(); } |
| bool HeapObject::IsDescriptorArray() const { return IsFixedArray(); } |
| +bool HeapObject::IsFrameArray() const { return IsFixedArray(); } |
| + |
| bool HeapObject::IsArrayList() const { return IsFixedArray(); } |
| bool Object::IsLayoutDescriptor() const { |
| @@ -2610,6 +2612,38 @@ Object** FixedArray::RawFieldOfElementAt(int index) { |
| return HeapObject::RawField(this, OffsetOfElementAt(index)); |
| } |
| +#define DEFINE_FRAME_ARRAY_ACCESSORS(name, type) \ |
| + type* FrameArray::name(int frame_ix) const { \ |
| + Object* obj = \ |
| + get(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset); \ |
| + return type::cast(obj); \ |
| + } \ |
| + \ |
| + void FrameArray::Set##name(int frame_ix, type* value) { \ |
| + set(kFirstIndex + frame_ix * kElementsPerFrame + k##name##Offset, value); \ |
| + } |
| +FRAME_ARRAY_FIELD_LIST(DEFINE_FRAME_ARRAY_ACCESSORS) |
| +#undef DEFINE_FRAME_ARRAY_ACCESSORS |
| + |
| +Smi* FrameArray::SloppyFrameCount() const { |
|
Toon Verwaest
2016/08/23 22:01:47
A little uneven that this returns a Smi* but the s
jgruber
2016/08/24 07:33:02
Done.
|
| + return Smi::cast(get(kSloppyFramesIndex)); |
| +} |
| + |
| +void FrameArray::SetSloppyFrameCount(int count) { |
| + return set(kSloppyFramesIndex, Smi::FromInt(count)); |
| +} |
| + |
| +bool FrameArray::IsWasmFrame(int frame_ix) const { |
| + Object* obj = get(kFirstIndex + frame_ix * kElementsPerFrame + |
| + kWasmFunctionIndexOffset); |
| + return obj->IsSmi(); |
| +} |
| + |
| +int FrameArray::FrameCount() const { |
| + const int frame_count = Smi::cast(get(kFrameCountIndex))->value(); |
| + DCHECK_LE(0, frame_count); |
| + return frame_count; |
| +} |
| bool DescriptorArray::IsEmpty() { |
| DCHECK(length() >= kFirstIndex || |
| @@ -3223,6 +3257,7 @@ CAST_ACCESSOR(FixedDoubleArray) |
| CAST_ACCESSOR(FixedTypedArrayBase) |
| CAST_ACCESSOR(Float32x4) |
| CAST_ACCESSOR(Foreign) |
| +CAST_ACCESSOR(FrameArray) |
| CAST_ACCESSOR(GlobalDictionary) |
| CAST_ACCESSOR(HandlerTable) |
| CAST_ACCESSOR(HeapObject) |