From bcc175ad438393aac6bc2593b373c084edb401d2 Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Thu, 26 Jul 2012 14:55:22 +0000 Subject: [PATCH] Extending map verification to also verify LastAdded/DescriptorArray consistency. Removed ASSERT now subsumed by extended map verification. Review URL: https://chromiumcodereview.appspot.com/10827037 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 2 -- src/objects-debug.cc | 6 ++++++ src/objects.cc | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/heap.cc b/src/heap.cc index 69529ad..8e64f9e 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 3047326..311cab6 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 57f4165..5b442ed 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()); -- 2.7.4