Commit 48bccaec authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Use atomic length accessors in HeapObject::SizeFromMap

BUG=chromium:694255

Change-Id: I5dc1efff984c4e358313960fc4c1598e3a3ff313
Reviewed-on: https://chromium-review.googlesource.com/528105Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45856}
parent 066ad187
......@@ -3399,10 +3399,12 @@ int HeapObject::SizeFromMap(Map* map) {
reinterpret_cast<SeqOneByteString*>(this)->synchronized_length());
}
if (instance_type == BYTE_ARRAY_TYPE) {
return reinterpret_cast<ByteArray*>(this)->ByteArraySize();
return ByteArray::SizeFor(
reinterpret_cast<ByteArray*>(this)->synchronized_length());
}
if (instance_type == BYTECODE_ARRAY_TYPE) {
return reinterpret_cast<BytecodeArray*>(this)->BytecodeArraySize();
return BytecodeArray::SizeFor(
reinterpret_cast<BytecodeArray*>(this)->synchronized_length());
}
if (instance_type == FREE_SPACE_TYPE) {
return reinterpret_cast<FreeSpace*>(this)->relaxed_read_size();
......@@ -3416,7 +3418,7 @@ int HeapObject::SizeFromMap(Map* map) {
}
if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
return FixedDoubleArray::SizeFor(
reinterpret_cast<FixedDoubleArray*>(this)->length());
reinterpret_cast<FixedDoubleArray*>(this)->synchronized_length());
}
if (instance_type >= FIRST_FIXED_TYPED_ARRAY_TYPE &&
instance_type <= LAST_FIXED_TYPED_ARRAY_TYPE) {
......
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