<!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>[186383] trunk</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/186383">186383</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2015-07-06 16:26:40 -0700 (Mon, 06 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Content Extensions] Remove memory page reporting
https://bugs.webkit.org/show_bug.cgi?id=146659
Reviewed by Benjamin Poulain.
Source/WebCore:
* contentextensions/CompiledContentExtension.cpp:
(WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
(WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
* contentextensions/CompiledContentExtension.h:
* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
* contentextensions/ContentExtension.h:
(WebCore::ContentExtensions::ContentExtension::compiledExtension):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::getBits):
(WebCore::ContentExtensions::getInstruction):
(WebCore::ContentExtensions::jumpSizeInBytes):
(WebCore::ContentExtensions::getJumpSize):
(WebCore::ContentExtensions::getJumpDistance):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFABytecodeInterpreter.h:
Don't keep track of memory page usage. It wasn't even correct anyways.
Tools:
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsCompiledContentExtensioncpp">trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsCompiledContentExtensionh">trunk/Source/WebCore/contentextensions/CompiledContentExtension.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensioncpp">trunk/Source/WebCore/contentextensions/ContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionh">trunk/Source/WebCore/contentextensions/ContentExtension.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpreterh">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/ChangeLog        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2015-07-06 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><ins>+ [Content Extensions] Remove memory page reporting
+ https://bugs.webkit.org/show_bug.cgi?id=146659
+
+ Reviewed by Benjamin Poulain.
+
+ * contentextensions/CompiledContentExtension.cpp:
+ (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
+ (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
+ * contentextensions/CompiledContentExtension.h:
+ * contentextensions/ContentExtension.cpp:
+ (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
+ * contentextensions/ContentExtension.h:
+ (WebCore::ContentExtensions::ContentExtension::compiledExtension):
+ * contentextensions/ContentExtensionsBackend.cpp:
+ (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
+ * contentextensions/DFABytecodeInterpreter.cpp:
+ (WebCore::ContentExtensions::getBits):
+ (WebCore::ContentExtensions::getInstruction):
+ (WebCore::ContentExtensions::jumpSizeInBytes):
+ (WebCore::ContentExtensions::getJumpSize):
+ (WebCore::ContentExtensions::getJumpDistance):
+ (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
+ (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
+ (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
+ (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
+ * contentextensions/DFABytecodeInterpreter.h:
+ Don't keep track of memory page usage. It wasn't even correct anyways.
+
+2015-07-06 Alex Christensen <achristensen@webkit.org>
+
</ins><span class="cx"> [Content Extensions] Increase maxNFASize
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=146656
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsCompiledContentExtensioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -36,9 +36,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<String> CompiledContentExtension::globalDisplayNoneSelectors(Vector<bool>& pagesUsed)
</del><ins>+Vector<String> CompiledContentExtension::globalDisplayNoneSelectors()
</ins><span class="cx"> {
</span><del>- DFABytecodeInterpreter interpreter(filtersWithoutDomainsBytecode(), filtersWithoutDomainsBytecodeLength(), pagesUsed);
</del><ins>+ DFABytecodeInterpreter interpreter(filtersWithoutDomainsBytecode(), filtersWithoutDomainsBytecodeLength());
</ins><span class="cx"> DFABytecodeInterpreter::Actions actionLocations = interpreter.actionsForDefaultStylesheetFromDFARoot();
</span><span class="cx">
</span><span class="cx"> Vector<Action> globalActions;
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsCompiledContentExtensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/CompiledContentExtension.h (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/CompiledContentExtension.h        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/CompiledContentExtension.h        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> virtual unsigned domainFiltersBytecodeLength() const = 0;
</span><span class="cx"> virtual const SerializedActionByte* actions() const = 0;
</span><span class="cx"> virtual unsigned actionsLength() const = 0;
</span><del>- Vector<String> globalDisplayNoneSelectors(Vector<bool>& pagesUsed);
</del><ins>+ Vector<String> globalDisplayNoneSelectors();
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtension.cpp (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtension.cpp        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.cpp        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">
</span><span class="cx"> m_parsedGlobalDisplayNoneStyleSheet = true;
</span><span class="cx">
</span><del>- Vector<String> selectors = m_compiledExtension->globalDisplayNoneSelectors(m_pagesUsed);
</del><ins>+ Vector<String> selectors = m_compiledExtension->globalDisplayNoneSelectors();
</ins><span class="cx"> if (selectors.isEmpty())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtension.h (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtension.h        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/ContentExtension.h        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> const CompiledContentExtension& compiledExtension() const { return m_compiledExtension.get(); }
</span><span class="cx"> StyleSheetContents* globalDisplayNoneStyleSheet();
</span><span class="cx">
</span><del>- mutable Vector<bool> m_pagesUsed;
</del><span class="cx"> private:
</span><span class="cx"> ContentExtension(const String& identifier, Ref<CompiledContentExtension>&&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -89,16 +89,15 @@
</span><span class="cx"> RELEASE_ASSERT(contentExtension);
</span><span class="cx"> const CompiledContentExtension& compiledExtension = contentExtension->compiledExtension();
</span><span class="cx">
</span><del>- // FIXME: These should use a different Vector<bool> to keep track of which memory pages are used when doing memory reporting. Or just remove the memory reporting completely.
- DFABytecodeInterpreter withoutDomainsInterpreter(compiledExtension.filtersWithoutDomainsBytecode(), compiledExtension.filtersWithoutDomainsBytecodeLength(), contentExtension->m_pagesUsed);
</del><ins>+ DFABytecodeInterpreter withoutDomainsInterpreter(compiledExtension.filtersWithoutDomainsBytecode(), compiledExtension.filtersWithoutDomainsBytecodeLength());
</ins><span class="cx"> DFABytecodeInterpreter::Actions triggeredActions = withoutDomainsInterpreter.interpret(urlCString, flags);
</span><span class="cx">
</span><span class="cx"> // Check to see if there are any actions triggered with if- or unless-domain and check the domain if there are.
</span><del>- DFABytecodeInterpreter withDomainsInterpreter(compiledExtension.filtersWithDomainsBytecode(), compiledExtension.filtersWithDomainsBytecodeLength(), contentExtension->m_pagesUsed);
</del><ins>+ DFABytecodeInterpreter withDomainsInterpreter(compiledExtension.filtersWithDomainsBytecode(), compiledExtension.filtersWithDomainsBytecodeLength());
</ins><span class="cx">
</span><span class="cx"> DFABytecodeInterpreter::Actions withDomainsPossibleActions = withDomainsInterpreter.interpret(urlCString, flags);
</span><span class="cx"> if (!withDomainsPossibleActions.isEmpty()) {
</span><del>- DFABytecodeInterpreter domainsInterpreter(compiledExtension.domainFiltersBytecode(), compiledExtension.domainFiltersBytecodeLength(), contentExtension->m_pagesUsed);
</del><ins>+ DFABytecodeInterpreter domainsInterpreter(compiledExtension.domainFiltersBytecode(), compiledExtension.domainFiltersBytecodeLength());
</ins><span class="cx"> DFABytecodeInterpreter::Actions domainsActions = domainsInterpreter.interpret(resourceLoadInfo.mainDocumentURL.host().utf8(), flags);
</span><span class="cx">
</span><span class="cx"> DFABytecodeInterpreter::Actions ifDomainActions;
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -36,24 +36,15 @@
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx">
</span><span class="cx"> template <typename IntType>
</span><del>-static inline IntType getBits(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index, Vector<bool>& pagesUsed)
</del><ins>+static inline IntType getBits(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index)
</ins><span class="cx"> {
</span><del>-#if CONTENT_EXTENSIONS_MEMORY_REPORTING
- uint32_t page = index / CONTENT_EXTENSIONS_PAGE_SIZE;
- while (pagesUsed.size() < (bytecodeLength + CONTENT_EXTENSIONS_PAGE_SIZE - 1) / CONTENT_EXTENSIONS_PAGE_SIZE)
- pagesUsed.append(false);
- pagesUsed[page] = true;
-#else
- UNUSED_PARAM(pagesUsed);
-#endif
</del><span class="cx"> ASSERT_UNUSED(bytecodeLength, index + sizeof(IntType) <= bytecodeLength);
</span><span class="cx"> return *reinterpret_cast<const IntType*>(&bytecode[index]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: Get rid of pagesUsed. We don't need to keep track of the pages used.
-static inline DFABytecodeInstruction getInstruction(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index, Vector<bool>& pagesUsed)
</del><ins>+static inline DFABytecodeInstruction getInstruction(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index)
</ins><span class="cx"> {
</span><del>- return static_cast<DFABytecodeInstruction>(getBits<uint8_t>(bytecode, bytecodeLength, index, pagesUsed) & DFABytecodeInstructionMask);
</del><ins>+ return static_cast<DFABytecodeInstruction>(getBits<uint8_t>(bytecode, bytecodeLength, index) & DFABytecodeInstructionMask);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline size_t jumpSizeInBytes(DFABytecodeJumpSize jumpSize)
</span><span class="lines">@@ -70,22 +61,22 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline DFABytecodeJumpSize getJumpSize(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index, Vector<bool>& pagesUsed)
</del><ins>+static inline DFABytecodeJumpSize getJumpSize(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index)
</ins><span class="cx"> {
</span><del>- DFABytecodeJumpSize jumpSize = static_cast<DFABytecodeJumpSize>(getBits<uint8_t>(bytecode, bytecodeLength, index, pagesUsed) & DFABytecodeJumpSizeMask);
</del><ins>+ DFABytecodeJumpSize jumpSize = static_cast<DFABytecodeJumpSize>(getBits<uint8_t>(bytecode, bytecodeLength, index) & DFABytecodeJumpSizeMask);
</ins><span class="cx"> ASSERT(jumpSize == DFABytecodeJumpSize::Int32 || jumpSize == DFABytecodeJumpSize::Int16 || jumpSize == DFABytecodeJumpSize::Int8);
</span><span class="cx"> return jumpSize;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline int32_t getJumpDistance(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index, Vector<bool>& pagesUsed, DFABytecodeJumpSize jumpSize)
</del><ins>+static inline int32_t getJumpDistance(const DFABytecode* bytecode, uint32_t bytecodeLength, uint32_t index, DFABytecodeJumpSize jumpSize)
</ins><span class="cx"> {
</span><span class="cx"> switch (jumpSize) {
</span><span class="cx"> case Int8:
</span><del>- return getBits<int8_t>(bytecode, bytecodeLength, index, pagesUsed);
</del><ins>+ return getBits<int8_t>(bytecode, bytecodeLength, index);
</ins><span class="cx"> case Int16:
</span><del>- return getBits<int16_t>(bytecode, bytecodeLength, index, pagesUsed);
</del><ins>+ return getBits<int16_t>(bytecode, bytecodeLength, index);
</ins><span class="cx"> case Int32:
</span><del>- return getBits<int32_t>(bytecode, bytecodeLength, index, pagesUsed);
</del><ins>+ return getBits<int32_t>(bytecode, bytecodeLength, index);
</ins><span class="cx"> default:
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="lines">@@ -93,10 +84,10 @@
</span><span class="cx">
</span><span class="cx"> void DFABytecodeInterpreter::interpretAppendAction(uint32_t& programCounter, Actions& actions, bool ifDomain)
</span><span class="cx"> {
</span><del>- ASSERT(getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) == DFABytecodeInstruction::AppendAction
- || getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) == DFABytecodeInstruction::AppendActionWithIfDomain
- || getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) == DFABytecodeInstruction::AppendActionDefaultStylesheet);
- actions.add((ifDomain ? IfDomainFlag : 0) | static_cast<uint64_t>(getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed)));
</del><ins>+ ASSERT(getInstruction(m_bytecode, m_bytecodeLength, programCounter) == DFABytecodeInstruction::AppendAction
+ || getInstruction(m_bytecode, m_bytecodeLength, programCounter) == DFABytecodeInstruction::AppendActionWithIfDomain
+ || getInstruction(m_bytecode, m_bytecodeLength, programCounter) == DFABytecodeInstruction::AppendActionDefaultStylesheet);
+ actions.add((ifDomain ? IfDomainFlag : 0) | static_cast<uint64_t>(getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction))));
</ins><span class="cx"> programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
</span><span class="cx"> ASSERT(instructionSizeWithArguments(DFABytecodeInstruction::AppendAction) == instructionSizeWithArguments(DFABytecodeInstruction::AppendActionWithIfDomain));
</span><span class="cx"> ASSERT(instructionSizeWithArguments(DFABytecodeInstruction::AppendAction) == instructionSizeWithArguments(DFABytecodeInstruction::AppendActionDefaultStylesheet));
</span><span class="lines">@@ -104,9 +95,9 @@
</span><span class="cx">
</span><span class="cx"> void DFABytecodeInterpreter::interpretTestFlagsAndAppendAction(uint32_t& programCounter, uint16_t flags, Actions& actions, bool ifDomain)
</span><span class="cx"> {
</span><del>- ASSERT(getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) == DFABytecodeInstruction::TestFlagsAndAppendAction
- || getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) == DFABytecodeInstruction::TestFlagsAndAppendActionWithIfDomain);
- uint16_t flagsToCheck = getBits<uint16_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed);
</del><ins>+ ASSERT(getInstruction(m_bytecode, m_bytecodeLength, programCounter) == DFABytecodeInstruction::TestFlagsAndAppendAction
+ || getInstruction(m_bytecode, m_bytecodeLength, programCounter) == DFABytecodeInstruction::TestFlagsAndAppendActionWithIfDomain);
+ uint16_t flagsToCheck = getBits<uint16_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction));
</ins><span class="cx">
</span><span class="cx"> uint16_t loadTypeFlags = flagsToCheck & LoadTypeMask;
</span><span class="cx"> uint16_t ressourceTypeFlags = flagsToCheck & ResourceTypeMask;
</span><span class="lines">@@ -115,7 +106,7 @@
</span><span class="cx"> bool ressourceTypeMatches = ressourceTypeFlags ? (ressourceTypeFlags & flags) : true;
</span><span class="cx">
</span><span class="cx"> if (loadTypeMatches && ressourceTypeMatches)
</span><del>- actions.add((ifDomain ? IfDomainFlag : 0) | static_cast<uint64_t>(getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint16_t), m_pagesUsed)));
</del><ins>+ actions.add((ifDomain ? IfDomainFlag : 0) | static_cast<uint64_t>(getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint16_t))));
</ins><span class="cx"> programCounter += instructionSizeWithArguments(DFABytecodeInstruction::TestFlagsAndAppendAction);
</span><span class="cx"> ASSERT(instructionSizeWithArguments(DFABytecodeInstruction::TestFlagsAndAppendAction) == instructionSizeWithArguments(DFABytecodeInstruction::TestFlagsAndAppendActionWithIfDomain));
</span><span class="cx"> }
</span><span class="lines">@@ -125,11 +116,11 @@
</span><span class="cx"> Actions actions;
</span><span class="cx">
</span><span class="cx"> // DFA header.
</span><del>- uint32_t dfaBytecodeLength = getBits<uint32_t>(m_bytecode, m_bytecodeLength, 0, m_pagesUsed);
</del><ins>+ uint32_t dfaBytecodeLength = getBits<uint32_t>(m_bytecode, m_bytecodeLength, 0);
</ins><span class="cx"> uint32_t programCounter = sizeof(uint32_t);
</span><span class="cx">
</span><span class="cx"> while (programCounter < dfaBytecodeLength) {
</span><del>- DFABytecodeInstruction instruction = getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
</del><ins>+ DFABytecodeInstruction instruction = getInstruction(m_bytecode, m_bytecodeLength, programCounter);
</ins><span class="cx"> if (instruction == DFABytecodeInstruction::AppendActionDefaultStylesheet)
</span><span class="cx"> interpretAppendAction(programCounter, actions, false);
</span><span class="cx"> else if (instruction == DFABytecodeInstruction::AppendAction)
</span><span class="lines">@@ -159,13 +150,13 @@
</span><span class="cx">
</span><span class="cx"> // DFA header.
</span><span class="cx"> uint32_t dfaStart = programCounter;
</span><del>- uint32_t dfaBytecodeLength = getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
</del><ins>+ uint32_t dfaBytecodeLength = getBits<uint32_t>(m_bytecode, m_bytecodeLength, programCounter);
</ins><span class="cx"> programCounter += sizeof(uint32_t);
</span><span class="cx">
</span><span class="cx"> // Skip the default stylesheet actions on the DFA root. These are accessed via actionsForDefaultStylesheetFromDFARoot.
</span><span class="cx"> if (!dfaStart) {
</span><span class="cx"> while (programCounter < dfaBytecodeLength) {
</span><del>- DFABytecodeInstruction instruction = getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
</del><ins>+ DFABytecodeInstruction instruction = getInstruction(m_bytecode, m_bytecodeLength, programCounter);
</ins><span class="cx"> if (instruction == DFABytecodeInstruction::AppendActionDefaultStylesheet)
</span><span class="cx"> programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendActionDefaultStylesheet);
</span><span class="cx"> else if (instruction == DFABytecodeInstruction::AppendAction)
</span><span class="lines">@@ -178,8 +169,8 @@
</span><span class="cx"> if (programCounter >= m_bytecodeLength)
</span><span class="cx"> return actions;
</span><span class="cx"> } else {
</span><del>- ASSERT_WITH_MESSAGE(getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) != DFABytecodeInstruction::AppendAction
- && getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed) != DFABytecodeInstruction::TestFlagsAndAppendAction,
</del><ins>+ ASSERT_WITH_MESSAGE(getInstruction(m_bytecode, m_bytecodeLength, programCounter) != DFABytecodeInstruction::AppendAction
+ && getInstruction(m_bytecode, m_bytecodeLength, programCounter) != DFABytecodeInstruction::TestFlagsAndAppendAction,
</ins><span class="cx"> "Triggers that match everything should only be in the first DFA.");
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -189,7 +180,7 @@
</span><span class="cx"> bool urlIndexIsAfterEndOfString = false;
</span><span class="cx"> while (true) {
</span><span class="cx"> ASSERT(programCounter <= m_bytecodeLength);
</span><del>- switch (getInstruction(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed)) {
</del><ins>+ switch (getInstruction(m_bytecode, m_bytecodeLength, programCounter)) {
</ins><span class="cx">
</span><span class="cx"> case DFABytecodeInstruction::Terminate:
</span><span class="cx"> goto nextDFA;
</span><span class="lines">@@ -200,10 +191,10 @@
</span><span class="cx">
</span><span class="cx"> // Check to see if the next character in the url is the value stored with the bytecode.
</span><span class="cx"> char character = url[urlIndex];
</span><del>- DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
- if (character == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed)) {
</del><ins>+ DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter);
+ if (character == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction))) {
</ins><span class="cx"> uint32_t jumpLocation = programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t);
</span><del>- programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, m_pagesUsed, jumpSize);
</del><ins>+ programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, jumpSize);
</ins><span class="cx"> if (!character)
</span><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><span class="lines">@@ -218,10 +209,10 @@
</span><span class="cx">
</span><span class="cx"> // Check to see if the next character in the url is the value stored with the bytecode.
</span><span class="cx"> char character = toASCIILower(url[urlIndex]);
</span><del>- DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
- if (character == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed)) {
</del><ins>+ DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter);
+ if (character == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction))) {
</ins><span class="cx"> uint32_t jumpLocation = programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t);
</span><del>- programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, m_pagesUsed, jumpSize);
</del><ins>+ programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, jumpSize);
</ins><span class="cx"> if (!character)
</span><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><span class="lines">@@ -235,11 +226,11 @@
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><span class="cx"> char character = url[urlIndex];
</span><del>- DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
- if (character >= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed)
- && character <= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t), m_pagesUsed)) {
</del><ins>+ DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter);
+ if (character >= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction))
+ && character <= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t))) {
</ins><span class="cx"> uint32_t jumpLocation = programCounter + sizeof(DFABytecodeInstruction) + 2 * sizeof(uint8_t);
</span><del>- programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, m_pagesUsed, jumpSize);
</del><ins>+ programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, jumpSize);
</ins><span class="cx"> if (!character)
</span><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><span class="lines">@@ -253,11 +244,11 @@
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><span class="cx"> char character = toASCIILower(url[urlIndex]);
</span><del>- DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
- if (character >= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction), m_pagesUsed)
- && character <= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t), m_pagesUsed)) {
</del><ins>+ DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter);
+ if (character >= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction))
+ && character <= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecodeInstruction) + sizeof(uint8_t))) {
</ins><span class="cx"> uint32_t jumpLocation = programCounter + sizeof(DFABytecodeInstruction) + 2 * sizeof(uint8_t);
</span><del>- programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, m_pagesUsed, jumpSize);
</del><ins>+ programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, jumpSize);
</ins><span class="cx"> if (!character)
</span><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><span class="lines">@@ -271,8 +262,8 @@
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><span class="cx"> uint32_t jumpLocation = programCounter + sizeof(DFABytecodeInstruction);
</span><del>- DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter, m_pagesUsed);
- programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, m_pagesUsed, jumpSize);
</del><ins>+ DFABytecodeJumpSize jumpSize = getJumpSize(m_bytecode, m_bytecodeLength, programCounter);
+ programCounter += getJumpDistance(m_bytecode, m_bytecodeLength, jumpLocation, jumpSize);
</ins><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -41,21 +41,11 @@
</span><span class="cx">
</span><span class="cx"> class WEBCORE_EXPORT DFABytecodeInterpreter {
</span><span class="cx"> public:
</span><del>- DFABytecodeInterpreter(const DFABytecode* bytecode, unsigned bytecodeLength, Vector<bool>& pagesUsed)
</del><ins>+ DFABytecodeInterpreter(const DFABytecode* bytecode, unsigned bytecodeLength)
</ins><span class="cx"> : m_bytecode(bytecode)
</span><span class="cx"> , m_bytecodeLength(bytecodeLength)
</span><del>- , m_pagesUsed(pagesUsed)
</del><span class="cx"> {
</span><span class="cx"> }
</span><del>- ~DFABytecodeInterpreter()
- {
-#if CONTENT_EXTENSIONS_MEMORY_REPORTING
- size_t total = 0;
- for (bool& b : m_pagesUsed)
- total += b;
- dataLogF("Pages used: %zu / %zu\n", total, m_pagesUsed.size());
-#endif
- }
</del><span class="cx">
</span><span class="cx"> typedef HashSet<uint64_t, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> Actions;
</span><span class="cx">
</span><span class="lines">@@ -67,7 +57,6 @@
</span><span class="cx"> void interpretTestFlagsAndAppendAction(unsigned& programCounter, uint16_t flags, Actions&, bool ifDomain);
</span><span class="cx"> const DFABytecode* m_bytecode;
</span><span class="cx"> const unsigned m_bytecodeLength;
</span><del>- Vector<bool>& m_pagesUsed;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Tools/ChangeLog        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-07-06 Alex Christensen <achristensen@webkit.org>
+
+ [Content Extensions] Remove memory page reporting
+ https://bugs.webkit.org/show_bug.cgi?id=146659
+
+ Reviewed by Benjamin Poulain.
+
+ * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
+ (TestWebKitAPI::TEST_F):
+
</ins><span class="cx"> 2015-07-06 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> [Content Extensions] Make the DFA transitions ranges instead of characters
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp (186382 => 186383)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp        2015-07-06 23:06:18 UTC (rev 186382)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp        2015-07-06 23:26:40 UTC (rev 186383)
</span><span class="lines">@@ -1100,8 +1100,7 @@
</span><span class="cx"> combinedBytecode.appendVector(bytecode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Vector<bool> pagesUsed;
- ContentExtensions::DFABytecodeInterpreter interpreter(&combinedBytecode[0], combinedBytecode.size(), pagesUsed);
</del><ins>+ ContentExtensions::DFABytecodeInterpreter interpreter(&combinedBytecode[0], combinedBytecode.size());
</ins><span class="cx">
</span><span class="cx"> EXPECT_EQ(interpreter.interpret("ABBBX", 0).size(), 1ull);
</span><span class="cx"> EXPECT_EQ(interpreter.interpret("ACCCX", 0).size(), 1ull);
</span></span></pre>
</div>
</div>
</body>
</html>