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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 HandleScope scope(isolate); | 685 HandleScope scope(isolate); |
686 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 686 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
687 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 687 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
688 Object* obj = it.rinfo()->target_object(); | 688 Object* obj = it.rinfo()->target_object(); |
689 if (IsWeakObject(obj)) { | 689 if (IsWeakObject(obj)) { |
690 if (obj->IsMap()) { | 690 if (obj->IsMap()) { |
691 Map* map = Map::cast(obj); | 691 Map* map = Map::cast(obj); |
692 CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup, | 692 CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup, |
693 cell)); | 693 cell)); |
694 } else if (obj->IsJSObject()) { | 694 } else if (obj->IsJSObject()) { |
695 WeakHashTable* table = | 695 if (isolate->heap()->InNewSpace(obj)) { |
696 GetIsolate()->heap()->weak_object_to_code_table(); | 696 ArrayList* list = |
697 Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate); | 697 GetIsolate()->heap()->weak_new_space_object_to_code_list(); |
698 CHECK(DependentCode::cast(table->Lookup(key_obj)) | 698 bool found = false; |
699 ->Contains(DependentCode::kWeakCodeGroup, cell)); | 699 for (int i = 0; i < list->Length(); i += 2) { |
| 700 WeakCell* obj_cell = WeakCell::cast(list->Get(i)); |
| 701 if (!obj_cell->cleared() && obj_cell->value() == obj && |
| 702 WeakCell::cast(list->Get(i + 1)) == cell) { |
| 703 found = true; |
| 704 break; |
| 705 } |
| 706 } |
| 707 CHECK(found); |
| 708 } else { |
| 709 Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate); |
| 710 DependentCode* dep = |
| 711 GetIsolate()->heap()->LookupWeakObjectToCodeDependency(key_obj); |
| 712 dep->Contains(DependentCode::kWeakCodeGroup, cell); |
| 713 } |
700 } | 714 } |
701 } | 715 } |
702 } | 716 } |
703 } | 717 } |
704 | 718 |
705 | 719 |
706 void JSArray::JSArrayVerify() { | 720 void JSArray::JSArrayVerify() { |
707 JSObjectVerify(); | 721 JSObjectVerify(); |
708 Isolate* isolate = GetIsolate(); | 722 Isolate* isolate = GetIsolate(); |
709 CHECK(length()->IsNumber() || length()->IsUndefined(isolate)); | 723 CHECK(length()->IsNumber() || length()->IsUndefined(isolate)); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 | 1333 |
1320 // Both are done at the same time. | 1334 // Both are done at the same time. |
1321 CHECK_EQ(new_it.done(), old_it.done()); | 1335 CHECK_EQ(new_it.done(), old_it.done()); |
1322 } | 1336 } |
1323 | 1337 |
1324 | 1338 |
1325 #endif // DEBUG | 1339 #endif // DEBUG |
1326 | 1340 |
1327 } // namespace internal | 1341 } // namespace internal |
1328 } // namespace v8 | 1342 } // namespace v8 |
OLD | NEW |