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