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 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 } | 2906 } |
2907 | 2907 |
2908 | 2908 |
2909 bool SeededNumberDictionary::requires_slow_elements() { | 2909 bool SeededNumberDictionary::requires_slow_elements() { |
2910 Object* max_index_object = get(kMaxNumberKeyIndex); | 2910 Object* max_index_object = get(kMaxNumberKeyIndex); |
2911 if (!max_index_object->IsSmi()) return false; | 2911 if (!max_index_object->IsSmi()) return false; |
2912 return 0 != | 2912 return 0 != |
2913 (Smi::cast(max_index_object)->value() & kRequiresSlowElementsMask); | 2913 (Smi::cast(max_index_object)->value() & kRequiresSlowElementsMask); |
2914 } | 2914 } |
2915 | 2915 |
| 2916 |
2916 uint32_t SeededNumberDictionary::max_number_key() { | 2917 uint32_t SeededNumberDictionary::max_number_key() { |
2917 DCHECK(!requires_slow_elements()); | 2918 DCHECK(!requires_slow_elements()); |
2918 Object* max_index_object = get(kMaxNumberKeyIndex); | 2919 Object* max_index_object = get(kMaxNumberKeyIndex); |
2919 if (!max_index_object->IsSmi()) return 0; | 2920 if (!max_index_object->IsSmi()) return 0; |
2920 uint32_t value = static_cast<uint32_t>(Smi::cast(max_index_object)->value()); | 2921 uint32_t value = static_cast<uint32_t>(Smi::cast(max_index_object)->value()); |
2921 return value >> kRequiresSlowElementsTagSize; | 2922 return value >> kRequiresSlowElementsTagSize; |
2922 } | 2923 } |
2923 | 2924 |
| 2925 |
2924 void SeededNumberDictionary::set_requires_slow_elements() { | 2926 void SeededNumberDictionary::set_requires_slow_elements() { |
2925 set(kMaxNumberKeyIndex, Smi::FromInt(kRequiresSlowElementsMask)); | 2927 set(kMaxNumberKeyIndex, Smi::FromInt(kRequiresSlowElementsMask)); |
2926 } | 2928 } |
2927 | 2929 |
2928 | 2930 |
2929 // ------------------------------------ | 2931 // ------------------------------------ |
2930 // Cast operations | 2932 // Cast operations |
2931 | 2933 |
2932 | 2934 |
2933 CAST_ACCESSOR(AccessorInfo) | 2935 CAST_ACCESSOR(AccessorInfo) |
(...skipping 4351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7285 #undef READ_SHORT_FIELD | 7287 #undef READ_SHORT_FIELD |
7286 #undef WRITE_SHORT_FIELD | 7288 #undef WRITE_SHORT_FIELD |
7287 #undef READ_BYTE_FIELD | 7289 #undef READ_BYTE_FIELD |
7288 #undef WRITE_BYTE_FIELD | 7290 #undef WRITE_BYTE_FIELD |
7289 #undef NOBARRIER_READ_BYTE_FIELD | 7291 #undef NOBARRIER_READ_BYTE_FIELD |
7290 #undef NOBARRIER_WRITE_BYTE_FIELD | 7292 #undef NOBARRIER_WRITE_BYTE_FIELD |
7291 | 7293 |
7292 } } // namespace v8::internal | 7294 } } // namespace v8::internal |
7293 | 7295 |
7294 #endif // V8_OBJECTS_INL_H_ | 7296 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |