<!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>[193471] 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/193471">193471</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2015-12-04 14:28:11 -0800 (Fri, 04 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Snippefy bitwise operators for the baseline JIT.
https://bugs.webkit.org/show_bug.cgi?id=151680

Reviewed by Geoffrey Garen.

This patch has passed the JSC tests on x86 and x86_64.  It has also passed the
layout tests on x86_64.

With the DFG enabled, perf is neutral on x86_64 and x86.
With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g.
    gcc-loops.cpp           1.0269x faster
    stepanov_container.cpp  1.0180x faster

With the DFG disabled on x86, perf is neutral.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:

* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::moveValueRegs):
(JSC::AssemblyHelpers::branchIfNotInt32):
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emitBitwiseBinaryOpFastPath):
- Template for the bitwise operations.
(JSC::JIT::emit_op_bitand):
(JSC::JIT::emit_op_bitor):
(JSC::JIT::emit_op_bitxor):
- Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators.
(JSC::JIT::emitSlow_op_bitand):
(JSC::JIT::emitSlow_op_bitor):
(JSC::JIT::emitSlow_op_bitxor):
- Implement respective slow paths.

* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_op_bitand): Deleted.
(JSC::JIT::emitSlow_op_bitand): Deleted.
(JSC::JIT::emit_op_bitor): Deleted.
(JSC::JIT::emitSlow_op_bitor): Deleted.
(JSC::JIT::emit_op_bitxor): Deleted.
(JSC::JIT::emitSlow_op_bitxor): Deleted.
- Now unified with the 64-bit version using snippets. 

* jit/JITBitAndGenerator.cpp: Added.
(JSC::JITBitAndGenerator::generateFastPath):
* jit/JITBitAndGenerator.h: Added.
(JSC::JITBitAndGenerator::JITBitAndGenerator):
* jit/JITBitOrGenerator.cpp: Added.
(JSC::JITBitOrGenerator::generateFastPath):
* jit/JITBitOrGenerator.h: Added.
(JSC::JITBitOrGenerator::JITBitOrGenerator):
* jit/JITBitXorGenerator.cpp: Added.
(JSC::JITBitXorGenerator::generateFastPath):
* jit/JITBitXorGenerator.h: Added.
(JSC::JITBitXorGenerator::JITBitXorGenerator):
* jit/JITBitwiseBinaryOpGenerator.h: Added.
(JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator):
(JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath):
(JSC::JITBitwiseBinaryOpGenerator::endJumpList):
(JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList):

* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_bitxor): Deleted.
(JSC::JIT::emit_op_bitor): Deleted.
(JSC::JIT::emitSlow_op_bitxor): Deleted.
(JSC::JIT::emitSlow_op_bitor): Deleted.
* jit/SnippetOperand.h:
(JSC::SnippetOperand::SnippetOperand):

