Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index be4af06116e5aadefc8b4b467672a9b5d1446433..49af163f11cab10a52525dd4a3c427a5ec17f35d 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -292,6 +292,9 @@ MaybeObject* Object::AllocateNewStorageFor(Heap* heap, |
PretenureFlag tenure) { |
if (!FLAG_track_double_fields) return this; |
if (!representation.IsDouble()) return this; |
+ if (IsUninitialized()) { |
+ return heap->AllocateHeapNumber(0, tenure); |
+ } |
return heap->AllocateHeapNumber(Number(), tenure); |
} |
@@ -530,6 +533,11 @@ bool MaybeObject::IsTheHole() { |
} |
+bool MaybeObject::IsUninitialized() { |
+ return !IsFailure() && ToObjectUnchecked()->IsUninitialized(); |
+} |
+ |
+ |
Failure* Failure::cast(MaybeObject* obj) { |
ASSERT(HAS_FAILURE_TAG(obj)); |
return reinterpret_cast<Failure*>(obj); |
@@ -845,6 +853,11 @@ bool Object::IsTheHole() { |
} |
+bool Object::IsUninitialized() { |
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kUninitialized; |
+} |
+ |
+ |
bool Object::IsTrue() { |
return IsOddball() && Oddball::cast(this)->kind() == Oddball::kTrue; |
} |
@@ -1541,7 +1554,7 @@ MaybeObject* JSObject::MigrateInstance() { |
// Converting any field to the most specific type will cause the |
// GeneralizeFieldRepresentation algorithm to create the most general existing |
// transition that matches the object. This achieves what is needed. |
- return GeneralizeFieldRepresentation(0, Representation::Smi()); |
+ return GeneralizeFieldRepresentation(0, Representation::None()); |
} |
@@ -2366,7 +2379,6 @@ void DescriptorArray::Set(int descriptor_number, |
// Range check. |
ASSERT(descriptor_number < number_of_descriptors()); |
- ASSERT(!desc->GetDetails().representation().IsNone()); |
NoIncrementalWriteBarrierSet(this, |
ToKeyIndex(descriptor_number), |
desc->GetKey()); |
@@ -2382,7 +2394,6 @@ void DescriptorArray::Set(int descriptor_number, |
void DescriptorArray::Set(int descriptor_number, Descriptor* desc) { |
// Range check. |
ASSERT(descriptor_number < number_of_descriptors()); |
- ASSERT(!desc->GetDetails().representation().IsNone()); |
set(ToKeyIndex(descriptor_number), desc->GetKey()); |
set(ToValueIndex(descriptor_number), desc->GetValue()); |
@@ -3617,6 +3628,9 @@ bool Map::CanBeDeprecated() { |
int descriptor = LastAdded(); |
for (int i = 0; i <= descriptor; i++) { |
PropertyDetails details = instance_descriptors()->GetDetails(i); |
+ if (FLAG_track_fields && details.representation().IsNone()) { |
+ return true; |
+ } |
if (FLAG_track_fields && details.representation().IsSmi()) { |
return true; |
} |