| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 HandleScope scope(isolate); | 691 HandleScope scope(isolate); |
| 692 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 692 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 693 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { | 693 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
| 694 Object* obj = it.rinfo()->target_object(); | 694 Object* obj = it.rinfo()->target_object(); |
| 695 if (IsWeakObject(obj)) { | 695 if (IsWeakObject(obj)) { |
| 696 if (obj->IsMap()) { | 696 if (obj->IsMap()) { |
| 697 Map* map = Map::cast(obj); | 697 Map* map = Map::cast(obj); |
| 698 CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup, | 698 CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup, |
| 699 cell)); | 699 cell)); |
| 700 } else if (obj->IsJSObject()) { | 700 } else if (obj->IsJSObject()) { |
| 701 WeakHashTable* table = | 701 if (isolate->heap()->InNewSpace(obj)) { |
| 702 GetIsolate()->heap()->weak_object_to_code_table(); | 702 ArrayList* list = |
| 703 Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate); | 703 GetIsolate()->heap()->weak_new_space_object_to_code_list(); |
| 704 CHECK(DependentCode::cast(table->Lookup(key_obj)) | 704 bool found = false; |
| 705 ->Contains(DependentCode::kWeakCodeGroup, cell)); | 705 for (int i = 0; i < list->Length(); i += 2) { |
| 706 WeakCell* obj_cell = WeakCell::cast(list->Get(i)); |
| 707 if (!obj_cell->cleared() && obj_cell->value() == obj && |
| 708 WeakCell::cast(list->Get(i + 1)) == cell) { |
| 709 found = true; |
| 710 break; |
| 711 } |
| 712 } |
| 713 CHECK(found); |
| 714 } else { |
| 715 Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate); |
| 716 DependentCode* dep = |
| 717 GetIsolate()->heap()->LookupWeakObjectToCodeDependency(key_obj); |
| 718 dep->Contains(DependentCode::kWeakCodeGroup, cell); |
| 719 } |
| 706 } | 720 } |
| 707 } | 721 } |
| 708 } | 722 } |
| 709 } | 723 } |
| 710 | 724 |
| 711 | 725 |
| 712 void JSArray::JSArrayVerify() { | 726 void JSArray::JSArrayVerify() { |
| 713 JSObjectVerify(); | 727 JSObjectVerify(); |
| 714 Isolate* isolate = GetIsolate(); | 728 Isolate* isolate = GetIsolate(); |
| 715 CHECK(length()->IsNumber() || length()->IsUndefined(isolate)); | 729 CHECK(length()->IsNumber() || length()->IsUndefined(isolate)); |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 | 1337 |
| 1324 // Both are done at the same time. | 1338 // Both are done at the same time. |
| 1325 CHECK_EQ(new_it.done(), old_it.done()); | 1339 CHECK_EQ(new_it.done(), old_it.done()); |
| 1326 } | 1340 } |
| 1327 | 1341 |
| 1328 | 1342 |
| 1329 #endif // DEBUG | 1343 #endif // DEBUG |
| 1330 | 1344 |
| 1331 } // namespace internal | 1345 } // namespace internal |
| 1332 } // namespace v8 | 1346 } // namespace v8 |
| OLD | NEW |