<!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>[199812] trunk/Source/JavaScriptCore</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/199812">199812</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2016-04-21 03:57:45 -0700 (Thu, 21 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Align RegExp[@@match] with other @@ methods
https://bugs.webkit.org/show_bug.cgi?id=156832

Reviewed by Mark Lam.

Various changes to align the RegExp[@@match] with [@@search] and [@@split].

Made RegExp.prototype.@exec a hidden property on the global object and
called it @regExpBuiltinExec to match the name it has in the standard.
Changed all places that used the old name to use the new one.

Made the match fast path function, which used to be call @match, to be called
@regExpMatchFast and put it on the global object.  Changed it to also handle
expressions both with and without the global flag.  Refactored the builtin
@match accordingly.

Added the builtin function @hasObservableSideEffectsForRegExpMatch() that
checks to see if we can use the fast path of if we need the explicit version.

Put the main RegExp functions @match, @search and @split in alphabetical
order in RegExpPrototype.js.  Did the same for @match, @repeat, @search and 
@split in StringPrototype.js.
        
* builtins/RegExpPrototype.js:
(regExpExec):
(hasObservableSideEffectsForRegExpMatch): New.
(match):
(search):
(hasObservableSideEffectsForRegExpSplit):
Reordered in the file and updated to use @regExpBuiltinExec.

* builtins/StringPrototype.js:
(match):
(repeatSlowPath):
(repeat):
(search):
(split):
Reordered functions in the file.

* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::setGlobalThis):
(JSC::getById):
(JSC::getGetterById):
(JSC::JSGlobalObject::init):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncMatchFast):
(JSC::regExpProtoFuncMatchPrivate): Deleted.
* runtime/RegExpPrototype.h:</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-04-21  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Align RegExp[@@match] with other @@ methods
+        https://bugs.webkit.org/show_bug.cgi?id=156832
+
+        Reviewed by Mark Lam.
+
+        Various changes to align the RegExp[@@match] with [@@search] and [@@split].
+
+        Made RegExp.prototype.@exec a hidden property on the global object and
+        called it @regExpBuiltinExec to match the name it has in the standard.
+        Changed all places that used the old name to use the new one.
+
+        Made the match fast path function, which used to be call @match, to be called
+        @regExpMatchFast and put it on the global object.  Changed it to also handle
+        expressions both with and without the global flag.  Refactored the builtin
+        @match accordingly.
+
+        Added the builtin function @hasObservableSideEffectsForRegExpMatch() that
+        checks to see if we can use the fast path of if we need the explicit version.
+
+        Put the main RegExp functions @match, @search and @split in alphabetical
+        order in RegExpPrototype.js.  Did the same for @match, @repeat, @search and 
+        @split in StringPrototype.js.
+        
+        * builtins/RegExpPrototype.js:
+        (regExpExec):
+        (hasObservableSideEffectsForRegExpMatch): New.
+        (match):
+        (search):
+        (hasObservableSideEffectsForRegExpSplit):
+        Reordered in the file and updated to use @regExpBuiltinExec.
+
+        * builtins/StringPrototype.js:
+        (match):
+        (repeatSlowPath):
+        (repeat):
+        (search):
+        (split):
+        Reordered functions in the file.
+
+        * runtime/CommonIdentifiers.h:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::setGlobalThis):
+        (JSC::getById):
+        (JSC::getGetterById):
+        (JSC::JSGlobalObject::init):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::RegExpPrototype::finishCreation):
+        (JSC::regExpProtoFuncExec):
+        (JSC::regExpProtoFuncMatchFast):
+        (JSC::regExpProtoFuncMatchPrivate): Deleted.
+        * runtime/RegExpPrototype.h:
+
</ins><span class="cx"> 2016-04-20  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         JavaScriptCore garbage collection is missing an autorelease pool
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsRegExpPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/builtins/RegExpPrototype.js        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -45,69 +45,81 @@
</span><span class="cx">     return index + 2;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function match(str)
</del><ins>+function regExpExec(regexp, str)
</ins><span class="cx"> {
</span><span class="cx">     &quot;use strict&quot;;
</span><span class="cx"> 
</span><ins>+    let exec = regexp.exec;
+    let builtinExec = @regExpBuiltinExec;
+    if (exec !== builtinExec &amp;&amp; typeof exec === &quot;function&quot;) {
+        let result = exec.@call(regexp, str);
+        if (result !== null &amp;&amp; !@isObject(result))
+            throw new @TypeError(&quot;The result of a RegExp exec must be null or an object&quot;);
+        return result;
+    }
+    return builtinExec.@call(regexp, str);
+}
+
+function hasObservableSideEffectsForRegExpMatch(regexp) {
+    // This is accessed by the RegExpExec internal function.
+    let regexpExec = @tryGetById(regexp, &quot;exec&quot;);
+    if (regexpExec !== @regExpBuiltinExec)
+        return true;
+
+    let regexpGlobal = @tryGetById(regexp, &quot;global&quot;);
+    if (regexpGlobal !== @regExpProtoGlobalGetter)
+        return true;
+    let regexpUnicode = @tryGetById(regexp, &quot;unicode&quot;);
+    if (regexpUnicode !== @regExpProtoUnicodeGetter)
+        return true;
+
+    return !@isRegExpObject(regexp);
+}
+
+function match(strArg)
+{
+    &quot;use strict&quot;;
+
</ins><span class="cx">     if (!@isObject(this))
</span><span class="cx">         throw new @TypeError(&quot;RegExp.prototype.@@match requires that |this| be an Object&quot;);
</span><span class="cx"> 
</span><span class="cx">     let regexp = this;
</span><del>-    let stringArg = @toString(str);
</del><span class="cx"> 
</span><ins>+    // Check for observable side effects and call the fast path if there aren't any.
+    if (!@hasObservableSideEffectsForRegExpMatch(regexp))
+        return @regExpMatchFast.@call(regexp, strArg);
+
+    let str = @toString(strArg);
+
</ins><span class="cx">     if (!regexp.global)
</span><del>-        return regexp.exec(stringArg);
-
</del><ins>+        return @regExpExec(regexp, str);
+    
</ins><span class="cx">     let unicode = regexp.unicode;
</span><span class="cx">     regexp.lastIndex = 0;
</span><span class="cx">     let resultList = [];
</span><del>-    let execFunc = regexp.exec;
</del><ins>+    let stringLength = str.length;
</ins><span class="cx"> 
</span><del>-    if (execFunc !== @RegExp.prototype.@exec &amp;&amp; typeof execFunc === &quot;function&quot;) {
-        // Match using the overridden exec.
-        let stringLength = stringArg.length;
</del><ins>+    while (true) {
+        let result = @regExpExec(regexp, str);
+        
+        if (result === null) {
+            if (resultList.length === 0)
+                return null;
+            return resultList;
+        }
</ins><span class="cx"> 
</span><del>-        while (true) {
-            let result = execFunc(stringArg);
-            
-            if (result === null) {
-                if (resultList.length === 0)
-                    return null;
-                return resultList;
-            }
</del><ins>+        if (!@isObject(result))
+            throw new @TypeError(&quot;RegExp.prototype.@@match call to RegExp.exec didn't return null or an object&quot;);
</ins><span class="cx"> 
</span><del>-            if (!@isObject(result))
-                throw new @TypeError(&quot;RegExp.prototype.@@match call to RegExp.exec didn't return null or an object&quot;);
</del><ins>+        let resultString = @toString(result[0]);
</ins><span class="cx"> 
</span><del>-            let resultString = @toString(result[0]);
</del><ins>+        if (!resultString.length)
+            regexp.lastIndex = @advanceStringIndex(str, regexp.lastIndex, unicode);
</ins><span class="cx"> 
</span><del>-            if (!resultString.length)
-                regexp.lastIndex = @advanceStringIndex(stringArg, regexp.lastIndex, unicode);
-
-            resultList.@push(resultString);
-
-            execFunc = regexp.exec;
-        }
</del><ins>+        resultList.@push(resultString);
</ins><span class="cx">     }
</span><del>-
-    return regexp.@match(stringArg);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-function regExpExec(regexp, str)
-{
-    &quot;use strict&quot;;
-
-    let exec = regexp.exec;
-    let builtinExec = @RegExp.prototype.@exec;
-    if (exec !== builtinExec &amp;&amp; typeof exec === &quot;function&quot;) {
-        let result = exec.@call(regexp, str);
-        if (result !== null &amp;&amp; !@isObject(result))
-            throw new @TypeError(&quot;The result of a RegExp exec must be null or an object&quot;);
-        return result;
-    }
-    return builtinExec.@call(regexp, str);
-}
-
</del><span class="cx"> // 21.2.5.9 RegExp.prototype[@@search] (string)
</span><span class="cx"> function search(strArg)
</span><span class="cx"> {
</span><span class="lines">@@ -116,7 +128,7 @@
</span><span class="cx">     let regexp = this;
</span><span class="cx"> 
</span><span class="cx">     // Check for observable side effects and call the fast path if there aren't any.
</span><del>-    if (@isRegExpObject(regexp) &amp;&amp; @tryGetById(regexp, &quot;exec&quot;) === @RegExp.prototype.@exec)
</del><ins>+    if (@isRegExpObject(regexp) &amp;&amp; @tryGetById(regexp, &quot;exec&quot;) === @regExpBuiltinExec)
</ins><span class="cx">         return @regExpSearchFast.@call(regexp, strArg);
</span><span class="cx"> 
</span><span class="cx">     // 1. Let rx be the this value.
</span><span class="lines">@@ -145,7 +157,7 @@
</span><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><del>-    if (regexpExec !== @RegExp.prototype.@exec)
</del><ins>+    if (regexpExec !== @regExpBuiltinExec)
</ins><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     // This is accessed by step 5 below.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsStringPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/StringPrototype.js (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -46,27 +46,6 @@
</span><span class="cx">     return createdRegExp[@symbolMatch](thisString);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function search(regexp)
-{
-    &quot;use strict&quot;;
-
-    if (this == null) {
-        if (this === null)
-            throw new @TypeError(&quot;String.prototype.search requires that |this| not be null&quot;);
-        throw new @TypeError(&quot;String.prototype.search requires that |this| not be undefined&quot;);
-    }
-
-    if (regexp != null) {
-        var searcher = regexp[@symbolSearch];
-        if (searcher != @undefined)
-            return searcher.@call(regexp, this);
-    }
-
-    var thisString = @toString(this);
-    var createdRegExp = @regExpCreate(regexp, @undefined);
-    return createdRegExp[@symbolSearch](thisString);
-}
-
</del><span class="cx"> function repeatSlowPath(string, count)
</span><span class="cx"> {
</span><span class="cx">     &quot;use strict&quot;;
</span><span class="lines">@@ -126,6 +105,27 @@
</span><span class="cx">     return @repeatSlowPath(string, count);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function search(regexp)
+{
+    &quot;use strict&quot;;
+
+    if (this == null) {
+        if (this === null)
+            throw new @TypeError(&quot;String.prototype.search requires that |this| not be null&quot;);
+        throw new @TypeError(&quot;String.prototype.search requires that |this| not be undefined&quot;);
+    }
+
+    if (regexp != null) {
+        var searcher = regexp[@symbolSearch];
+        if (searcher != @undefined)
+            return searcher.@call(regexp, this);
+    }
+
+    var thisString = @toString(this);
+    var createdRegExp = @regExpCreate(regexp, @undefined);
+    return createdRegExp[@symbolSearch](thisString);
+}
+
</ins><span class="cx"> function split(separator, limit)
</span><span class="cx"> {
</span><span class="cx">     &quot;use strict&quot;;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -427,6 +427,8 @@
</span><span class="cx">     macro(setIteratorNext) \
</span><span class="cx">     macro(MapIterator) \
</span><span class="cx">     macro(mapIteratorNext) \
</span><ins>+    macro(regExpBuiltinExec) \
+    macro(regExpMatchFast) \
</ins><span class="cx">     macro(regExpProtoFlagsGetter) \
</span><span class="cx">     macro(regExpProtoGlobalGetter) \
</span><span class="cx">     macro(regExpProtoIgnoreCaseGetter) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -257,7 +257,6 @@
</span><span class="cx">     m_globalThis.set(vm, this, globalThis);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> static JSObject* getGetterById(ExecState* exec, JSObject* base, const Identifier&amp; ident)
</span><span class="cx"> {
</span><span class="cx">     JSValue baseValue = JSValue(base);
</span><span class="lines">@@ -646,10 +645,13 @@
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpProtoUnicodeGetterPrivateName, regExpProtoUnicodeGetterObject, DontEnum | DontDelete | ReadOnly),
</span><span class="cx"> 
</span><span class="cx">         // RegExp.prototype helpers.
</span><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;regExpBuiltinExecPrivateName, m_regExpPrototype-&gt;getDirect(vm, vm.propertyNames-&gt;exec), DontEnum | DontDelete | ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpCreatePrivateName, JSFunction::create(vm, this, 2, String(), esSpecRegExpCreate, NoIntrinsic), DontEnum | DontDelete | ReadOnly),
</span><ins>+        GlobalPropertyInfo(vm.propertyNames-&gt;builtinNames().hasObservableSideEffectsForRegExpMatchPrivateName(), JSFunction::createBuiltinFunction(vm, regExpPrototypeHasObservableSideEffectsForRegExpMatchCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
</ins><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;regExpMatchFastPrivateName, JSFunction::create(vm, this, 2, String(), regExpProtoFuncMatchFast), DontEnum | DontDelete | ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpSearchFastPrivateName, JSFunction::create(vm, this, 2, String(), regExpProtoFuncSearchFast), DontEnum | DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;regExpSplitFastPrivateName, JSFunction::create(vm, this, 2, String(), regExpProtoFuncSplitFast), DontEnum | DontDelete | ReadOnly),
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-04-21 10:57:45 UTC (rev 199812)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncTest(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncExec(ExecState*);
</span><del>-static EncodedJSValue JSC_HOST_CALL regExpProtoFuncMatchPrivate(ExecState*);
</del><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL regExpProtoGetterGlobal(ExecState*);
</span><span class="lines">@@ -69,6 +68,7 @@
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;compile, regExpProtoFuncCompile, DontEnum, 2);
</span><ins>+    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;exec, regExpProtoFuncExec, DontEnum, 1, RegExpExecIntrinsic);
</ins><span class="cx">     JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;test, regExpProtoFuncTest, DontEnum, 1, RegExpTestIntrinsic);
</span><span class="cx">     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;toString, regExpProtoFuncToString, DontEnum, 0);
</span><span class="cx">     JSC_NATIVE_GETTER(vm.propertyNames-&gt;global, regExpProtoGetterGlobal, DontEnum | Accessor);
</span><span class="lines">@@ -78,15 +78,10 @@
</span><span class="cx">     JSC_NATIVE_GETTER(vm.propertyNames-&gt;unicode, regExpProtoGetterUnicode, DontEnum | Accessor);
</span><span class="cx">     JSC_NATIVE_GETTER(vm.propertyNames-&gt;source, regExpProtoGetterSource, DontEnum | Accessor);
</span><span class="cx">     JSC_NATIVE_GETTER(vm.propertyNames-&gt;flags, regExpProtoGetterFlags, DontEnum | Accessor);
</span><del>-    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;builtinNames().matchPrivateName(), regExpProtoFuncMatchPrivate, DontEnum | DontDelete | ReadOnly, 1);
</del><span class="cx">     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;matchSymbol, regExpPrototypeMatchCodeGenerator, DontEnum);
</span><span class="cx">     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;searchSymbol, regExpPrototypeSearchCodeGenerator, DontEnum);
</span><span class="cx">     JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames-&gt;splitSymbol, regExpPrototypeSplitCodeGenerator, DontEnum);
</span><span class="cx"> 
</span><del>-    JSFunction* execFunction = JSFunction::create(vm, globalObject, 1, vm.propertyNames-&gt;exec.string(), regExpProtoFuncExec, RegExpExecIntrinsic);
-    putDirectWithoutTransition(vm, vm.propertyNames-&gt;execPrivateName, execFunction, DontEnum | DontDelete | ReadOnly);
-    putDirectWithoutTransition(vm, vm.propertyNames-&gt;exec, execFunction, DontEnum);
-
</del><span class="cx">     m_emptyRegExp.set(vm, this, RegExp::create(vm, &quot;&quot;, NoFlags));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -123,7 +118,7 @@
</span><span class="cx">     return JSValue::encode(asRegExpObject(thisValue)-&gt;exec(exec, exec-&gt;lexicalGlobalObject(), string));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL regExpProtoFuncMatchPrivate(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL regExpProtoFuncMatchFast(ExecState* exec)
</ins><span class="cx"> {
</span><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     if (!thisValue.inherits(RegExpObject::info()))
</span><span class="lines">@@ -131,6 +126,8 @@
</span><span class="cx">     JSString* string = exec-&gt;argument(0).toStringOrNull(exec);
</span><span class="cx">     if (!string)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><ins>+    if (!asRegExpObject(thisValue)-&gt;regExp()-&gt;global())
+        return JSValue::encode(asRegExpObject(thisValue)-&gt;exec(exec, exec-&gt;lexicalGlobalObject(), string));
</ins><span class="cx">     return JSValue::encode(asRegExpObject(thisValue)-&gt;matchGlobal(exec, exec-&gt;lexicalGlobalObject(), string));
</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 (199811 => 199812)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h        2016-04-21 10:53:51 UTC (rev 199811)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h        2016-04-21 10:57:45 UTC (rev 199812)
</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 regExpProtoFuncMatchFast(ExecState*);
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearchFast(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL regExpProtoFuncSplitFast(ExecState*);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>