OLD | NEW |
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 Loading... |
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 // If a GC was caused while constructing this object, the elements | 333 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when |
334 // pointer may point to a one pointer filler map. | 334 // allocation folding is turned off. |
335 if ((FLAG_use_gvn && FLAG_use_allocation_folding) || | 335 if (reinterpret_cast<Map*>(elements()) != |
336 (reinterpret_cast<Map*>(elements()) != | 336 GetHeap()->one_pointer_filler_map()) { |
337 GetHeap()->one_pointer_filler_map())) { | |
338 CHECK_EQ((map()->has_fast_smi_or_object_elements() || | 337 CHECK_EQ((map()->has_fast_smi_or_object_elements() || |
339 (elements() == GetHeap()->empty_fixed_array())), | 338 (elements() == GetHeap()->empty_fixed_array())), |
340 (elements()->map() == GetHeap()->fixed_array_map() || | 339 (elements()->map() == GetHeap()->fixed_array_map() || |
341 elements()->map() == GetHeap()->fixed_cow_array_map())); | 340 elements()->map() == GetHeap()->fixed_cow_array_map())); |
342 CHECK(map()->has_fast_object_elements() == HasFastObjectElements()); | 341 CHECK(map()->has_fast_object_elements() == HasFastObjectElements()); |
343 } | 342 } |
344 } | 343 } |
345 | 344 |
346 | 345 |
347 void Map::MapVerify() { | 346 void Map::MapVerify() { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 DependentCode::kWeaklyEmbeddedGroup, this)); | 676 DependentCode::kWeaklyEmbeddedGroup, this)); |
678 } | 677 } |
679 } | 678 } |
680 } | 679 } |
681 } | 680 } |
682 | 681 |
683 | 682 |
684 void JSArray::JSArrayVerify() { | 683 void JSArray::JSArrayVerify() { |
685 JSObjectVerify(); | 684 JSObjectVerify(); |
686 CHECK(length()->IsNumber() || length()->IsUndefined()); | 685 CHECK(length()->IsNumber() || length()->IsUndefined()); |
687 // If a GC was caused while constructing this array, the elements | 686 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when |
688 // pointer may point to a one pointer filler map. | 687 // allocation folding is turned off. |
689 if ((FLAG_use_gvn && FLAG_use_allocation_folding) || | 688 if (reinterpret_cast<Map*>(elements()) != |
690 (reinterpret_cast<Map*>(elements()) != | 689 GetHeap()->one_pointer_filler_map()) { |
691 GetHeap()->one_pointer_filler_map())) { | |
692 CHECK(elements()->IsUndefined() || | 690 CHECK(elements()->IsUndefined() || |
693 elements()->IsFixedArray() || | 691 elements()->IsFixedArray() || |
694 elements()->IsFixedDoubleArray()); | 692 elements()->IsFixedDoubleArray()); |
695 // TODO(mvstanton): to diagnose chromium bug 284577, remove after. | 693 // TODO(mvstanton): to diagnose chromium bug 284577, remove after. |
696 AllocationMemento* memento = AllocationMemento::FindForJSObject(this); | 694 AllocationMemento* memento = AllocationMemento::FindForJSObject(this); |
697 if (memento != NULL && memento->IsValid()) { | 695 if (memento != NULL && memento->IsValid()) { |
698 memento->AllocationMementoVerify(); | 696 memento->AllocationMementoVerify(); |
699 } | 697 } |
700 } | 698 } |
701 } | 699 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 for (int i = 0; i < number_of_transitions(); ++i) { | 1187 for (int i = 0; i < number_of_transitions(); ++i) { |
1190 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1188 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1191 } | 1189 } |
1192 return true; | 1190 return true; |
1193 } | 1191 } |
1194 | 1192 |
1195 | 1193 |
1196 #endif // DEBUG | 1194 #endif // DEBUG |
1197 | 1195 |
1198 } } // namespace v8::internal | 1196 } } // namespace v8::internal |
OLD | NEW |