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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 // Ensure that GC will not iterate twice over the same pointer. | 634 // Ensure that GC will not iterate twice over the same pointer. |
635 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { | 635 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { |
636 CHECK(it.rinfo()->pc() != last_gc_pc); | 636 CHECK(it.rinfo()->pc() != last_gc_pc); |
637 last_gc_pc = it.rinfo()->pc(); | 637 last_gc_pc = it.rinfo()->pc(); |
638 } | 638 } |
639 } | 639 } |
640 } | 640 } |
641 | 641 |
642 | 642 |
643 void Code::VerifyEmbeddedObjectsDependency() { | 643 void Code::VerifyEmbeddedObjectsDependency() { |
| 644 if (!CanContainWeakObjects()) return; |
644 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 645 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
645 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 646 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
646 Object* obj = it.rinfo()->target_object(); | 647 Object* obj = it.rinfo()->target_object(); |
647 if (IsWeakObject(obj)) { | 648 if (IsWeakObject(obj)) { |
648 if (obj->IsMap()) { | 649 if (obj->IsMap()) { |
649 Map* map = Map::cast(obj); | 650 Map* map = Map::cast(obj); |
650 CHECK(map->dependent_code()->Contains( | 651 CHECK(map->dependent_code()->Contains( |
651 DependentCode::kWeaklyEmbeddedGroup, this)); | 652 DependentCode::kWeaklyEmbeddedGroup, this)); |
652 } else if (obj->IsJSObject()) { | 653 } else if (obj->IsJSObject()) { |
653 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); | 654 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 for (int i = 0; i < number_of_transitions(); ++i) { | 1160 for (int i = 0; i < number_of_transitions(); ++i) { |
1160 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1161 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1161 } | 1162 } |
1162 return true; | 1163 return true; |
1163 } | 1164 } |
1164 | 1165 |
1165 | 1166 |
1166 #endif // DEBUG | 1167 #endif // DEBUG |
1167 | 1168 |
1168 } } // namespace v8::internal | 1169 } } // namespace v8::internal |
OLD | NEW |