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