Commit a8443629 authored by hpayer@chromium.org's avatar hpayer@chromium.org

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
parent 3824d596
...@@ -330,10 +330,11 @@ void JSObject::JSObjectVerify() { ...@@ -330,10 +330,11 @@ void JSObject::JSObjectVerify() {
} }
} }
// TODO(hpayer): deal gracefully with partially constructed JSObjects, when // If a GC was caused while constructing this object, the elements
// allocation folding is turned off. // pointer may point to a one pointer filler map.
if (reinterpret_cast<Map*>(elements()) != if ((FLAG_use_gvn && FLAG_use_allocation_folding) ||
GetHeap()->one_pointer_filler_map()) { (reinterpret_cast<Map*>(elements()) !=
GetHeap()->one_pointer_filler_map())) {
CHECK_EQ((map()->has_fast_smi_or_object_elements() || CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
(elements() == GetHeap()->empty_fixed_array())), (elements() == GetHeap()->empty_fixed_array())),
(elements()->map() == GetHeap()->fixed_array_map() || (elements()->map() == GetHeap()->fixed_array_map() ||
...@@ -683,10 +684,11 @@ void Code::VerifyEmbeddedMapsDependency() { ...@@ -683,10 +684,11 @@ void Code::VerifyEmbeddedMapsDependency() {
void JSArray::JSArrayVerify() { void JSArray::JSArrayVerify() {
JSObjectVerify(); JSObjectVerify();
CHECK(length()->IsNumber() || length()->IsUndefined()); CHECK(length()->IsNumber() || length()->IsUndefined());
// TODO(hpayer): deal gracefully with partially constructed JSObjects, when // If a GC was caused while constructing this array, the elements
// allocation folding is turned off. // pointer may point to a one pointer filler map.
if (reinterpret_cast<Map*>(elements()) != if ((FLAG_use_gvn && FLAG_use_allocation_folding) ||
GetHeap()->one_pointer_filler_map()) { (reinterpret_cast<Map*>(elements()) !=
GetHeap()->one_pointer_filler_map())) {
CHECK(elements()->IsUndefined() || CHECK(elements()->IsUndefined() ||
elements()->IsFixedArray() || elements()->IsFixedArray() ||
elements()->IsFixedDoubleArray()); elements()->IsFixedDoubleArray());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment