From a8443629377531c28151b10d1c9f3b0c6a5b0df9 Mon Sep 17 00:00:00 2001 From: "hpayer@chromium.org" Date: Fri, 13 Sep 2013 11:47:54 +0000 Subject: [PATCH] Fix heap verifier for partially constructed arrays when allocation folding is off. BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/23934008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects-debug.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/objects-debug.cc b/src/objects-debug.cc index 3716df1..acb00da 100644 --- a/src/objects-debug.cc +++ b/src/objects-debug.cc @@ -330,10 +330,11 @@ void JSObject::JSObjectVerify() { } } - // TODO(hpayer): deal gracefully with partially constructed JSObjects, when - // allocation folding is turned off. - if (reinterpret_cast(elements()) != - GetHeap()->one_pointer_filler_map()) { + // If a GC was caused while constructing this object, the elements + // pointer may point to a one pointer filler map. + if ((FLAG_use_gvn && FLAG_use_allocation_folding) || + (reinterpret_cast(elements()) != + GetHeap()->one_pointer_filler_map())) { CHECK_EQ((map()->has_fast_smi_or_object_elements() || (elements() == GetHeap()->empty_fixed_array())), (elements()->map() == GetHeap()->fixed_array_map() || @@ -683,10 +684,11 @@ void Code::VerifyEmbeddedMapsDependency() { void JSArray::JSArrayVerify() { JSObjectVerify(); CHECK(length()->IsNumber() || length()->IsUndefined()); - // TODO(hpayer): deal gracefully with partially constructed JSObjects, when - // allocation folding is turned off. - if (reinterpret_cast(elements()) != - GetHeap()->one_pointer_filler_map()) { + // If a GC was caused while constructing this array, the elements + // pointer may point to a one pointer filler map. + if ((FLAG_use_gvn && FLAG_use_allocation_folding) || + (reinterpret_cast(elements()) != + GetHeap()->one_pointer_filler_map())) { CHECK(elements()->IsUndefined() || elements()->IsFixedArray() || elements()->IsFixedDoubleArray()); -- 2.7.4