<!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>[201335] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/201335">201335</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2016-05-24 10:08:45 -0700 (Tue, 24 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>LLInt64 should have typed array fast paths for get_by_val
https://bugs.webkit.org/show_bug.cgi?id=157931

Reviewed by Keith Miller.

Source/JavaScriptCore:

I think that the LLInt should be able to access typed arrays more quickly than it does now.
Ideally we would have fast paths for every major typed array operation and we would use
inline cache optimizations. I don't want to do this all in one go, so my plan is to
incrementally add support for this as time allows.
        
This change just adds the easy typed array fast paths for get_by_val in the 64-bit version
of LLInt.
        
Another bug, https://bugs.webkit.org/show_bug.cgi?id=157922, tracks the overall task of
adding all typed array fast paths to both versions of the LLInt.
        
This is a 30% speed-up on typed array benchmarks in LLInt. This is not a speed-up when the
JITs are enabled.

* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/backends.rb:
* runtime/JSArrayBufferView.h:
* runtime/JSType.h:

LayoutTests:

* js/regress/get_by_val-Int32Array-expected.txt: Added.
* js/regress/get_by_val-Int32Array.html: Added.
* js/regress/script-tests/get_by_val-Int32Array.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntDatacpp">trunk/Source/JavaScriptCore/llint/LLIntData.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp">trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreofflineasmbackendsrb">trunk/Source/JavaScriptCore/offlineasm/backends.rb</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferViewh">trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypeh">trunk/Source/JavaScriptCore/runtime/JSType.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsregressget_by_valInt32Arrayexpectedtxt">trunk/LayoutTests/js/regress/get_by_val-Int32Array-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressget_by_valInt32Arrayhtml">trunk/LayoutTests/js/regress/get_by_val-Int32Array.html</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsget_by_valInt32Arrayjs">trunk/LayoutTests/js/regress/script-tests/get_by_val-Int32Array.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/LayoutTests/ChangeLog        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-05-24  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        LLInt64 should have typed array fast paths for get_by_val
+        https://bugs.webkit.org/show_bug.cgi?id=157931
+
+        Reviewed by Keith Miller.
+
+        * js/regress/get_by_val-Int32Array-expected.txt: Added.
+        * js/regress/get_by_val-Int32Array.html: Added.
+        * js/regress/script-tests/get_by_val-Int32Array.js: Added.
+
</ins><span class="cx"> 2016-05-24  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed GTK+ gardening. Rebaseline several tests after r200116.
</span></span></pre></div>
<a id="trunkLayoutTestsjsregressget_by_valInt32Arrayexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/get_by_val-Int32Array-expected.txt (0 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/get_by_val-Int32Array-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/get_by_val-Int32Array-expected.txt        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/get_by_val-Int32Array
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressget_by_valInt32Arrayhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/get_by_val-Int32Array.html (0 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/get_by_val-Int32Array.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/get_by_val-Int32Array.html        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/get_by_val-Int32Array.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsget_by_valInt32Arrayjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/get_by_val-Int32Array.js (0 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/get_by_val-Int32Array.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/get_by_val-Int32Array.js        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+(function() {
+    var array = new Int32Array(42);
+    for (var i = 0; i &lt; 42; ++i)
+        array[i] = i;
+    var result = 0;
+    for (var i = 0; i &lt; 100000; ++i)
+        result += array[i % array.length];
+    if (result != 2049960)
+        throw &quot;Error: bad result: &quot; + result;
+})();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-05-24  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        LLInt64 should have typed array fast paths for get_by_val
+        https://bugs.webkit.org/show_bug.cgi?id=157931
+
+        Reviewed by Keith Miller.
+
+        I think that the LLInt should be able to access typed arrays more quickly than it does now.
+        Ideally we would have fast paths for every major typed array operation and we would use
+        inline cache optimizations. I don't want to do this all in one go, so my plan is to
+        incrementally add support for this as time allows.
+        
+        This change just adds the easy typed array fast paths for get_by_val in the 64-bit version
+        of LLInt.
+        
+        Another bug, https://bugs.webkit.org/show_bug.cgi?id=157922, tracks the overall task of
+        adding all typed array fast paths to both versions of the LLInt.
+        
+        This is a 30% speed-up on typed array benchmarks in LLInt. This is not a speed-up when the
+        JITs are enabled.
+
+        * llint/LLIntData.cpp:
+        (JSC::LLInt::Data::performAssertions):
+        * llint/LLIntOffsetsExtractor.cpp:
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter64.asm:
+        * offlineasm/backends.rb:
+        * runtime/JSArrayBufferView.h:
+        * runtime/JSType.h:
+
</ins><span class="cx"> 2016-05-24  Saam barati  &lt;sbarati@apple.com&gt; and Yusuke Suzuki &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ThisTDZMode is no longer needed
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntData.cpp (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntData.cpp        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/llint/LLIntData.cpp        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -148,6 +148,15 @@
</span><span class="cx">     STATIC_ASSERT(ObjectType == 20);
</span><span class="cx">     STATIC_ASSERT(FinalObjectType == 21);
</span><span class="cx">     STATIC_ASSERT(JSFunctionType == 23);
</span><ins>+    STATIC_ASSERT(Int8ArrayType == 100);
+    STATIC_ASSERT(Int16ArrayType == 101);
+    STATIC_ASSERT(Int32ArrayType == 102);
+    STATIC_ASSERT(Uint8ArrayType == 103);
+    STATIC_ASSERT(Uint8ClampedArrayType == 104);
+    STATIC_ASSERT(Uint16ArrayType == 105);
+    STATIC_ASSERT(Uint32ArrayType == 106);
+    STATIC_ASSERT(Float32ArrayType == 107);
+    STATIC_ASSERT(Float64ArrayType == 108);
</ins><span class="cx">     STATIC_ASSERT(MasqueradesAsUndefined == 1);
</span><span class="cx">     STATIC_ASSERT(ImplementsDefaultHasInstance == 2);
</span><span class="cx">     STATIC_ASSERT(FirstConstantRegisterIndex == 0x40000000);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -35,9 +35,9 @@
</span><span class="cx"> #include &quot;Heap.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><ins>+#include &quot;JSArrayBufferView.h&quot;
</ins><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="cx"> #include &quot;JSFunction.h&quot;
</span><del>-#include &quot;VM.h&quot;
</del><span class="cx"> #include &quot;JSEnvironmentRecord.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;JSModuleRecord.h&quot;
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #include &quot;TypeProfilerLog.h&quot;
</span><span class="cx"> #include &quot;VMEntryRecord.h&quot;
</span><span class="cx"> #include &quot;ValueProfile.h&quot;
</span><ins>+#include &quot;VM.h&quot;
</ins><span class="cx"> #include &quot;Watchdog.h&quot;
</span><span class="cx"> #include &lt;wtf/text/StringImpl.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -333,6 +333,21 @@
</span><span class="cx"> const FinalObjectType = 21
</span><span class="cx"> const JSFunctionType = 23
</span><span class="cx"> 
</span><ins>+# The typed array types need to be numbered in a particular order because of the manually written
+# switch statement in get_by_val and put_by_val.
+const Int8ArrayType = 100
+const Int16ArrayType = 101
+const Int32ArrayType = 102
+const Uint8ArrayType = 103
+const Uint8ClampedArrayType = 104
+const Uint16ArrayType = 105
+const Uint32ArrayType = 106
+const Float32ArrayType = 107
+const Float64ArrayType = 108
+
+const FirstArrayType = Int8ArrayType
+const LastArrayType = Float64ArrayType
+
</ins><span class="cx"> # Type flags constants.
</span><span class="cx"> const MasqueradesAsUndefined = 1
</span><span class="cx"> const ImplementsDefaultHasInstance = 2
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -1393,7 +1393,24 @@
</span><span class="cx">     callSlowPath(_llint_slow_path_put_by_id)
</span><span class="cx">     dispatch(9)
</span><span class="cx"> 
</span><ins>+macro finishGetByVal(result, scratch)
+    loadisFromInstruction(1, scratch)
+    storeq result, [cfr, scratch, 8]
+    valueProfile(result, 5, scratch)
+    dispatch(6)
+end
</ins><span class="cx"> 
</span><ins>+macro finishIntGetByVal(result, scratch)
+    orq tagTypeNumber, result
+    finishGetByVal(result, scratch)
+end
+
+macro finishDoubleGetByVal(result, scratch1, scratch2)
+    fd2q result, scratch1
+    subq tagTypeNumber, scratch1
+    finishGetByVal(scratch1, scratch2)
+end
+
</ins><span class="cx"> _llint_op_get_by_val:
</span><span class="cx">     traceExecution()
</span><span class="cx">     loadisFromInstruction(2, t2)
</span><span class="lines">@@ -1428,7 +1445,7 @@
</span><span class="cx">     
</span><span class="cx"> .opGetByValNotDouble:
</span><span class="cx">     subi ArrayStorageShape, t2
</span><del>-    bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValSlow
</del><ins>+    bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValNotIndexedStorage
</ins><span class="cx">     biaeq t1, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t3], .opGetByValOutOfBounds
</span><span class="cx">     loadisFromInstruction(1, t0)
</span><span class="cx">     loadq ArrayStorage::m_vector[t3, t1, 8], t2
</span><span class="lines">@@ -1442,6 +1459,73 @@
</span><span class="cx"> .opGetByValOutOfBounds:
</span><span class="cx">     loadpFromInstruction(4, t0)
</span><span class="cx">     storeb 1, ArrayProfile::m_outOfBounds[t0]
</span><ins>+
+.opGetByValNotIndexedStorage:
+    # First lets check if we even have a typed array. This lets us do some boilerplate up front.
+    loadb JSCell::m_type[t0], t2
+    subi FirstArrayType, t2
+    bia t2, LastArrayType - FirstArrayType, .opGetByValSlow
+    
+    # Sweet, now we know that we have a typed array. Do some basic things now.
+    loadp JSArrayBufferView::m_vector[t0], t3
+    biaeq t1, JSArrayBufferView::m_length[t0], .opGetByValSlow
+    
+    # Now bisect through the various types. Note that we can treat Uint8ArrayType and
+    # Uint8ClampedArrayType the same.
+    bia t2, Uint8ClampedArrayType - FirstArrayType, .opGetByValAboveUint8ClampedArray
+    
+    # We have one of Int8ArrayType .. Uint8ClampedArrayType.
+    bia t2, Int16ArrayType - FirstArrayType, .opGetByValInt32ArrayOrUint8Array
+    
+    # We have one of Int8ArrayType or Int16ArrayType
+    bineq t2, Int8ArrayType - FirstArrayType, .opGetByValInt16Array
+    
+    # We have Int8ArrayType
+    loadbs [t3, t1], t0
+    finishIntGetByVal(t0, t1)
+
+.opGetByValInt16Array:
+    loadhs [t3, t1, 2], t0
+    finishIntGetByVal(t0, t1)
+
+.opGetByValInt32ArrayOrUint8Array:
+    # We have one of Int16Array, Uint8Array, or Uint8ClampedArray.
+    bieq t2, Int32ArrayType - FirstArrayType, .opGetByValInt32Array
+    
+    # We have either Uint8Array or Uint8ClampedArray. They behave the same so that's cool.
+    loadb [t3, t1], t0
+    finishIntGetByVal(t0, t1)
+
+.opGetByValInt32Array:
+    loadi [t3, t1, 4], t0
+    finishIntGetByVal(t0, t1)
+
+.opGetByValAboveUint8ClampedArray:
+    # We have one of Uint16ArrayType .. Float64ArrayType.
+    bia t2, Uint32ArrayType - FirstArrayType, .opGetByValAboveUint32Array
+    
+    # We have either Uint16ArrayType or Uint32ArrayType.
+    bieq t2, Uint32ArrayType - FirstArrayType, .opGetByValUint32Array
+
+    # We have Uint16ArrayType.
+    loadh [t3, t1, 2], t0
+    finishIntGetByVal(t0, t1)
+
+.opGetByValUint32Array:
+    # This is the hardest part because of large unsigned values.
+    loadi [t3, t1, 4], t0
+    bilt t0, 0, .opGetByValSlow # This case is still awkward to implement in LLInt.
+    finishIntGetByVal(t0, t1)
+
+.opGetByValAboveUint32Array:
+    # We have one of Float32ArrayType or Float64ArrayType. Sadly, we cannot handle Float32Array
+    # inline yet. That would require some offlineasm changes.
+    bieq t2, Float32ArrayType - FirstArrayType, .opGetByValSlow
+
+    # We have Float64ArrayType.
+    loadd [t3, t1, 8], ft0
+    finishDoubleGetByVal(ft0, t0, t1)
+
</ins><span class="cx"> .opGetByValSlow:
</span><span class="cx">     callSlowPath(_llint_slow_path_get_by_val)
</span><span class="cx">     dispatch(6)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreofflineasmbackendsrb"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/offlineasm/backends.rb (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/offlineasm/backends.rb        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/offlineasm/backends.rb        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -98,14 +98,23 @@
</span><span class="cx">     $validBackends.keys
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+class LoweringError &lt; StandardError
+    attr_reader :originString
+    
+    def initialize(e, originString)
+        super &quot;#{e} (due to #{originString})&quot;
+        @originString = originString
+        set_backtrace e.backtrace
+    end
+end
+
</ins><span class="cx"> class Node
</span><span class="cx">     def lower(name)
</span><span class="cx">         begin
</span><span class="cx">             $activeBackend = name
</span><span class="cx">             send(&quot;lower&quot; + name)
</span><span class="cx">         rescue =&gt; e
</span><del>-            e.message &lt;&lt; &quot;At #{codeOriginString}&quot;
-            raise e
</del><ins>+            raise LoweringError.new(e, codeOriginString)
</ins><span class="cx">         end
</span><span class="cx">     end
</span><span class="cx"> end
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.h        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+class LLIntOffsetsExtractor;
+
</ins><span class="cx"> // This class serves two purposes:
</span><span class="cx"> //
</span><span class="cx"> // 1) It provides those parts of JSGenericTypedArrayView that don't depend
</span><span class="lines">@@ -173,6 +175,8 @@
</span><span class="cx">     static void finalize(JSCell*);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    friend class LLIntOffsetsExtractor;
+
</ins><span class="cx">     ArrayBuffer* existingBufferInButterfly();
</span><span class="cx"> 
</span><span class="cx">     CopyBarrier&lt;char&gt; m_vector; // this is really a void*, but void would not work here.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSType.h (201334 => 201335)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSType.h        2016-05-24 16:59:13 UTC (rev 201334)
+++ trunk/Source/JavaScriptCore/runtime/JSType.h        2016-05-24 17:08:45 UTC (rev 201335)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     DirectArgumentsType,
</span><span class="cx">     ScopedArgumentsType,
</span><span class="cx"> 
</span><del>-    Int8ArrayType,
</del><ins>+    Int8ArrayType = 100,
</ins><span class="cx">     Int16ArrayType,
</span><span class="cx">     Int32ArrayType,
</span><span class="cx">     Uint8ArrayType,
</span></span></pre>
</div>
</div>

</body>
</html>