| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_LAYOUT_DESCRIPTOR_H_ | 5 #ifndef V8_LAYOUT_DESCRIPTOR_H_ |
| 6 #define V8_LAYOUT_DESCRIPTOR_H_ | 6 #define V8_LAYOUT_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Otherwise the field is considered tagged. If the queried bit lays "outside" | 21 // Otherwise the field is considered tagged. If the queried bit lays "outside" |
| 22 // of the descriptor then the field is also considered tagged. | 22 // of the descriptor then the field is also considered tagged. |
| 23 // Once a layout descriptor is created it is allowed only to append properties | 23 // Once a layout descriptor is created it is allowed only to append properties |
| 24 // to it. | 24 // to it. |
| 25 class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { | 25 class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
| 26 public: | 26 public: |
| 27 V8_INLINE bool IsTagged(int field_index); | 27 V8_INLINE bool IsTagged(int field_index); |
| 28 | 28 |
| 29 // Returns true if this is a layout of the object having only tagged fields. | 29 // Returns true if this is a layout of the object having only tagged fields. |
| 30 V8_INLINE bool IsFastPointerLayout(); | 30 V8_INLINE bool IsFastPointerLayout(); |
| 31 V8_INLINE static bool IsFastPointerLayout(Object* layout_descriptor); |
| 31 | 32 |
| 32 // Returns true if the layout descriptor is in non-Smi form. | 33 // Returns true if the layout descriptor is in non-Smi form. |
| 33 V8_INLINE bool IsSlowLayout(); | 34 V8_INLINE bool IsSlowLayout(); |
| 34 | 35 |
| 35 V8_INLINE static LayoutDescriptor* cast(Object* object); | 36 V8_INLINE static LayoutDescriptor* cast(Object* object); |
| 36 V8_INLINE static const LayoutDescriptor* cast(const Object* object); | 37 V8_INLINE static const LayoutDescriptor* cast(const Object* object); |
| 37 | 38 |
| 38 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object); | 39 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object); |
| 39 | 40 |
| 40 // Builds layout descriptor optimized for given |map| by |num_descriptors| | 41 // Builds layout descriptor optimized for given |map| by |num_descriptors| |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 118 |
| 118 private: | 119 private: |
| 119 bool all_fields_tagged_; | 120 bool all_fields_tagged_; |
| 120 int header_size_; | 121 int header_size_; |
| 121 LayoutDescriptor* layout_descriptor_; | 122 LayoutDescriptor* layout_descriptor_; |
| 122 }; | 123 }; |
| 123 } | 124 } |
| 124 } // namespace v8::internal | 125 } // namespace v8::internal |
| 125 | 126 |
| 126 #endif // V8_LAYOUT_DESCRIPTOR_H_ | 127 #endif // V8_LAYOUT_DESCRIPTOR_H_ |
| OLD | NEW |