Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751

This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571

"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582

Canonical link: https://commits.webkit.org/184798@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Feb 2, 2017
1 parent 35d102f commit a3d7840
Show file tree
Hide file tree
Showing 21 changed files with 99 additions and 357 deletions.
18 changes: 18 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,21 @@
2017-02-02 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751

This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571

"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582

2017-02-02 Andreas Kling <akling@apple.com>

[Mac] In-process memory pressure monitor for WebContent processes.
Expand Down
8 changes: 8 additions & 0 deletions Source/JavaScriptCore/heap/Heap.cpp
Expand Up @@ -1726,6 +1726,11 @@ void Heap::notifyIncrementalSweeper()
m_sweeper->startSweeping();
}

NEVER_INLINE void Heap::didExceedMaxLiveSize()
{
CRASH();
}

void Heap::updateAllocationLimits()
{
static const bool verbose = false;
Expand Down Expand Up @@ -1757,6 +1762,9 @@ void Heap::updateAllocationLimits()

if (verbose)
dataLog("extraMemorySize() = ", extraMemorySize(), ", currentHeapSize = ", currentHeapSize, "\n");

if (m_maxLiveSize && currentHeapSize > m_maxLiveSize)
didExceedMaxLiveSize();

if (Options::gcMaxHeapSize() && currentHeapSize > Options::gcMaxHeapSize())
HeapStatistics::exitWithFailure();
Expand Down
6 changes: 6 additions & 0 deletions Source/JavaScriptCore/heap/Heap.h
Expand Up @@ -132,6 +132,9 @@ class Heap {

VM* vm() const;

// Set a hard limit where JSC will crash if live heap size exceeds it.
void setMaxLiveSize(size_t size) { m_maxLiveSize = size; }

MarkedSpace& objectSpace() { return m_objectSpace; }
MachineThreads& machineThreads() { return m_machineThreads; }

Expand Down Expand Up @@ -600,6 +603,9 @@ class Heap {
size_t m_blockBytesAllocated { 0 };
size_t m_externalMemorySize { 0 };
#endif

NO_RETURN_DUE_TO_CRASH void didExceedMaxLiveSize();
size_t m_maxLiveSize { 0 };

std::unique_ptr<MutatorScheduler> m_scheduler;

Expand Down
18 changes: 18 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,21 @@
2017-02-02 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751

This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571

"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582

2017-02-02 Andreas Kling <akling@apple.com>

[Mac] In-process memory pressure monitor for WebContent processes.
Expand Down
8 changes: 0 additions & 8 deletions Source/WTF/WTF.xcodeproj/project.pbxproj
Expand Up @@ -337,8 +337,6 @@
A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; };
A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; };
AD7C434B1DD2A4A70026888B /* Expected.h in Headers */ = {isa = PBXBuildFile; fileRef = AD7C434A1DD2A4A70026888B /* Expected.h */; };
ADF2CE661E39F106006889DB /* MemoryFootprint.h in Headers */ = {isa = PBXBuildFile; fileRef = ADF2CE641E39F106006889DB /* MemoryFootprint.h */; settings = {ATTRIBUTES = (Private, ); }; };
ADF2CE671E39F106006889DB /* MemoryFootprint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */; };
B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; };
C8B0E1A1E01A486EB95E0D11 /* IndexSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 3137E1D7DBD84AC38FAE4D34 /* IndexSet.h */; };
Expand Down Expand Up @@ -721,8 +719,6 @@
A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
AD7C434A1DD2A4A70026888B /* Expected.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Expected.h; sourceTree = "<group>"; };
ADF2CE641E39F106006889DB /* MemoryFootprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryFootprint.h; sourceTree = "<group>"; };
ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFootprint.cpp; sourceTree = "<group>"; };
B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1009,8 +1005,6 @@
A8A472CB151A825B004123FF /* MD5.h */,
CD5497AA15857D0300B5BC30 /* MediaTime.cpp */,
CD5497AB15857D0300B5BC30 /* MediaTime.h */,
ADF2CE641E39F106006889DB /* MemoryFootprint.h */,
ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */,
A8A472CC151A825B004123FF /* MessageQueue.h */,
A8A472CD151A825B004123FF /* MetaAllocator.cpp */,
A8A472CE151A825B004123FF /* MetaAllocator.h */,
Expand Down Expand Up @@ -1500,7 +1494,6 @@
A8A4741C151A825B004123FF /* RefPtr.h in Headers */,
A8A4741E151A825B004123FF /* RetainPtr.h in Headers */,
2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */,
ADF2CE661E39F106006889DB /* MemoryFootprint.h in Headers */,
1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */,
A5098B001C169E0700087797 /* SandboxSPI.h in Headers */,
14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */,
Expand Down Expand Up @@ -1708,7 +1701,6 @@
1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */,
A8A473AE151A825B004123FF /* diy-fp.cc in Sources */,
A8A473B0151A825B004123FF /* double-conversion.cc in Sources */,
ADF2CE671E39F106006889DB /* MemoryFootprint.cpp in Sources */,
A8A473BA151A825B004123FF /* dtoa.cpp in Sources */,
A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */,
0F7C5FB61D885CF20044F5E2 /* FastBitVector.cpp in Sources */,
Expand Down
2 changes: 0 additions & 2 deletions Source/WTF/wtf/CMakeLists.txt
Expand Up @@ -64,7 +64,6 @@ set(WTF_HEADERS
MallocPtr.h
MathExtras.h
MediaTime.h
MemoryFootprint.h
MessageQueue.h
MetaAllocator.h
MetaAllocatorHandle.h
Expand Down Expand Up @@ -205,7 +204,6 @@ set(WTF_SOURCES
MD5.cpp
MainThread.cpp
MediaTime.cpp
MemoryFootprint.cpp
MetaAllocator.cpp
MonotonicTime.cpp
NumberOfCores.cpp
Expand Down
50 changes: 0 additions & 50 deletions Source/WTF/wtf/MemoryFootprint.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions Source/WTF/wtf/MemoryFootprint.h

This file was deleted.

18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2017-02-02 Commit Queue <commit-queue@webkit.org>

Unreviewed, rolling out r211571 and r211582.
https://bugs.webkit.org/show_bug.cgi?id=167751

This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).

Reverted changesets:

"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571

"Unreviewed attempt to fix the Windows build after r211571."
http://trac.webkit.org/changeset/211582

2017-02-02 Chris Dumez <cdumez@apple.com>

Unreviewed attempt to fix the Windows build after r211571.
Expand Down
4 changes: 4 additions & 0 deletions Source/WebCore/bindings/js/CommonVM.cpp
Expand Up @@ -46,6 +46,10 @@ VM& commonVMSlow()

ScriptController::initializeThreading();
g_commonVMOrNull = &VM::createLeaked(LargeHeap).leakRef();
#if CPU(X86_64) || CPU(ARM64)
static const size_t maxGCHeapSize = 4 * GB;
g_commonVMOrNull->heap.setMaxLiveSize(maxGCHeapSize);
#endif
g_commonVMOrNull->heap.acquireAccess(); // At any time, we may do things that affect the GC.
#if !PLATFORM(IOS)
g_commonVMOrNull->setExclusiveThread(std::this_thread::get_id());
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/FrameLoader.cpp
Expand Up @@ -1742,7 +1742,7 @@ void FrameLoader::setState(FrameState newState)
if (m_documentLoader)
m_documentLoader->stopRecordingResponses();
if (m_frame.isMainFrame() && oldState != newState)
static_cast<MainFrame&>(m_frame).didCompleteLoad();
static_cast<MainFrame&>(m_frame).performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
}
}

Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/page/MainFrame.cpp
Expand Up @@ -95,12 +95,6 @@ void MainFrame::dropChildren()
tree().removeChild(*child);
}

void MainFrame::didCompleteLoad()
{
m_timeOfLastCompletedLoad = MonotonicTime::now();
performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
}

#if PLATFORM(MAC)
ScrollLatchingState* MainFrame::latchingState()
{
Expand Down
5 changes: 0 additions & 5 deletions Source/WebCore/page/MainFrame.h
Expand Up @@ -69,9 +69,6 @@ class MainFrame final : public Frame {

PerformanceLogging& performanceLogging() const { return *m_performanceLogging; }

void didCompleteLoad();
MonotonicTime timeOfLastCompletedLoad() const { return m_timeOfLastCompletedLoad; }

private:
MainFrame(Page&, PageConfiguration&);

Expand All @@ -94,8 +91,6 @@ class MainFrame final : public Frame {
#endif

std::unique_ptr<PerformanceLogging> m_performanceLogging;

MonotonicTime m_timeOfLastCompletedLoad;
};

} // namespace WebCore

0 comments on commit a3d7840

Please sign in to comment.