<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197226] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197226">197226</a></dd>
<dt>Author</dt> <dd>oliver@apple.com</dd>
<dt>Date</dt> <dd>2016-02-26 18:10:29 -0800 (Fri, 26 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove the on demand executable allocator
https://bugs.webkit.org/show_bug.cgi?id=154749
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
Remove all the DemandExecutable code and executable allocator ifdefs.
* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/ExecutableAllocator.cpp: Removed.
(JSC::DemandExecutableAllocator::DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::~DemandExecutableAllocator): Deleted.
(JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::bytesCommittedByAllocactors): Deleted.
(JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators): Deleted.
(JSC::DemandExecutableAllocator::allocateNewSpace): Deleted.
(JSC::DemandExecutableAllocator::notifyNeedPage): Deleted.
(JSC::DemandExecutableAllocator::notifyPageIsFree): Deleted.
(JSC::DemandExecutableAllocator::allocators): Deleted.
(JSC::DemandExecutableAllocator::allocatorsMutex): Deleted.
(JSC::ExecutableAllocator::initializeAllocator): Deleted.
(JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
(JSC::ExecutableAllocator::isValid): Deleted.
(JSC::ExecutableAllocator::underMemoryPressure): Deleted.
(JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
(JSC::ExecutableAllocator::allocate): Deleted.
(JSC::ExecutableAllocator::committedByteCount): Deleted.
(JSC::ExecutableAllocator::dumpProfile): Deleted.
(JSC::ExecutableAllocator::getLock): Deleted.
(JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
(JSC::ExecutableAllocator::reprotectRegion): Deleted.
* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp:
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
(JSC::JITStubRoutine::filteringStartAddress): Deleted.
(JSC::JITStubRoutine::filteringExtentSize): Deleted.
Source/WTF:
Remove the DeamndExecutableAllocator compile flags.
* wtf/Platform.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorh">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorFixedVMPoolcpp">trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubRoutineh">trunk/Source/JavaScriptCore/jit/JITStubRoutine.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorejitExecutableAllocatorcpp">trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -515,7 +515,6 @@
</span><span class="cx"> jit/CallFrameShuffler32_64.cpp
</span><span class="cx"> jit/CallFrameShuffler64.cpp
</span><span class="cx"> jit/ExecutableAllocationFuzz.cpp
</span><del>- jit/ExecutableAllocator.cpp
</del><span class="cx"> jit/ExecutableAllocatorFixedVMPool.cpp
</span><span class="cx"> jit/GCAwareJITStubRoutine.cpp
</span><span class="cx"> jit/GPRInfo.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-02-26 Oliver Hunt <oliver@apple.com>
+
+ Remove the on demand executable allocator
+ https://bugs.webkit.org/show_bug.cgi?id=154749
+
+ Reviewed by Geoffrey Garen.
+
+ Remove all the DemandExecutable code and executable allocator ifdefs.
+
+ * CMakeLists.txt:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * jit/ExecutableAllocator.cpp: Removed.
+ (JSC::DemandExecutableAllocator::DemandExecutableAllocator): Deleted.
+ (JSC::DemandExecutableAllocator::~DemandExecutableAllocator): Deleted.
+ (JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators): Deleted.
+ (JSC::DemandExecutableAllocator::bytesCommittedByAllocactors): Deleted.
+ (JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators): Deleted.
+ (JSC::DemandExecutableAllocator::allocateNewSpace): Deleted.
+ (JSC::DemandExecutableAllocator::notifyNeedPage): Deleted.
+ (JSC::DemandExecutableAllocator::notifyPageIsFree): Deleted.
+ (JSC::DemandExecutableAllocator::allocators): Deleted.
+ (JSC::DemandExecutableAllocator::allocatorsMutex): Deleted.
+ (JSC::ExecutableAllocator::initializeAllocator): Deleted.
+ (JSC::ExecutableAllocator::ExecutableAllocator): Deleted.
+ (JSC::ExecutableAllocator::~ExecutableAllocator): Deleted.
+ (JSC::ExecutableAllocator::isValid): Deleted.
+ (JSC::ExecutableAllocator::underMemoryPressure): Deleted.
+ (JSC::ExecutableAllocator::memoryPressureMultiplier): Deleted.
+ (JSC::ExecutableAllocator::allocate): Deleted.
+ (JSC::ExecutableAllocator::committedByteCount): Deleted.
+ (JSC::ExecutableAllocator::dumpProfile): Deleted.
+ (JSC::ExecutableAllocator::getLock): Deleted.
+ (JSC::ExecutableAllocator::isValidExecutableMemory): Deleted.
+ (JSC::ExecutableAllocator::reprotectRegion): Deleted.
+ * jit/ExecutableAllocator.h:
+ * jit/ExecutableAllocatorFixedVMPool.cpp:
+ * jit/JITStubRoutine.h:
+ (JSC::JITStubRoutine::canPerformRangeFilter): Deleted.
+ (JSC::JITStubRoutine::filteringStartAddress): Deleted.
+ (JSC::JITStubRoutine::filteringExtentSize): Deleted.
+
</ins><span class="cx"> 2016-02-26 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Reduce direct callers of Structure::findStructuresAndMapForMaterialization
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -635,7 +635,6 @@
</span><span class="cx"> <ClCompile Include="..\jit\CallFrameShuffler32_64.cpp" />
</span><span class="cx"> <ClCompile Include="..\jit\CallFrameShuffler64.cpp" />
</span><span class="cx"> <ClCompile Include="..\jit\ExecutableAllocationFuzz.cpp" />
</span><del>- <ClCompile Include="..\jit\ExecutableAllocator.cpp" />
</del><span class="cx"> <ClCompile Include="..\jit\ExecutableAllocatorFixedVMPool.cpp" />
</span><span class="cx"> <ClCompile Include="..\jit\GCAwareJITStubRoutine.cpp" />
</span><span class="cx"> <ClCompile Include="..\jit\HostCallReturnValue.cpp" />
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -390,9 +390,6 @@
</span><span class="cx"> <ClCompile Include="..\interpreter\StackVisitor.cpp">
</span><span class="cx"> <Filter>interpreter</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\jit\ExecutableAllocator.cpp">
- <Filter>jit</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\jit\GCAwareJITStubRoutine.cpp">
</span><span class="cx"> <Filter>jit</Filter>
</span><span class="cx"> </ClCompile>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -1757,7 +1757,6 @@
</span><span class="cx">                 A7A8AF4017ADB5F3005AB174 /* Uint8ClampedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3117ADB5F3005AB174 /* Uint8ClampedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7A8AF4117ADB5F3005AB174 /* Uint16Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3217ADB5F3005AB174 /* Uint16Array.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7A8AF4217ADB5F3005AB174 /* Uint32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */; };
</del><span class="cx">                 A7B4ACAF1484C9CE00B38A36 /* JSExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7BDAEC817F4EA1400F6140C /* ArrayIteratorPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */; };
</span><span class="lines">@@ -3947,7 +3946,6 @@
</span><span class="cx">                 A7A8AF3317ADB5F3005AB174 /* Uint32Array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Uint32Array.h; sourceTree = "<group>"; };
</span><span class="cx">                 A7A979C418BE8D9E002C3733 /* FunctionPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = FunctionPrototype.js; sourceTree = "<group>"; };
</span><span class="cx">                 A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
</span><del>-                A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 A7B4ACAE1484C9CE00B38A36 /* JSExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSExportMacros.h; sourceTree = "<group>"; };
</span><span class="cx">                 A7BDAEC217F4EA1400F6140C /* ArrayIteratorPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ArrayIteratorPrototype.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</span><span class="cx">                 A7BDAEC317F4EA1400F6140C /* ArrayIteratorPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayIteratorPrototype.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4942,7 +4940,6 @@
</span><span class="cx">                                 0FD82E37141AB14200179C94 /* CompactJITCodeMap.h */,
</span><span class="cx">                                 0FF054F71AC35B4400E5BE57 /* ExecutableAllocationFuzz.cpp */,
</span><span class="cx">                                 0FF054F81AC35B4400E5BE57 /* ExecutableAllocationFuzz.h */,
</span><del>-                                A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */,
</del><span class="cx">                                 A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */,
</span><span class="cx">                                 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */,
</span><span class="cx">                                 0F24E53E17EA9F5900ABB217 /* FPRInfo.h */,
</span><span class="lines">@@ -8849,7 +8846,6 @@
</span><span class="cx">                                 1429D8780ED21ACD00B89619 /* ExceptionHelpers.cpp in Sources */,
</span><span class="cx">                                 86CA032E1038E8440028A609 /* Executable.cpp in Sources */,
</span><span class="cx">                                 0FF054F91AC35B4400E5BE57 /* ExecutableAllocationFuzz.cpp in Sources */,
</span><del>-                                A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */,
</del><span class="cx">                                 86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
</span><span class="cx">                                 0F56A1D515001CF4002992B1 /* ExecutionCounter.cpp in Sources */,
</span><span class="cx">                                 0F0332C018ADFAE1005F979A /* ExitingJITType.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -1,275 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ExecutableAllocator.h"
-
-#include "JSCInlines.h"
-
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
-#include "CodeProfiling.h"
-#include <wtf/HashSet.h>
-#include <wtf/Lock.h>
-#include <wtf/MetaAllocator.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/PageReservation.h>
-#include <wtf/VMTags.h>
-#endif
-
-// Uncomment to create an artificial executable memory usage limit. This limit
-// is imperfect and is primarily useful for testing the VM's ability to handle
-// out-of-executable-memory situations.
-// #define EXECUTABLE_MEMORY_LIMIT 1000000
-
-#if ENABLE(ASSEMBLER)
-
-using namespace WTF;
-
-namespace JSC {
-
-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
-
-class DemandExecutableAllocator : public MetaAllocator {
-public:
- DemandExecutableAllocator()
- : MetaAllocator(jitAllocationGranule)
- {
- std::lock_guard<StaticLock> lock(allocatorsMutex());
- allocators().add(this);
- // Don't preallocate any memory here.
- }
-
- virtual ~DemandExecutableAllocator()
- {
- {
- std::lock_guard<StaticLock> lock(allocatorsMutex());
- allocators().remove(this);
- }
- for (unsigned i = 0; i < reservations.size(); ++i)
- reservations.at(i).deallocate();
- }
-
- static size_t bytesAllocatedByAllAllocators()
- {
- size_t total = 0;
- std::lock_guard<StaticLock> lock(allocatorsMutex());
- for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
- total += (*allocator)->bytesAllocated();
- return total;
- }
-
- static size_t bytesCommittedByAllocactors()
- {
- size_t total = 0;
- std::lock_guard<StaticLock> lock(allocatorsMutex());
- for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
- total += (*allocator)->bytesCommitted();
- return total;
- }
-
-#if ENABLE(META_ALLOCATOR_PROFILE)
- static void dumpProfileFromAllAllocators()
- {
- std::lock_guard<StaticLock> lock(allocatorsMutex());
- for (HashSet<DemandExecutableAllocator*>::const_iterator allocator = allocators().begin(); allocator != allocators().end(); ++allocator)
- (*allocator)->dumpProfile();
- }
-#endif
-
-protected:
- virtual void* allocateNewSpace(size_t& numPages)
- {
- size_t newNumPages = (((numPages * pageSize() + JIT_ALLOCATOR_LARGE_ALLOC_SIZE - 1) / JIT_ALLOCATOR_LARGE_ALLOC_SIZE * JIT_ALLOCATOR_LARGE_ALLOC_SIZE) + pageSize() - 1) / pageSize();
-
- ASSERT(newNumPages >= numPages);
-
- numPages = newNumPages;
-
-#ifdef EXECUTABLE_MEMORY_LIMIT
- if (bytesAllocatedByAllAllocators() >= EXECUTABLE_MEMORY_LIMIT)
- return 0;
-#endif
-
- PageReservation reservation = PageReservation::reserve(numPages * pageSize(), OSAllocator::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
- RELEASE_ASSERT(reservation);
-
- reservations.append(reservation);
-
- return reservation.base();
- }
-
- virtual void notifyNeedPage(void* page)
- {
- OSAllocator::commit(page, pageSize(), EXECUTABLE_POOL_WRITABLE, true);
- }
-
- virtual void notifyPageIsFree(void* page)
- {
- OSAllocator::decommit(page, pageSize());
- }
-
-private:
- Vector<PageReservation, 16> reservations;
- static HashSet<DemandExecutableAllocator*>& allocators()
- {
- static NeverDestroyed<HashSet<DemandExecutableAllocator*>> set;
- return set;
- }
-
- static StaticLock& allocatorsMutex()
- {
- static StaticLock mutex;
-
- return mutex;
- }
-};
-
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-void ExecutableAllocator::initializeAllocator()
-{
-}
-#else
-static DemandExecutableAllocator* gAllocator;
-
-namespace {
-static inline DemandExecutableAllocator* allocator()
-{
- return gAllocator;
-}
-}
-
-void ExecutableAllocator::initializeAllocator()
-{
- ASSERT(!gAllocator);
- gAllocator = new DemandExecutableAllocator();
- CodeProfiling::notifyAllocator(gAllocator);
-}
-#endif
-
-ExecutableAllocator::ExecutableAllocator(VM&)
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
- : m_allocator(std::make_unique<DemandExecutableAllocator>())
-#endif
-{
- ASSERT(allocator());
-}
-
-ExecutableAllocator::~ExecutableAllocator()
-{
-}
-
-bool ExecutableAllocator::isValid() const
-{
- return true;
-}
-
-bool ExecutableAllocator::underMemoryPressure()
-{
-#ifdef EXECUTABLE_MEMORY_LIMIT
- return DemandExecutableAllocator::bytesAllocatedByAllAllocators() > EXECUTABLE_MEMORY_LIMIT / 2;
-#else
- return false;
-#endif
-}
-
-double ExecutableAllocator::memoryPressureMultiplier(size_t addedMemoryUsage)
-{
- double result;
-#ifdef EXECUTABLE_MEMORY_LIMIT
- size_t bytesAllocated = DemandExecutableAllocator::bytesAllocatedByAllAllocators() + addedMemoryUsage;
- if (bytesAllocated >= EXECUTABLE_MEMORY_LIMIT)
- bytesAllocated = EXECUTABLE_MEMORY_LIMIT;
- result = static_cast<double>(EXECUTABLE_MEMORY_LIMIT) /
- (EXECUTABLE_MEMORY_LIMIT - bytesAllocated);
-#else
- UNUSED_PARAM(addedMemoryUsage);
- result = 1.0;
-#endif
- if (result < 1.0)
- result = 1.0;
- return result;
-
-}
-
-RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
-{
- RefPtr<ExecutableMemoryHandle> result = allocator()->allocate(sizeInBytes, ownerUID);
- RELEASE_ASSERT(result || effort != JITCompilationMustSucceed);
- return result;
-}
-
-size_t ExecutableAllocator::committedByteCount()
-{
- return DemandExecutableAllocator::bytesCommittedByAllocactors();
-}
-
-#if ENABLE(META_ALLOCATOR_PROFILE)
-void ExecutableAllocator::dumpProfile()
-{
- DemandExecutableAllocator::dumpProfileFromAllAllocators();
-}
-#endif
-
-Lock& ExecutableAllocator::getLock() const
-{
- return gAllocator->getLock();
-}
-
-bool ExecutableAllocator::isValidExecutableMemory(const LockHolder& locker, void* address)
-{
- return gAllocator->isInAllocatedMemory(locker, address);
-}
-
-#endif // ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
-
-#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
-
-#if OS(WINDOWS)
-#error "ASSEMBLER_WX_EXCLUSIVE not yet suported on this platform."
-#endif
-
-void ExecutableAllocator::reprotectRegion(void* start, size_t size, ProtectionSetting setting)
-{
- size_t pageSize = WTF::pageSize();
-
- // Calculate the start of the page containing this region,
- // and account for this extra memory within size.
- intptr_t startPtr = reinterpret_cast<intptr_t>(start);
- intptr_t pageStartPtr = startPtr & ~(pageSize - 1);
- void* pageStart = reinterpret_cast<void*>(pageStartPtr);
- size += (startPtr - pageStartPtr);
-
- // Round size up
- size += (pageSize - 1);
- size &= ~(pageSize - 1);
-
- mprotect(pageStart, size, (setting == Writable) ? PROTECTION_FLAGS_RW : PROTECTION_FLAGS_RX);
-}
-
-#endif
-
-}
-
-#endif // HAVE(ASSEMBLER)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocator.h        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -69,11 +69,6 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ASSEMBLER)
</span><span class="cx">
</span><del>-#if ENABLE(EXECUTABLE_ALLOCATOR_DEMAND)
-class DemandExecutableAllocator;
-#endif
-
-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
</del><span class="cx"> #if CPU(ARM)
</span><span class="cx"> static const size_t fixedExecutableMemoryPoolSize = 16 * 1024 * 1024;
</span><span class="cx"> #elif CPU(ARM64)
</span><span class="lines">@@ -90,7 +85,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> extern uintptr_t startOfFixedExecutableMemoryPool;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> class ExecutableAllocator {
</span><span class="cx"> enum ProtectionSetting { Writable, Executable };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitExecutableAllocatorFixedVMPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -28,8 +28,6 @@
</span><span class="cx">
</span><span class="cx"> #include "JSCInlines.h"
</span><span class="cx">
</span><del>-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
-
</del><span class="cx"> #include "CodeProfiling.h"
</span><span class="cx"> #include "ExecutableAllocationFuzz.h"
</span><span class="cx"> #include <errno.h>
</span><span class="lines">@@ -222,6 +220,3 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-
-#endif // ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubRoutineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubRoutine.h (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubRoutine.h        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/JavaScriptCore/jit/JITStubRoutine.h        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -103,29 +103,15 @@
</span><span class="cx">
</span><span class="cx"> static bool canPerformRangeFilter()
</span><span class="cx"> {
</span><del>-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
</del><span class="cx"> return true;
</span><del>-#else
- return false;
-#endif
</del><span class="cx"> }
</span><span class="cx"> static uintptr_t filteringStartAddress()
</span><span class="cx"> {
</span><del>-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
</del><span class="cx"> return startOfFixedExecutableMemoryPool;
</span><del>-#else
- UNREACHABLE_FOR_PLATFORM();
- return 0;
-#endif
</del><span class="cx"> }
</span><span class="cx"> static size_t filteringExtentSize()
</span><span class="cx"> {
</span><del>-#if ENABLE(EXECUTABLE_ALLOCATOR_FIXED)
</del><span class="cx"> return fixedExecutableMemoryPoolSize;
</span><del>-#else
- UNREACHABLE_FOR_PLATFORM();
- return 0;
-#endif
</del><span class="cx"> }
</span><span class="cx"> static bool passesFilter(uintptr_t address)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/WTF/ChangeLog        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-02-26 Oliver Hunt <oliver@apple.com>
+
+ Remove the on demand executable allocator
+ https://bugs.webkit.org/show_bug.cgi?id=154749
+
+ Reviewed by Geoffrey Garen.
+
+ Remove the DeamndExecutableAllocator compile flags.
+
+ * wtf/Platform.h:
+
</ins><span class="cx"> 2016-02-26 Keith Rollin <krollin@apple.com>
</span><span class="cx">
</span><span class="cx"> Enhance logging: Add "always on" macros
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (197225 => 197226)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2016-02-27 02:03:18 UTC (rev 197225)
+++ trunk/Source/WTF/wtf/Platform.h        2016-02-27 02:10:29 UTC (rev 197226)
</span><span class="lines">@@ -882,16 +882,6 @@
</span><span class="cx"> #define ENABLE_MASM_PROBE 0
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
- On non-Windows x86-64, iOS, and ARM64 we use a single fixed mmap, on other platforms we mmap on demand. */
-#if ENABLE(ASSEMBLER)
-#if CPU(X86_64) || PLATFORM(IOS) || CPU(ARM64)
-#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
-#else
-#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
-#endif
-#endif
-
</del><span class="cx"> /* CSS Selector JIT Compiler */
</span><span class="cx"> #if !defined(ENABLE_CSS_SELECTOR_JIT)
</span><span class="cx"> #if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(EFL))
</span></span></pre>
</div>
</div>
</body>
</html>