OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, heap->null_value()); | 1867 WRITE_FIELD(this, kHeaderSize + index * kPointerSize, heap->null_value()); |
1868 } | 1868 } |
1869 | 1869 |
1870 | 1870 |
1871 Object** FixedArray::data_start() { | 1871 Object** FixedArray::data_start() { |
1872 return HeapObject::RawField(this, kHeaderSize); | 1872 return HeapObject::RawField(this, kHeaderSize); |
1873 } | 1873 } |
1874 | 1874 |
1875 | 1875 |
1876 bool DescriptorArray::IsEmpty() { | 1876 bool DescriptorArray::IsEmpty() { |
1877 ASSERT(this->IsSmi() || | 1877 ASSERT(length() >= kFirstIndex || |
1878 this->MayContainTransitions() || | |
1879 this == HEAP->empty_descriptor_array()); | 1878 this == HEAP->empty_descriptor_array()); |
1880 return this->IsSmi() || length() < kFirstIndex; | 1879 return length() < kFirstIndex; |
1881 } | 1880 } |
1882 | 1881 |
1883 | 1882 |
1884 bool DescriptorArray::MayContainTransitions() { | 1883 bool DescriptorArray::MayContainTransitions() { |
1885 return length() >= kTransitionsIndex; | 1884 return !IsEmpty(); |
1886 } | 1885 } |
1887 | 1886 |
1888 | 1887 |
1889 int DescriptorArray::bit_field3_storage() { | 1888 int DescriptorArray::bit_field3_storage() { |
1890 Object* storage = READ_FIELD(this, kBitField3StorageOffset); | 1889 Object* storage = READ_FIELD(this, kBitField3StorageOffset); |
1891 return Smi::cast(storage)->value(); | 1890 return Smi::cast(storage)->value(); |
1892 } | 1891 } |
1893 | 1892 |
1894 void DescriptorArray::set_bit_field3_storage(int value) { | 1893 void DescriptorArray::set_bit_field3_storage(int value) { |
1895 ASSERT(this->MayContainTransitions()); | 1894 ASSERT(this->MayContainTransitions()); |
(...skipping 3286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5182 #undef WRITE_UINT32_FIELD | 5181 #undef WRITE_UINT32_FIELD |
5183 #undef READ_SHORT_FIELD | 5182 #undef READ_SHORT_FIELD |
5184 #undef WRITE_SHORT_FIELD | 5183 #undef WRITE_SHORT_FIELD |
5185 #undef READ_BYTE_FIELD | 5184 #undef READ_BYTE_FIELD |
5186 #undef WRITE_BYTE_FIELD | 5185 #undef WRITE_BYTE_FIELD |
5187 | 5186 |
5188 | 5187 |
5189 } } // namespace v8::internal | 5188 } } // namespace v8::internal |
5190 | 5189 |
5191 #endif // V8_OBJECTS_INL_H_ | 5190 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |