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