summaryrefslogtreecommitdiff
path: root/deps/v8/src/layout-descriptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/layout-descriptor.h')
-rw-r--r--deps/v8/src/layout-descriptor.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/deps/v8/src/layout-descriptor.h b/deps/v8/src/layout-descriptor.h
index 8f2942c0eb..0a14f53198 100644
--- a/deps/v8/src/layout-descriptor.h
+++ b/deps/v8/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);