Index: third_party/WebKit/Source/platform/heap/HeapPage.cpp |
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp |
index 136413569200bb7bcb158e12db2e3063881a04cb..40fe3cfdaedfa69b43b52e586abb9ded97bfac19 100644 |
--- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp |
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp |
@@ -298,17 +298,11 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex) |
return nullptr; |
TRACE_EVENT0("blink_gc", "BaseHeap::lazySweepPages"); |
- ThreadState::SweepForbiddenScope scope(threadState()); |
- double startTime = WTF::currentTimeMS(); |
- |
- if (threadState()->isMainThread()) |
- ScriptForbiddenScope::enter(); |
+ ThreadState::SweepForbiddenScope sweepForbidden(threadState()); |
+ ScriptForbiddenIfMainThreadScope scriptForbidden; |
+ double startTime = WTF::currentTimeMS(); |
Address result = lazySweepPages(allocationSize, gcInfoIndex); |
- |
- if (threadState()->isMainThread()) |
- ScriptForbiddenScope::exit(); |
- |
threadState()->accumulateSweepingTime(WTF::currentTimeMS() - startTime); |
Heap::reportMemoryUsageForTracing(); |