| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 it.rinfo()->Verify(); | 657 it.rinfo()->Verify(); |
| 658 // Ensure that GC will not iterate twice over the same pointer. | 658 // Ensure that GC will not iterate twice over the same pointer. |
| 659 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { | 659 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { |
| 660 CHECK(it.rinfo()->pc() != last_gc_pc); | 660 CHECK(it.rinfo()->pc() != last_gc_pc); |
| 661 last_gc_pc = it.rinfo()->pc(); | 661 last_gc_pc = it.rinfo()->pc(); |
| 662 } | 662 } |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 | 665 |
| 666 | 666 |
| 667 void Code::VerifyEmbeddedMapsDependency() { | 667 void Code::VerifyEmbeddedObjectsDependency() { |
| 668 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 668 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 669 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 669 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
| 670 RelocInfo::Mode mode = it.rinfo()->rmode(); | 670 Object* obj = it.rinfo()->target_object(); |
| 671 if (mode == RelocInfo::EMBEDDED_OBJECT && | 671 if (IsWeakEmbeddedObject(kind(), obj)) { |
| 672 it.rinfo()->target_object()->IsMap()) { | 672 if (obj->IsMap()) { |
| 673 Map* map = Map::cast(it.rinfo()->target_object()); | 673 Map* map = Map::cast(obj); |
| 674 if (map->CanTransition()) { | |
| 675 CHECK(map->dependent_code()->Contains( | 674 CHECK(map->dependent_code()->Contains( |
| 676 DependentCode::kWeaklyEmbeddedGroup, this)); | 675 DependentCode::kWeaklyEmbeddedGroup, this)); |
| 676 } else if (obj->IsJSObject()) { |
| 677 Object* raw_table = GetIsolate()->heap()->weak_object_to_code(); |
| 678 WeakHashTable* table = WeakHashTable::cast(raw_table); |
| 679 CHECK(DependentCode::cast(table->Lookup(obj))->Contains( |
| 680 DependentCode::kWeaklyEmbeddedGroup, this)); |
| 677 } | 681 } |
| 678 } | 682 } |
| 679 } | 683 } |
| 680 } | 684 } |
| 681 | 685 |
| 682 | 686 |
| 683 void JSArray::JSArrayVerify() { | 687 void JSArray::JSArrayVerify() { |
| 684 JSObjectVerify(); | 688 JSObjectVerify(); |
| 685 CHECK(length()->IsNumber() || length()->IsUndefined()); | 689 CHECK(length()->IsNumber() || length()->IsUndefined()); |
| 686 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when | 690 // TODO(hpayer): deal gracefully with partially constructed JSObjects, when |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 for (int i = 0; i < number_of_transitions(); ++i) { | 1191 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1188 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1192 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1189 } | 1193 } |
| 1190 return true; | 1194 return true; |
| 1191 } | 1195 } |
| 1192 | 1196 |
| 1193 | 1197 |
| 1194 #endif // DEBUG | 1198 #endif // DEBUG |
| 1195 | 1199 |
| 1196 } } // namespace v8::internal | 1200 } } // namespace v8::internal |
| OLD | NEW |