Commit 9bdae1a1 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Use atomic length accessors in body descriptors.

BUG=chromium:694255

Change-Id: I87bfe8eee853ece1260ffc34b61213720ef3e5fa
Reviewed-on: https://chromium-review.googlesource.com/531008
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45895}
parent 35391e43
......@@ -284,7 +284,7 @@ class ByteArray::BodyDescriptor final : public BodyDescriptorBase {
static inline void IterateBody(HeapObject* obj, int object_size) {}
static inline int SizeOf(Map* map, HeapObject* obj) {
return reinterpret_cast<ByteArray*>(obj)->ByteArraySize();
return ByteArray::SizeFor(ByteArray::cast(obj)->synchronized_length());
}
};
......@@ -312,7 +312,8 @@ class BytecodeArray::BodyDescriptor final : public BodyDescriptorBase {
}
static inline int SizeOf(Map* map, HeapObject* obj) {
return reinterpret_cast<BytecodeArray*>(obj)->BytecodeArraySize();
return BytecodeArray::SizeFor(
BytecodeArray::cast(obj)->synchronized_length());
}
};
......@@ -329,7 +330,7 @@ class FixedDoubleArray::BodyDescriptor final : public BodyDescriptorBase {
static inline int SizeOf(Map* map, HeapObject* obj) {
return FixedDoubleArray::SizeFor(
reinterpret_cast<FixedDoubleArray*>(obj)->length());
FixedDoubleArray::cast(obj)->synchronized_length());
}
};
......@@ -352,7 +353,7 @@ class FixedTypedArrayBase::BodyDescriptor final : public BodyDescriptorBase {
}
static inline int SizeOf(Map* map, HeapObject* object) {
return reinterpret_cast<FixedTypedArrayBase*>(object)->size();
return FixedTypedArrayBase::cast(object)->size();
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment