Index: src/layout-descriptor.h |
diff --git a/src/layout-descriptor.h b/src/layout-descriptor.h |
index 8f2942c0eb52319b2ca1b61fe1f6fad86a840912..0a14f53198f5c4fd48dd78b28d4b33d5d8792526 100644 |
--- a/src/layout-descriptor.h |
+++ b/src/layout-descriptor.h |
@@ -70,7 +70,14 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
V8_INLINE static LayoutDescriptor* FastPointerLayout(); |
// Check that this layout descriptor corresponds to given map. |
- bool IsConsistentWithMap(Map* map); |
+ bool IsConsistentWithMap(Map* map, bool check_tail = false); |
+ |
+ // Trims this layout descriptor to given number of descriptors. This happens |
+ // only when corresponding descriptors array is trimmed. |
+ // The layout descriptor could be trimmed if it was slow or it could |
+ // become fast. |
+ LayoutDescriptor* Trim(Heap* heap, Map* map, DescriptorArray* descriptors, |
+ int num_descriptors); |
#ifdef OBJECT_PRINT |
// For our gdb macros, we should perhaps change these in the future. |
@@ -94,6 +101,21 @@ class LayoutDescriptor : public FixedTypedArray<Uint32ArrayTraits> { |
V8_INLINE static bool InobjectUnboxedField(int inobject_properties, |
PropertyDetails details); |
+ // Calculates minimal layout descriptor capacity required for given |
+ // |map|, |descriptors| and |num_descriptors|. |
+ V8_INLINE static int CalculateCapacity(Map* map, DescriptorArray* descriptors, |
+ int num_descriptors); |
+ |
+ // Calculates the length of the slow-mode backing store array by given layout |
+ // descriptor length. |
+ V8_INLINE static int GetSlowModeBackingStoreLength(int length); |
+ |
+ // Fills in clean |layout_descriptor| according to given |map|, |descriptors| |
+ // and |num_descriptors|. |
+ V8_INLINE static LayoutDescriptor* Initialize( |
+ LayoutDescriptor* layout_descriptor, Map* map, |
+ DescriptorArray* descriptors, int num_descriptors); |
+ |
static Handle<LayoutDescriptor> EnsureCapacity( |
Isolate* isolate, Handle<LayoutDescriptor> layout_descriptor, |
int new_capacity); |