Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 3b0e96f1ef93793398b98eb7a5daa50ca1c156a6..02f56ce1ae2aee7bf280284c5cddb17112573e28 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1749,9 +1749,17 @@ 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 { |
+ int offset = kHeaderSize; |
+ for (int i = 0; i < old_length; ++i) { |
+ WRITE_DOUBLE_FIELD(this, offset, READ_DOUBLE_FIELD(from, offset)); |
+ offset += kDoubleSize; |
+ } |
+ } |
int offset = kHeaderSize + old_length * kDoubleSize; |
for (int current = from->length(); current < length(); ++current) { |
WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); |
danno
2011/09/06 13:22:13
just do set(current, from->get(current)) and don't
Jakob Kummerow
2011/09/06 13:31:03
Done.
|