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

Unified Diff: src/layout-descriptor.h

Issue 1033273005: Layout descriptor must be trimmed when corresponding descriptors array is trimmed to stay in sync. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forgot to actually trim the array Created 5 years, 9 months 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
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);
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/layout-descriptor.cc » ('j') | src/layout-descriptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698