* tests/stress/op_bitand.js:
* tests/stress/op_bitor.js:
* tests/stress/op_bitxor.js:
- Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorejitAssemblyHelpersh">trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITh">trunk/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITArithmeticcpp">trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITArithmetic32_64cpp">trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitSnippetOperandh">trunk/Source/JavaScriptCore/jit/SnippetOperand.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressop_bitandjs">trunk/Source/JavaScriptCore/tests/stress/op_bitand.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressop_bitorjs">trunk/Source/JavaScriptCore/tests/stress/op_bitor.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressop_bitxorjs">trunk/Source/JavaScriptCore/tests/stress/op_bitxor.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorejitJITBitAndGeneratorcpp">trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitAndGeneratorh">trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitOrGeneratorcpp">trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitOrGeneratorh">trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitXorGeneratorcpp">trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitXorGeneratorh">trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITBitwiseBinaryOpGeneratorh">trunk/Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -452,6 +452,9 @@
</span><span class="cx">     jit/JITAddGenerator.cpp
</span><span class="cx">     jit/JITArithmetic.cpp
</span><span class="cx">     jit/JITArithmetic32_64.cpp
</span><ins>+    jit/JITBitAndGenerator.cpp
+    jit/JITBitOrGenerator.cpp
+    jit/JITBitXorGenerator.cpp
</ins><span class="cx">     jit/JITCall.cpp
</span><span class="cx">     jit/JITCall32_64.cpp
</span><span class="cx">     jit/JITCode.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2015-12-04  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Snippefy bitwise operators for the baseline JIT.
+        https://bugs.webkit.org/show_bug.cgi?id=151680
+
+        Reviewed by Geoffrey Garen.
+
+        This patch has passed the JSC tests on x86 and x86_64.  It has also passed the
+        layout tests on x86_64.
+
+        With the DFG enabled, perf is neutral on x86_64 and x86.
+        With the DFG disabled on x86_64, some AsmBench tests are showing progressions e.g.
+            gcc-loops.cpp           1.0269x faster
+            stepanov_container.cpp  1.0180x faster
+
+        With the DFG disabled on x86, perf is neutral.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
+        * jit/AssemblyHelpers.h:
+        (JSC::AssemblyHelpers::moveValueRegs):
+        (JSC::AssemblyHelpers::branchIfNotInt32):
+        * jit/JIT.h:
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emitBitwiseBinaryOpFastPath):
+        - Template for the bitwise operations.
+        (JSC::JIT::emit_op_bitand):
+        (JSC::JIT::emit_op_bitor):
+        (JSC::JIT::emit_op_bitxor):
+        - Specializes emitBitwiseBinaryOpFastPath() with the respective snippet generators.
+        (JSC::JIT::emitSlow_op_bitand):
+        (JSC::JIT::emitSlow_op_bitor):
+        (JSC::JIT::emitSlow_op_bitxor):
+        - Implement respective slow paths.
+
+        * jit/JITArithmetic32_64.cpp:
+        (JSC::JIT::emit_op_bitand): Deleted.
+        (JSC::JIT::emitSlow_op_bitand): Deleted.
+        (JSC::JIT::emit_op_bitor): Deleted.
+        (JSC::JIT::emitSlow_op_bitor): Deleted.
+        (JSC::JIT::emit_op_bitxor): Deleted.
+        (JSC::JIT::emitSlow_op_bitxor): Deleted.
+        - Now unified with the 64-bit version using snippets. 
+
+        * jit/JITBitAndGenerator.cpp: Added.
+        (JSC::JITBitAndGenerator::generateFastPath):
+        * jit/JITBitAndGenerator.h: Added.
+        (JSC::JITBitAndGenerator::JITBitAndGenerator):
+        * jit/JITBitOrGenerator.cpp: Added.
+        (JSC::JITBitOrGenerator::generateFastPath):
+        * jit/JITBitOrGenerator.h: Added.
+        (JSC::JITBitOrGenerator::JITBitOrGenerator):
+        * jit/JITBitXorGenerator.cpp: Added.
+        (JSC::JITBitXorGenerator::generateFastPath):
+        * jit/JITBitXorGenerator.h: Added.
+        (JSC::JITBitXorGenerator::JITBitXorGenerator):
+        * jit/JITBitwiseBinaryOpGenerator.h: Added.
+        (JSC::JITBitwiseBinaryOpGenerator::JITBitwiseBinaryOpGenerator):
+        (JSC::JITBitwiseBinaryOpGenerator::didEmitFastPath):
+        (JSC::JITBitwiseBinaryOpGenerator::endJumpList):
+        (JSC::JITBitwiseBinaryOpGenerator::slowPathJumpList):
+
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_bitxor): Deleted.
+        (JSC::JIT::emit_op_bitor): Deleted.
+        (JSC::JIT::emitSlow_op_bitxor): Deleted.
+        (JSC::JIT::emitSlow_op_bitor): Deleted.
+        * jit/SnippetOperand.h:
+        (JSC::SnippetOperand::SnippetOperand):
+
+        * tests/stress/op_bitand.js:
+        * tests/stress/op_bitor.js:
+        * tests/stress/op_bitxor.js:
+        - Fix a test value typo: it's supposed to be 0x7fffffff, not 0x7ffffff.
+
</ins><span class="cx"> 2015-12-04  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Having a bad time has a really awful time when it runs at the same time as the JIT
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -644,6 +644,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITAddGenerator.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITArithmetic.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITArithmetic32_64.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\jit\JITBitAndGenerator.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\jit\JITBitOrGenerator.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\jit\JITBitXorGenerator.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITCall.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITCall32_64.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITCode.cpp&quot; /&gt;
</span><span class="lines">@@ -1472,6 +1475,10 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\HostCallReturnValue.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JIT.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITAddGenerator.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\jit\JITBitAndGenerator.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitOrGenerator.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitXorGenerator.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitwiseBinaryOpGenerator.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITCode.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITCompilationEffort.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITDisassembler.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -429,6 +429,15 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITArithmetic32_64.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\jit\JITBitAndGenerator.cpp&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\jit\JITBitOrGenerator.cpp&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\jit\JITBitXorGenerator.cpp&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\jit\JITCall.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -2528,6 +2537,18 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITAddGenerator.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\jit\JITBitAndGenerator.h&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitOrGenerator.h&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitXorGenerator.h&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\jit\JITBitwiseBinaryOpGenerator.h&quot;&gt;
+      &lt;Filter&gt;jit&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\jit\JITCode.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -2007,6 +2007,13 @@
</span><span class="cx">                 FE3913541B794F6E00EDAF71 /* LiveObjectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE3913521B794AC900EDAF71 /* LiveObjectList.cpp */; };
</span><span class="cx">                 FE3913551B794F8A00EDAF71 /* LiveObjectData.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3913511B794AC900EDAF71 /* LiveObjectData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE3913561B794F8F00EDAF71 /* LiveObjectList.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3913531B794AC900EDAF71 /* LiveObjectList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                FE3A06A61C10B72D00390FDD /* JITBitOrGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06A41C10B70800390FDD /* JITBitOrGenerator.h */; settings = {ASSET_TAGS = (); }; };
+                FE3A06A81C10BC8100390FDD /* JITBitwiseBinaryOpGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06A71C10BC7400390FDD /* JITBitwiseBinaryOpGenerator.h */; settings = {ASSET_TAGS = (); }; };
+                FE3A06AC1C10C39E00390FDD /* JITBitOrGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE3A06A31C10B70800390FDD /* JITBitOrGenerator.cpp */; settings = {ASSET_TAGS = (); }; };
+                FE3A06B11C10CB8400390FDD /* JITBitAndGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE3A06AD1C10CB6F00390FDD /* JITBitAndGenerator.cpp */; settings = {ASSET_TAGS = (); }; };
+                FE3A06B21C10CB8900390FDD /* JITBitAndGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06AE1C10CB6F00390FDD /* JITBitAndGenerator.h */; settings = {ASSET_TAGS = (); }; };
+                FE3A06B31C10CB8E00390FDD /* JITBitXorGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE3A06AF1C10CB6F00390FDD /* JITBitXorGenerator.cpp */; settings = {ASSET_TAGS = (); }; };
+                FE3A06B41C10CB9300390FDD /* JITBitXorGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE3A06B01C10CB6F00390FDD /* JITBitXorGenerator.h */; settings = {ASSET_TAGS = (); }; };
</ins><span class="cx">                 FE4238901BE18C3C00514737 /* JITSubGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE42388F1BE18C1200514737 /* JITSubGenerator.cpp */; };
</span><span class="cx">                 FE4BFF2B1AD476E700088F87 /* FunctionOverrides.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */; };
</span><span class="cx">                 FE4BFF2C1AD476E700088F87 /* FunctionOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */; };
</span><span class="lines">@@ -4172,6 +4179,13 @@
</span><span class="cx">                 FE3913511B794AC900EDAF71 /* LiveObjectData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveObjectData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE3913521B794AC900EDAF71 /* LiveObjectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LiveObjectList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE3913531B794AC900EDAF71 /* LiveObjectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveObjectList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE3A06A31C10B70800390FDD /* JITBitOrGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITBitOrGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06A41C10B70800390FDD /* JITBitOrGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITBitOrGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06A71C10BC7400390FDD /* JITBitwiseBinaryOpGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITBitwiseBinaryOpGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06AD1C10CB6F00390FDD /* JITBitAndGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITBitAndGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06AE1C10CB6F00390FDD /* JITBitAndGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITBitAndGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06AF1C10CB6F00390FDD /* JITBitXorGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITBitXorGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE3A06B01C10CB6F00390FDD /* JITBitXorGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITBitXorGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE42388F1BE18C1200514737 /* JITSubGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITSubGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionOverrides.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionOverrides.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4842,6 +4856,13 @@
</span><span class="cx">                                 FE1220261BE7F5640039E6F2 /* JITAddGenerator.h */,
</span><span class="cx">                                 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */,
</span><span class="cx">                                 A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */,
</span><ins>+                                FE3A06AD1C10CB6F00390FDD /* JITBitAndGenerator.cpp */,
+                                FE3A06AE1C10CB6F00390FDD /* JITBitAndGenerator.h */,
+                                FE3A06A31C10B70800390FDD /* JITBitOrGenerator.cpp */,
+                                FE3A06A41C10B70800390FDD /* JITBitOrGenerator.h */,
+                                FE3A06AF1C10CB6F00390FDD /* JITBitXorGenerator.cpp */,
+                                FE3A06B01C10CB6F00390FDD /* JITBitXorGenerator.h */,
+                                FE3A06A71C10BC7400390FDD /* JITBitwiseBinaryOpGenerator.h */,
</ins><span class="cx">                                 86CC85A20EE79B7400288682 /* JITCall.cpp */,
</span><span class="cx">                                 146FE51111A710430087AE66 /* JITCall32_64.cpp */,
</span><span class="cx">                                 0F8F94431667635200D61971 /* JITCode.cpp */,
</span><span class="lines">@@ -6847,6 +6868,7 @@
</span><span class="cx">                                 0F338E111BF0276C0013C88F /* B3OpaqueByproduct.h in Headers */,
</span><span class="cx">                                 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */,
</span><span class="cx">                                 99DA00A31BD5993100F4575C /* builtins_generator.py in Headers */,
</span><ins>+                                FE3A06A61C10B72D00390FDD /* JITBitOrGenerator.h in Headers */,
</ins><span class="cx">                                 99DA00A41BD5993100F4575C /* builtins_model.py in Headers */,
</span><span class="cx">                                 99DA00A51BD5993100F4575C /* builtins_templates.py in Headers */,
</span><span class="cx">                                 41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */,
</span><span class="lines">@@ -7112,6 +7134,7 @@
</span><span class="cx">                                 0FD8A32817D51F5700CA2C40 /* DFGTierUpCheckInjectionPhase.h in Headers */,
</span><span class="cx">                                 0FD8A32A17D51F5700CA2C40 /* DFGToFTLDeferredCompilationCallback.h in Headers */,
</span><span class="cx">                                 0FD8A32C17D51F5700CA2C40 /* DFGToFTLForOSREntryDeferredCompilationCallback.h in Headers */,
</span><ins>+                                FE3A06B41C10CB9300390FDD /* JITBitXorGenerator.h in Headers */,
</ins><span class="cx">                                 0FE7211E193B9C590031F6ED /* DFGTransition.h in Headers */,
</span><span class="cx">                                 0F63943F15C75F19006A597C /* DFGTypeCheckHoistingPhase.h in Headers */,
</span><span class="cx">                                 0FBE0F7716C1DB120082C5E8 /* DFGUnificationPhase.h in Headers */,
</span><span class="lines">@@ -7365,6 +7388,7 @@
</span><span class="cx">                                 86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
</span><span class="cx">                                 0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
</span><span class="cx">                                 0FAF7EFE165BA91F000C8455 /* JITDisassembler.h in Headers */,
</span><ins>+                                FE3A06A81C10BC8100390FDD /* JITBitwiseBinaryOpGenerator.h in Headers */,
</ins><span class="cx">                                 0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */,
</span><span class="cx">                                 0FB14E1F18124ACE009B6B4D /* JITInlineCacheGenerator.h in Headers */,
</span><span class="cx">                                 86CC85A10EE79A4700288682 /* JITInlines.h in Headers */,
</span><span class="lines">@@ -7653,6 +7677,7 @@
</span><span class="cx">                                 0FB1058C1675483300F8AB6E /* ProfilerOSRExit.h in Headers */,
</span><span class="cx">                                 0FB1058E1675483A00F8AB6E /* ProfilerOSRExitSite.h in Headers */,
</span><span class="cx">                                 0F13912C16771C3D009CCB07 /* ProfilerProfiledBytecodes.h in Headers */,
</span><ins>+                                FE3A06B21C10CB8900390FDD /* JITBitAndGenerator.h in Headers */,
</ins><span class="cx">                                 0FD3E40E1B618B6600C80E1E /* PropertyCondition.h in Headers */,
</span><span class="cx">                                 A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
</span><span class="cx">                                 BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */,
</span><span class="lines">@@ -8591,6 +8616,7 @@
</span><span class="cx">                                 0FC09791146A6F7100CF2442 /* DFGOSRExit.cpp in Sources */,
</span><span class="cx">                                 0F235BEB17178E7300690C7F /* DFGOSRExitBase.cpp in Sources */,
</span><span class="cx">                                 0FC09792146A6F7300CF2442 /* DFGOSRExitCompiler.cpp in Sources */,
</span><ins>+                                FE3A06B11C10CB8400390FDD /* JITBitAndGenerator.cpp in Sources */,
</ins><span class="cx">                                 0FC09776146943B000CF2442 /* DFGOSRExitCompiler32_64.cpp in Sources */,
</span><span class="cx">                                 0FC0977214693AF900CF2442 /* DFGOSRExitCompiler64.cpp in Sources */,
</span><span class="cx">                                 0F7025A91714B0FA00382C0E /* DFGOSRExitCompilerCommon.cpp in Sources */,
</span><span class="lines">@@ -8755,6 +8781,7 @@
</span><span class="cx">                                 A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */,
</span><span class="cx">                                 A532438718568335002ED692 /* InspectorBackendDispatchers.cpp in Sources */,
</span><span class="cx">                                 A5FD0081189B191A00633231 /* InspectorConsoleAgent.cpp in Sources */,
</span><ins>+                                FE3A06B31C10CB8E00390FDD /* JITBitXorGenerator.cpp in Sources */,
</ins><span class="cx">                                 A57D23E51890CEBF0031C7FA /* InspectorDebuggerAgent.cpp in Sources */,
</span><span class="cx">                                 A532438918568335002ED692 /* InspectorFrontendDispatchers.cpp in Sources */,
</span><span class="cx">                                 99F1A6FE1B8E6D9400463B26 /* InspectorFrontendRouter.cpp in Sources */,
</span><span class="lines">@@ -8930,6 +8957,7 @@
</span><span class="cx">                                 A729009C17976C6000317298 /* MacroAssemblerARMv7.cpp in Sources */,
</span><span class="cx">                                 FE68C6381B90DE0B0042BCB3 /* MacroAssemblerPrinter.cpp in Sources */,
</span><span class="cx">                                 A7A4AE0817973B26005612B1 /* MacroAssemblerX86Common.cpp in Sources */,
</span><ins>+                                FE3A06AC1C10C39E00390FDD /* JITBitOrGenerator.cpp in Sources */,
</ins><span class="cx">                                 A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */,
</span><span class="cx">                                 A74DEF93182D991400522C22 /* MapIteratorPrototype.cpp in Sources */,
</span><span class="cx">                                 A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitAssemblyHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -149,6 +149,14 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void moveValueRegs(JSValueRegs srcRegs, JSValueRegs destRegs)
+    {
+#if USE(JSVALUE32_64)
+        move(srcRegs.tagGPR(), destRegs.tagGPR());
+#endif
+        move(srcRegs.payloadGPR(), destRegs.payloadGPR());
+    }
+
</ins><span class="cx">     void moveValue(JSValue value, JSValueRegs regs)
</span><span class="cx">     {
</span><span class="cx"> #if USE(JSVALUE64)
</span><span class="lines">@@ -685,13 +693,20 @@
</span><span class="cx">         return branch32(Equal, regs.tagGPR(), TrustedImm32(JSValue::Int32Tag));
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+#if USE(JSVALUE64)
+    Jump branchIfNotInt32(GPRReg gpr, TagRegistersMode mode = HaveTagRegisters)
+    {
+        if (mode == HaveTagRegisters)
+            return branch64(Below, gpr, GPRInfo::tagTypeNumberRegister);
+        return branch64(Below, gpr, TrustedImm64(TagTypeNumber));
+    }
+#endif
+
</ins><span class="cx">     Jump branchIfNotInt32(JSValueRegs regs, TagRegistersMode mode = HaveTagRegisters)
</span><span class="cx">     {
</span><span class="cx"> #if USE(JSVALUE64)
</span><del>-        if (mode == HaveTagRegisters)
-            return branch64(Below, regs.gpr(), GPRInfo::tagTypeNumberRegister);
-        return branch64(Below, regs.gpr(), TrustedImm64(TagTypeNumber));
</del><ins>+        return branchIfNotInt32(regs.gpr(), mode);
</ins><span class="cx"> #else
</span><span class="cx">         UNUSED_PARAM(mode);
</span><span class="cx">         return branch32(NotEqual, regs.tagGPR(), TrustedImm32(JSValue::Int32Tag));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.h (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.h        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/JIT.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -826,6 +826,9 @@
</span><span class="cx">         MacroAssembler::Call callOperation(J_JITOperation_EJscCJ, int, GPRReg, JSCell*, GPRReg, GPRReg);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+        template&lt;typename SnippetGenerator&gt;
+        void emitBitwiseBinaryOpFastPath(Instruction* currentInstruction);
+
</ins><span class="cx">         Jump checkStructure(RegisterID reg, Structure* structure);
</span><span class="cx"> 
</span><span class="cx">         void updateTopCallFrame();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITArithmeticcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -30,6 +30,9 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;JITAddGenerator.h&quot;
</span><ins>+#include &quot;JITBitAndGenerator.h&quot;
+#include &quot;JITBitOrGenerator.h&quot;
+#include &quot;JITBitXorGenerator.h&quot;
</ins><span class="cx"> #include &quot;JITDivGenerator.h&quot;
</span><span class="cx"> #include &quot;JITInlines.h&quot;
</span><span class="cx"> #include &quot;JITMulGenerator.h&quot;
</span><span class="lines">@@ -525,42 +528,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JIT::emit_op_bitand(Instruction* currentInstruction)
-{
-    int result = currentInstruction[1].u.operand;
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    if (isOperandConstantInt(op1)) {
-        emitGetVirtualRegister(op2, regT0);
-        emitJumpSlowCaseIfNotInt(regT0);
-        int32_t imm = getOperandConstantInt(op1);
-        and64(Imm32(imm), regT0);
-        if (imm &gt;= 0)
-            emitTagInt(regT0, regT0);
-    } else if (isOperandConstantInt(op2)) {
-        emitGetVirtualRegister(op1, regT0);
-        emitJumpSlowCaseIfNotInt(regT0);
-        int32_t imm = getOperandConstantInt(op2);
-        and64(Imm32(imm), regT0);
-        if (imm &gt;= 0)
-            emitTagInt(regT0, regT0);
-    } else {
-        emitGetVirtualRegisters(op1, regT0, op2, regT1);
-        and64(regT1, regT0);
-        emitJumpSlowCaseIfNotInt(regT0);
-    }
-    emitPutVirtualRegister(result);
-}
-
-void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    linkSlowCase(iter);
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
-    slowPathCall.call();
-}
-
</del><span class="cx"> void JIT::emit_op_inc(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int srcDst = currentInstruction[1].u.operand;
</span><span class="lines">@@ -664,6 +631,100 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(JSVALUE64)
</span><span class="cx"> 
</span><ins>+template&lt;typename SnippetGenerator&gt;
+void JIT::emitBitwiseBinaryOpFastPath(Instruction* currentInstruction)
+{
+    int result = currentInstruction[1].u.operand;
+    int op1 = currentInstruction[2].u.operand;
+    int op2 = currentInstruction[3].u.operand;
+
+#if USE(JSVALUE64)
+    JSValueRegs leftRegs = JSValueRegs(GPRInfo::regT0);
+    JSValueRegs rightRegs = JSValueRegs(GPRInfo::regT1);
+    JSValueRegs resultRegs = leftRegs;
+    GPRReg scratchGPR = GPRInfo::regT2;
+#else
+    JSValueRegs leftRegs = JSValueRegs(GPRInfo::regT1, GPRInfo::regT0);
+    JSValueRegs rightRegs = JSValueRegs(GPRInfo::regT3, GPRInfo::regT2);
+    JSValueRegs resultRegs = leftRegs;
+    GPRReg scratchGPR = InvalidGPRReg;
+#endif
+
+    SnippetOperand leftOperand;
+    SnippetOperand rightOperand;
+
+    if (isOperandConstantInt(op1))
+        leftOperand.setConstInt32(getOperandConstantInt(op1));
+    if (isOperandConstantInt(op2))
+        rightOperand.setConstInt32(getOperandConstantInt(op2));
+
+    RELEASE_ASSERT(!leftOperand.isConst() || !rightOperand.isConst());
+
+    if (!leftOperand.isConst())
+        emitGetVirtualRegister(op1, leftRegs);
+    if (!rightOperand.isConst())
+        emitGetVirtualRegister(op2, rightRegs);
+
+    SnippetGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, scratchGPR);
+
+    gen.generateFastPath(*this);
+
+    if (gen.didEmitFastPath()) {
+        gen.endJumpList().link(this);
+#if USE(JSVALUE32_64)
+        emitStoreInt32(result, resultRegs.payloadGPR(), op1 == result || op2 == result);
+#else
+        emitPutVirtualRegister(result, resultRegs);
+#endif
+
+        addSlowCase(gen.slowPathJumpList());
+    } else {
+        ASSERT(gen.endJumpList().empty());
+        ASSERT(gen.slowPathJumpList().empty());
+        JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
+        slowPathCall.call();
+    }
+}
+
+void JIT::emit_op_bitand(Instruction* currentInstruction)
+{
+    emitBitwiseBinaryOpFastPath&lt;JITBitAndGenerator&gt;(currentInstruction);
+}
+
+void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
+{
+    linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
+
+    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
+    slowPathCall.call();
+}
+
+void JIT::emit_op_bitor(Instruction* currentInstruction)
+{
+    emitBitwiseBinaryOpFastPath&lt;JITBitOrGenerator&gt;(currentInstruction);
+}
+
+void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
+{
+    linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
+
+    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
+    slowPathCall.call();
+}
+
+void JIT::emit_op_bitxor(Instruction* currentInstruction)
+{
+    emitBitwiseBinaryOpFastPath&lt;JITBitXorGenerator&gt;(currentInstruction);
+}
+
+void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
+{
+    linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
+
+    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
+    slowPathCall.call();
+}
+
</ins><span class="cx"> void JIT::emit_op_add(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int result = currentInstruction[1].u.operand;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITArithmetic32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -324,120 +324,6 @@
</span><span class="cx">     slowPathCall.call();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// BitAnd (&amp;)
-
-void JIT::emit_op_bitand(Instruction* currentInstruction)
-{
-    int dst = currentInstruction[1].u.operand;
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    int op;
-    int32_t constant;
-    if (getOperandConstantInt(op1, op2, op, constant)) {
-        emitLoad(op, regT1, regT0);
-        addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-        and32(Imm32(constant), regT0);
-        emitStoreInt32(dst, regT0, dst == op);
-        return;
-    }
-
-    emitLoad2(op1, regT1, regT0, op2, regT3, regT2);
-    addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-    addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
-    and32(regT2, regT0);
-    emitStoreInt32(dst, regT0, op1 == dst || op2 == dst);
-}
-
-void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    if (!isOperandConstantInt(op1) &amp;&amp; !isOperandConstantInt(op2))
-        linkSlowCase(iter); // int32 check
-    linkSlowCase(iter); // int32 check
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
-    slowPathCall.call();
-}
-
-// BitOr (|)
-
-void JIT::emit_op_bitor(Instruction* currentInstruction)
-{
-    int dst = currentInstruction[1].u.operand;
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    int op;
-    int32_t constant;
-    if (getOperandConstantInt(op1, op2, op, constant)) {
-        emitLoad(op, regT1, regT0);
-        addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-        or32(Imm32(constant), regT0);
-        emitStoreInt32(dst, regT0, op == dst);
-        return;
-    }
-
-    emitLoad2(op1, regT1, regT0, op2, regT3, regT2);
-    addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-    addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
-    or32(regT2, regT0);
-    emitStoreInt32(dst, regT0, op1 == dst || op2 == dst);
-}
-
-void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    if (!isOperandConstantInt(op1) &amp;&amp; !isOperandConstantInt(op2))
-        linkSlowCase(iter); // int32 check
-    linkSlowCase(iter); // int32 check
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
-    slowPathCall.call();
-}
-
-// BitXor (^)
-
-void JIT::emit_op_bitxor(Instruction* currentInstruction)
-{
-    int dst = currentInstruction[1].u.operand;
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    int op;
-    int32_t constant;
-    if (getOperandConstantInt(op1, op2, op, constant)) {
-        emitLoad(op, regT1, regT0);
-        addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-        xor32(Imm32(constant), regT0);
-        emitStoreInt32(dst, regT0, op == dst);
-        return;
-    }
-
-    emitLoad2(op1, regT1, regT0, op2, regT3, regT2);
-    addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
-    addSlowCase(branch32(NotEqual, regT3, TrustedImm32(JSValue::Int32Tag)));
-    xor32(regT2, regT0);
-    emitStoreInt32(dst, regT0, op1 == dst || op2 == dst);
-}
-
-void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    int op1 = currentInstruction[2].u.operand;
-    int op2 = currentInstruction[3].u.operand;
-
-    if (!isOperandConstantInt(op1) &amp;&amp; !isOperandConstantInt(op2))
-        linkSlowCase(iter); // int32 check
-    linkSlowCase(iter); // int32 check
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
-    slowPathCall.call();
-}
-
</del><span class="cx"> void JIT::emit_op_inc(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int srcDst = currentInstruction[1].u.operand;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitAndGeneratorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.cpp (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JITBitAndGenerator.h&quot;
+
+#if ENABLE(JIT)
+
+namespace JSC {
+
+void JITBitAndGenerator::generateFastPath(CCallHelpers&amp; jit)
+{
+#if USE(JSVALUE64)
+    ASSERT(m_scratchGPR != InvalidGPRReg);
+    ASSERT(m_scratchGPR != m_left.payloadGPR());
+    ASSERT(m_scratchGPR != m_right.payloadGPR());
+#else
+    UNUSED_PARAM(m_scratchGPR);
+#endif
+
+    ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32());
+
+    m_didEmitFastPath = true;
+
+    if (m_leftOperand.isConstInt32() || m_rightOperand.isConstInt32()) {
+        JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left;
+        SnippetOperand&amp; constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
+        
+        // Try to do intVar &amp; intConstant.
+        m_slowPathJumpList.append(jit.branchIfNotInt32(var));
+        
+        jit.moveValueRegs(var, m_result);
+#if USE(JSVALUE64)
+        jit.and64(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+        if (constOpr.asConstInt32() &gt;= 0)
+            jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+#else
+        jit.and32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+#endif
+        
+    } else {
+        ASSERT(!m_leftOperand.isConstInt32() &amp;&amp; !m_rightOperand.isConstInt32());
+        
+        // Try to do intVar &amp; intVar.
+#if USE(JSVALUE64)
+        jit.move(m_left.payloadGPR(), m_scratchGPR);
+        jit.and64(m_right.payloadGPR(), m_scratchGPR);
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_scratchGPR));
+        jit.move(m_scratchGPR, m_result.payloadGPR());
+#else
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
+        jit.moveValueRegs(m_left, m_result);
+        jit.and32(m_right.payloadGPR(), m_result.payloadGPR());
+#endif
+    }
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitAndGeneratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.h (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitAndGenerator.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef JITBitAndGenerator_h
+#define JITBitAndGenerator_h
+
+#if ENABLE(JIT)
+
+#include &quot;JITBitwiseBinaryOpGenerator.h&quot;
+
+namespace JSC {
+
+class JITBitAndGenerator : public JITBitwiseBinaryOpGenerator {
+public:
+    JITBitAndGenerator(const SnippetOperand&amp; leftOperand, const SnippetOperand&amp; rightOperand,
+        JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg scratchGPR)
+        : JITBitwiseBinaryOpGenerator(leftOperand, rightOperand, result, left, right, scratchGPR)
+    { }
+
+    void generateFastPath(CCallHelpers&amp;);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
+#endif // JITBitAndGenerator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitOrGeneratorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.cpp (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JITBitOrGenerator.h&quot;
+
+#if ENABLE(JIT)
+
+namespace JSC {
+
+void JITBitOrGenerator::generateFastPath(CCallHelpers&amp; jit)
+{
+    ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32());
+    
+    m_didEmitFastPath = true;
+    
+    if (m_leftOperand.isConstInt32() || m_rightOperand.isConstInt32()) {
+        JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left;
+        SnippetOperand&amp; constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
+        
+        // Try to do intVar &amp; intConstant.
+        m_slowPathJumpList.append(jit.branchIfNotInt32(var));
+        
+        jit.moveValueRegs(var, m_result);
+#if USE(JSVALUE64)
+        jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+#else
+        jit.or32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+#endif
+        
+    } else {
+        ASSERT(!m_leftOperand.isConstInt32() &amp;&amp; !m_rightOperand.isConstInt32());
+        
+        // Try to do intVar &amp; intVar.
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
+
+        jit.moveValueRegs(m_left, m_result);
+#if USE(JSVALUE64)
+        jit.or64(m_right.payloadGPR(), m_result.payloadGPR());
+#else
+        jit.or32(m_right.payloadGPR(), m_result.payloadGPR());
+#endif
+    }
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitOrGeneratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.h (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitOrGenerator.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef JITBitOrGenerator_h
+#define JITBitOrGenerator_h
+
+#if ENABLE(JIT)
+
+#include &quot;JITBitwiseBinaryOpGenerator.h&quot;
+
+namespace JSC {
+
+class JITBitOrGenerator : public JITBitwiseBinaryOpGenerator {
+public:
+    JITBitOrGenerator(const SnippetOperand&amp; leftOperand, const SnippetOperand&amp; rightOperand,
+        JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg unused = InvalidGPRReg)
+        : JITBitwiseBinaryOpGenerator(leftOperand, rightOperand, result, left, right, unused)
+    { }
+
+    void generateFastPath(CCallHelpers&amp;);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
+#endif // JITBitOrGenerator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitXorGeneratorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.cpp (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JITBitXorGenerator.h&quot;
+
+#if ENABLE(JIT)
+
+namespace JSC {
+
+void JITBitXorGenerator::generateFastPath(CCallHelpers&amp; jit)
+{
+    ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32());
+    
+    m_didEmitFastPath = true;
+    
+    if (m_leftOperand.isConstInt32() || m_rightOperand.isConstInt32()) {
+        JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left;
+        SnippetOperand&amp; constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand;
+        
+        // Try to do intVar &amp; intConstant.
+        m_slowPathJumpList.append(jit.branchIfNotInt32(var));
+        
+        jit.moveValueRegs(var, m_result);
+#if USE(JSVALUE64)
+        jit.xor32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+#else
+        jit.xor32(CCallHelpers::Imm32(constOpr.asConstInt32()), m_result.payloadGPR());
+#endif
+        
+    } else {
+        ASSERT(!m_leftOperand.isConstInt32() &amp;&amp; !m_rightOperand.isConstInt32());
+        
+        // Try to do intVar &amp; intVar.
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_left));
+        m_slowPathJumpList.append(jit.branchIfNotInt32(m_right));
+        
+        jit.moveValueRegs(m_left, m_result);
+#if USE(JSVALUE64)
+        jit.xor64(m_right.payloadGPR(), m_result.payloadGPR());
+        jit.or64(GPRInfo::tagTypeNumberRegister, m_result.payloadGPR());
+#else
+        jit.xor32(m_right.payloadGPR(), m_result.payloadGPR());
+#endif
+    }
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitXorGeneratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.h (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitXorGenerator.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef JITBitXorGenerator_h
+#define JITBitXorGenerator_h
+
+#if ENABLE(JIT)
+
+#include &quot;JITBitwiseBinaryOpGenerator.h&quot;
+
+namespace JSC {
+
+class JITBitXorGenerator : public JITBitwiseBinaryOpGenerator {
+public:
+    JITBitXorGenerator(const SnippetOperand&amp; leftOperand, const SnippetOperand&amp; rightOperand,
+        JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg unused = InvalidGPRReg)
+        : JITBitwiseBinaryOpGenerator(leftOperand, rightOperand, result, left, right, unused)
+    { }
+
+    void generateFastPath(CCallHelpers&amp;);
+};
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
+#endif // JITBitOrGenerator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITBitwiseBinaryOpGeneratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h (0 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/jit/JITBitwiseBinaryOpGenerator.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef JITBitwiseBinaryOpGenerator_h
+#define JITBitwiseBinaryOpGenerator_h
+
+#if ENABLE(JIT)
+
+#include &quot;CCallHelpers.h&quot;
+#include &quot;SnippetOperand.h&quot;
+
+namespace JSC {
+
+class JITBitwiseBinaryOpGenerator {
+public:
+    JITBitwiseBinaryOpGenerator(const SnippetOperand&amp; leftOperand, const SnippetOperand&amp; rightOperand,
+        JSValueRegs result, JSValueRegs left, JSValueRegs right, GPRReg scratchGPR)
+        : m_leftOperand(leftOperand)
+        , m_rightOperand(rightOperand)
+        , m_result(result)
+        , m_left(left)
+        , m_right(right)
+        , m_scratchGPR(scratchGPR)
+    {
+        ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32());
+    }
+
+    bool didEmitFastPath() const { return m_didEmitFastPath; }
+    CCallHelpers::JumpList&amp; endJumpList() { return m_endJumpList; }
+    CCallHelpers::JumpList&amp; slowPathJumpList() { return m_slowPathJumpList; }
+
+protected:
+    SnippetOperand m_leftOperand;
+    SnippetOperand m_rightOperand;
+    JSValueRegs m_result;
+    JSValueRegs m_left;
+    JSValueRegs m_right;
+    GPRReg m_scratchGPR;
+    bool m_didEmitFastPath { false };
+
+    CCallHelpers::JumpList m_endJumpList;
+    CCallHelpers::JumpList m_slowPathJumpList;
+};
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
+#endif // JITBitwiseBinaryOpGenerator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -401,23 +401,6 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JIT::emit_op_bitxor(Instruction* currentInstruction)
-{
-    emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
-    emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
-    xor64(regT1, regT0);
-    emitTagInt(regT0, regT0);
-    emitPutVirtualRegister(currentInstruction[1].u.operand);
-}
-
-void JIT::emit_op_bitor(Instruction* currentInstruction)
-{
-    emitGetVirtualRegisters(currentInstruction[2].u.operand, regT0, currentInstruction[3].u.operand, regT1);
-    emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
-    or64(regT1, regT0);
-    emitPutVirtualRegister(currentInstruction[1].u.operand);
-}
-
</del><span class="cx"> void JIT::emit_op_throw(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(regT0 == returnValueGPR);
</span><span class="lines">@@ -819,20 +802,6 @@
</span><span class="cx">     emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), currentInstruction[2].u.operand);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    linkSlowCase(iter);
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
-    slowPathCall.call();
-}
-
-void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
-{
-    linkSlowCase(iter);
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
-    slowPathCall.call();
-}
-
</del><span class="cx"> void JIT::emitSlow_op_eq(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
</span><span class="cx"> {
</span><span class="cx">     linkSlowCase(iter);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitSnippetOperandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/SnippetOperand.h (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/SnippetOperand.h        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/jit/SnippetOperand.h        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -40,6 +40,10 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> public:
</span><ins>+    SnippetOperand()
+        : m_resultType(ResultType::unknownType())
+    { }
+
</ins><span class="cx">     SnippetOperand(ResultType resultType)
</span><span class="cx">         : m_resultType(resultType)
</span><span class="cx">     { }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressop_bitandjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/op_bitand.js (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/op_bitand.js        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/tests/stress/op_bitand.js        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx">     '-0x7fff',
</span><span class="cx">     '0x10000',
</span><span class="cx">     '-0x10000',
</span><del>-    '0x7ffffff',
-    '-0x7ffffff',
</del><ins>+    '0x7fffffff',
+    '-0x7fffffff',
</ins><span class="cx">     '0xa5a5a5a5',
</span><span class="cx">     '0x100000000',
</span><span class="cx">     '-0x100000000',
</span><span class="lines">@@ -54,8 +54,8 @@
</span><span class="cx">     '&quot;-0&quot;',
</span><span class="cx">     '&quot;1&quot;',
</span><span class="cx">     '&quot;-1&quot;',
</span><del>-    '&quot;0x7ffffff&quot;',
-    '&quot;-0x7ffffff&quot;',
</del><ins>+    '&quot;0x7fffffff&quot;',
+    '&quot;-0x7fffffff&quot;',
</ins><span class="cx">     '&quot;0xa5a5a5a5&quot;',
</span><span class="cx">     '&quot;0x100000000&quot;',
</span><span class="cx">     '&quot;-0x100000000&quot;',
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressop_bitorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/op_bitor.js (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/op_bitor.js        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/tests/stress/op_bitor.js        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx">     '-0x7fff',
</span><span class="cx">     '0x10000',
</span><span class="cx">     '-0x10000',
</span><del>-    '0x7ffffff',
-    '-0x7ffffff',
</del><ins>+    '0x7fffffff',
+    '-0x7fffffff',
</ins><span class="cx">     '0xa5a5a5a5',
</span><span class="cx">     '0x100000000',
</span><span class="cx">     '-0x100000000',
</span><span class="lines">@@ -54,8 +54,8 @@
</span><span class="cx">     '&quot;-0&quot;',
</span><span class="cx">     '&quot;1&quot;',
</span><span class="cx">     '&quot;-1&quot;',
</span><del>-    '&quot;0x7ffffff&quot;',
-    '&quot;-0x7ffffff&quot;',
</del><ins>+    '&quot;0x7fffffff&quot;',
+    '&quot;-0x7fffffff&quot;',
</ins><span class="cx">     '&quot;0xa5a5a5a5&quot;',
</span><span class="cx">     '&quot;0x100000000&quot;',
</span><span class="cx">     '&quot;-0x100000000&quot;',
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressop_bitxorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/op_bitxor.js (193470 => 193471)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/op_bitxor.js        2015-12-04 22:25:26 UTC (rev 193470)
+++ trunk/Source/JavaScriptCore/tests/stress/op_bitxor.js        2015-12-04 22:28:11 UTC (rev 193471)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx">     '-0x7fff',
</span><span class="cx">     '0x10000',
</span><span class="cx">     '-0x10000',
</span><del>-    '0x7ffffff',
-    '-0x7ffffff',
</del><ins>+    '0x7fffffff',
+    '-0x7fffffff',
</ins><span class="cx">     '0xa5a5a5a5',
</span><span class="cx">     '0x100000000',
</span><span class="cx">     '-0x100000000',
</span><span class="lines">@@ -54,8 +54,8 @@
</span><span class="cx">     '&quot;-0&quot;',
</span><span class="cx">     '&quot;1&quot;',
</span><span class="cx">     '&quot;-1&quot;',
</span><del>-    '&quot;0x7ffffff&quot;',
-    '&quot;-0x7ffffff&quot;',
</del><ins>+    '&quot;0x7fffffff&quot;',
+    '&quot;-0x7fffffff&quot;',
</ins><span class="cx">     '&quot;0xa5a5a5a5&quot;',
</span><span class="cx">     '&quot;0x100000000&quot;',
</span><span class="cx">     '&quot;-0x100000000&quot;',
</span></span></pre>
</div>
</div>

</body>
</html>