diff --git a/src/heap.cc b/src/heap.cc index 69529ad6de..8e64f9e39c 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -4159,8 +4159,6 @@ MaybeObject* Heap::AllocateGlobalObject(JSFunction* constructor) { MaybeObject* maybe_map = map->CopyDropDescriptors(); if (!maybe_map->To(&new_map)) return maybe_map; - ASSERT(new_map->LastAdded() == Map::kNoneAdded); - // Set up the global object as a normalized object. global->set_map(new_map); global->set_properties(dictionary); diff --git a/src/objects-debug.cc b/src/objects-debug.cc index 3047326e2a..311cab6d8b 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -302,6 +302,12 @@ void Map::MapVerify() { instance_size() < HEAP->Capacity())); VerifyHeapPointer(prototype()); VerifyHeapPointer(instance_descriptors()); + if (instance_descriptors()->number_of_descriptors() == 0) { + ASSERT(LastAdded() == kNoneAdded); + } else { + ASSERT(instance_descriptors()->GetDetails(LastAdded()).index() == + instance_descriptors()->number_of_descriptors()); + } SLOW_ASSERT(instance_descriptors()->IsSortedNoDuplicates()); if (HasTransitionArray()) { SLOW_ASSERT(transitions()->IsSortedNoDuplicates()); diff --git a/src/objects.cc b/src/objects.cc index 57f4165143..5b442ed06c 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -4872,7 +4872,7 @@ MaybeObject* Map::CopyReplaceDescriptors(DescriptorArray* descriptors, if (!maybe_result->To(&result)) return maybe_result; if (last_added == kNoneAdded) { - ASSERT(descriptors->IsEmpty()); + ASSERT(descriptors->number_of_descriptors() == 0); } else { ASSERT(descriptors->GetDetails(last_added).index() == descriptors->number_of_descriptors());