<!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>[199511] 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/199511">199511</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-04-13 13:00:31 -0700 (Wed, 13 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>ES6: Implement RegExp.prototype[@@search].
https://bugs.webkit.org/show_bug.cgi?id=156331

Reviewed by Keith Miller.

Source/JavaScriptCore:

What changed?
1. Implemented search builtin in RegExpPrototype.js.
   The native path is now used as a fast path.
2. Added DFG support for an IsRegExpObjectIntrinsic (modelled after the
   IsJSArrayIntrinsic).
3. Renamed @isRegExp to @isRegExpObject to match the new IsRegExpObjectIntrinsic.
4. Change the esSpecIsRegExpObject() implementation to check if the object's
   JSType is RegExpObjectType instead of walking the classinfo chain.

* builtins/RegExpPrototype.js:
(search):
* builtins/StringPrototype.js:
(search):
- fixed some indentation.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
(JSC::DFG::SpeculativeJIT::compileIsRegExpObject):
(JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::compileIsRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isExoticForTypeof):
(JSC::FTL::DFG::LowerDFGToB3::isRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::isType):
* runtime/Intrinsic.h:
- Added IsRegExpObjectIntrinsic.

* runtime/CommonIdentifiers.h:

* runtime/ECMAScriptSpecInternalFunctions.cpp:
(JSC::esSpecIsConstructor):
- Changed to use uncheckedArgument since this is only called from internal code.
(JSC::esSpecIsRegExpObject):
(JSC::esSpecIsRegExp): Deleted.
* runtime/ECMAScriptSpecInternalFunctions.h:
- Changed to check the object for a JSType of RegExpObjectType.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- Added split fast path.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSearch): Deleted.
* runtime/RegExpPrototype.h:

* tests/es6.yaml:
* tests/stress/regexp-search.js:
- Rebased test.

LayoutTests:

* js/regress/regexp-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects.html: Added.
* js/regress/regexp-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects2.html: Added.

* js/regress/script-tests/regexp-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js: Added.

* js/regress/script-tests/string-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects2.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects3.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects4.js: Added.

