<!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>[181980] trunk/Source/WebCore</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/181980">181980</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2015-03-25 16:05:36 -0700 (Wed, 25 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add case-insensitive checks to DFA bytecode.
https://bugs.webkit.org/show_bug.cgi?id=142977
Reviewed by Benjamin Poulain.
* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
(WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
Add case-insensitive bytecode.
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
Check to see if case-insensitive bytecodes can be used.
(WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
* contentextensions/DFABytecodeCompiler.h:
(WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
Interpret case-insensitive bytecodes.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeh">trunk/Source/WebCore/contentextensions/DFABytecode.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeCompilercpp">trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeCompilerh">trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181979 => 181980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-25 22:56:50 UTC (rev 181979)
+++ trunk/Source/WebCore/ChangeLog        2015-03-25 23:05:36 UTC (rev 181980)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-03-25 Alex Christensen <achristensen@webkit.org>
+
+ Add case-insensitive checks to DFA bytecode.
+ https://bugs.webkit.org/show_bug.cgi?id=142977
+
+ Reviewed by Benjamin Poulain.
+
+ * contentextensions/DFABytecode.h:
+ (WebCore::ContentExtensions::instructionSizeWithArguments):
+ * contentextensions/DFABytecodeCompiler.cpp:
+ (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
+ (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
+ Add case-insensitive bytecode.
+ (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
+ Check to see if case-insensitive bytecodes can be used.
+ (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
+ * contentextensions/DFABytecodeCompiler.h:
+ (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
+ Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
+ * contentextensions/DFABytecodeInterpreter.cpp:
+ (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
+ Interpret case-insensitive bytecodes.
+
</ins><span class="cx"> 2015-03-25 Sam Weinig <sam@webkit.org>
</span><span class="cx">
</span><span class="cx"> Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecode.h (181979 => 181980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecode.h        2015-03-25 22:56:50 UTC (rev 181979)
+++ trunk/Source/WebCore/contentextensions/DFABytecode.h        2015-03-25 23:05:36 UTC (rev 181980)
</span><span class="lines">@@ -39,13 +39,15 @@
</span><span class="cx"> // CheckValue has two arguments:
</span><span class="cx"> // The value to check (1 byte),
</span><span class="cx"> // The index to jump to if the values are equal (4 bytes).
</span><del>- CheckValue,
</del><ins>+ CheckValueCaseInsensitive,
+ CheckValueCaseSensitive,
</ins><span class="cx">
</span><span class="cx"> // Jump to an offset if the input value is within a certain range.
</span><span class="cx"> // The lower value (1 byte).
</span><span class="cx"> // The higher value (1 byte).
</span><span class="cx"> // The index to jump to if the value is in the range (4 bytes).
</span><del>- CheckValueRange,
</del><ins>+ CheckValueRangeCaseInsensitive,
+ CheckValueRangeCaseSensitive,
</ins><span class="cx">
</span><span class="cx"> // AppendAction has one argument:
</span><span class="cx"> // The action to append (4 bytes).
</span><span class="lines">@@ -67,9 +69,11 @@
</span><span class="cx"> static inline size_t instructionSizeWithArguments(DFABytecodeInstruction instruction)
</span><span class="cx"> {
</span><span class="cx"> switch (instruction) {
</span><del>- case DFABytecodeInstruction::CheckValue:
</del><ins>+ case DFABytecodeInstruction::CheckValueCaseSensitive:
+ case DFABytecodeInstruction::CheckValueCaseInsensitive:
</ins><span class="cx"> return sizeof(DFABytecodeInstruction) + sizeof(uint8_t) + sizeof(unsigned);
</span><del>- case DFABytecodeInstruction::CheckValueRange:
</del><ins>+ case DFABytecodeInstruction::CheckValueRangeCaseSensitive:
+ case DFABytecodeInstruction::CheckValueRangeCaseInsensitive:
</ins><span class="cx"> return sizeof(DFABytecodeInstruction) + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(unsigned);
</span><span class="cx"> case DFABytecodeInstruction::AppendAction:
</span><span class="cx"> return sizeof(DFABytecodeInstruction) + sizeof(unsigned);
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp (181979 => 181980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp        2015-03-25 22:56:50 UTC (rev 181979)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.cpp        2015-03-25 23:05:36 UTC (rev 181980)
</span><span class="lines">@@ -69,24 +69,23 @@
</span><span class="cx"> append<unsigned>(m_bytecode, 0); // This value will be set when linking.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DFABytecodeCompiler::emitCheckValue(uint8_t value, unsigned destinationNodeIndex)
</del><ins>+void DFABytecodeCompiler::emitCheckValue(uint8_t value, unsigned destinationNodeIndex, bool caseSensitive)
</ins><span class="cx"> {
</span><del>- append<DFABytecodeInstruction>(m_bytecode, DFABytecodeInstruction::CheckValue);
</del><ins>+ append<DFABytecodeInstruction>(m_bytecode, caseSensitive ? DFABytecodeInstruction::CheckValueCaseSensitive : DFABytecodeInstruction::CheckValueCaseInsensitive);
</ins><span class="cx"> append<uint8_t>(m_bytecode, value);
</span><span class="cx"> m_linkRecords.append(std::make_pair(m_bytecode.size(), destinationNodeIndex));
</span><span class="cx"> append<unsigned>(m_bytecode, 0); // This value will be set when linking.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DFABytecodeCompiler::emitCheckValueRange(uint8_t lowValue, uint8_t highValue, unsigned destinationNodeIndex)
</del><ins>+void DFABytecodeCompiler::emitCheckValueRange(uint8_t lowValue, uint8_t highValue, unsigned destinationNodeIndex, bool caseSensitive)
</ins><span class="cx"> {
</span><del>- ASSERT_WITH_MESSAGE(lowValue != highValue, "A single value check should be emitted for single values.");
- ASSERT_WITH_MESSAGE(lowValue < highValue, "The instruction semantic impose lowValue is smaller than highValue.");
</del><ins>+ ASSERT_WITH_MESSAGE(lowValue < highValue, "The instruction semantic impose lowValue is strictly less than highValue.");
</ins><span class="cx">
</span><del>- append<DFABytecodeInstruction>(m_bytecode, DFABytecodeInstruction::CheckValueRange);
</del><ins>+ append<DFABytecodeInstruction>(m_bytecode, caseSensitive ? DFABytecodeInstruction::CheckValueRangeCaseSensitive : DFABytecodeInstruction::CheckValueRangeCaseInsensitive);
</ins><span class="cx"> append<uint8_t>(m_bytecode, lowValue);
</span><span class="cx"> append<uint8_t>(m_bytecode, highValue);
</span><span class="cx"> m_linkRecords.append(std::make_pair(m_bytecode.size(), destinationNodeIndex));
</span><del>- append<unsigned>(m_bytecode, 0);
</del><ins>+ append<unsigned>(m_bytecode, 0); // This value will be set when linking.
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DFABytecodeCompiler::emitTerminate()
</span><span class="lines">@@ -113,56 +112,84 @@
</span><span class="cx">
</span><span class="cx"> void DFABytecodeCompiler::compileNodeTransitions(const DFANode& node)
</span><span class="cx"> {
</span><ins>+ unsigned destinations[128];
+ const unsigned noDestination = std::numeric_limits<unsigned>::max();
+ for (uint16_t i = 0; i < 128; i++) {
+ auto it = node.transitions.find(i);
+ if (it == node.transitions.end())
+ destinations[i] = noDestination;
+ else
+ destinations[i] = it->value;
+ }
+
+ Vector<Range> ranges;
+ uint8_t rangeMin;
</ins><span class="cx"> bool hasRangeMin = false;
</span><del>- uint16_t rangeMin;
- unsigned rangeDestination = 0;
</del><ins>+ for (uint8_t i = 0; i < 128; i++) {
+ if (hasRangeMin) {
+ ASSERT_WITH_MESSAGE(!(node.hasFallbackTransition && node.fallbackTransition == destinations[rangeMin]), "Individual transitions to the fallback transitions should have been eliminated by the optimizer.");
+ if (destinations[i] != destinations[rangeMin]) {
</ins><span class="cx">
</span><del>- for (unsigned char i = 0; i < 128; ++i) {
- auto transitionIterator = node.transitions.find(i);
- if (transitionIterator == node.transitions.end()) {
- if (hasRangeMin) {
- ASSERT_WITH_MESSAGE(!(node.hasFallbackTransition && node.fallbackTransition == rangeDestination), "Individual transitions to the fallback transitions should have been eliminated by the optimizer.");
</del><ins>+ // This is the end of a range. Check if it can be case insensitive.
+ uint8_t rangeMax = i - 1;
+ bool caseSensitive = true;
+ if (rangeMin >= 'A' && rangeMax <= 'Z') {
+ caseSensitive = false;
+ for (uint8_t rangeIndex = rangeMin; rangeIndex <= rangeMax; rangeIndex++) {
+ if (destinations[rangeMin] != destinations[toASCIILower(rangeIndex)]) {
+ caseSensitive = true;
+ break;
+ }
+ }
+ }
</ins><span class="cx">
</span><del>- unsigned char lastHighValue = i - 1;
- compileCheckForRange(rangeMin, lastHighValue, rangeDestination);
- hasRangeMin = false;
</del><ins>+ if (!caseSensitive) {
+ // If all the lower-case destinations are the same as the upper-case destinations,
+ // then they will be covered by a case-insensitive range and will not need their own range.
+ for (uint8_t rangeIndex = rangeMin; rangeIndex <= rangeMax; rangeIndex++) {
+ ASSERT(destinations[rangeMin] == destinations[toASCIILower(rangeIndex)]);
+ destinations[toASCIILower(rangeIndex)] = noDestination;
+ }
+ ranges.append(Range(toASCIILower(rangeMin), toASCIILower(rangeMax), destinations[rangeMin], caseSensitive));
+ } else
+ ranges.append(Range(rangeMin, rangeMax, destinations[rangeMin], caseSensitive));
+
+ if (destinations[i] == noDestination)
+ hasRangeMin = false;
+ else
+ rangeMin = i;
</ins><span class="cx"> }
</span><del>- continue;
- }
-
- if (!hasRangeMin) {
- hasRangeMin = true;
- rangeMin = transitionIterator->key;
- rangeDestination = transitionIterator->value;
</del><span class="cx"> } else {
</span><del>- if (transitionIterator->value == rangeDestination)
- continue;
-
- unsigned char lastHighValue = i - 1;
- compileCheckForRange(rangeMin, lastHighValue, rangeDestination);
- rangeMin = i;
- rangeDestination = transitionIterator->value;
</del><ins>+ if (destinations[i] != noDestination) {
+ rangeMin = i;
+ hasRangeMin = true;
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>- if (hasRangeMin)
- compileCheckForRange(rangeMin, 127, rangeDestination);
</del><ins>+ if (hasRangeMin) {
+ // Ranges are appended after passing the end of them.
+ // If a range goes to 127, we will have an uncommitted rangeMin because the loop does not check 128.
+ // If a range goes to 127, there will never be values higher than it, so checking for case-insensitive ranges would always fail.
+ ranges.append(Range(rangeMin, 127, destinations[rangeMin], true));
+ }
</ins><span class="cx">
</span><ins>+ for (const auto& range : ranges)
+ compileCheckForRange(range);
</ins><span class="cx"> if (node.hasFallbackTransition)
</span><span class="cx"> emitJump(node.fallbackTransition);
</span><span class="cx"> else
</span><span class="cx"> emitTerminate();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DFABytecodeCompiler::compileCheckForRange(uint16_t lowValue, uint16_t highValue, unsigned destinationNodeIndex)
</del><ins>+void DFABytecodeCompiler::compileCheckForRange(const Range& range)
</ins><span class="cx"> {
</span><del>- ASSERT_WITH_MESSAGE(lowValue < 128, "The DFA engine only supports the ASCII alphabet.");
- ASSERT_WITH_MESSAGE(highValue < 128, "The DFA engine only supports the ASCII alphabet.");
- ASSERT(lowValue <= highValue);
</del><ins>+ ASSERT_WITH_MESSAGE(range.max < 128, "The DFA engine only supports the ASCII alphabet.");
+ ASSERT(range.min <= range.max);
</ins><span class="cx">
</span><del>- if (lowValue == highValue)
- emitCheckValue(lowValue, destinationNodeIndex);
</del><ins>+ if (range.min == range.max)
+ emitCheckValue(range.min, range.destination, range.caseSensitive);
</ins><span class="cx"> else
</span><del>- emitCheckValueRange(lowValue, highValue, destinationNodeIndex);
</del><ins>+ emitCheckValueRange(range.min, range.max, range.destination, range.caseSensitive);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DFABytecodeCompiler::compile()
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeCompilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.h (181979 => 181980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.h        2015-03-25 22:56:50 UTC (rev 181979)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeCompiler.h        2015-03-25 23:05:36 UTC (rev 181980)
</span><span class="lines">@@ -49,15 +49,28 @@
</span><span class="cx"> void compile();
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ struct Range {
+ Range(uint8_t min, uint8_t max, unsigned destination, bool caseSensitive)
+ : min(min)
+ , max(max)
+ , destination(destination)
+ , caseSensitive(caseSensitive)
+ {
+ }
+ uint8_t min;
+ uint8_t max;
+ unsigned destination;
+ bool caseSensitive;
+ };
</ins><span class="cx"> void compileNode(unsigned);
</span><span class="cx"> void compileNodeTransitions(const DFANode&);
</span><del>- void compileCheckForRange(uint16_t lowValue, uint16_t highValue, unsigned destinationNodeIndex);
</del><ins>+ void compileCheckForRange(const Range&);
</ins><span class="cx">
</span><span class="cx"> void emitAppendAction(unsigned);
</span><span class="cx"> void emitTestFlagsAndAppendAction(uint16_t flags, unsigned);
</span><span class="cx"> void emitJump(unsigned destinationNodeIndex);
</span><del>- void emitCheckValue(uint8_t value, unsigned destinationNodeIndex);
- void emitCheckValueRange(uint8_t lowValue, uint8_t highValue, unsigned destinationNodeIndex);
</del><ins>+ void emitCheckValue(uint8_t value, unsigned destinationNodeIndex, bool caseSensitive);
+ void emitCheckValueRange(uint8_t lowValue, uint8_t highValue, unsigned destinationNodeIndex, bool caseSensitive);
</ins><span class="cx"> void emitTerminate();
</span><span class="cx">
</span><span class="cx"> Vector<DFABytecode>& m_bytecode;
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp (181979 => 181980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-25 22:56:50 UTC (rev 181979)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-25 23:05:36 UTC (rev 181980)
</span><span class="lines">@@ -85,33 +85,46 @@
</span><span class="cx"> case DFABytecodeInstruction::Terminate:
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><del>- case DFABytecodeInstruction::CheckValue:
</del><ins>+ case DFABytecodeInstruction::CheckValueCaseSensitive:
+ case DFABytecodeInstruction::CheckValueCaseInsensitive: {
</ins><span class="cx"> if (urlIndexIsAfterEndOfString)
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><ins>+ char character = url[urlIndex];
+ if (static_cast<DFABytecodeInstruction>(m_bytecode[programCounter]) == DFABytecodeInstruction::CheckValueCaseInsensitive)
+ character = toASCIILower(character);
+
</ins><span class="cx"> // Check to see if the next character in the url is the value stored with the bytecode.
</span><del>- if (url[urlIndex] == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))) {
</del><ins>+ if (character == getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))) {
</ins><span class="cx"> programCounter = getBits<unsigned>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t));
</span><del>- if (!url[urlIndex])
</del><ins>+ if (!character)
</ins><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><del>- } else
- programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValue);
</del><ins>+ } else {
+ programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValueCaseSensitive);
+ ASSERT(instructionSizeWithArguments(DFABytecodeInstruction::CheckValueCaseSensitive) == instructionSizeWithArguments(DFABytecodeInstruction::CheckValueCaseInsensitive));
+ }
</ins><span class="cx"> break;
</span><ins>+ }
</ins><span class="cx">
</span><del>- case DFABytecodeInstruction::CheckValueRange: {
</del><ins>+ case DFABytecodeInstruction::CheckValueRangeCaseSensitive:
+ case DFABytecodeInstruction::CheckValueRangeCaseInsensitive: {
</ins><span class="cx"> if (urlIndexIsAfterEndOfString)
</span><span class="cx"> goto nextDFA;
</span><span class="cx">
</span><span class="cx"> char character = url[urlIndex];
</span><ins>+ if (static_cast<DFABytecodeInstruction>(m_bytecode[programCounter]) == DFABytecodeInstruction::CheckValueRangeCaseInsensitive)
+ character = toASCIILower(character);
</ins><span class="cx"> if (character >= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))
</span><span class="cx"> && character <= getBits<uint8_t>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t))) {
</span><span class="cx"> programCounter = getBits<unsigned>(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t) + sizeof(uint8_t));
</span><span class="cx"> if (!character)
</span><span class="cx"> urlIndexIsAfterEndOfString = true;
</span><span class="cx"> urlIndex++; // This represents an edge in the DFA.
</span><del>- } else
- programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRange);
</del><ins>+ } else {
+ programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRangeCaseSensitive);
+ ASSERT(instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRangeCaseSensitive) == instructionSizeWithArguments(DFABytecodeInstruction::CheckValueRangeCaseInsensitive));
+ }
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>