OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 void Map::MapVerify() { | 639 void Map::MapVerify() { |
640 ASSERT(!Heap::InNewSpace(this)); | 640 ASSERT(!Heap::InNewSpace(this)); |
641 ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); | 641 ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); |
642 ASSERT(kPointerSize <= instance_size() | 642 ASSERT(kPointerSize <= instance_size() |
643 && instance_size() < Heap::Capacity()); | 643 && instance_size() < Heap::Capacity()); |
644 VerifyHeapPointer(prototype()); | 644 VerifyHeapPointer(prototype()); |
645 VerifyHeapPointer(instance_descriptors()); | 645 VerifyHeapPointer(instance_descriptors()); |
646 } | 646 } |
647 | 647 |
648 | 648 |
| 649 void Map::NormalizedMapVerify() { |
| 650 MapVerify(); |
| 651 ASSERT(instance_descriptors() == Heap::empty_descriptor_array()); |
| 652 ASSERT(code_cache() == Heap::empty_fixed_array()); |
| 653 ASSERT(pre_allocated_property_fields() == 0); |
| 654 ASSERT(unused_property_fields() == 0); |
| 655 ASSERT(scavenger() == Heap::GetScavenger(instance_type(), instance_size())); |
| 656 } |
| 657 |
| 658 |
649 void CodeCache::CodeCachePrint() { | 659 void CodeCache::CodeCachePrint() { |
650 HeapObject::PrintHeader("CodeCache"); | 660 HeapObject::PrintHeader("CodeCache"); |
651 PrintF("\n - default_cache: "); | 661 PrintF("\n - default_cache: "); |
652 default_cache()->ShortPrint(); | 662 default_cache()->ShortPrint(); |
653 PrintF("\n - normal_type_cache: "); | 663 PrintF("\n - normal_type_cache: "); |
654 normal_type_cache()->ShortPrint(); | 664 normal_type_cache()->ShortPrint(); |
655 } | 665 } |
656 | 666 |
657 | 667 |
658 void CodeCache::CodeCacheVerify() { | 668 void CodeCache::CodeCacheVerify() { |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 get(i)->Verify(); | 1364 get(i)->Verify(); |
1355 } | 1365 } |
1356 for (int i = size; i < length(); i++) { | 1366 for (int i = size; i < length(); i++) { |
1357 ASSERT(get(i)->IsTheHole()); | 1367 ASSERT(get(i)->IsTheHole()); |
1358 get(i)->Verify(); | 1368 get(i)->Verify(); |
1359 } | 1369 } |
1360 } | 1370 } |
1361 } | 1371 } |
1362 | 1372 |
1363 | 1373 |
| 1374 void NormalizedMapCache::NormalizedMapCacheVerify() { |
| 1375 FixedArray::cast(this)->Verify(); |
| 1376 if (FLAG_enable_slow_asserts) { |
| 1377 for (int i = 0; i < length(); i++) { |
| 1378 Object* e = get(i); |
| 1379 if (e->IsMap()) { |
| 1380 Map::cast(e)->NormalizedMapVerify(); |
| 1381 } else { |
| 1382 ASSERT(e->IsUndefined()); |
| 1383 } |
| 1384 } |
| 1385 } |
| 1386 } |
| 1387 |
| 1388 |
1364 #endif // DEBUG | 1389 #endif // DEBUG |
1365 | 1390 |
1366 } } // namespace v8::internal | 1391 } } // namespace v8::internal |
OLD | NEW |