Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Side by Side Diff: src/objects-debug.cc

Issue 2091733002: Reland [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 WeakHashTable* table = 704 if (isolate->heap()->InNewSpace(obj)) {
705 GetIsolate()->heap()->weak_object_to_code_table(); 705 ArrayList* list =
706 Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate); 706 GetIsolate()->heap()->weak_new_space_object_to_code_list();
707 CHECK(DependentCode::cast(table->Lookup(key_obj)) 707 bool found = false;
708 ->Contains(DependentCode::kWeakCodeGroup, cell)); 708 for (int i = 0; i < list->Length(); i += 2) {
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 }
709 } 723 }
710 } 724 }
711 } 725 }
712 } 726 }
713 727
714 728
715 void JSArray::JSArrayVerify() { 729 void JSArray::JSArrayVerify() {
716 JSObjectVerify(); 730 JSObjectVerify();
717 Isolate* isolate = GetIsolate(); 731 Isolate* isolate = GetIsolate();
718 CHECK(length()->IsNumber() || length()->IsUndefined(isolate)); 732 CHECK(length()->IsNumber() || length()->IsUndefined(isolate));
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 1340
1327 // Both are done at the same time. 1341 // Both are done at the same time.
1328 CHECK_EQ(new_it.done(), old_it.done()); 1342 CHECK_EQ(new_it.done(), old_it.done());
1329 } 1343 }
1330 1344
1331 1345
1332 #endif // DEBUG 1346 #endif // DEBUG
1333 1347
1334 } // namespace internal 1348 } // namespace internal
1335 } // namespace v8 1349 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698