| 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 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "disassembler.h" | 30 #include "disassembler.h" |
| 31 #include "disasm.h" | 31 #include "disasm.h" |
| 32 #include "jsregexp.h" | 32 #include "jsregexp.h" |
| 33 #include "objects-visiting.h" |
| 33 | 34 |
| 34 namespace v8 { | 35 namespace v8 { |
| 35 namespace internal { | 36 namespace internal { |
| 36 | 37 |
| 37 #ifdef DEBUG | 38 #ifdef DEBUG |
| 38 | 39 |
| 39 static const char* TypeToString(InstanceType type); | 40 static const char* TypeToString(InstanceType type); |
| 40 | 41 |
| 41 | 42 |
| 42 void Object::Print() { | 43 void Object::Print() { |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 ASSERT(!Heap::InNewSpace(this)); | 642 ASSERT(!Heap::InNewSpace(this)); |
| 642 ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); | 643 ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); |
| 643 ASSERT(instance_size() == kVariableSizeSentinel || | 644 ASSERT(instance_size() == kVariableSizeSentinel || |
| 644 (kPointerSize <= instance_size() && | 645 (kPointerSize <= instance_size() && |
| 645 instance_size() < Heap::Capacity())); | 646 instance_size() < Heap::Capacity())); |
| 646 VerifyHeapPointer(prototype()); | 647 VerifyHeapPointer(prototype()); |
| 647 VerifyHeapPointer(instance_descriptors()); | 648 VerifyHeapPointer(instance_descriptors()); |
| 648 } | 649 } |
| 649 | 650 |
| 650 | 651 |
| 652 void Map::NormalizedMapVerify() { |
| 653 MapVerify(); |
| 654 ASSERT_EQ(Heap::empty_descriptor_array(), instance_descriptors()); |
| 655 ASSERT_EQ(Heap::empty_fixed_array(), code_cache()); |
| 656 ASSERT_EQ(0, pre_allocated_property_fields()); |
| 657 ASSERT_EQ(0, unused_property_fields()); |
| 658 ASSERT_EQ(StaticVisitorBase::GetVisitorId(instance_type(), instance_size()), |
| 659 visitor_id()); |
| 660 } |
| 661 |
| 662 |
| 651 void CodeCache::CodeCachePrint() { | 663 void CodeCache::CodeCachePrint() { |
| 652 HeapObject::PrintHeader("CodeCache"); | 664 HeapObject::PrintHeader("CodeCache"); |
| 653 PrintF("\n - default_cache: "); | 665 PrintF("\n - default_cache: "); |
| 654 default_cache()->ShortPrint(); | 666 default_cache()->ShortPrint(); |
| 655 PrintF("\n - normal_type_cache: "); | 667 PrintF("\n - normal_type_cache: "); |
| 656 normal_type_cache()->ShortPrint(); | 668 normal_type_cache()->ShortPrint(); |
| 657 } | 669 } |
| 658 | 670 |
| 659 | 671 |
| 660 void CodeCache::CodeCacheVerify() { | 672 void CodeCache::CodeCacheVerify() { |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 get(i)->Verify(); | 1368 get(i)->Verify(); |
| 1357 } | 1369 } |
| 1358 for (int i = size; i < length(); i++) { | 1370 for (int i = size; i < length(); i++) { |
| 1359 ASSERT(get(i)->IsTheHole()); | 1371 ASSERT(get(i)->IsTheHole()); |
| 1360 get(i)->Verify(); | 1372 get(i)->Verify(); |
| 1361 } | 1373 } |
| 1362 } | 1374 } |
| 1363 } | 1375 } |
| 1364 | 1376 |
| 1365 | 1377 |
| 1378 void NormalizedMapCache::NormalizedMapCacheVerify() { |
| 1379 FixedArray::cast(this)->Verify(); |
| 1380 if (FLAG_enable_slow_asserts) { |
| 1381 for (int i = 0; i < length(); i++) { |
| 1382 Object* e = get(i); |
| 1383 if (e->IsMap()) { |
| 1384 Map::cast(e)->NormalizedMapVerify(); |
| 1385 } else { |
| 1386 ASSERT(e->IsUndefined()); |
| 1387 } |
| 1388 } |
| 1389 } |
| 1390 } |
| 1391 |
| 1392 |
| 1366 #endif // DEBUG | 1393 #endif // DEBUG |
| 1367 | 1394 |
| 1368 } } // namespace v8::internal | 1395 } } // namespace v8::internal |
| OLD | NEW |