OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2826 | 2826 |
2827 int DescriptorArray::number_of_descriptors() { | 2827 int DescriptorArray::number_of_descriptors() { |
2828 DCHECK(length() >= kFirstIndex || IsEmpty()); | 2828 DCHECK(length() >= kFirstIndex || IsEmpty()); |
2829 int len = length(); | 2829 int len = length(); |
2830 return len == 0 ? 0 : Smi::cast(get(kDescriptorLengthIndex))->value(); | 2830 return len == 0 ? 0 : Smi::cast(get(kDescriptorLengthIndex))->value(); |
2831 } | 2831 } |
2832 | 2832 |
2833 | 2833 |
2834 int DescriptorArray::number_of_descriptors_storage() { | 2834 int DescriptorArray::number_of_descriptors_storage() { |
2835 int len = length(); | 2835 int len = length(); |
2836 return len == 0 ? 0 : (len - kFirstIndex) / kDescriptorSize; | 2836 return len == 0 ? 0 : (len - kFirstIndex) / kEntrySize; |
2837 } | 2837 } |
2838 | 2838 |
2839 | 2839 |
2840 int DescriptorArray::NumberOfSlackDescriptors() { | 2840 int DescriptorArray::NumberOfSlackDescriptors() { |
2841 return number_of_descriptors_storage() - number_of_descriptors(); | 2841 return number_of_descriptors_storage() - number_of_descriptors(); |
2842 } | 2842 } |
2843 | 2843 |
2844 | 2844 |
2845 void DescriptorArray::SetNumberOfDescriptors(int number_of_descriptors) { | 2845 void DescriptorArray::SetNumberOfDescriptors(int number_of_descriptors) { |
2846 WRITE_FIELD( | 2846 WRITE_FIELD( |
(...skipping 5548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8395 #undef WRITE_INT64_FIELD | 8395 #undef WRITE_INT64_FIELD |
8396 #undef READ_BYTE_FIELD | 8396 #undef READ_BYTE_FIELD |
8397 #undef WRITE_BYTE_FIELD | 8397 #undef WRITE_BYTE_FIELD |
8398 #undef NOBARRIER_READ_BYTE_FIELD | 8398 #undef NOBARRIER_READ_BYTE_FIELD |
8399 #undef NOBARRIER_WRITE_BYTE_FIELD | 8399 #undef NOBARRIER_WRITE_BYTE_FIELD |
8400 | 8400 |
8401 } // namespace internal | 8401 } // namespace internal |
8402 } // namespace v8 | 8402 } // namespace v8 |
8403 | 8403 |
8404 #endif // V8_OBJECTS_INL_H_ | 8404 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |