| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 | 1732 |
| 1733 void FixedDoubleArray::Initialize(FixedDoubleArray* from) { | 1733 void FixedDoubleArray::Initialize(FixedDoubleArray* from) { |
| 1734 int old_length = from->length(); | 1734 int old_length = from->length(); |
| 1735 ASSERT(old_length < length()); | 1735 ASSERT(old_length < length()); |
| 1736 if (old_length * kDoubleSize >= OS::kMinComplexMemCopy) { | 1736 if (old_length * kDoubleSize >= OS::kMinComplexMemCopy) { |
| 1737 OS::MemCopy(FIELD_ADDR(this, kHeaderSize), | 1737 OS::MemCopy(FIELD_ADDR(this, kHeaderSize), |
| 1738 FIELD_ADDR(from, kHeaderSize), | 1738 FIELD_ADDR(from, kHeaderSize), |
| 1739 old_length * kDoubleSize); | 1739 old_length * kDoubleSize); |
| 1740 } else { | 1740 } else { |
| 1741 for (int i = 0; i < old_length; ++i) { | 1741 for (int i = 0; i < old_length; ++i) { |
| 1742 set(i, from->get_scalar(i)); | 1742 if (from->is_the_hole(i)) { |
| 1743 set_the_hole(i); |
| 1744 } else { |
| 1745 set(i, from->get_scalar(i)); |
| 1746 } |
| 1743 } | 1747 } |
| 1744 } | 1748 } |
| 1745 int offset = kHeaderSize + old_length * kDoubleSize; | 1749 int offset = kHeaderSize + old_length * kDoubleSize; |
| 1746 for (int current = from->length(); current < length(); ++current) { | 1750 for (int current = from->length(); current < length(); ++current) { |
| 1747 WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); | 1751 WRITE_DOUBLE_FIELD(this, offset, hole_nan_as_double()); |
| 1748 offset += kDoubleSize; | 1752 offset += kDoubleSize; |
| 1749 } | 1753 } |
| 1750 } | 1754 } |
| 1751 | 1755 |
| 1752 | 1756 |
| (...skipping 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4633 #undef WRITE_INT_FIELD | 4637 #undef WRITE_INT_FIELD |
| 4634 #undef READ_SHORT_FIELD | 4638 #undef READ_SHORT_FIELD |
| 4635 #undef WRITE_SHORT_FIELD | 4639 #undef WRITE_SHORT_FIELD |
| 4636 #undef READ_BYTE_FIELD | 4640 #undef READ_BYTE_FIELD |
| 4637 #undef WRITE_BYTE_FIELD | 4641 #undef WRITE_BYTE_FIELD |
| 4638 | 4642 |
| 4639 | 4643 |
| 4640 } } // namespace v8::internal | 4644 } } // namespace v8::internal |
| 4641 | 4645 |
| 4642 #endif // V8_OBJECTS_INL_H_ | 4646 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |