Cleanup FooSpace::VerifyObject and ElementsAccessor::Validate.

R=danno@chromium.org

Review URL: https://codereview.chromium.org/23273004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2013-08-21 13:39:20 +00:00
parent df48b2f831
commit 34417e1d0f
2 changed files with 4 additions and 15 deletions

View File

@ -581,14 +581,8 @@ class ElementsAccessorBase : public ElementsAccessor {
// When objects are first allocated, its elements are Failures. // When objects are first allocated, its elements are Failures.
if (fixed_array_base->IsFailure()) return; if (fixed_array_base->IsFailure()) return;
if (!fixed_array_base->IsHeapObject()) return; if (!fixed_array_base->IsHeapObject()) return;
Map* map = fixed_array_base->map();
// Arrays that have been shifted in place can't be verified. // Arrays that have been shifted in place can't be verified.
Heap* heap = holder->GetHeap(); if (fixed_array_base->IsFiller()) return;
if (map == heap->one_pointer_filler_map() ||
map == heap->two_pointer_filler_map() ||
map == heap->free_space_map()) {
return;
}
int length = 0; int length = 0;
if (holder->IsJSArray()) { if (holder->IsJSArray()) {
Object* length_obj = JSArray::cast(holder)->length(); Object* length_obj = JSArray::cast(holder)->length();

View File

@ -2852,8 +2852,7 @@ void FixedSpace::PrepareForMarkCompact() {
// the VerifyObject definition behind VERIFY_HEAP. // the VerifyObject definition behind VERIFY_HEAP.
void MapSpace::VerifyObject(HeapObject* object) { void MapSpace::VerifyObject(HeapObject* object) {
// The object should be a map or a free-list node. CHECK(object->IsMap());
CHECK(object->IsMap() || object->IsFreeSpace());
} }
@ -2864,16 +2863,12 @@ void MapSpace::VerifyObject(HeapObject* object) {
// the VerifyObject definition behind VERIFY_HEAP. // the VerifyObject definition behind VERIFY_HEAP.
void CellSpace::VerifyObject(HeapObject* object) { void CellSpace::VerifyObject(HeapObject* object) {
// The object should be a global object property cell or a free-list node. CHECK(object->IsCell());
CHECK(object->IsCell() ||
object->map() == heap()->two_pointer_filler_map());
} }
void PropertyCellSpace::VerifyObject(HeapObject* object) { void PropertyCellSpace::VerifyObject(HeapObject* object) {
// The object should be a global object property cell or a free-list node. CHECK(object->IsPropertyCell());
CHECK(object->IsPropertyCell() ||
object->map() == heap()->two_pointer_filler_map());
} }