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

Unified Diff: src/heap/spaces-inl.h

Issue 2531873003: [heap] Use safe way to obtain page in PagedSpace::Contains(Address addr). (Closed)
Patch Set: use heap Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index faf18e07a6808630db715cb7419dc67ec16ee2cf..685611e8151527a150a952be9ce47d28b64c0167 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -249,9 +249,7 @@ void MemoryChunk::IncrementLiveBytes(int by) {
}
bool PagedSpace::Contains(Address addr) {
- Page* p = Page::FromAddress(addr);
- if (!Page::IsValid(p)) return false;
- return p->owner() == this;
+ return MemoryChunk::FromAnyPointerAddress(heap(), addr)->owner() == this;
}
bool PagedSpace::Contains(Object* o) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698