Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 3b0e96f1ef93793398b98eb7a5daa50ca1c156a6..588b0f63a8d230cab6dcdee3ea699b65c817b3e2 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1749,9 +1749,15 @@ bool FixedDoubleArray::is_the_hole(int index) { |
void FixedDoubleArray::Initialize(FixedDoubleArray* from) { |
int old_length = from->length(); |
ASSERT(old_length < length()); |
- OS::MemCopy(FIELD_ADDR(this, kHeaderSize), |
- FIELD_ADDR(from, kHeaderSize), |
- old_length * kDoubleSize); |
+ if (old_length * kDoubleSize >= OS::kMinComplexMemCopy) { |
+ OS::MemCopy(FIELD_ADDR(this, kHeaderSize), |
+ FIELD_ADDR(from, kHeaderSize), |
+ old_length * kDoubleSize); |
+ } else { |
+ for (int i = 0; i < old_length; ++i) { |
+ set(i, from->get_scalar(i)); |
+ } |
+ } |
int offset = kHeaderSize + old_length * kDoubleSize; |
for (int current = from->length(); current < length(); ++current) { |
WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); |