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

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

Issue 23934008: Fix heap verifier for partially constructed arrays when allocation folding is off. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 int field = descriptors->GetFieldIndex(i); 323 int field = descriptors->GetFieldIndex(i);
324 Object* value = RawFastPropertyAt(field); 324 Object* value = RawFastPropertyAt(field);
325 if (r.IsDouble()) ASSERT(value->IsHeapNumber()); 325 if (r.IsDouble()) ASSERT(value->IsHeapNumber());
326 if (value->IsUninitialized()) continue; 326 if (value->IsUninitialized()) continue;
327 if (r.IsSmi()) ASSERT(value->IsSmi()); 327 if (r.IsSmi()) ASSERT(value->IsSmi());
328 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); 328 if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
329 } 329 }
330 } 330 }
331 } 331 }
332 332
333 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when 333 // If a GC was caused while constructing this object, the elements
334 // allocation folding is turned off. 334 // pointer may point to a one pointer filler map.
335 if (reinterpret_cast<Map*>(elements()) != 335 if ((FLAG_use_gvn && FLAG_use_allocation_folding) ||
336 GetHeap()->one_pointer_filler_map()) { 336 (reinterpret_cast<Map*>(elements()) !=
337 GetHeap()->one_pointer_filler_map())) {
337 CHECK_EQ((map()->has_fast_smi_or_object_elements() || 338 CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
338 (elements() == GetHeap()->empty_fixed_array())), 339 (elements() == GetHeap()->empty_fixed_array())),
339 (elements()->map() == GetHeap()->fixed_array_map() || 340 (elements()->map() == GetHeap()->fixed_array_map() ||
340 elements()->map() == GetHeap()->fixed_cow_array_map())); 341 elements()->map() == GetHeap()->fixed_cow_array_map()));
341 CHECK(map()->has_fast_object_elements() == HasFastObjectElements()); 342 CHECK(map()->has_fast_object_elements() == HasFastObjectElements());
342 } 343 }
343 } 344 }
344 345
345 346
346 void Map::MapVerify() { 347 void Map::MapVerify() {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 DependentCode::kWeaklyEmbeddedGroup, this)); 677 DependentCode::kWeaklyEmbeddedGroup, this));
677 } 678 }
678 } 679 }
679 } 680 }
680 } 681 }
681 682
682 683
683 void JSArray::JSArrayVerify() { 684 void JSArray::JSArrayVerify() {
684 JSObjectVerify(); 685 JSObjectVerify();
685 CHECK(length()->IsNumber() || length()->IsUndefined()); 686 CHECK(length()->IsNumber() || length()->IsUndefined());
686 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when 687 // If a GC was caused while constructing this array, the elements
687 // allocation folding is turned off. 688 // pointer may point to a one pointer filler map.
688 if (reinterpret_cast<Map*>(elements()) != 689 if ((FLAG_use_gvn && FLAG_use_allocation_folding) ||
689 GetHeap()->one_pointer_filler_map()) { 690 (reinterpret_cast<Map*>(elements()) !=
691 GetHeap()->one_pointer_filler_map())) {
690 CHECK(elements()->IsUndefined() || 692 CHECK(elements()->IsUndefined() ||
691 elements()->IsFixedArray() || 693 elements()->IsFixedArray() ||
692 elements()->IsFixedDoubleArray()); 694 elements()->IsFixedDoubleArray());
693 // TODO(mvstanton): to diagnose chromium bug 284577, remove after. 695 // TODO(mvstanton): to diagnose chromium bug 284577, remove after.
694 AllocationMemento* memento = AllocationMemento::FindForJSObject(this); 696 AllocationMemento* memento = AllocationMemento::FindForJSObject(this);
695 if (memento != NULL && memento->IsValid()) { 697 if (memento != NULL && memento->IsValid()) {
696 memento->AllocationMementoVerify(); 698 memento->AllocationMementoVerify();
697 } 699 }
698 } 700 }
699 } 701 }
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 for (int i = 0; i < number_of_transitions(); ++i) { 1189 for (int i = 0; i < number_of_transitions(); ++i) {
1188 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1190 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1189 } 1191 }
1190 return true; 1192 return true;
1191 } 1193 }
1192 1194
1193 1195
1194 #endif // DEBUG 1196 #endif // DEBUG
1195 1197
1196 } } // namespace v8::internal 1198 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698