Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: src/objects-debug.cc

Issue 23936007: To diagnose chromium bug 284577, some additional CHECKS. TODOs are (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nit Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 Representation r = descriptors->GetDetails(i).representation(); 321 Representation r = descriptors->GetDetails(i).representation();
322 int field = descriptors->GetFieldIndex(i); 322 int field = descriptors->GetFieldIndex(i);
323 Object* value = RawFastPropertyAt(field); 323 Object* value = RawFastPropertyAt(field);
324 if (r.IsDouble()) ASSERT(value->IsHeapNumber()); 324 if (r.IsDouble()) ASSERT(value->IsHeapNumber());
325 if (value->IsUninitialized()) continue; 325 if (value->IsUninitialized()) continue;
326 if (r.IsSmi()) ASSERT(value->IsSmi()); 326 if (r.IsSmi()) ASSERT(value->IsSmi());
327 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); 327 if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
328 } 328 }
329 } 329 }
330 } 330 }
331 CHECK_EQ((map()->has_fast_smi_or_object_elements() || 331
332 (elements() == GetHeap()->empty_fixed_array())), 332 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when
333 (elements()->map() == GetHeap()->fixed_array_map() || 333 // allocation folding is turned off.
334 elements()->map() == GetHeap()->fixed_cow_array_map())); 334 if (reinterpret_cast<Map*>(elements()) !=
335 CHECK(map()->has_fast_object_elements() == HasFastObjectElements()); 335 GetHeap()->one_pointer_filler_map()) {
336 CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
337 (elements() == GetHeap()->empty_fixed_array())),
338 (elements()->map() == GetHeap()->fixed_array_map() ||
339 elements()->map() == GetHeap()->fixed_cow_array_map()));
340 CHECK(map()->has_fast_object_elements() == HasFastObjectElements());
341 }
336 } 342 }
337 343
338 344
339 void Map::MapVerify() { 345 void Map::MapVerify() {
340 CHECK(!HEAP->InNewSpace(this)); 346 CHECK(!HEAP->InNewSpace(this));
341 CHECK(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); 347 CHECK(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE);
342 CHECK(instance_size() == kVariableSizeSentinel || 348 CHECK(instance_size() == kVariableSizeSentinel ||
343 (kPointerSize <= instance_size() && 349 (kPointerSize <= instance_size() &&
344 instance_size() < HEAP->Capacity())); 350 instance_size() < HEAP->Capacity()));
345 VerifyHeapPointer(prototype()); 351 VerifyHeapPointer(prototype());
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 DependentCode::kWeaklyEmbeddedGroup, this)); 674 DependentCode::kWeaklyEmbeddedGroup, this));
669 } 675 }
670 } 676 }
671 } 677 }
672 } 678 }
673 679
674 680
675 void JSArray::JSArrayVerify() { 681 void JSArray::JSArrayVerify() {
676 JSObjectVerify(); 682 JSObjectVerify();
677 CHECK(length()->IsNumber() || length()->IsUndefined()); 683 CHECK(length()->IsNumber() || length()->IsUndefined());
678 CHECK(elements()->IsUndefined() || 684 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when
679 elements()->IsFixedArray() || 685 // allocation folding is turned off.
680 elements()->IsFixedDoubleArray()); 686 if (reinterpret_cast<Map*>(elements()) !=
687 GetHeap()->one_pointer_filler_map()) {
688 CHECK(elements()->IsUndefined() ||
689 elements()->IsFixedArray() ||
690 elements()->IsFixedDoubleArray());
691 // TODO(mvstanton): to diagnose chromium bug 284577, remove after.
692 AllocationMemento* memento = AllocationMemento::FindForJSObject(this);
693 if (memento != NULL && memento->IsValid()) {
694 memento->AllocationMementoVerify();
695 }
696 }
681 } 697 }
682 698
683 699
684 void JSSet::JSSetVerify() { 700 void JSSet::JSSetVerify() {
685 CHECK(IsJSSet()); 701 CHECK(IsJSSet());
686 JSObjectVerify(); 702 JSObjectVerify();
687 VerifyHeapPointer(table()); 703 VerifyHeapPointer(table());
688 CHECK(table()->IsHashTable() || table()->IsUndefined()); 704 CHECK(table()->IsHashTable() || table()->IsUndefined());
689 } 705 }
690 706
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 for (int i = 0; i < number_of_transitions(); ++i) { 1185 for (int i = 0; i < number_of_transitions(); ++i) {
1170 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1186 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1171 } 1187 }
1172 return true; 1188 return true;
1173 } 1189 }
1174 1190
1175 1191
1176 #endif // DEBUG 1192 #endif // DEBUG
1177 1193
1178 } } // namespace v8::internal 1194 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698