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

Unified Diff: third_party/WebKit/Source/platform/heap/HeapCompact.cpp

Issue 2673683002: HeapCompact: don't cast to BasePage before sanity check. (Closed)
Patch Set: Created 3 years, 11 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
« 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: third_party/WebKit/Source/platform/heap/HeapCompact.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapCompact.cpp b/third_party/WebKit/Source/platform/heap/HeapCompact.cpp
index 2b68cd2107dd275641df2aa7645b888d80f71db4..e400ece5568615a8426f3a86c8540f53714ff182 100644
--- a/third_party/WebKit/Source/platform/heap/HeapCompact.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapCompact.cpp
@@ -83,10 +83,10 @@ class HeapCompact::MovableObjectFixups final {
// derive the raw BasePage address here and check if it is a member
// of the compactable and relocatable page address set.
Address slotAddress = reinterpret_cast<Address>(slot);
- BasePage* slotPage = reinterpret_cast<BasePage*>(
- blinkPageAddress(slotAddress) + blinkGuardPageSize);
- if (LIKELY(!m_relocatablePages.contains(slotPage)))
+ void* slotPageAddress = blinkPageAddress(slotAddress) + blinkGuardPageSize;
+ if (LIKELY(!m_relocatablePages.contains(slotPageAddress)))
return;
+ BasePage* slotPage = reinterpret_cast<BasePage*>(slotPageAddress);
sof 2017/02/03 16:04:57 nit: now only used if DCHECK_IS_ON().
#if DCHECK_IS_ON()
DCHECK(slotPage->contains(slotAddress));
#endif
@@ -245,7 +245,7 @@ class HeapCompact::MovableObjectFixups final {
HashMap<MovableReference*, Address> m_interiorFixups;
// All pages that are being compacted.
sof 2017/02/02 22:04:41 Could you update the comment to say that the void*
krasin1 2017/02/02 22:19:09 Is it better now?
sof 2017/02/03 16:04:57 Much better, thanks :)
- HashSet<BasePage*> m_relocatablePages;
+ HashSet<void*> m_relocatablePages;
std::unique_ptr<SparseHeapBitmap> m_interiors;
};
« 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