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

Unified Diff: src/objects-debug.cc

Issue 1312763006: [heap] User safer root set accessor when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-root-set-1
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index 93da2ed3874960606958888ae0255eaf00745a4a..961ad51f61bd9a05407a3b39914f15d9e8fba740 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -1236,7 +1236,8 @@ bool CanLeak(Object* obj, Heap* heap, bool skip_weak_cell) {
if (obj->IsMap()) {
Map* map = Map::cast(obj);
for (int i = 0; i < Heap::kStrongRootListLength; i++) {
- if (map == heap->roots_array_start()[i]) return false;
+ Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i);
+ if (map == heap->root(root_index)) return false;
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698