Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 76209c42b5ec1cd198118589b78909cf3329478a..877b21d2eb123aae3b6303575d142a5edc869264 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -3730,6 +3730,7 @@ static void ForFixedTypedArray(ExternalArrayType array_type, int* element_size, |
AllocationResult Heap::AllocateFixedTypedArray(int length, |
ExternalArrayType array_type, |
+ bool initialize, |
PretenureFlag pretenure) { |
int element_size; |
ElementsKind elements_kind; |
@@ -3747,7 +3748,7 @@ AllocationResult Heap::AllocateFixedTypedArray(int length, |
object->set_map(MapForFixedTypedArray(array_type)); |
FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); |
elements->set_length(length); |
- memset(elements->DataPtr(), 0, elements->DataSize()); |
+ if (initialize) memset(elements->DataPtr(), 0, elements->DataSize()); |
return elements; |
} |
@@ -4317,7 +4318,7 @@ AllocationResult Heap::CopyAndTenureFixedCOWArray(FixedArray* src) { |
AllocationResult Heap::AllocateEmptyFixedTypedArray( |
ExternalArrayType array_type) { |
- return AllocateFixedTypedArray(0, array_type, TENURED); |
+ return AllocateFixedTypedArray(0, array_type, false, TENURED); |
} |