<!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>[198171] 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/198171">198171</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2016-03-14 16:28:03 -0700 (Mon, 14 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/194394">r194394</a>): >2x slow-down on CDjs
https://bugs.webkit.org/show_bug.cgi?id=155471
Unreviewed (rollout).
Source/JavaScriptCore:
This revision changes localeCompare() so that it's *much* slower than before. It's
understandable that sometimes things will get a tiny bit slower when implementing new
language features, but more than 2x regression on a major benchmark is not OK.
This rolls out that change. We can reland it once we think about how to do it in a
performant way.
* builtins/StringPrototype.js:
(search):
(localeCompare): Deleted.
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
LayoutTests:
* js/dom/script-tests/string-prototype-properties.js:
* js/dom/string-prototype-properties-expected.txt:
* js/script-tests/string-localeCompare.js:
* js/string-localeCompare-expected.txt:
* js/string-localeCompare.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsdomscripttestsstringprototypepropertiesjs">trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js</a></li>
<li><a href="#trunkLayoutTestsjsdomstringprototypepropertiesexpectedtxt">trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsstringlocaleComparejs">trunk/LayoutTests/js/script-tests/string-localeCompare.js</a></li>
<li><a href="#trunkLayoutTestsjsstringlocaleCompareexpectedtxt">trunk/LayoutTests/js/string-localeCompare-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsstringlocaleComparehtml">trunk/LayoutTests/js/string-localeCompare.html</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsStringPrototypejs">trunk/Source/JavaScriptCore/builtins/StringPrototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringPrototypecpp">trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/ChangeLog        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-03-14 Filip Pizlo <fpizlo@apple.com>
+
+ REGRESSION(r194394): >2x slow-down on CDjs
+ https://bugs.webkit.org/show_bug.cgi?id=155471
+
+ Unreviewed (rollout).
+
+ * js/dom/script-tests/string-prototype-properties.js:
+ * js/dom/string-prototype-properties-expected.txt:
+ * js/script-tests/string-localeCompare.js:
+ * js/string-localeCompare-expected.txt:
+ * js/string-localeCompare.html:
+
</ins><span class="cx"> 2016-03-14 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Marking js/funcion-apply.html as flaky on mac debug
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomscripttestsstringprototypepropertiesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/js/dom/script-tests/string-prototype-properties.js        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> shouldThrow("String.prototype.substring.call(undefined, 1, 3)");
</span><span class="cx"> shouldThrow("String.prototype.toLowerCase.call(undefined)");
</span><span class="cx"> shouldThrow("String.prototype.toUpperCase.call(undefined)");
</span><del>-shouldThrow("String.prototype.localeCompare.call(undefined, '1224')", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
</del><ins>+shouldThrow("String.prototype.localeCompare.call(undefined, '1224')");
</ins><span class="cx"> shouldThrow("String.prototype.toLocaleLowerCase.call(undefined)");
</span><span class="cx"> shouldThrow("String.prototype.toLocaleUpperCase.call(undefined)");
</span><span class="cx"> shouldThrow("String.prototype.trim.call(undefined)");
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomstringprototypepropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/js/dom/string-prototype-properties-expected.txt        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -20,7 +20,7 @@
</span><span class="cx"> PASS String.prototype.substring.call(undefined, 1, 3) threw exception TypeError: Type error.
</span><span class="cx"> PASS String.prototype.toLowerCase.call(undefined) threw exception TypeError: Type error.
</span><span class="cx"> PASS String.prototype.toUpperCase.call(undefined) threw exception TypeError: Type error.
</span><del>-PASS String.prototype.localeCompare.call(undefined, '1224') threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
</del><ins>+PASS String.prototype.localeCompare.call(undefined, '1224') threw exception TypeError: Type error.
</ins><span class="cx"> PASS String.prototype.toLocaleLowerCase.call(undefined) threw exception TypeError: Type error.
</span><span class="cx"> PASS String.prototype.toLocaleUpperCase.call(undefined) threw exception TypeError: Type error.
</span><span class="cx"> PASS String.prototype.trim.call(undefined) threw exception TypeError: Type error.
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsstringlocaleComparejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/string-localeCompare.js (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/string-localeCompare.js        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/js/script-tests/string-localeCompare.js        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -1,28 +1,5 @@
</span><del>-description("This test checks the behavior of String.prototype.localeCompare as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).");
</del><ins>+description("This test checks String.localeCompare().");
</ins><span class="cx">
</span><del>-shouldBe("String.prototype.localeCompare.length", "1");
-shouldBeFalse("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').enumerable");
-shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').configurable");
-shouldBeTrue("Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').writable");
-
-// Test RequireObjectCoercible.
-shouldThrow("String.prototype.localeCompare.call()", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
-shouldThrow("String.prototype.localeCompare.call(undefined)", "'TypeError: String.prototype.localeCompare requires that |this| not be undefined'");
-shouldThrow("String.prototype.localeCompare.call(null)", "'TypeError: String.prototype.localeCompare requires that |this| not be null'");
-shouldNotThrow("String.prototype.localeCompare.call({}, '')");
-shouldNotThrow("String.prototype.localeCompare.call([], '')");
-shouldNotThrow("String.prototype.localeCompare.call(NaN, '')");
-shouldNotThrow("String.prototype.localeCompare.call(5, '')");
-shouldNotThrow("String.prototype.localeCompare.call('', '')");
-shouldNotThrow("String.prototype.localeCompare.call(() => {}, '')");
-
-// Test toString fails.
-shouldThrow("''.localeCompare.call({ toString() { throw 'thisFail' } }, '')", "'thisFail'");
-shouldThrow("''.localeCompare({ toString() { throw 'thatFail' } })", "'thatFail'");
-shouldNotThrow("''.localeCompare()");
-shouldNotThrow("''.localeCompare(null)");
-
-// Basic support.
</del><span class="cx"> shouldBeTrue('"a".localeCompare("aa") < 0');
</span><span class="cx"> shouldBeTrue('"a".localeCompare("b") < 0');
</span><span class="cx">
</span><span class="lines">@@ -31,45 +8,3 @@
</span><span class="cx">
</span><span class="cx"> shouldBeTrue('"aa".localeCompare("a") > 0');
</span><span class="cx"> shouldBeTrue('"b".localeCompare("a") > 0');
</span><del>-
-// Uses Intl.Collator.
-shouldThrow("'a'.localeCompare('b', '$')", "'RangeError: invalid language tag: $'");
-shouldThrow("'a'.localeCompare('b', 'en', {usage: 'Sort'})", '\'RangeError: usage must be either "sort" or "search"\'');
-
-shouldBe("'ä'.localeCompare('z', 'en')", "-1");
-shouldBe("'ä'.localeCompare('z', 'sv')", "1");
-
-shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'base' })", "-1");
-shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'base' })", "0");
-shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'base' })", "0");
-shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'base' })", "0");
-
-shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'accent' })", "-1");
-shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'accent' })", "-1");
-shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'accent' })", "0");
-shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'accent' })", "0");
-
-shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'case' })", "-1");
-shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'case' })", "0");
-shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'case' })", "-1");
-shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'case' })", "0");
-
-shouldBe("'a'.localeCompare('b', 'en', { sensitivity:'variant' })", "-1");
-shouldBe("'a'.localeCompare('ä', 'en', { sensitivity:'variant' })", "-1");
-shouldBe("'a'.localeCompare('A', 'en', { sensitivity:'variant' })", "-1");
-shouldBe("'a'.localeCompare('ⓐ', 'en', { sensitivity:'variant' })", "-1");
-
-shouldBe("'1'.localeCompare('2', 'en', { numeric:false })", "-1");
-shouldBe("'2'.localeCompare('10', 'en', { numeric:false })", "1");
-shouldBe("'01'.localeCompare('1', 'en', { numeric:false })", "-1");
-shouldBe("'๑'.localeCompare('๒', 'en', { numeric:false })", "-1");
-shouldBe("'๒'.localeCompare('๑๐', 'en', { numeric:false })", "1");
-shouldBe("'๐๑'.localeCompare('๑', 'en', { numeric:false })", "-1");
-
-shouldBe("'1'.localeCompare('2', 'en', { numeric:true })", "-1");
-shouldBe("'2'.localeCompare('10', 'en', { numeric:true })", "-1");
-shouldBe("'01'.localeCompare('1', 'en', { numeric:true })", "0");
-shouldBe("'๑'.localeCompare('๒', 'en', { numeric:true })", "-1");
-shouldBe("'๒'.localeCompare('๑๐', 'en', { numeric:true })", "-1");
-shouldBe("'๐๑'.localeCompare('๑', 'en', { numeric:true })", "0");
-
</del></span></pre></div>
<a id="trunkLayoutTestsjsstringlocaleCompareexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/string-localeCompare-expected.txt (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/string-localeCompare-expected.txt        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/js/string-localeCompare-expected.txt        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -1,63 +1,14 @@
</span><del>-This test checks the behavior of String.prototype.localeCompare as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
</del><ins>+This test checks String.localeCompare().
</ins><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS String.prototype.localeCompare.length is 1
-PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').enumerable is false
-PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').configurable is true
-PASS Object.getOwnPropertyDescriptor(String.prototype, 'localeCompare').writable is true
-PASS String.prototype.localeCompare.call() threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
-PASS String.prototype.localeCompare.call(undefined) threw exception TypeError: String.prototype.localeCompare requires that |this| not be undefined.
-PASS String.prototype.localeCompare.call(null) threw exception TypeError: String.prototype.localeCompare requires that |this| not be null.
-PASS String.prototype.localeCompare.call({}, '') did not throw exception.
-PASS String.prototype.localeCompare.call([], '') did not throw exception.
-PASS String.prototype.localeCompare.call(NaN, '') did not throw exception.
-PASS String.prototype.localeCompare.call(5, '') did not throw exception.
-PASS String.prototype.localeCompare.call('', '') did not throw exception.
-PASS String.prototype.localeCompare.call(() => {}, '') did not throw exception.
-PASS ''.localeCompare.call({ toString() { throw 'thisFail' } }, '') threw exception thisFail.
-PASS ''.localeCompare({ toString() { throw 'thatFail' } }) threw exception thatFail.
-PASS ''.localeCompare() did not throw exception.
-PASS ''.localeCompare(null) did not throw exception.
</del><span class="cx"> PASS "a".localeCompare("aa") < 0 is true
</span><span class="cx"> PASS "a".localeCompare("b") < 0 is true
</span><span class="cx"> PASS "a".localeCompare("a") === 0 is true
</span><span class="cx"> PASS "ạ̈".localeCompare("ạ̈") === 0 is true
</span><span class="cx"> PASS "aa".localeCompare("a") > 0 is true
</span><span class="cx"> PASS "b".localeCompare("a") > 0 is true
</span><del>-PASS 'a'.localeCompare('b', '$') threw exception RangeError: invalid language tag: $.
-PASS 'a'.localeCompare('b', 'en', {usage: 'Sort'}) threw exception RangeError: usage must be either "sort" or "search".
-PASS 'ä'.localeCompare('z', 'en') is -1
-PASS 'ä'.localeCompare('z', 'sv') is 1
-PASS 'a'.localeCompare('b', 'en', { sensitivity:'base' }) is -1
-PASS 'a'.localeCompare('ä', 'en', { sensitivity:'base' }) is 0
-PASS 'a'.localeCompare('A', 'en', { sensitivity:'base' }) is 0
-PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'base' }) is 0
-PASS 'a'.localeCompare('b', 'en', { sensitivity:'accent' }) is -1
-PASS 'a'.localeCompare('ä', 'en', { sensitivity:'accent' }) is -1
-PASS 'a'.localeCompare('A', 'en', { sensitivity:'accent' }) is 0
-PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'accent' }) is 0
-PASS 'a'.localeCompare('b', 'en', { sensitivity:'case' }) is -1
-PASS 'a'.localeCompare('ä', 'en', { sensitivity:'case' }) is 0
-PASS 'a'.localeCompare('A', 'en', { sensitivity:'case' }) is -1
-PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'case' }) is 0
-PASS 'a'.localeCompare('b', 'en', { sensitivity:'variant' }) is -1
-PASS 'a'.localeCompare('ä', 'en', { sensitivity:'variant' }) is -1
-PASS 'a'.localeCompare('A', 'en', { sensitivity:'variant' }) is -1
-PASS 'a'.localeCompare('ⓐ', 'en', { sensitivity:'variant' }) is -1
-PASS '1'.localeCompare('2', 'en', { numeric:false }) is -1
-PASS '2'.localeCompare('10', 'en', { numeric:false }) is 1
-PASS '01'.localeCompare('1', 'en', { numeric:false }) is -1
-PASS '๑'.localeCompare('๒', 'en', { numeric:false }) is -1
-PASS '๒'.localeCompare('๑๐', 'en', { numeric:false }) is 1
-PASS '๐๑'.localeCompare('๑', 'en', { numeric:false }) is -1
-PASS '1'.localeCompare('2', 'en', { numeric:true }) is -1
-PASS '2'.localeCompare('10', 'en', { numeric:true }) is -1
-PASS '01'.localeCompare('1', 'en', { numeric:true }) is 0
-PASS '๑'.localeCompare('๒', 'en', { numeric:true }) is -1
-PASS '๒'.localeCompare('๑๐', 'en', { numeric:true }) is -1
-PASS '๐๑'.localeCompare('๑', 'en', { numeric:true }) is 0
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsstringlocaleComparehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/string-localeCompare.html (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/string-localeCompare.html        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/LayoutTests/js/string-localeCompare.html        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -1,7 +1,6 @@
</span><span class="cx"> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><del>-<meta charset="utf-8">
</del><span class="cx"> <script src="../resources/js-test-pre.js"></script>
</span><span class="cx"> </head>
</span><span class="cx"> <body>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-03-14 Filip Pizlo <fpizlo@apple.com>
+
+ REGRESSION(r194394): >2x slow-down on CDjs
+ https://bugs.webkit.org/show_bug.cgi?id=155471
+
+ Unreviewed (rollout).
+
+ This revision changes localeCompare() so that it's *much* slower than before. It's
+ understandable that sometimes things will get a tiny bit slower when implementing new
+ language features, but more than 2x regression on a major benchmark is not OK.
+
+ This rolls out that change. We can reland it once we think about how to do it in a
+ performant way.
+
+ * builtins/StringPrototype.js:
+ (search):
+ (localeCompare): Deleted.
+ * runtime/StringPrototype.cpp:
+ (JSC::StringPrototype::finishCreation):
+
</ins><span class="cx"> 2016-03-14 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> Need to distinguish between Symbol() and Symbol("").
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsStringPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/StringPrototype.js (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/Source/JavaScriptCore/builtins/StringPrototype.js        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -26,40 +26,6 @@
</span><span class="cx">
</span><span class="cx"> // @conditional=ENABLE(INTL)
</span><span class="cx">
</span><del>-function localeCompare(that/*, locales, options */)
-{
- "use strict";
-
- // 13.1.1 String.prototype.localeCompare (that [, locales [, options ]]) (ECMA-402 2.0)
- // http://ecma-international.org/publications/standards/Ecma-402.htm
-
- // 1. Let O be RequireObjectCoercible(this value).
- if (this === null)
- throw new @TypeError("String.prototype.localeCompare requires that |this| not be null");
-
- if (this === @undefined)
- throw new @TypeError("String.prototype.localeCompare requires that |this| not be undefined");
-
- // 2. Let S be ToString(O).
- // 3. ReturnIfAbrupt(S).
- var thisString = @toString(this);
-
- // 4. Let That be ToString(that).
- // 5. ReturnIfAbrupt(That).
- var thatString = @toString(that);
-
- // Avoid creating a collator for defaults.
- if (arguments[1] === @undefined && arguments[2] === @undefined)
- return @Collator.prototype.compare(thisString, thatString);
-
- // 6. Let collator be Construct(%Collator%, «locales, options»).
- // 7. ReturnIfAbrupt(collator).
- var collator = new @Collator(arguments[1], arguments[2]);
-
- // 8. Return CompareStrings(collator, S, That).
- return collator.compare(thisString, thatString);
-}
-
</del><span class="cx"> function search(regexp)
</span><span class="cx"> {
</span><span class="cx"> "use strict";
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp (198170 => 198171)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-03-14 23:26:37 UTC (rev 198170)
+++ trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-03-14 23:28:03 UTC (rev 198171)
</span><span class="lines">@@ -142,12 +142,11 @@
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("substring", stringProtoFuncSubstring, DontEnum, 2);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toLowerCase", stringProtoFuncToLowerCase, DontEnum, 0);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toUpperCase", stringProtoFuncToUpperCase, DontEnum, 0);
</span><ins>+ JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1);
</ins><span class="cx"> #if ENABLE(INTL)
</span><del>- JSC_BUILTIN_FUNCTION_WITHOUT_TRANSITION("localeCompare", stringPrototypeLocaleCompareCodeGenerator, DontEnum);
</del><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toLocaleLowerCase", stringProtoFuncToLocaleLowerCase, DontEnum, 0);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toLocaleUpperCase", stringProtoFuncToLocaleUpperCase, DontEnum, 0);
</span><span class="cx"> #else
</span><del>- JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("localeCompare", stringProtoFuncLocaleCompare, DontEnum, 1);
</del><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toLocaleLowerCase", stringProtoFuncToLowerCase, DontEnum, 0);
</span><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("toLocaleUpperCase", stringProtoFuncToUpperCase, DontEnum, 0);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>