OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 if (!CanContainWeakObjects()) return; | 677 if (!CanContainWeakObjects()) return; |
678 DisallowHeapAllocation no_gc; | 678 DisallowHeapAllocation no_gc; |
679 Isolate* isolate = GetIsolate(); | 679 Isolate* isolate = GetIsolate(); |
680 HandleScope scope(isolate); | 680 HandleScope scope(isolate); |
681 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 681 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
682 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 682 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
683 Object* obj = it.rinfo()->target_object(); | 683 Object* obj = it.rinfo()->target_object(); |
684 if (IsWeakObject(obj)) { | 684 if (IsWeakObject(obj)) { |
685 if (obj->IsMap()) { | 685 if (obj->IsMap()) { |
686 Map* map = Map::cast(obj); | 686 Map* map = Map::cast(obj); |
687 DependentCode::DependencyGroup group = is_optimized_code() ? | 687 CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup, |
688 DependentCode::kWeakCodeGroup : DependentCode::kWeakICGroup; | 688 this)); |
689 CHECK(map->dependent_code()->Contains(group, this)); | |
690 } else if (obj->IsJSObject()) { | 689 } else if (obj->IsJSObject()) { |
691 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); | 690 Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); |
692 WeakHashTable* table = WeakHashTable::cast(raw_table); | 691 WeakHashTable* table = WeakHashTable::cast(raw_table); |
693 Handle<Object> key_obj(obj, isolate); | 692 Handle<Object> key_obj(obj, isolate); |
694 CHECK(DependentCode::cast(table->Lookup(key_obj))->Contains( | 693 CHECK(DependentCode::cast(table->Lookup(key_obj))->Contains( |
695 DependentCode::kWeakCodeGroup, this)); | 694 DependentCode::kWeakCodeGroup, this)); |
696 } | 695 } |
697 } | 696 } |
698 } | 697 } |
699 } | 698 } |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 while (map != heap->roots_array_start()[i++]) { | 1272 while (map != heap->roots_array_start()[i++]) { |
1274 CHECK_LT(i, Heap::kStrongRootListLength); | 1273 CHECK_LT(i, Heap::kStrongRootListLength); |
1275 } | 1274 } |
1276 } | 1275 } |
1277 } | 1276 } |
1278 | 1277 |
1279 | 1278 |
1280 #endif // DEBUG | 1279 #endif // DEBUG |
1281 | 1280 |
1282 } } // namespace v8::internal | 1281 } } // namespace v8::internal |
OLD | NEW |