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

Unified Diff: third_party/WebKit/Source/platform/heap/HeapPage.h

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix var used only in assert Created 4 years, 8 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 | « third_party/WebKit/Source/core/dom/NodeRareData.cpp ('k') | 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/HeapPage.h
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index bb54094a1d36f75d643424a1a8c381a2b14357a1..9b1443131a982a0ffc670b60553e18afc4b1cb26 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -142,7 +142,7 @@ class WebMemoryAllocatorDump;
// - 1 bit used to mark DOM trees for V8.
// - 14 bit is enough for gcInfoIndex because there are less than 2^14 types
// in Blink.
-const size_t headerDOMMarkBitMask = 1u << 17;
+const size_t headerWrapperMarkBitMask = 1u << 17;
const size_t headerGCInfoIndexShift = 18;
const size_t headerGCInfoIndexMask = (static_cast<size_t>((1 << 14) - 1)) << headerGCInfoIndexShift;
const size_t headerSizeMask = (static_cast<size_t>((1 << 14) - 1)) << 3;
@@ -205,6 +205,9 @@ public:
ASSERT(size < nonLargeObjectPageSizeMax);
m_encoded = static_cast<uint32_t>(size) | (m_encoded & ~headerSizeMask);
}
+ bool isWrapperHeaderMarked() const;
+ void markWrapperHeader();
+ void unmarkWrapperHeader();
bool isMarked() const;
void mark();
void unmark();
@@ -835,6 +838,29 @@ inline HeapObjectHeader* HeapObjectHeader::fromPayload(const void* payload)
}
NO_SANITIZE_ADDRESS inline
+bool HeapObjectHeader::isWrapperHeaderMarked() const
+{
+ ASSERT(checkHeader());
+ return m_encoded & headerWrapperMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
+void HeapObjectHeader::markWrapperHeader()
+{
+ ASSERT(checkHeader());
+ ASSERT(!isWrapperHeaderMarked());
+ m_encoded |= headerWrapperMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
+void HeapObjectHeader::unmarkWrapperHeader()
+{
+ ASSERT(checkHeader());
+ ASSERT(isWrapperHeaderMarked());
+ m_encoded &= ~headerWrapperMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
bool HeapObjectHeader::isMarked() const
{
ASSERT(checkHeader());
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698