<!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>[204485] 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/204485">204485</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-08-15 14:52:22 -0700 (Mon, 15 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make JSValue::strictEqual() handle failures to resolve JSRopeStrings.
https://bugs.webkit.org/show_bug.cgi?id=160832
&lt;rdar://problem/27577556&gt;

Reviewed by Geoffrey Garen.

Currently, JSValue::strictEqualSlowCaseInline() (and peers) will blindly try to
access the StringImpl of a JSRopeString that fails to resolve its rope.  As a
result, we'll crash with null pointer dereferences.

We can fix this by introducing a JSString::equal() method that will do the
equality comparison, but is aware of the potential failures to resolve ropes.
JSValue::strictEqualSlowCaseInline() (and peers) will now call JSString::equal()
instead of accessing the underlying StringImpl directly.

Also added some exception checks.

* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/JITOperations.cpp:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqualSlowCaseInline):
* runtime/JSString.cpp:
(JSC::JSString::equalSlowCase):
* runtime/JSString.h:
* runtime/JSStringInlines.h: Added.
(JSC::JSString::equal):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh">trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringcpp">trunk/Source/JavaScriptCore/runtime/JSString.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringh">trunk/Source/JavaScriptCore/runtime/JSString.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringInlinesh">trunk/Source/JavaScriptCore/runtime/JSStringInlines.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-08-15  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Make JSValue::strictEqual() handle failures to resolve JSRopeStrings.
+        https://bugs.webkit.org/show_bug.cgi?id=160832
+        &lt;rdar://problem/27577556&gt;
+
+        Reviewed by Geoffrey Garen.
+
+        Currently, JSValue::strictEqualSlowCaseInline() (and peers) will blindly try to
+        access the StringImpl of a JSRopeString that fails to resolve its rope.  As a
+        result, we'll crash with null pointer dereferences.
+
+        We can fix this by introducing a JSString::equal() method that will do the
+        equality comparison, but is aware of the potential failures to resolve ropes.
+        JSValue::strictEqualSlowCaseInline() (and peers) will now call JSString::equal()
+        instead of accessing the underlying StringImpl directly.
+
+        Also added some exception checks.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * jit/JITOperations.cpp:
+        * runtime/ArrayPrototype.cpp:
+        (JSC::arrayProtoFuncIndexOf):
+        (JSC::arrayProtoFuncLastIndexOf):
+        * runtime/JSCJSValueInlines.h:
+        (JSC::JSValue::equalSlowCaseInline):
+        (JSC::JSValue::strictEqualSlowCaseInline):
+        * runtime/JSString.cpp:
+        (JSC::JSString::equalSlowCase):
+        * runtime/JSString.h:
+        * runtime/JSStringInlines.h: Added.
+        (JSC::JSString::equal):
+
</ins><span class="cx"> 2016-08-15  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement WASM Parser and B3 IR generator
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -962,6 +962,7 @@
</span><span class="cx">                 0FFFC95E14EF90B700C72532 /* DFGPredictionPropagationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */; };
</span><span class="cx">                 0FFFC95F14EF90BB00C72532 /* DFGVirtualRegisterAllocationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFFC95314EF909500C72532 /* DFGVirtualRegisterAllocationPhase.cpp */; };
</span><span class="cx">                 0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFFC95414EF909500C72532 /* DFGVirtualRegisterAllocationPhase.h */; };
</span><ins>+                13FECE06D3B445FCB6C93461 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1879510614C540FFB561C124 /* JSModuleLoader.cpp */; };
</ins><span class="cx">                 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; };
</span><span class="cx">                 140566D6107EC271005DBC8D /* JSFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A85E0255597D01FF60F7 /* JSFunction.cpp */; };
</span><span class="cx">                 140B7D1D0DC69AF7009C42B8 /* JSLexicalEnvironment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSLexicalEnvironment.cpp */; };
</span><span class="lines">@@ -1999,6 +2000,7 @@
</span><span class="cx">                 C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D01A05C76F005CAB76 /* cpp_generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C4F4B6F51A05C984005CAB76 /* generate_objc_protocol_types_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D71A05C76F005CAB76 /* generate_objc_protocol_types_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C4F4B6F61A05C984005CAB76 /* objc_generator_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = C4F4B6D81A05C76F005CAB76 /* objc_generator_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                D9722752DC54459B9125B539 /* JSModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 77B25CB2C3094A92A38E1DB3 /* JSModuleLoader.h */; };
</ins><span class="cx">                 DC00039319D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h in Headers */ = {isa = PBXBuildFile; fileRef = DC00039019D8BE6F00023EB0 /* DFGPreciseLocalClobberize.h */; };
</span><span class="cx">                 DC0184191D10C1890057B053 /* JITWorklist.h in Headers */ = {isa = PBXBuildFile; fileRef = DC0184181D10C1870057B053 /* JITWorklist.h */; };
</span><span class="cx">                 DC01841A1D10C18C0057B053 /* JITWorklist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC0184171D10C1870057B053 /* JITWorklist.cpp */; };
</span><span class="lines">@@ -2141,8 +2143,7 @@
</span><span class="cx">                 FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; };
</span><span class="cx">                 FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEF040511AAE662D00BD28B0 /* CompareAndSwapTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEF040501AAE662D00BD28B0 /* CompareAndSwapTest.cpp */; };
</span><del>-                D9722752DC54459B9125B539 /* JSModuleLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 77B25CB2C3094A92A38E1DB3 /* JSModuleLoader.h */; };
-                13FECE06D3B445FCB6C93461 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1879510614C540FFB561C124 /* JSModuleLoader.cpp */; };
</del><ins>+                FEFD6FC61D5E7992008F2F0B /* JSStringInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx"> /* End PBXBuildFile section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXContainerItemProxy section */
</span><span class="lines">@@ -3286,6 +3287,7 @@
</span><span class="cx">                 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakHandleOwner.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14F7256414EE265E00B1652B /* WeakHandleOwner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakHandleOwner.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14F97446138C853E00DA1C67 /* HeapRootVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapRootVisitor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1879510614C540FFB561C124 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A28D4A7177B71C80007FA3C /* JSStringRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringRefPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1ACF7376171CA6FB00C9BB1E /* Weak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Weak.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C9051420BA9E8A70081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3522,6 +3524,7 @@
</span><span class="cx">                 70ECA6041AFDBEA200449739 /* TemplateRegistryKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateRegistryKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 72AAF7CB1D0D318B005E60BE /* JSCustomGetterSetterFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomGetterSetterFunction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 72AAF7CC1D0D318B005E60BE /* JSCustomGetterSetterFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomGetterSetterFunction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                77B25CB2C3094A92A38E1DB3 /* JSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModuleLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7905BB661D12050E0019FE57 /* InlineAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineAccess.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7905BB671D12050E0019FE57 /* InlineAccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineAccess.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 79160DBB1C8E3EC8008C085A /* ProxyRevoke.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProxyRevoke.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4446,8 +4449,7 @@
</span><span class="cx">                 FEDA50D51B97F4D9009A3B4F /* PingPongStackOverflowTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PingPongStackOverflowTest.h; path = API/tests/PingPongStackOverflowTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF040501AAE662D00BD28B0 /* CompareAndSwapTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompareAndSwapTest.cpp; path = API/tests/CompareAndSwapTest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF040521AAEC4ED00BD28B0 /* CompareAndSwapTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompareAndSwapTest.h; path = API/tests/CompareAndSwapTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                77B25CB2C3094A92A38E1DB3 /* JSModuleLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSModuleLoader.h; path = JSModuleLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                1879510614C540FFB561C124 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSModuleLoader.cpp; path = JSModuleLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx"> /* End PBXFileReference section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFrameworksBuildPhase section */
</span><span class="lines">@@ -5931,6 +5933,7 @@
</span><span class="cx">                                 BC02E9B60E1842FA000F9297 /* JSString.cpp */,
</span><span class="cx">                                 F692A8620255597D01FF60F7 /* JSString.h */,
</span><span class="cx">                                 86E85538111B9968001AF51E /* JSStringBuilder.h */,
</span><ins>+                                FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */,
</ins><span class="cx">                                 70EC0EBC1AA0D7DA00B6AAFA /* JSStringIterator.cpp */,
</span><span class="cx">                                 70EC0EBD1AA0D7DA00B6AAFA /* JSStringIterator.h */,
</span><span class="cx">                                 2600B5A4152BAAA70091EE5F /* JSStringJoiner.cpp */,
</span><span class="lines">@@ -8044,6 +8047,7 @@
</span><span class="cx">                                 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */,
</span><span class="cx">                                 ADDB1F6318D77DBE009B58A8 /* OpaqueRootSet.h in Headers */,
</span><span class="cx">                                 969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */,
</span><ins>+                                FEFD6FC61D5E7992008F2F0B /* JSStringInlines.h in Headers */,
</ins><span class="cx">                                 0F2BDC2C151FDE9100CD8910 /* Operands.h in Headers */,
</span><span class="cx">                                 A70447EA17A0BD4600F5898E /* OperandsInlines.h in Headers */,
</span><span class="cx">                                 BC18C4480E16F5CD00B34460 /* Operations.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -1051,7 +1051,7 @@
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><span class="cx"> 
</span><del>-    bool result = WTF::equal(*asString(left)-&gt;value(exec).impl(), *asString(right)-&gt;value(exec).impl());
</del><ins>+    bool result = asString(left)-&gt;equal(exec, asString(right));
</ins><span class="cx"> #if USE(JSVALUE64)
</span><span class="cx">     return JSValue::encode(jsBoolean(result));
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -1032,8 +1032,9 @@
</span><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(vm.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
</span><span class="lines">@@ -1040,12 +1041,14 @@
</span><span class="cx">     JSValue searchElement = exec-&gt;argument(0);
</span><span class="cx">     for (; index &lt; length; ++index) {
</span><span class="cx">         JSValue e = getProperty(exec, thisObj, index);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (!e)
</span><span class="cx">             continue;
</span><span class="cx">         if (JSValue::strictEqual(exec, searchElement, e))
</span><span class="cx">             return JSValue::encode(jsNumber(index));
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return JSValue::encode(jsUndefined());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(jsNumber(-1));
</span><span class="lines">@@ -1074,16 +1077,19 @@
</span><span class="cx">             index = static_cast&lt;unsigned&gt;(fromDouble);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSValue searchElement = exec-&gt;argument(0);
</span><span class="cx">     do {
</span><span class="cx">         RELEASE_ASSERT(index &lt; length);
</span><span class="cx">         JSValue e = getProperty(exec, thisObj, index);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (!e)
</span><span class="cx">             continue;
</span><span class="cx">         if (JSValue::strictEqual(exec, searchElement, e))
</span><span class="cx">             return JSValue::encode(jsNumber(index));
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return JSValue::encode(jsUndefined());
</ins><span class="cx">     } while (index--);
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(jsNumber(-1));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;JSCellInlines.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><ins>+#include &quot;JSStringInlines.h&quot;
</ins><span class="cx"> #include &quot;MathCommon.h&quot;
</span><span class="cx"> #include &lt;wtf/text/StringImpl.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -900,7 +901,7 @@
</span><span class="cx">         bool s1 = v1.isString();
</span><span class="cx">         bool s2 = v2.isString();
</span><span class="cx">         if (s1 &amp;&amp; s2)
</span><del>-            return WTF::equal(*asString(v1)-&gt;value(exec).impl(), *asString(v2)-&gt;value(exec).impl());
</del><ins>+            return asString(v1)-&gt;equal(exec, asString(v2));
</ins><span class="cx"> 
</span><span class="cx">         if (v1.isUndefinedOrNull()) {
</span><span class="cx">             if (v2.isUndefinedOrNull())
</span><span class="lines">@@ -970,7 +971,7 @@
</span><span class="cx">     ASSERT(v1.isCell() &amp;&amp; v2.isCell());
</span><span class="cx"> 
</span><span class="cx">     if (v1.asCell()-&gt;isString() &amp;&amp; v2.asCell()-&gt;isString())
</span><del>-        return WTF::equal(*asString(v1)-&gt;value(exec).impl(), *asString(v2)-&gt;value(exec).impl());
</del><ins>+        return asString(v1)-&gt;equal(exec, asString(v2));
</ins><span class="cx">     return v1 == v2;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.cpp (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.cpp        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/runtime/JSString.cpp        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -72,6 +72,15 @@
</span><span class="cx">     out.printf(&quot;&gt;&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSString::equalSlowCase(ExecState* exec, JSString* other) const
+{
+    String str1 = value(exec);
+    String str2 = other-&gt;value(exec);
+    if (exec-&gt;hadException())
+        return false;
+    return WTF::equal(*str1.impl(), *str2.impl());
+}
+
</ins><span class="cx"> size_t JSString::estimatedSize(JSCell* cell)
</span><span class="cx"> {
</span><span class="cx">     JSString* thisObject = jsCast&lt;JSString*&gt;(cell);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.h (204484 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.h        2016-08-15 21:35:07 UTC (rev 204484)
+++ trunk/Source/JavaScriptCore/runtime/JSString.h        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -155,6 +155,7 @@
</span><span class="cx">     SafeView view(ExecState*) const;
</span><span class="cx">     StringViewWithUnderlyingString viewWithUnderlyingString(ExecState&amp;) const;
</span><span class="cx"> 
</span><ins>+    inline bool equal(ExecState*, JSString* other) const;
</ins><span class="cx">     const String&amp; value(ExecState*) const;
</span><span class="cx">     const String&amp; tryGetValue() const;
</span><span class="cx">     const StringImpl* tryGetValueImpl() const;
</span><span class="lines">@@ -192,6 +193,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     friend class JSValue;
</span><span class="cx"> 
</span><ins>+    JS_EXPORT_PRIVATE bool equalSlowCase(ExecState*, JSString* other) const;
</ins><span class="cx">     bool isRope() const { return m_value.isNull(); }
</span><span class="cx">     bool isSubstring() const;
</span><span class="cx">     bool is8Bit() const { return m_flags &amp; Is8Bit; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringInlinesh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/JSStringInlines.h (0 => 204485)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSStringInlines.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/JSStringInlines.h        2016-08-15 21:52:22 UTC (rev 204485)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;JSString.h&quot;
+
+namespace JSC {
+    
+bool JSString::equal(ExecState* exec, JSString* other) const
+{
+    if (isRope() || other-&gt;isRope())
+        return equalSlowCase(exec, other);
+    return WTF::equal(*m_value.impl(), *other-&gt;m_value.impl());
+}
+
+} // namespace JSC
</ins></span></pre>
</div>
</div>

</body>
</html>