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

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: Revert to traceActiveScriptWrappables - C++ is happier 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
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..1c3c8b59392881ccc603707bc829088a43ebd22f 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 headerWrappableMarkBitMask = 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 isWrappableMarked() const;
+ void markWrappable();
+ void unmarkWrappable();
bool isMarked() const;
haraken 2016/04/18 04:35:42 headerWrappableMarkBitMask => headerWrapperMarkBit
Marcel Hlopko 2016/04/18 11:45:35 Done.
void mark();
void unmark();
@@ -835,6 +838,29 @@ inline HeapObjectHeader* HeapObjectHeader::fromPayload(const void* payload)
}
NO_SANITIZE_ADDRESS inline
+bool HeapObjectHeader::isWrappableMarked() const
+{
+ ASSERT(checkHeader());
+ return m_encoded & headerWrappableMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
+void HeapObjectHeader::markWrappable()
+{
+ ASSERT(checkHeader());
+ ASSERT(!isWrappableMarked());
+ m_encoded |= headerWrappableMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
+void HeapObjectHeader::unmarkWrappable()
+{
+ ASSERT(checkHeader());
+ ASSERT(isWrappableMarked());
+ m_encoded &= ~headerWrappableMarkBitMask;
+}
+
+NO_SANITIZE_ADDRESS inline
bool HeapObjectHeader::isMarked() const
{
ASSERT(checkHeader());

Powered by Google App Engine
This is Rietveld 408576698