Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 94a122800b17df1047d6f921e5c3ef771ef0e799..00170c8ef7b29ddd1fcbaa853dd6289bca72e300 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -6633,7 +6633,7 @@ Handle<Map> Map::ShareDescriptor(Handle<Map> map, |
Handle<LayoutDescriptor> layout_descriptor = |
FLAG_unbox_double_fields |
- ? LayoutDescriptor::Append(map, descriptor->GetDetails()) |
+ ? LayoutDescriptor::ShareAppend(map, descriptor->GetDetails()) |
: handle(LayoutDescriptor::FastPointerLayout(), map->GetIsolate()); |
{ |
@@ -7150,13 +7150,14 @@ Handle<Map> Map::CopyAddDescriptor(Handle<Map> map, |
return ShareDescriptor(map, descriptors, descriptor); |
} |
- Handle<DescriptorArray> new_descriptors = DescriptorArray::CopyUpTo( |
- descriptors, map->NumberOfOwnDescriptors(), 1); |
+ int nof = map->NumberOfOwnDescriptors(); |
+ Handle<DescriptorArray> new_descriptors = |
+ DescriptorArray::CopyUpTo(descriptors, nof, 1); |
new_descriptors->Append(descriptor); |
Handle<LayoutDescriptor> new_layout_descriptor = |
FLAG_unbox_double_fields |
- ? LayoutDescriptor::Append(map, descriptor->GetDetails()) |
+ ? LayoutDescriptor::New(map, new_descriptors, nof + 1) |
: handle(LayoutDescriptor::FastPointerLayout(), map->GetIsolate()); |
return CopyReplaceDescriptors(map, new_descriptors, new_layout_descriptor, |