Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: src/layout-descriptor.h

Issue 726713003: LayoutDescriptorHelper is now able to calculate the length of contiguous regions of tagged/non-tagg… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/store-buffer.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/layout-descriptor.h
diff --git a/src/layout-descriptor.h b/src/layout-descriptor.h
index cc149f18a431b48a004d0fdf7827e5d07fa2d811..cc2666a4873919252e01ec395fe4f906a0c5a944 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 the given field is tagged or false otherwise and writes
+ // the 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 fields starting at |offset_in_bytes| are tagged or false
+ // otherwise 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_;
« no previous file with comments | « src/heap/store-buffer.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698