* js/regress/string-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects.html: Added.
* js/regress/string-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects2.html: Added.
* js/regress/string-prototype-search-observable-side-effects3-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects3.html: Added.
* js/regress/string-prototype-search-observable-side-effects4-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects4.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsRegExpPrototypejs">trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsStringPrototypejs">trunk/Source/JavaScriptCore/builtins/StringPrototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh">trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGClobberizeh">trunk/Source/JavaScriptCore/dfg/DFGClobberize.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGDoesGCcpp">trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGFixupPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGNodeTypeh">trunk/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSafeToExecuteh">trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJITh">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLCapabilitiescpp">trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLowerDFGToB3cpp">trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeECMAScriptSpecInternalFunctionscpp">trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeECMAScriptSpecInternalFunctionsh">trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntrinsich">trunk/Source/JavaScriptCore/runtime/Intrinsic.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp">trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpPrototypeh">trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestses6yaml">trunk/Source/JavaScriptCore/tests/es6.yaml</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressregexpsearchjs">trunk/Source/JavaScriptCore/tests/stress/regexp-search.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffectsexpectedtxt">trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffectshtml">trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects.html</a></li>
<li><a href="#trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffects2expectedtxt">trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffects2html">trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2.html</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsregexpprototypesearchobservablesideeffectsjs">trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects.js</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsregexpprototypesearchobservablesideeffects2js">trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffectsjs">trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects.js</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects2js">trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects2.js</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects3js">trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects3.js</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects4js">trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects4.js</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffectsexpectedtxt">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffectshtml">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects.html</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects2expectedtxt">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects2html">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2.html</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects3expectedtxt">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects3html">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3.html</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects4expectedtxt">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects4html">trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/LayoutTests/ChangeLog        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-04-13  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        ES6: Implement RegExp.prototype[@@search].
+        https://bugs.webkit.org/show_bug.cgi?id=156331
+
+        Reviewed by Keith Miller.
+
+        * js/regress/regexp-prototype-search-observable-side-effects-expected.txt: Added.
+        * js/regress/regexp-prototype-search-observable-side-effects.html: Added.
+        * js/regress/regexp-prototype-search-observable-side-effects2-expected.txt: Added.
+        * js/regress/regexp-prototype-search-observable-side-effects2.html: Added.
+
+        * js/regress/script-tests/regexp-prototype-search-observable-side-effects.js: Added.
+        * js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js: Added.
+
+        * js/regress/script-tests/string-prototype-search-observable-side-effects.js: Added.
+        * js/regress/script-tests/string-prototype-search-observable-side-effects2.js: Added.
+        * js/regress/script-tests/string-prototype-search-observable-side-effects3.js: Added.
+        * js/regress/script-tests/string-prototype-search-observable-side-effects4.js: Added.
+
+        * js/regress/string-prototype-search-observable-side-effects-expected.txt: Added.
+        * js/regress/string-prototype-search-observable-side-effects.html: Added.
+        * js/regress/string-prototype-search-observable-side-effects2-expected.txt: Added.
+        * js/regress/string-prototype-search-observable-side-effects2.html: Added.
+        * js/regress/string-prototype-search-observable-side-effects3-expected.txt: Added.
+        * js/regress/string-prototype-search-observable-side-effects3.html: Added.
+        * js/regress/string-prototype-search-observable-side-effects4-expected.txt: Added.
+        * js/regress/string-prototype-search-observable-side-effects4.html: Added.
+
</ins><span class="cx"> 2016-04-13  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Mark fast/canvas/webgl/gl-teximage.html as flaky on Macs
</span></span></pre></div>
<a id="trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffectsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/regexp-prototype-search-observable-side-effects
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffectshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/regexp-prototype-search-observable-side-effects.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffects2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/regexp-prototype-search-observable-side-effects2
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressregexpprototypesearchobservablesideeffects2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/regexp-prototype-search-observable-side-effects2.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/regexp-prototype-search-observable-side-effects2.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsregexpprototypesearchobservablesideeffectsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,281 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+// RegExp subclass should not be able to override lastIndex.
+(function () {
+    let accesses = [];
+    class SubRegExp extends RegExp {
+        get lastIndex() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return super.lastIndex;
+        }
+        set lastIndex(newIndex) {
+            accesses.push(&quot;setLastIndex&quot;);
+            super.lastIndex = newIndex;
+        }
+    }
+
+    let obj = new SubRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;Should not be able to override lastIndex&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;&quot;, &quot;Should not be able to override lastIndex&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// RegExp subclass overriding exec.
+(function () {
+    let accesses = [];
+    class SubRegExp extends RegExp {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return super.exec(str);
+        }
+    }
+
+    let obj = new SubRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();

+// Any object with custom prototype overriding lastIndex.
+(function () {
+    let accesses = [];
+    let TestRegExpProto = {
+        get lastIndex() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return this._regex.lastIndex;
+        },
+        set lastIndex(newIndex) {
+            accesses.push(&quot;setLastIndex&quot;);
+            this._regex.lastIndex = newIndex;
+        },
+    }
+    TestRegExpProto.__proto__ = RegExp.prototype;
+
+    let TestRegExp = function(regex) {
+        this._regex = new RegExp(regex);
+    }
+    TestRegExp.prototype = TestRegExpProto;
+    TestRegExpProto.constructor = TestRegExp;
+
+    let obj = new TestRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    try {
+        RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+        assert(false, &quot;Error not thrown&quot;);
+    } catch (e) {
+        assert(e.toString() == &quot;TypeError: Builtin RegExp exec can only be called on a RegExp object&quot;,
+            &quot;Unexpected error message&quot;);
+    }
+    assert(accesses == &quot;getLastIndex,setLastIndex&quot;, &quot;Property accesses do not match expectation&quot;);
+})();
+
+// Any object with custom prototype overriding exec.
+(function () {
+    let accesses = [];
+    let TestRegExpProto = {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return this._regex.exec(str);
+        }
+    }
+    TestRegExpProto.__proto__ = RegExp.prototype;
+
+    let TestRegExp = function(regex) {
+        this._regex = new RegExp(regex);
+    }
+    TestRegExp.prototype = TestRegExpProto;
+    TestRegExpProto.constructor = TestRegExp;
+
+    let obj = new TestRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with the middle parent overriding exec.
+(function () {
+    let accesses = [];
+    class RegExpB extends RegExp {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return super.exec(str);
+        }
+    }
+    class RegExpC extends RegExpB { }
+
+    assert(RegExpB.__proto__ == RegExp);
+    assert(RegExpC.__proto__ == RegExpB);
+
+    let obj = new RegExpC(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with substituted prototype before instantiation.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { }
+    class C extends B { }
+
+    assert(B.__proto__ === RegExp);
+    assert(C.__proto__ === B);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === B.prototype);
+
+    let X = function () {}
+    Object.defineProperty(X.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return /rch/.exec(str);
+        }
+    });
+    Object.defineProperty(X.prototype, &quot;lastIndex&quot;, {
+        get: function() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return 0;
+        },
+        set: function(value) {
+            accesses.push(&quot;setLastIndex&quot;);
+        }
+    });
+
+    // Monkey with the prototype chain before instantiating C.
+    X.__proto__ = RegExp;
+    X.prototype.__proto__ = RegExp.prototype;
+    C.__proto__ = X;
+    C.prototype.__proto__ = X.prototype;
+
+    assert(X.__proto__ === RegExp);
+    assert(C.__proto__ === X);
+    assert(X.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === X.prototype);
+
+    let obj = new C();
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;getLastIndex,setLastIndex,exec,setLastIndex&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with substituted prototype after instantiation.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { }
+    class C extends B { }
+
+    assert(B.__proto__ === RegExp);
+    assert(C.__proto__ === B);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === B.prototype);
+
+    let obj = new C();
+
+    let X = function () {}
+    Object.defineProperty(X.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return /rch/.exec(str);
+        }
+    });
+    Object.defineProperty(X.prototype, &quot;lastIndex&quot;, {
+        get: function() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return 0;
+        },
+        set: function(value) {
+            accesses.push(&quot;setLastIndex&quot;);
+        }
+    });
+
+    // Monkey with the prototype chain after instantiating C.
+    X.__proto__ = RegExp;
+    X.prototype.__proto__ = RegExp.prototype;
+    C.__proto__ = X;
+    C.prototype.__proto__ = X.prototype;
+
+    assert(X.__proto__ === RegExp);
+    assert(C.__proto__ === X);
+    assert(X.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === X.prototype);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with proxied prototype.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { };
+
+    assert(B.__proto__ === RegExp);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+
+    let proxy = new Proxy(RegExp.prototype, {
+        get: function(obj, prop) {
+            accesses.push(&quot;get_&quot; + prop.toString());
+
+            function proxyExec(str) {
+                accesses.push(&quot;exec&quot;);
+                return /rch/.exec(str);
+            }
+
+            if (prop === &quot;exec&quot;)
+                return proxyExec;
+            return obj[prop];
+        },
+        set: function(obj, prop, value) {
+            accesses.push(&quot;set_&quot; + prop.toString());
+        }
+    });
+    B.prototype.__proto__ = proxy;
+
+    let obj = new B();
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;get_exec,exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// Proxied RegExp observing every get.
+(function () {
+    let accesses = [];
+    let regexp = new RegExp(/rch/);
+    let proxy = new Proxy(regexp, {
+        get(obj, prop) {
+            accesses.push(prop.toString());
+            if (prop == &quot;exec&quot;) {
+                return function(str) {
+                    return obj.exec(str);
+                }
+            }
+            return obj[prop];
+        }
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(proxy, &quot;searchme&quot;);
+    assert(accesses.toString() == &quot;lastIndex,exec&quot;, &quot;Proxy not able to observe some gets&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsregexpprototypesearchobservablesideeffects2js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+// RegExp.prototype with overridden exec.
+(function () {
+    let accesses = [];
+    let origExec = RegExp.prototype.exec;
+
+    let obj = /rch/;
+    Object.defineProperty(RegExp.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return origExec.call(this, str);
+        }
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = RegExp.prototype[Symbol.search].call(obj, &quot;searchme&quot;);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffectsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,379 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+//======================================================================================
+// Testing the string that we're calling search on.
+
+// Proxied String subclass.
+(function () {
+    let accesses = [];
+    class ExtString extends String { }
+    var obj = new ExtString(&quot;searchme&quot;);
+    var proxy = new Proxy(obj, {
+        get(obj, prop) {
+            accesses.push(prop.toString());
+            if (prop === &quot;toString&quot;) {
+                return function() {
+                    accesses.push(&quot;in_toString&quot;);
+                    return obj.toString();
+                }
+            }
+            return obj[prop];
+        }
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = String.prototype.search.call(proxy, &quot;rch&quot;);    
+    assert(accesses == &quot;Symbol(Symbol.toPrimitive),toString,in_toString&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// Object that looks like a string.
+(function () {
+    let accesses = [];
+    var obj = {
+        [Symbol.toPrimitive]() {
+            accesses.push(Symbol.toPrimitive.toString());
+            return &quot;searchme&quot;;
+        }
+    }
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = String.prototype.search.call(obj, &quot;rch&quot;);    
+    assert(accesses == &quot;Symbol(Symbol.toPrimitive)&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// Object that looks like a string.
+(function () {
+    let accesses = [];
+    var obj = {
+        toString() {
+            accesses.push(&quot;toString&quot;);
+            return &quot;searchme&quot;;
+        }
+    }
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = String.prototype.search.call(obj, &quot;rch&quot;);    
+    assert(accesses == &quot;toString&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// String subclass with overridden @@search.
+(function () {
+    let accesses = [];
+    class ExtString extends String {
+        [Symbol.search] (str) {
+            accesses.push(&quot;Symbol(Symbol.search)&quot;);
+            return /rch/[Symbol.search](str);
+        }
+    };
+
+    var obj = new ExtString;
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);    
+    assert(accesses == &quot;Symbol(Symbol.search)&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+
+// Object with overridden @@search.
+(function () {
+    let accesses = [];
+    var obj = {
+        [Symbol.search] (str) {
+            accesses.push(&quot;Symbol(Symbol.search)&quot;);
+            return /rch/[Symbol.search](str);
+        },
+    }
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;Symbol(Symbol.search)&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+
+//======================================================================================
+// Testing the regexp object that we're calling search with.
+
+// RegExp subclass should not be able to override lastIndex.
+(function () {
+    let accesses = [];
+    class SubRegExp extends RegExp {
+        get lastIndex() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return super.lastIndex;
+        }
+        set lastIndex(newIndex) {
+            accesses.push(&quot;setLastIndex&quot;);
+            super.lastIndex = newIndex;
+        }
+    }
+
+    let obj = new SubRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;Should not be able to override lastIndex&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;&quot;, &quot;Should not be able to override lastIndex&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// RegExp subclass overriding exec.
+(function () {
+    let accesses = [];
+    class SubRegExp extends RegExp {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return super.exec(str);
+        }
+    }
+
+    let obj = new SubRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();

+// Any object with custom prototype overriding lastIndex.
+(function () {
+    let accesses = [];
+    let TestRegExpProto = {
+        get lastIndex() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return this._regex.lastIndex;
+        },
+        set lastIndex(newIndex) {
+            accesses.push(&quot;setLastIndex&quot;);
+            this._regex.lastIndex = newIndex;
+        },
+    }
+    TestRegExpProto.__proto__ = RegExp.prototype;
+
+    let TestRegExp = function(regex) {
+        this._regex = new RegExp(regex);
+    }
+    TestRegExp.prototype = TestRegExpProto;
+    TestRegExpProto.constructor = TestRegExp;
+
+    let obj = new TestRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    try {
+        let result = &quot;searchme&quot;.search(obj);
+        assert(false, &quot;Error not thrown&quot;);
+    } catch (e) {
+        assert(e.toString() == &quot;TypeError: Builtin RegExp exec can only be called on a RegExp object&quot;,
+            &quot;Unexpected error message&quot;);
+    }
+    assert(accesses == &quot;getLastIndex,setLastIndex&quot;, &quot;Property accesses do not match expectation&quot;);
+})();
+
+// Any object with custom prototype overriding exec.
+(function () {
+    let accesses = [];
+    let TestRegExpProto = {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return this._regex.exec(str);
+        }
+    }
+    TestRegExpProto.__proto__ = RegExp.prototype;
+
+    let TestRegExp = function(regex) {
+        this._regex = new RegExp(regex);
+    }
+    TestRegExp.prototype = TestRegExpProto;
+    TestRegExpProto.constructor = TestRegExp;
+
+    let obj = new TestRegExp(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with the middle parent overriding exec.
+(function () {
+    let accesses = [];
+    class RegExpB extends RegExp {
+        exec(str) {
+            accesses.push(&quot;exec&quot;);
+            return super.exec(str);
+        }
+    }
+    class RegExpC extends RegExpB { }
+
+    assert(RegExpB.__proto__ == RegExp);
+    assert(RegExpC.__proto__ == RegExpB);
+
+    let obj = new RegExpC(/rch/);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with substituted prototype before instantiation.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { }
+    class C extends B { }
+
+    assert(B.__proto__ === RegExp);
+    assert(C.__proto__ === B);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === B.prototype);
+
+    let X = function () {}
+    Object.defineProperty(X.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return /rch/.exec(str);
+        }
+    });
+    Object.defineProperty(X.prototype, &quot;lastIndex&quot;, {
+        get: function() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return 0;
+        },
+        set: function(value) {
+            accesses.push(&quot;setLastIndex&quot;);
+        }
+    });
+
+    // Monkey with the prototype chain before instantiating C.
+    X.__proto__ = RegExp;
+    X.prototype.__proto__ = RegExp.prototype;
+    C.__proto__ = X;
+    C.prototype.__proto__ = X.prototype;
+
+    assert(X.__proto__ === RegExp);
+    assert(C.__proto__ === X);
+    assert(X.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === X.prototype);
+
+    let obj = new C();
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;getLastIndex,setLastIndex,exec,setLastIndex&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with substituted prototype after instantiation.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { }
+    class C extends B { }
+
+    assert(B.__proto__ === RegExp);
+    assert(C.__proto__ === B);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === B.prototype);
+
+    let obj = new C();
+
+    let X = function () {}
+    Object.defineProperty(X.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return /rch/.exec(str);
+        }
+    });
+    Object.defineProperty(X.prototype, &quot;lastIndex&quot;, {
+        get: function() {
+            accesses.push(&quot;getLastIndex&quot;);
+            return 0;
+        },
+        set: function(value) {
+            accesses.push(&quot;setLastIndex&quot;);
+        }
+    });
+
+    // Monkey with the prototype chain after instantiating C.
+    X.__proto__ = RegExp;
+    X.prototype.__proto__ = RegExp.prototype;
+    C.__proto__ = X;
+    C.prototype.__proto__ = X.prototype;
+
+    assert(X.__proto__ === RegExp);
+    assert(C.__proto__ === X);
+    assert(X.prototype.__proto__ === RegExp.prototype);
+    assert(C.prototype.__proto__ === X.prototype);
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// 2 levels of RegExp subclasses with proxied prototype.
+(function () {
+    let accesses = [];
+
+    class B extends RegExp { };
+
+    assert(B.__proto__ === RegExp);
+    assert(B.prototype.__proto__ === RegExp.prototype);
+
+    let proxy = new Proxy(RegExp.prototype, {
+        get: function(obj, prop) {
+            accesses.push(&quot;get_&quot; + prop.toString());
+
+            function proxyExec(str) {
+                accesses.push(&quot;exec&quot;);
+                return /rch/.exec(str);
+            }
+
+            if (prop === &quot;exec&quot;)
+                return proxyExec;
+            return obj[prop];
+        },
+        set: function(obj, prop, value) {
+            accesses.push(&quot;set_&quot; + prop.toString());
+        }
+    });
+    B.prototype.__proto__ = proxy;
+
+    let obj = new B();
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;get_Symbol(Symbol.search),get_exec,exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
+
+// Proxied RegExp observing every get.
+(function () {
+    let accesses = [];
+    let regexp = new RegExp(/rch/);
+    let proxy = new Proxy(regexp, {
+        get(obj, prop) {
+            accesses.push(prop.toString());
+            if (prop == &quot;exec&quot;) {
+                return function(str) {
+                    return obj.exec(str);
+                }
+            }
+            return obj[prop];
+        }
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(proxy);
+    assert(accesses.toString() == &quot;Symbol(Symbol.search),lastIndex,exec&quot;, &quot;Proxy not able to observe some gets&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects2js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects2.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects2.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects2.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+// String prototype with overridden @@search.
+(function () {
+    let accesses = [];
+    var obj = String(&quot;&quot;);
+    Object.defineProperty(String.prototype, Symbol.search, {
+        value: function (str) {
+            accesses.push(&quot;Symbol(Symbol.search)&quot;);
+            return /rch/[Symbol.search](str);
+        },
+        writable: true,
+        configurable: true,
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;Symbol(Symbol.search)&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+
+    Object.defineProperty(String.prototype, Symbol.search, { value: undefined, writable: false, configurable: true });
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects3js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects3.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects3.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects3.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+// String prototype with overridden @@search: test with string literal.
+(function () {
+    let accesses = [];
+    var obj = &quot;&quot;;
+    Object.defineProperty(String.prototype, Symbol.search, {
+        value: function (str) {
+            accesses.push(&quot;Symbol(Symbol.search)&quot;);
+            return /rch/[Symbol.search](str);
+        },
+        writable: true,
+        configurable: true,
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;Symbol(Symbol.search)&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+
+    Object.defineProperty(String.prototype, Symbol.search, { value: undefined, writable: false, configurable: true });
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsstringprototypesearchobservablesideeffects4js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects4.js (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects4.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/string-prototype-search-observable-side-effects4.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+//@ runDefault
+
+function assert(testedValue, msg) {
+    if (!testedValue)
+        throw Error(msg);
+}
+
+// RegExp.prototype with overridden exec.
+(function () {
+    let accesses = [];
+    let origExec = RegExp.prototype.exec;
+
+    let obj = /rch/;
+    Object.defineProperty(RegExp.prototype, &quot;exec&quot;, {
+        value: function(str) {
+            accesses.push(&quot;exec&quot;);
+            return origExec.call(this, str);
+        }
+    });
+
+    assert(accesses == &quot;&quot;, &quot;unexpected call to overridden props&quot;);
+    let result = &quot;searchme&quot;.search(obj);
+    assert(accesses == &quot;exec&quot;, &quot;Property accesses do not match expectation&quot;);
+    assert(result === 3, &quot;Unexpected result&quot;);
+})();
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffectsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/string-prototype-search-observable-side-effects
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffectshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/string-prototype-search-observable-side-effects.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/string-prototype-search-observable-side-effects2
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects2.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/string-prototype-search-observable-side-effects2.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/string-prototype-search-observable-side-effects3
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects3.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/string-prototype-search-observable-side-effects3.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4-expected.txt (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4-expected.txt        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/string-prototype-search-observable-side-effects4
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressstringprototypesearchobservablesideeffects4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4.html (0 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/string-prototype-search-observable-side-effects4.html        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/string-prototype-search-observable-side-effects4.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -1,3 +1,86 @@
</span><ins>+2016-04-13  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        ES6: Implement RegExp.prototype[@@search].
+        https://bugs.webkit.org/show_bug.cgi?id=156331
+
+        Reviewed by Keith Miller.
+
+        What changed?
+        1. Implemented search builtin in RegExpPrototype.js.
+           The native path is now used as a fast path.
+        2. Added DFG support for an IsRegExpObjectIntrinsic (modelled after the
+           IsJSArrayIntrinsic).
+        3. Renamed @isRegExp to @isRegExpObject to match the new IsRegExpObjectIntrinsic.
+        4. Change the esSpecIsRegExpObject() implementation to check if the object's
+           JSType is RegExpObjectType instead of walking the classinfo chain.
+
+        * builtins/RegExpPrototype.js:
+        (search):
+        * builtins/StringPrototype.js:
+        (search):
+        - fixed some indentation.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
+        (JSC::DFG::SpeculativeJIT::compileIsRegExpObject):
+        (JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
+        * dfg/DFGSpeculativeJIT.h:
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileNode):
+        (JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
+        (JSC::FTL::DFG::LowerDFGToB3::compileIsRegExpObject):
+        (JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
+        (JSC::FTL::DFG::LowerDFGToB3::isExoticForTypeof):
+        (JSC::FTL::DFG::LowerDFGToB3::isRegExpObject):
+        (JSC::FTL::DFG::LowerDFGToB3::isType):
+        * runtime/Intrinsic.h:
+        - Added IsRegExpObjectIntrinsic.
+
+        * runtime/CommonIdentifiers.h:
+
+        * runtime/ECMAScriptSpecInternalFunctions.cpp:
+        (JSC::esSpecIsConstructor):
+        - Changed to use uncheckedArgument since this is only called from internal code.
+        (JSC::esSpecIsRegExpObject):
+        (JSC::esSpecIsRegExp): Deleted.
+        * runtime/ECMAScriptSpecInternalFunctions.h:
+        - Changed to check the object for a JSType of RegExpObjectType.
+
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init):
+        - Added split fast path.
+
+        * runtime/RegExpPrototype.cpp:
+        (JSC::RegExpPrototype::finishCreation):
+        (JSC::regExpProtoFuncSearchFast):
+        (JSC::regExpProtoFuncSearch): Deleted.
+        * runtime/RegExpPrototype.h:
+
+        * tests/es6.yaml:
+        * tests/stress/regexp-search.js:
+        - Rebased test.
+
</ins><span class="cx"> 2016-04-12  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         PolymorphicAccess::regenerate() shouldn't have to clone non-generated AccessCases
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsRegExpPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -108,6 +108,40 @@
</span><span class="cx">     return builtinExec.@call(regexp, str);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// 21.2.5.9 RegExp.prototype[@@search] (string)
+function search(strArg)
+{
+    &quot;use strict&quot;;
+
+    let regexp = this;
+
+    // Check for observable side effects and call the fast path if there aren't any.
+    if (@isRegExpObject(regexp) &amp;&amp; @tryGetById(regexp, &quot;exec&quot;) === @RegExp.prototype.@exec)
+        return @regExpSearchFast.@call(regexp, strArg);
+
+    // 1. Let rx be the this value.
+    // 2. If Type(rx) is not Object, throw a TypeError exception.
+    if (!@isObject(this))
+        throw new @TypeError(&quot;RegExp.prototype.@@search requires that |this| be an Object&quot;);
+
+    // 3. Let S be ? ToString(string).
+    let str = @toString(strArg)
+
+    // 4. Let previousLastIndex be ? Get(rx, &quot;lastIndex&quot;).
+    let previousLastIndex = regexp.lastIndex;
+    // 5. Perform ? Set(rx, &quot;lastIndex&quot;, 0, true).
+    regexp.lastIndex = 0;
+    // 6. Let result be ? RegExpExec(rx, S).
+    let result = @regExpExec(regexp, str);
+    // 7. Perform ? Set(rx, &quot;lastIndex&quot;, previousLastIndex, true).
+    regexp.lastIndex = previousLastIndex;
+    // 8. If result is null, return -1.
+    if (result === null)
+        return -1;
+    // 9. Return ? Get(result, &quot;index&quot;).
+    return result.index;
+}
+
</ins><span class="cx"> function hasObservableSideEffectsForRegExpSplit(regexp) {
</span><span class="cx">     // This is accessed by the RegExpExec internal function.
</span><span class="cx">     let regexpExec = @tryGetById(regexp, &quot;exec&quot;);
</span><span class="lines">@@ -141,7 +175,7 @@
</span><span class="cx">     if (regexpSource !== @regExpProtoSourceGetter)
</span><span class="cx">         return true;
</span><span class="cx">     
</span><del>-    return !@isRegExp(regexp);
</del><ins>+    return !@isRegExpObject(regexp);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ES 21.2.5.11 RegExp.prototype[@@split](string, limit)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsStringPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/StringPrototype.js (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (regexp != null) {
</span><del>-         var searcher = regexp[@symbolSearch];
-         if (searcher != @undefined)
</del><ins>+        var searcher = regexp[@symbolSearch];
+        if (searcher != @undefined)
</ins><span class="cx">             return searcher.@call(regexp, this);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -974,7 +974,8 @@
</span><span class="cx">     case IsString:
</span><span class="cx">     case IsObject:
</span><span class="cx">     case IsObjectOrNull:
</span><del>-    case IsFunction: {
</del><ins>+    case IsFunction:
+    case IsRegExpObject: {
</ins><span class="cx">         AbstractValue child = forNode(node-&gt;child1());
</span><span class="cx">         if (child.value()) {
</span><span class="cx">             bool constantWasSet = true;
</span><span class="lines">@@ -1049,6 +1050,9 @@
</span><span class="cx">                 } else
</span><span class="cx">                     setConstant(node, jsBoolean(false));
</span><span class="cx">                 break;
</span><ins>+            case IsRegExpObject:
+                setConstant(node, jsBoolean(child.value().isObject() &amp;&amp; child.value().getObject()-&gt;type() == RegExpObjectType));
+                break;
</ins><span class="cx">             default:
</span><span class="cx">                 constantWasSet = false;
</span><span class="cx">                 break;
</span><span class="lines">@@ -1191,6 +1195,21 @@
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             break;
</span><ins>+
+        case IsRegExpObject:
+            // We don't have a SpeculatedType for Proxies yet so we can't do better at proving false.
+            if (!(child.m_type &amp; ~SpecRegExpObject)) {
+                setConstant(node, jsBoolean(true));
+                constantWasSet = true;
+                break;
+            }
+            if (!(child.m_type &amp; SpecObject)) {
+                setConstant(node, jsBoolean(false));
+                constantWasSet = true;
+                break;
+            }
+            break;
+
</ins><span class="cx">         default:
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -2242,6 +2242,15 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    case IsRegExpObjectIntrinsic: {
+        ASSERT(argumentCountIncludingThis == 2);
+
+        insertChecks();
+        Node* isRegExpObject = addToGraph(IsRegExpObject, OpInfo(prediction), get(virtualRegisterForArgument(1, registerOffset)));
+        set(VirtualRegister(resultOperand), isRegExpObject);
+        return true;
+    }
+
</ins><span class="cx">     case StringPrototypeReplaceIntrinsic: {
</span><span class="cx">         if (argumentCountIncludingThis != 3)
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGClobberizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGClobberize.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -160,6 +160,7 @@
</span><span class="cx">     case IsNumber:
</span><span class="cx">     case IsString:
</span><span class="cx">     case IsObject:
</span><ins>+    case IsRegExpObject:
</ins><span class="cx">     case LogicalNot:
</span><span class="cx">     case CheckInBounds:
</span><span class="cx">     case DoubleRep:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGDoesGCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx">     case IsObject:
</span><span class="cx">     case IsObjectOrNull:
</span><span class="cx">     case IsFunction:
</span><ins>+    case IsRegExpObject:
</ins><span class="cx">     case TypeOf:
</span><span class="cx">     case LogicalNot:
</span><span class="cx">     case ToPrimitive:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGFixupPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -1510,6 +1510,7 @@
</span><span class="cx">         case IsNumber:
</span><span class="cx">         case IsObjectOrNull:
</span><span class="cx">         case IsFunction:
</span><ins>+        case IsRegExpObject:
</ins><span class="cx">         case CreateDirectArguments:
</span><span class="cx">         case CreateClonedArguments:
</span><span class="cx">         case Jump:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGNodeType.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -309,6 +309,7 @@
</span><span class="cx">     macro(IsObject, NodeResultBoolean) \
</span><span class="cx">     macro(IsObjectOrNull, NodeResultBoolean) \
</span><span class="cx">     macro(IsFunction, NodeResultBoolean) \
</span><ins>+    macro(IsRegExpObject, NodeResultBoolean) \
</ins><span class="cx">     macro(TypeOf, NodeResultJS) \
</span><span class="cx">     macro(LogicalNot, NodeResultBoolean) \
</span><span class="cx">     macro(ToPrimitive, NodeResultJS | NodeMustGenerate) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -431,7 +431,8 @@
</span><span class="cx">         case IsString:
</span><span class="cx">         case IsObject:
</span><span class="cx">         case IsObjectOrNull:
</span><del>-        case IsFunction: {
</del><ins>+        case IsFunction:
+        case IsRegExpObject: {
</ins><span class="cx">             changed |= setPrediction(SpecBoolean);
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSafeToExecuteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -262,6 +262,7 @@
</span><span class="cx">     case IsObject:
</span><span class="cx">     case IsObjectOrNull:
</span><span class="cx">     case IsFunction:
</span><ins>+    case IsRegExpObject:
</ins><span class="cx">     case TypeOf:
</span><span class="cx">     case LogicalNot:
</span><span class="cx">     case CallObjectConstructor:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -3425,6 +3425,30 @@
</span><span class="cx">     unblessedBooleanResult(resultGPR, node);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void SpeculativeJIT::compileIsRegExpObject(Node* node)
+{
+    JSValueOperand value(this, node-&gt;child1());
+    GPRFlushedCallResult result(this);
+
+    JSValueRegs valueRegs = value.jsValueRegs();
+    GPRReg resultGPR = result.gpr();
+
+    JITCompiler::Jump isNotCell = m_jit.branchIfNotCell(valueRegs);
+
+    m_jit.compare8(JITCompiler::Equal,
+        JITCompiler::Address(valueRegs.payloadGPR(), JSCell::typeInfoTypeOffset()),
+        TrustedImm32(RegExpObjectType),
+        resultGPR);
+    blessBoolean(resultGPR);
+    JITCompiler::Jump done = m_jit.jump();
+
+    isNotCell.link(&amp;m_jit);
+    moveFalseTo(resultGPR);
+
+    done.link(&amp;m_jit);
+    blessedBooleanResult(resultGPR, node);
+}
+
</ins><span class="cx"> void SpeculativeJIT::compileCallObjectConstructor(Node* node)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(node-&gt;child1().useKind() == UntypedUse);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -737,6 +737,7 @@
</span><span class="cx">     void compileIsJSArray(Node*);
</span><span class="cx">     void compileIsArrayConstructor(Node*);
</span><span class="cx">     void compileIsArrayObject(Node*);
</span><ins>+    void compileIsRegExpObject(Node*);
</ins><span class="cx">     
</span><span class="cx">     void emitCall(Node*);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -4529,6 +4529,12 @@
</span><span class="cx">         compileIsFunction(node);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+
+    case IsRegExpObject: {
+        compileIsRegExpObject(node);
+        break;
+    }
+
</ins><span class="cx">     case TypeOf: {
</span><span class="cx">         compileTypeOf(node);
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -4542,6 +4542,11 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    case IsRegExpObject: {
+        compileIsRegExpObject(node);
+        break;
+    }
+
</ins><span class="cx">     case TypeOf: {
</span><span class="cx">         compileTypeOf(node);
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -186,6 +186,7 @@
</span><span class="cx">     case IsObject:
</span><span class="cx">     case IsObjectOrNull:
</span><span class="cx">     case IsFunction:
</span><ins>+    case IsRegExpObject:
</ins><span class="cx">     case CheckTypeInfoFlags:
</span><span class="cx">     case OverridesHasInstance:
</span><span class="cx">     case InstanceOf:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLowerDFGToB3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -870,6 +870,9 @@
</span><span class="cx">         case IsFunction:
</span><span class="cx">             compileIsFunction();
</span><span class="cx">             break;
</span><ins>+        case IsRegExpObject:
+            compileIsRegExpObject();
+            break;
</ins><span class="cx">         case TypeOf:
</span><span class="cx">             compileTypeOf();
</span><span class="cx">             break;
</span><span class="lines">@@ -5902,7 +5905,26 @@
</span><span class="cx">             m_out.boolean, notCellResult, functionResult, objectResult, slowResult);
</span><span class="cx">         setBoolean(result);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    void compileIsRegExpObject()
+    {
+        LValue value = lowJSValue(m_node-&gt;child1());
+
+        LBasicBlock isCellCase = m_out.newBlock();
+        LBasicBlock continuation = m_out.newBlock();
+
+        ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);
+        m_out.branch(
+            isCell(value, provenType(m_node-&gt;child1())), unsure(isCellCase), unsure(continuation));
+
+        LBasicBlock lastNext = m_out.appendTo(isCellCase, continuation);
+        ValueFromBlock cellResult = m_out.anchor(isRegExpObject(value, provenType(m_node-&gt;child1())));
+        m_out.jump(continuation);
+
+        m_out.appendTo(continuation, lastNext);
+        setBoolean(m_out.phi(m_out.boolean, notCellResult, cellResult));
+    }
+
</ins><span class="cx">     void compileTypeOf()
</span><span class="cx">     {
</span><span class="cx">         Edge child = m_node-&gt;child1();
</span><span class="lines">@@ -9950,7 +9972,16 @@
</span><span class="cx">             m_out.load8ZeroExt32(cell, m_heaps.JSCell_typeInfoFlags),
</span><span class="cx">             m_out.constInt32(MasqueradesAsUndefined | TypeOfShouldCallGetCallData));
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    LValue isRegExpObject(LValue cell, SpeculatedType type = SpecFullTop)
+    {
+        if (LValue proven = isProvenValue(type &amp; SpecCell, SpecRegExpObject))
+            return proven;
+        return m_out.equal(
+            m_out.load8ZeroExt32(cell, m_heaps.JSCell_typeInfoType),
+            m_out.constInt32(RegExpObjectType));
+    }
+
</ins><span class="cx">     LValue isType(LValue cell, JSType type)
</span><span class="cx">     {
</span><span class="cx">         return m_out.equal(
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx">     macro(isJSArray) \
</span><span class="cx">     macro(isArrayConstructor) \
</span><span class="cx">     macro(isConstructor) \
</span><del>-    macro(isRegExp) \
</del><ins>+    macro(isRegExpObject) \
</ins><span class="cx">     macro(concatMemcpy) \
</span><span class="cx">     macro(appendMemcpy) \
</span><span class="cx">     macro(predictFinalLengthFromArgumunts) \
</span><span class="lines">@@ -433,6 +433,7 @@
</span><span class="cx">     macro(regExpProtoSourceGetter) \
</span><span class="cx">     macro(regExpProtoStickyGetter) \
</span><span class="cx">     macro(regExpProtoUnicodeGetter) \
</span><ins>+    macro(regExpSearchFast) \
</ins><span class="cx">     macro(regExpSplitFast) \
</span><span class="cx">     macro(stringIncludesInternal) \
</span><span class="cx">     macro(stringSplitFast) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeECMAScriptSpecInternalFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -29,21 +29,22 @@
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;ConstructData.h&quot;
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><del>-#include &quot;ProxyObject.h&quot;
</del><span class="cx"> #include &quot;RegExpObject.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL esSpecIsConstructor(ExecState* exec)
</span><span class="cx"> {
</span><del>-    bool isConstructor = exec-&gt;argument(0).isConstructor();
</del><ins>+    bool isConstructor = exec-&gt;uncheckedArgument(0).isConstructor();
</ins><span class="cx">     return JSValue::encode(jsBoolean(isConstructor));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL esSpecIsRegExp(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL esSpecIsRegExpObject(ExecState* exec)
</ins><span class="cx"> {
</span><del>-    bool isRegExp = exec-&gt;argument(0).inherits(RegExpObject::info());
-    return JSValue::encode(jsBoolean(isRegExp));
</del><ins>+    JSValue value = exec-&gt;uncheckedArgument(0);
+    if (value.isObject())
+        return JSValue::encode(jsBoolean(value.getObject()-&gt;type() == RegExpObjectType));
+    return JSValue::encode(jsBoolean(false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeECMAScriptSpecInternalFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL esSpecIsConstructor(ExecState*);
</span><del>-EncodedJSValue JSC_HOST_CALL esSpecIsRegExp(ExecState*);
</del><ins>+EncodedJSValue JSC_HOST_CALL esSpecIsRegExpObject(ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntrinsich"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Intrinsic.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Intrinsic.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/Intrinsic.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     IsArrayIntrinsic,
</span><span class="cx">     IsArrayConstructorIntrinsic,
</span><span class="cx">     IsJSArrayIntrinsic,
</span><ins>+    IsRegExpObjectIntrinsic,
</ins><span class="cx"> 
</span><span class="cx">     // Getter intrinsics.
</span><span class="cx">     TypedArrayLengthIntrinsic,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -632,7 +632,7 @@
</span><span class="cx"> #endif // ENABLE(INTL)
</span><span class="cx"> 
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;isConstructorPrivateName, JSFunction::create(vm, this, 1, String(), esSpecIsConstructor, NoIntrinsic), DontEnum | DontDelete | ReadOnly),
</span><del>-        GlobalPropertyInfo(vm.propertyNames-&gt;isRegExpPrivateName, JSFunction::create(vm, this, 1, String(), esSpecIsRegExp, NoIntrinsic), DontEnum | DontDelete | ReadOnly),
</del><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;isRegExpObjectPrivateName, JSFunction::create(vm, this, 1, String(), esSpecIsRegExpObject, IsRegExpObjectIntrinsic), DontEnum | DontDelete | ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().speciesConstructorPrivateName(), JSFunction::createBuiltinFunction(vm, globalObjectSpeciesConstructorCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</span><span class="cx"> 
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpProtoFlagsGetterPrivateName, regExpProtoFlagsGetterObject, DontEnum | DontDelete | ReadOnly),
</span><span class="lines">@@ -648,6 +648,7 @@
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().hasObservableSideEffectsForRegExpSplitPrivateName(), JSFunction::createBuiltinFunction(vm, regExpPrototypeHasObservableSideEffectsForRegExpSplitCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().advanceStringIndexPrivateName(), JSFunction::createBuiltinFunction(vm, regExpPrototypeAdvanceStringIndexCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().regExpExecPrivateName(), JSFunction::createBuiltinFunction(vm, regExpPrototypeRegExpExecCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</span><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;regExpSearchFastPrivateName, JSFunction::create(vm, this, 2, String(), regExpProtoFuncSearchFast), DontEnum | DontDelete | ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpSplitFastPrivateName, JSFunction::create(vm, this, 2, String(), regExpProtoFuncSplitFast), DontEnum | DontDelete | ReadOnly),
</span><span class="cx"> 
</span><span class="cx">         // String.prototype helpers.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -49,7 +49,6 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncMatchPrivate(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState*);
</span><del>-static EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearch(ExecState*);
</del><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoGetterGlobal(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoGetterIgnoreCase(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoGetterMultiline(ExecState*);
</span><span class="lines">@@ -81,7 +80,7 @@
</span><span class="cx">     JSC_NATIVE_GETTER(vm.propertyNames-&gt;flags, regExpProtoGetterFlags, DontEnum | Accessor);
</span><span class="cx">     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;builtinNames().matchPrivateName(), regExpProtoFuncMatchPrivate, DontEnum | DontDelete | ReadOnly, 1);
</span><span class="cx">     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;matchSymbol, regExpPrototypeMatchCodeGenerator, DontEnum);
</span><del>-    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;searchSymbol, regExpProtoFuncSearch, DontEnum, 1);
</del><ins>+    JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;searchSymbol, regExpPrototypeSearchCodeGenerator, DontEnum);
</ins><span class="cx">     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;splitSymbol, regExpPrototypeSplitCodeGenerator, DontEnum);
</span><span class="cx"> 
</span><span class="cx">     JSFunction* execFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames-&gt;exec.string(), regExpProtoFuncExec, RegExpExecIntrinsic);
</span><span class="lines">@@ -419,20 +418,19 @@
</span><span class="cx">     return JSValue::encode(regExpProtoGetterSourceInternal(exec, pattern, pattern.characters16(), pattern.length()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearch(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearchFast(ExecState* exec)
</ins><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><del>-    if (!thisValue.inherits(RegExpObject::info()))
-        return throwVMTypeError(exec);
</del><span class="cx">     RegExp* regExp = asRegExpObject(thisValue)-&gt;regExp();
</span><span class="cx"> 
</span><del>-    JSString* string = exec-&gt;argument(0).toString(exec);
</del><ins>+    JSString* string = exec-&gt;uncheckedArgument(0).toString(exec);
</ins><span class="cx">     String s = string-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (vm.exception())
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     RegExpConstructor* regExpConstructor = exec-&gt;lexicalGlobalObject()-&gt;regExpConstructor();
</span><del>-    MatchResult result = regExpConstructor-&gt;performMatch(exec-&gt;vm(), regExp, string, s, 0);
</del><ins>+    MatchResult result = regExpConstructor-&gt;performMatch(vm, regExp, string, s, 0);
</ins><span class="cx">     return JSValue::encode(result ? jsNumber(result.start) : jsNumber(-1));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     WriteBarrier&lt;RegExp&gt; m_emptyRegExp;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearchFast(ExecState*);
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL regExpProtoFuncSplitFast(ExecState*);
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestses6yaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/es6.yaml (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/es6.yaml        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/tests/es6.yaml        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -1005,7 +1005,7 @@
</span><span class="cx"> - path: es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.replace].js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.search].js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.split].js
</span><span class="cx">   cmd: runES6 :normal
</span><span class="cx"> - path: es6/Proxy_internal_get_calls_RegExp_constructor.js
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressregexpsearchjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/regexp-search.js (199510 => 199511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/regexp-search.js        2016-04-13 19:35:40 UTC (rev 199510)
+++ trunk/Source/JavaScriptCore/tests/stress/regexp-search.js        2016-04-13 20:00:31 UTC (rev 199511)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> for (var primitive of primitives) {
</span><span class="cx">     shouldThrow(function () {
</span><span class="cx">         RegExp.prototype[Symbol.search].call(primitive)
</span><del>-    }, 'TypeError: Type error');
</del><ins>+    }, 'TypeError: RegExp.prototype.@@search requires that |this| be an Object');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> shouldThrow(function () {
</span></span></pre>
</div>
</div>

</body>
</html>