Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 3d82bf8205a895693d45fc1d1a27e3118c8959ec..a66f0b14325a4a18b9fb67ba58b941d386f3885c 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,28 @@ 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(1 + frame_ix * kElementsPerFrame + k##name##Offset); \ |
+ return type::cast(obj); \ |
+ } \ |
+ \ |
+ void FrameArray::Set##name(int frame_ix, type* value) { \ |
+ set(1 + frame_ix * kElementsPerFrame + k##name##Offset, value); \ |
+ } |
+FRAME_ARRAY_FIELD_LIST(DEFINE_FRAME_ARRAY_ACCESSORS) |
+#undef DEFINE_FRAME_ARRAY_ACCESSORS |
+ |
+bool FrameArray::IsWasmFrame(int frame_ix) const { |
+ Object* obj = |
+ get(1 + frame_ix * kElementsPerFrame + kWasmFunctionIndexOffset); |
+ return obj->IsSmi(); |
+} |
+ |
+int FrameArray::FrameCount() const { |
+ DCHECK_EQ(1, length() % kElementsPerFrame); |
+ return (length() - 1) / kElementsPerFrame; |
+} |
bool DescriptorArray::IsEmpty() { |
DCHECK(length() >= kFirstIndex || |
@@ -3223,6 +3247,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) |