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

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

Issue 9050001: Ensure newly allocated empty Arrays are transitioned to FAST_ELEMENT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix existing and add new tests Created 8 years, 11 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
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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 1616
1617 void FixedArray::set(int index, Object* value) { 1617 void FixedArray::set(int index, Object* value) {
1618 ASSERT(map() != HEAP->fixed_cow_array_map()); 1618 ASSERT(map() != HEAP->fixed_cow_array_map());
1619 ASSERT(index >= 0 && index < this->length()); 1619 ASSERT(index >= 0 && index < this->length());
1620 int offset = kHeaderSize + index * kPointerSize; 1620 int offset = kHeaderSize + index * kPointerSize;
1621 WRITE_FIELD(this, offset, value); 1621 WRITE_FIELD(this, offset, value);
1622 WRITE_BARRIER(GetHeap(), this, offset, value); 1622 WRITE_BARRIER(GetHeap(), this, offset, value);
1623 } 1623 }
1624 1624
1625 1625
1626 bool FixedArray::is_the_hole(int index) {
1627 return get(index)->IsTheHole();
1628 }
1629
1630
1626 inline bool FixedDoubleArray::is_the_hole_nan(double value) { 1631 inline bool FixedDoubleArray::is_the_hole_nan(double value) {
1627 return BitCast<uint64_t, double>(value) == kHoleNanInt64; 1632 return BitCast<uint64_t, double>(value) == kHoleNanInt64;
1628 } 1633 }
1629 1634
1630 1635
1631 inline double FixedDoubleArray::hole_nan_as_double() { 1636 inline double FixedDoubleArray::hole_nan_as_double() {
1632 return BitCast<double, uint64_t>(kHoleNanInt64); 1637 return BitCast<double, uint64_t>(kHoleNanInt64);
1633 } 1638 }
1634 1639
1635 1640
(...skipping 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after
4766 #undef WRITE_INT_FIELD 4771 #undef WRITE_INT_FIELD
4767 #undef READ_SHORT_FIELD 4772 #undef READ_SHORT_FIELD
4768 #undef WRITE_SHORT_FIELD 4773 #undef WRITE_SHORT_FIELD
4769 #undef READ_BYTE_FIELD 4774 #undef READ_BYTE_FIELD
4770 #undef WRITE_BYTE_FIELD 4775 #undef WRITE_BYTE_FIELD
4771 4776
4772 4777
4773 } } // namespace v8::internal 4778 } } // namespace v8::internal
4774 4779
4775 #endif // V8_OBJECTS_INL_H_ 4780 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698