Chromium Code Reviews| Index: src/layout-descriptor.h |
| diff --git a/src/layout-descriptor.h b/src/layout-descriptor.h |
| index cc149f18a431b48a004d0fdf7827e5d07fa2d811..64d5684272c6133a510df52b520c7718cb6a4fe6 100644 |
| --- a/src/layout-descriptor.h |
| +++ b/src/layout-descriptor.h |
| @@ -26,6 +26,14 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
| public: |
| V8_INLINE bool IsTagged(int field_index); |
| + // Queries the contiguous region of fields that are either tagged or not. |
| + // Returns true if given field is tagged or false otherwise and writes the |
|
Hannes Payer (out of office)
2014/11/25 17:20:13
... the given fields are ...
Igor Sheludko
2014/12/10 18:22:04
Done.
|
| + // length of the contiguous region to |out_sequence_length|. |
| + // If the sequence is longer than |max_sequence_length| then |
| + // |out_sequence_length| is set to |max_sequence_length|. |
| + bool IsTagged(int field_index, int max_sequence_length, |
| + int* out_sequence_length); |
| + |
| // Returns true if this is a layout of the object having only tagged fields. |
| V8_INLINE bool IsFastPointerLayout(); |
| V8_INLINE static bool IsFastPointerLayout(Object* layout_descriptor); |
| @@ -76,10 +84,8 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
| // Capacity of layout descriptors in bits. |
| V8_INLINE int capacity(); |
| - V8_INLINE LayoutDescriptor* SetTaggedForTesting(int field_index, |
| - bool tagged) { |
| - return SetTagged(field_index, tagged); |
| - } |
| + static Handle<LayoutDescriptor> NewForTesting(Isolate* isolate, int length); |
| + LayoutDescriptor* SetTaggedForTesting(int field_index, bool tagged); |
| private: |
| static const int kNumberOfBits = 32; |
| @@ -96,7 +102,7 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
| // Returns false if requested field_index is out of bounds. |
| V8_INLINE bool GetIndexes(int field_index, int* layout_word_index, |
| - uint32_t* layout_mask); |
| + int* layout_bit_index); |
| V8_INLINE MUST_USE_RESULT LayoutDescriptor* SetRawData(int field_index) { |
| return SetTagged(field_index, false); |
| @@ -107,15 +113,23 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
| }; |
| -// InobjectPropertiesHelper is a helper class for querying layout descriptor |
| +// LayoutDescriptorHelper is a helper class for querying layout descriptor |
| // about whether the field at given offset is tagged or not. |
| -class InobjectPropertiesHelper { |
| +class LayoutDescriptorHelper { |
| public: |
| - inline explicit InobjectPropertiesHelper(Map* map); |
| + inline explicit LayoutDescriptorHelper(Map* map); |
| bool all_fields_tagged() { return all_fields_tagged_; } |
| inline bool IsTagged(int offset_in_bytes); |
| + // Queries the contiguous region of fields that are either tagged or not. |
| + // Returns true if field at |offset_in_bytes| is tagged or false otherwise |
|
Hannes Payer (out of office)
2014/11/25 17:20:13
... fields starting at |offset_in_bytes| are tagge
Igor Sheludko
2014/12/10 18:22:04
Done.
|
| + // and writes the offset of the end of the contiguous region to |
| + // |out_end_of_contiguous_region_offset|. The |end_offset| value is the |
| + // upper bound for |out_end_of_contiguous_region_offset|. |
| + bool IsTagged(int offset_in_bytes, int end_offset, |
| + int* out_end_of_contiguous_region_offset); |
| + |
| private: |
| bool all_fields_tagged_; |
| int header_size_; |