Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index b02022a7992e5b00cd411e9ee224a198d7ff581e..ca001ccff843eeb041fa51611b5d1cf3e88c309b 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3458,15 +3458,11 @@ |
} |
PropertyDetails details = new_map->GetLastDescriptorDetails(); |
- int target_index = details.field_index() - new_map->GetInObjectProperties(); |
- bool have_space = old_map->unused_property_fields() > 0 || |
- (details.location() == kField && target_index >= 0 && |
- object->properties()->length() > target_index); |
// Either new_map adds an kDescriptor property, or a kField property for |
// which there is still space, and which does not require a mutable double |
// box (an out-of-object double). |
if (details.location() == kDescriptor || |
- (have_space && |
+ (old_map->unused_property_fields() > 0 && |
((FLAG_unbox_double_fields && object->properties()->length() == 0) || |
!details.representation().IsDouble()))) { |
object->synchronized_set_map(*new_map); |
@@ -3475,7 +3471,7 @@ |
// If there is still space in the object, we need to allocate a mutable |
// double box. |
- if (have_space) { |
+ if (old_map->unused_property_fields() > 0) { |
FieldIndex index = |
FieldIndex::ForDescriptor(*new_map, new_map->LastAdded()); |
DCHECK(details.representation().IsDouble()); |
@@ -3502,6 +3498,7 @@ |
} |
DCHECK_EQ(kField, details.location()); |
DCHECK_EQ(kData, details.kind()); |
+ int target_index = details.field_index() - new_map->GetInObjectProperties(); |
DCHECK(target_index >= 0); // Must be a backing store index. |
new_storage->set(target_index, *value); |