<!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>[202627] 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/202627">202627</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-29 09:53:25 -0700 (Wed, 29 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>LLInt should support other types of prototype GetById caching.
https://bugs.webkit.org/show_bug.cgi?id=158083

Recently, we started supporting prototype load caching for get_by_id
in the LLInt. This patch is expading the caching strategy to enable
cache the prototype accessor and custom acessors.

Similarly to the get_by_id_proto_load bytecode, we are adding new
bytecodes called get_by_id_proto_accessor that uses the calculated
offset of a object to call a getter function and get_by_id_proto_custom
that stores the pointer to the custom function and call them directly
from LowLevelInterpreter.

Patch by Caio Lima &lt;ticaiolima@gmail.com&gt; on 2016-06-29
Reviewed by Keith Miller

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdOp):
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setupGetByIdPrototypeCache):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCapabilitiescpp">trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITcpp">trunk/Source/JavaScriptCore/jit/JIT.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathsh">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIdentifierh">trunk/Source/JavaScriptCore/runtime/Identifier.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoretestsstressllintgetbyidprotoaccessorjs">trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-accessor.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstressllintgetbyidprotocustomjs">trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-custom.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-06-29  Caio Lima  &lt;ticaiolima@gmail.com&gt;
+
+        LLInt should support other types of prototype GetById caching.
+        https://bugs.webkit.org/show_bug.cgi?id=158083
+
+        Recently, we started supporting prototype load caching for get_by_id
+        in the LLInt. This patch is expading the caching strategy to enable
+        cache the prototype accessor and custom acessors.
+
+        Similarly to the get_by_id_proto_load bytecode, we are adding new
+        bytecodes called get_by_id_proto_accessor that uses the calculated
+        offset of a object to call a getter function and get_by_id_proto_custom
+        that stores the pointer to the custom function and call them directly
+        from LowLevelInterpreter.
+
+        Reviewed by Keith Miller
+
+        * bytecode/BytecodeList.json:
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeUsesForBytecodeOffset):
+        (JSC::computeDefsForBytecodeOffset):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::printGetByIdOp):
+        (JSC::CodeBlock::dumpBytecode):
+        (JSC::CodeBlock::finalizeLLIntInlineCaches):
+        * bytecode/GetByIdStatus.cpp:
+        (JSC::GetByIdStatus::computeFromLLInt):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGCapabilities.cpp:
+        (JSC::DFG::capabilityLevel):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass):
+        (JSC::JIT::privateCompileSlowCases):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::setupGetByIdPrototypeCache):
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+
</ins><span class="cx"> 2016-06-28  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202580.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -64,6 +64,8 @@
</span><span class="cx">             { &quot;name&quot; : &quot;op_get_by_id&quot;, &quot;length&quot; : 9  },
</span><span class="cx">             { &quot;name&quot; : &quot;op_get_by_id_proto_load&quot;, &quot;length&quot; : 9 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_get_by_id_unset&quot;, &quot;length&quot; : 9 },
</span><ins>+            { &quot;name&quot; : &quot;op_get_by_id_proto_accessor&quot;, &quot;length&quot; : 9 },
+            { &quot;name&quot; : &quot;op_get_by_id_proto_custom&quot;, &quot;length&quot; : 9 },
</ins><span class="cx">             { &quot;name&quot; : &quot;op_get_by_id_with_this&quot;, &quot;length&quot; : 5 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_get_by_val_with_this&quot;, &quot;length&quot; : 5 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_try_get_by_id&quot;, &quot;length&quot; : 4 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -164,6 +164,8 @@
</span><span class="cx">     case op_get_by_id:
</span><span class="cx">     case op_get_by_id_proto_load:
</span><span class="cx">     case op_get_by_id_unset:
</span><ins>+    case op_get_by_id_proto_accessor:
+    case op_get_by_id_proto_custom:
</ins><span class="cx">     case op_get_array_length:
</span><span class="cx">     case op_typeof:
</span><span class="cx">     case op_is_empty:
</span><span class="lines">@@ -403,6 +405,8 @@
</span><span class="cx">     case op_get_by_id:
</span><span class="cx">     case op_get_by_id_proto_load:
</span><span class="cx">     case op_get_by_id_unset:
</span><ins>+    case op_get_by_id_proto_accessor:
+    case op_get_by_id_proto_custom:
</ins><span class="cx">     case op_get_by_id_with_this:
</span><span class="cx">     case op_get_by_val_with_this:
</span><span class="cx">     case op_get_array_length:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -354,6 +354,12 @@
</span><span class="cx">     case op_get_by_id_unset:
</span><span class="cx">         op = &quot;get_by_id_unset&quot;;
</span><span class="cx">         break;
</span><ins>+    case op_get_by_id_proto_accessor:
+        op = &quot;op_get_by_id_proto_accessor&quot;;
+        break;
+    case op_get_by_id_proto_custom:
+        op = &quot;op_get_by_id_proto_custom&quot;;
+        break;
</ins><span class="cx">     case op_get_array_length:
</span><span class="cx">         op = &quot;array_length&quot;;
</span><span class="cx">         break;
</span><span class="lines">@@ -1137,6 +1143,8 @@
</span><span class="cx">         case op_get_by_id:
</span><span class="cx">         case op_get_by_id_proto_load:
</span><span class="cx">         case op_get_by_id_unset:
</span><ins>+        case op_get_by_id_proto_accessor:
+        case op_get_by_id_proto_custom:
</ins><span class="cx">         case op_get_array_length: {
</span><span class="cx">             printGetByIdOp(out, exec, location, it);
</span><span class="cx">             printGetByIdCacheStatus(out, exec, location, stubInfos);
</span><span class="lines">@@ -2796,7 +2804,9 @@
</span><span class="cx">         switch (interpreter-&gt;getOpcodeID(curInstruction[0].u.opcode)) {
</span><span class="cx">         case op_get_by_id:
</span><span class="cx">         case op_get_by_id_proto_load:
</span><del>-        case op_get_by_id_unset: {
</del><ins>+        case op_get_by_id_unset:
+        case op_get_by_id_proto_accessor:
+        case op_get_by_id_proto_custom: {
</ins><span class="cx">             StructureID oldStructureID = curInstruction[4].u.structureID;
</span><span class="cx">             if (!oldStructureID || Heap::isMarked(m_vm-&gt;heap.structureIDTable().get(oldStructureID)))
</span><span class="cx">                 break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> 
</span><span class="cx">     Opcode opcode = instruction[0].u.opcode;
</span><span class="cx"> 
</span><del>-    ASSERT(opcode == LLInt::getOpcode(op_get_array_length) || opcode == LLInt::getOpcode(op_try_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_proto_load) || opcode == LLInt::getOpcode(op_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_unset));
</del><ins>+    ASSERT(opcode == LLInt::getOpcode(op_get_array_length) || opcode == LLInt::getOpcode(op_try_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_proto_load) || opcode == LLInt::getOpcode(op_get_by_id) || opcode == LLInt::getOpcode(op_get_by_id_unset) || opcode == LLInt::getOpcode(op_get_by_id_proto_accessor) || opcode == LLInt::getOpcode(op_get_by_id_proto_custom));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: We should not just bail if we see a try_get_by_id or a get_by_id_proto_load.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=158039
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class UnlinkedCodeBlock : public JSCell {
</span><ins>+    friend class LLIntOffsetsExtractor;
</ins><span class="cx"> public:
</span><span class="cx">     typedef JSCell Base;
</span><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -4145,6 +4145,8 @@
</span><span class="cx">         case op_get_by_id:
</span><span class="cx">         case op_get_by_id_proto_load:
</span><span class="cx">         case op_get_by_id_unset:
</span><ins>+        case op_get_by_id_proto_accessor:
+        case op_get_by_id_proto_custom:
</ins><span class="cx">         case op_get_array_length: {
</span><span class="cx">             SpeculatedType prediction = getPrediction();
</span><span class="cx">             
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -158,6 +158,8 @@
</span><span class="cx">     case op_get_by_id:
</span><span class="cx">     case op_get_by_id_proto_load:
</span><span class="cx">     case op_get_by_id_unset:
</span><ins>+    case op_get_by_id_proto_accessor:
+    case op_get_by_id_proto_custom:
</ins><span class="cx">     case op_get_by_id_with_this:
</span><span class="cx">     case op_get_by_val_with_this:
</span><span class="cx">     case op_get_array_length:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/jit/JIT.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -250,6 +250,8 @@
</span><span class="cx">         case op_get_array_length:
</span><span class="cx">         case op_get_by_id_proto_load:
</span><span class="cx">         case op_get_by_id_unset:
</span><ins>+        case op_get_by_id_proto_accessor:
+        case op_get_by_id_proto_custom:
</ins><span class="cx">         DEFINE_OP(op_get_by_id)
</span><span class="cx">         DEFINE_OP(op_get_by_id_with_this)
</span><span class="cx">         DEFINE_OP(op_get_by_val)
</span><span class="lines">@@ -435,6 +437,8 @@
</span><span class="cx">         case op_get_array_length:
</span><span class="cx">         case op_get_by_id_proto_load:
</span><span class="cx">         case op_get_by_id_unset:
</span><ins>+        case op_get_by_id_proto_accessor:
+        case op_get_by_id_proto_custom:
</ins><span class="cx">         DEFINE_SLOWCASE_OP(op_get_by_id)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_get_by_val)
</span><span class="cx">         DEFINE_SLOWCASE_OP(op_instanceof)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -598,6 +598,8 @@
</span><span class="cx">     ObjectPropertyConditionSet conditions;
</span><span class="cx">     if (slot.isUnset())
</span><span class="cx">         conditions = generateConditionsForPropertyMiss(vm, codeBlock, exec, structure, ident.impl());
</span><ins>+    else if (slot.isCustom())
+        conditions = generateConditionsForPrototypePropertyHitCustom(vm, codeBlock, exec, structure, slot.slotBase(), ident.impl());
</ins><span class="cx">     else
</span><span class="cx">         conditions = generateConditionsForPrototypePropertyHit(vm, codeBlock, exec, structure, slot.slotBase(), ident.impl());
</span><span class="cx"> 
</span><span class="lines">@@ -614,7 +616,7 @@
</span><span class="cx">             offset = condition.condition().offset();
</span><span class="cx">         result.iterator-&gt;value.add(condition, pc)-&gt;install();
</span><span class="cx">     }
</span><del>-    ASSERT((offset == invalidOffset) == slot.isUnset());
</del><ins>+    ASSERT((offset == invalidOffset) == (slot.isUnset() || slot.isCustom()));
</ins><span class="cx"> 
</span><span class="cx">     ConcurrentJITLocker locker(codeBlock-&gt;m_lock);
</span><span class="cx"> 
</span><span class="lines">@@ -622,10 +624,20 @@
</span><span class="cx">         pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_unset);
</span><span class="cx">         pc[4].u.structureID = structure-&gt;id();
</span><span class="cx">         return;
</span><ins>+    } else if (slot.isCustom()) {
+        pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_proto_custom);
+        pc[4].u.structureID = structure-&gt;id();
+        pc[5].u.getterFunc = slot.customGetter();
+        pc[6].u.pointer = slot.attributes() &amp; CustomAccessor ? 0 : slot.slotBase();
+        return;
</ins><span class="cx">     }
</span><del>-    ASSERT(slot.isValue());
</del><ins>+    ASSERT(slot.isValue() || slot.isAccessor());
</ins><span class="cx"> 
</span><del>-    pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_proto_load);
</del><ins>+    if (slot.isAccessor())
+        pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_proto_accessor);
+    else
+        pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_proto_load);
+
</ins><span class="cx">     pc[4].u.structureID = structure-&gt;id();
</span><span class="cx">     pc[5].u.operand = offset;
</span><span class="cx">     // We know that this pointer will remain valid because it will be cleared by either a watchpoint fire or
</span><span class="lines">@@ -666,10 +678,12 @@
</span><span class="cx">                 
</span><span class="cx">                 ConcurrentJITLocker locker(codeBlock-&gt;m_lock);
</span><span class="cx"> 
</span><del>-                pc[4].u.structureID = structure-&gt;id();
-                pc[5].u.operand = slot.cachedOffset();
</del><ins>+                if (slot.isValue()) {
+                    pc[4].u.structureID = structure-&gt;id();
+                    pc[5].u.operand = slot.cachedOffset();
+                }
</ins><span class="cx">             }
</span><del>-        } else if (UNLIKELY(pc[7].u.operand &amp;&amp; (slot.isValue() || slot.isUnset()))) {
</del><ins>+        } else if (UNLIKELY(pc[7].u.operand &amp;&amp; (slot.isValue() || slot.isUnset() || ((slot.isAccessor() || slot.isCustom()) &amp;&amp; (slot.slotBase() != baseValue))))) {
</ins><span class="cx">             ASSERT(slot.slotBase() != baseValue);
</span><span class="cx"> 
</span><span class="cx">             if (!(--pc[7].u.operand))
</span><span class="lines">@@ -691,6 +705,19 @@
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LLINT_SLOW_PATH_DECL(slow_path_get_proto_accessor)
+{
+    LLINT_BEGIN();
+    JSValue baseValue = LLINT_OP_C(2).jsValue();
+    PropertyOffset offset = pc[5].u.operand;
+    JSObject* slotBase = jsCast&lt;JSObject*&gt;(pc[6].u.jsCell.get());
+    JSValue getterSetter = slotBase-&gt;getDirect(offset);
+
+    JSValue result = callGetter(exec, baseValue, getterSetter);
+
+    LLINT_RETURN_PROFILED(op_get_by_id, result);
+}
+
</ins><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_get_arguments_length)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof_custom);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_try_get_by_id);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_proto_accessor);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_arguments_length);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_by_id);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_del_by_id);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -423,6 +423,16 @@
</span><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+macro loadIdentifier(index, dest)
+    loadp CodeBlock[cfr], t1
+    loadp CodeBlock::m_unlinkedCode[t1], t2
+    loadp UnlinkedCodeBlock::m_identifiers[t2], t1
+    move index, t2
+    mulp sizeof Identifier, t2
+    addp t2, t1
+    loadp Identifier::m_string[t1], dest
+end
+
</ins><span class="cx"> macro checkStackPointerAlignment(tempReg, location)
</span><span class="cx">     if ARM64 or C_LOOP or SH4
</span><span class="cx">         # ARM64 will check for us!
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -1423,6 +1423,66 @@
</span><span class="cx">     dispatch(9)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+_llint_op_get_by_id_proto_accessor:
+    traceExecution()
+    loadi 8[PC], t0
+    loadi 16[PC], t1
+    loadConstantOrVariablePayload(t0, CellTag, t3, .opGetByIdProtoAcessorSlow)
+    bineq JSCell::m_structureID[t3], t1, .opGetByIdProtoAcessorSlow
+    callSlowPath(_llint_slow_path_get_proto_accessor)
+    dispatch(9)
+
+.opGetByIdProtoAcessorSlow:
+    callSlowPath(_llint_slow_path_get_by_id)
+    dispatch(9)
+
+macro loadEncodedThisValue(baseValue, dest)
+   loadp 24[PC], dest
+   bineq 0, dest, .loadEncodedThisValueDone
+   move baseValue, dest
+   .loadEncodedThisValueDone:
+end
+
+_llint_op_get_by_id_proto_custom:
+    traceExecution()
+    loadi 8[PC], t0
+    loadi 16[PC], t1
+    loadConstantOrVariablePayload(t0, CellTag, t3, .opGetByIdProtoCustomSlow)
+    bineq JSCell::m_structureID[t3], t1, .opGetByIdProtoCustomSlow
+    # Setting the topCallFrame
+    loadp Callee[cfr], t0
+    andp MarkedBlockMask, t0, t1
+    loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1
+    storep cfr, VM::topCallFrame[t1]
+    loadi 12[PC], t0
+    loadIdentifier(t0, t2)
+    loadEncodedThisValue(t3, t1)
+    loadp 20[PC], t0
+    # Inlining the GetValueFunc call
+    push t1 # Load arg3 JSObject *
+    push t2 # Load arg2 PropertyName
+    move CellTag, t3
+    if BIG_ENDIAN
+        push t1 # Load arg1 Payload of EncodedJSValue
+        push t3 # Load arg1 Tag of EncodedJSValue
+    else
+        push t3 # Load arg1 Tag of EncodedJSValue
+        push t1 # Load arg1 Payload of EncodedJSValue
+    end
+    push cfr # Loading exec
+    call t0
+    addp 20, sp
+    loadi 4[PC], t2
+    storei r1, TagOffset[cfr, t2, 8]
+    storei r0, PayloadOffset[cfr, t2, 8]
+    valueProfile(r0, r1, 32, t2)
+    dispatch(9)
+
+.opGetByIdProtoCustomSlow:
+    callSlowPath(_llint_slow_path_get_by_id)
+    dispatch(9)
+
+
</ins><span class="cx"> _llint_op_get_array_length:
</span><span class="cx">     traceExecution()
</span><span class="cx">     loadi 8[PC], t0
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -1294,6 +1294,63 @@
</span><span class="cx">     dispatch(9)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+_llint_op_get_by_id_proto_accessor:
+    traceExecution()
+    loadisFromInstruction(2, t0)
+    loadConstantOrVariableCell(t0, t3, .opGetByIdProtoAcessorSlow)
+    loadi JSCell::m_structureID[t3], t1
+    loadisFromInstruction(4, t2)
+    bineq t2, t1, .opGetByIdProtoAcessorSlow
+    callSlowPath(_llint_slow_path_get_proto_accessor)
+    dispatch(9)
+
+.opGetByIdProtoAcessorSlow:
+    callSlowPath(_llint_slow_path_get_by_id)
+    dispatch(9)
+
+
+macro loadEncodedThisValue(baseValue, dest)
+   loadpFromInstruction(6, dest)
+   bineq 0, dest, .loadEncodedThisValueDone
+   move baseValue, dest
+   .loadEncodedThisValueDone:
+end
+
+_llint_op_get_by_id_proto_custom:
+    traceExecution()
+    loadisFromInstruction(2, t0)
+    loadConstantOrVariableCell(t0, t3, .opGetByIdProtoCustomSlow)
+    loadi JSCell::m_structureID[t3], t1
+    loadisFromInstruction(4, t2)
+    bineq t2, t1, .opGetByIdProtoCustomSlow
+    # Setting the topCallFrame
+    loadp Callee[cfr], t0
+    andp MarkedBlockMask, t0, t1
+    loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1
+    storep cfr, VM::topCallFrame[t1]
+    push PC
+    push PB
+    loadpFromInstruction(3, t0)
+    loadIdentifier(t0, a2)
+    loadEncodedThisValue(t3, a1)
+    loadpFromInstruction(5, t0)
+    prepareStateForCCall()
+    move cfr, a0
+    move a1, a3
+    cCall4(t0)
+    restoreStateAfterCCall()
+    pop PB
+    pop PC
+    loadisFromInstruction(1, t2)
+    storeq r0, [cfr, t2, 8]
+    valueProfile(r0, 8, t1)
+    dispatch(9)
+
+.opGetByIdProtoCustomSlow:
+    callSlowPath(_llint_slow_path_get_by_id)
+    dispatch(9)
+
+
</ins><span class="cx"> _llint_op_get_array_length:
</span><span class="cx">     traceExecution()
</span><span class="cx">     loadisFromInstruction(2, t0)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIdentifierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Identifier.h (202626 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Identifier.h        2016-06-29 16:50:21 UTC (rev 202626)
+++ trunk/Source/JavaScriptCore/runtime/Identifier.h        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -87,6 +87,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Identifier {
</span><span class="cx">     friend class Structure;
</span><ins>+    friend class LLIntOffsetsExtractor;
</ins><span class="cx"> public:
</span><span class="cx">     Identifier() { }
</span><span class="cx">     enum EmptyIdentifierFlag { EmptyIdentifier };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressllintgetbyidprotoaccessorjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-accessor.js (0 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-accessor.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-accessor.js        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+foo = {};
+var expected = 6;
+Object.defineProperty(Object.prototype, &quot;bar&quot;, { get: () =&gt; { return 2 * 3; } });
+
+function test() {
+    if (foo.bar != expected) {
+        throw new Error();
+    }
+}
+
+for (var i = 0; i &lt; 10; i++) {
+    if (i == 9) {
+        foo = {bar: 7};
+        expected = 7;
+    }
+    test();
+}
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressllintgetbyidprotocustomjs"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-custom.js (0 => 202627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-custom.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/llint-get-by-id-proto-custom.js        2016-06-29 16:53:25 UTC (rev 202627)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+var v = Object.create(createCustomGetterObject());
+var expected = v.customGetter;
+
+for (var i = 0; i &lt; 10; i++) {
+    if (i == 9) {
+        v = {customGetter: 10};
+        expected = 10;
+    }
+    if (v.customGetter != expected) {
+        throw Error(&quot;&quot;);
+    }
+}
+
</ins></span></pre>
</div>
</div>

</body>
</html>