Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/objects-inl.h

Issue 8281001: Adding missing hole check to FixedDoubleArray::Initialize (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698