<!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>[160628] 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/160628">160628</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-15 21:56:25 -0800 (Sun, 15 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION: 2x regression on Dromaeo DOM query tests
https://bugs.webkit.org/show_bug.cgi?id=125377

Reviewed by Filip Pizlo.

PerformanceTests:

Added a micro-benchmark for updating a named property on document.

* Bindings/update-name-getter.html: Added.
* Skipped:

Source/JavaScriptCore:

The bug was caused by JSC not JIT'ing property access on &quot;document&quot; due to its type info having
HasImpureGetOwnPropertySlot flag.

Fixed the bug by new type info flag NewImpurePropertyFiresWatchpoints, which allows the baseline
JIT to generate byte code for access properties on an object with named properties (a.k.a.
custom name getter) in DOM. When a new named property appears on the object, VM is notified via
VM::addImpureProperty and fires StructureStubClearingWatchpoint added during the repatch.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt): Take the slow path if we have any object with impure
properties in the prototype chain.
(JSC::GetByIdStatus::computeForChain): Ditto.

* jit/Repatch.cpp:
(JSC::repatchByIdSelfAccess): Throw away the byte code when a new impure property is added on any
object in the prototype chain via StructureStubClearingWatchpoint.
(JSC::generateProtoChainAccessStub): Ditto.
(JSC::tryCacheGetByID):
(JSC::tryBuildGetByIDList):
(JSC::tryRepatchIn): Ditto.

* runtime/JSTypeInfo.h: Added NewImpurePropertyFiresWatchpoints.
(JSC::TypeInfo::newImpurePropertyFiresWatchpoints): Added.

* runtime/Operations.h:
(JSC::normalizePrototypeChainForChainAccess): Don't exit early if VM will be notified of new
impure property even if the object had impure properties.

* runtime/Structure.h:
(JSC::Structure::takesSlowPathInDFGForImpureProperty): Added. Wraps hasImpureGetOwnPropertySlot and
asserts that newImpurePropertyFiresWatchpoints is true whenever hasImpureGetOwnPropertySlot is true.

* runtime/VM.cpp:
(JSC::VM::registerWatchpointForImpureProperty): Added.
(JSC::VM::addImpureProperty): Added. HTMLDocument calls it to notify JSC of a new impure property.

* runtime/VM.h:

Source/WebCore:

The bug was caused by JSC not JIT'ing property accesses on document because of its having
custom named getter (named properties).  This resulted in resolution of methods on document
such as getElementById to happen inside the interpreter.

Fixed the bug by using the new JSC type info flag which tells JSC to JIT property access on
document, and then notifying JSC whenever a new named property appeared on document.

Tests: js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html
       js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html
       js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html
       js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html
       js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html
       js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html

* bindings/js/JSDOMBinding.cpp:
(WebCore::addImpureProperty): Wraps VM::addImpureProperty.
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Added the support for NewImpurePropertyFiresWatchpoints.
* bindings/scripts/IDLAttributes.txt: Ditto.
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::addDocumentNamedItem): Calls addImpureProperty.
* html/HTMLDocument.idl: Added NewImpurePropertyFiresWatchpoints.

LayoutTests:

Added more regression tests for throwing away byte code when a new named property appears.

* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected: Rebaselined.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html: Fixed the test to use dfgShouldBe.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt: Added.
* js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt: Added.
* js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html: Added.
* js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottrapsexpectedtxt">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottrapshtml">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html</a></li>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
<li><a href="#trunkPerformanceTestsSkipped">trunk/PerformanceTests/Skipped</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitRepatchcpp">trunk/Source/JavaScriptCore/jit/Repatch.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypeInfoh">trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOperationsh">trunk/Source/JavaScriptCore/runtime/Operations.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStructureh">trunk/Source/JavaScriptCore/runtime/Structure.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumentcpp">trunk/Source/WebCore/html/HTMLDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumentidl">trunk/Source/WebCore/html/HTMLDocument.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps2expectedtxt">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps2html">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps3expectedtxt">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps3html">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps4expectedtxt">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps4html">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps5expectedtxt">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps5html">trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps2expectedtxt">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps2html">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps3expectedtxt">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps3html">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps4expectedtxt">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps4html">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps5expectedtxt">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps5html">trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html</a></li>
<li><a href="#trunkPerformanceTestsBindingsupdatenamegetterhtml">trunk/PerformanceTests/Bindings/update-name-getter.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsdomscripttestsdfgprototypechaincachingwithimpuregetownpropertyslottrapsjs">trunk/LayoutTests/js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/LayoutTests/ChangeLog        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2013-12-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION: 2x regression on Dromaeo DOM query tests
+        https://bugs.webkit.org/show_bug.cgi?id=125377
+
+        Reviewed by Filip Pizlo.
+
+        Added more regression tests for throwing away byte code when a new named property appears.
+        
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected: Rebaselined.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html: Fixed the test to use dfgShouldBe.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt: Added.
+        * js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt: Added.
+        * js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html: Added.
+        * js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js: Removed.
+
</ins><span class="cx"> 2013-12-15  Rob Buis  &lt;rob.buis@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Shapes] shape-outside animation does not handle 'auto' well
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot; on all iterations including after DFG tier-up.
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var obj = {};
+obj.__proto__ = document;
+
+function f() {
+    return obj.getElementsByTagName;
+}
+
+dfgShouldBe(f, &quot;typeof f()&quot;, &quot;\&quot;function\&quot;&quot;);
+
+var img = new Image();
+img.name = &quot;getElementsByTagName&quot;;
+document.body.appendChild(img);
+
+shouldBe(&quot;typeof f()&quot;, &quot;\&quot;object\&quot;&quot;);
+
+&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="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;object&quot; on all iterations including after DFG tier-up.
+PASS document.body.removeChild(img); typeof f() is &quot;function&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var img = new Image();
+img.name = &quot;getElementsByTagName&quot;;
+document.body.appendChild(img);
+
+function f() {
+    return document.getElementsByTagName;
+}
+
+dfgShouldBe(f, &quot;typeof f()&quot;, &quot;\&quot;object\&quot;&quot;);
+shouldBe(&quot;document.body.removeChild(img); typeof f()&quot;, &quot;\&quot;function\&quot;&quot;)
+
+&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="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot; on all iterations including after DFG tier-up.
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var obj = {};
+obj.__proto__ = document;
+document.foo = function () {};
+
+function f() {
+    return obj.foo;
+}
+
+dfgShouldBe(f, &quot;typeof f()&quot;, &quot;\&quot;function\&quot;&quot;);
+
+var img = new Image();
+img.name = &quot;foo&quot;;
+document.body.appendChild(img);
+
+shouldBe(&quot;typeof f()&quot;, &quot;\&quot;object\&quot;&quot;);
+
+&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="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot; on all iterations including after DFG tier-up.
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottraps5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+document.foo = function () {};
+
+function f() {
+    return document.foo;
+}
+
+dfgShouldBe(f, &quot;typeof f()&quot;, &quot;\&quot;function\&quot;&quot;);
+
+var img = new Image();
+img.name = &quot;foo&quot;;
+document.body.appendChild(img);
+
+shouldBe(&quot;typeof f()&quot;, &quot;\&quot;object\&quot;&quot;);
+
+&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="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottrapsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected.txt (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected.txt        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -3,406 +3,8 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
-PASS typeof f() is &quot;function&quot;
</del><ins>+PASS typeof f() is &quot;function&quot; on all iterations including after DFG tier-up.
</ins><span class="cx"> PASS typeof f() is &quot;object&quot;
</span><del>-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
-PASS typeof f() is &quot;object&quot;
</del><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdfgprototypechaincachingwithimpuregetownpropertyslottrapshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/LayoutTests/js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,10 +1,25 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
</del><ins>+&lt;!DOCTYPE html&gt;
</ins><span class="cx"> &lt;html&gt;
</span><del>-&lt;head&gt;
</del><ins>+&lt;body&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;/head&gt;
-&lt;body&gt;
-&lt;script src=&quot;script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js&quot;&gt;&lt;/script&gt;
</del><ins>+&lt;script&gt;
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var doc = document;
+
+function f() {
+    return doc.getElementsByTagName;
+}
+
+dfgShouldBe(f, &quot;typeof f()&quot;, &quot;\&quot;function\&quot;&quot;);
+
+var img = new Image();
+img.name = &quot;getElementsByTagName&quot;;
+document.body.appendChild(img);
+
+shouldBe(&quot;typeof f()&quot;, &quot;\&quot;object\&quot;&quot;);
+
+&lt;/script&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var obj = {};
+obj.__proto__ = document;
+
+function f() {
+    return obj.getElementsByTagName;
+}
+
+var expected = &quot;\&quot;function\&quot;&quot;;
+for (var i = 0; i &lt; 40; ++i) {
+    if (i == 35) {
+        var img = new Image();
+        img.name = &quot;getElementsByTagName&quot;;
+        document.body.appendChild(img);
+        expected = &quot;\&quot;object\&quot;&quot;;
+    }
+    shouldBe(&quot;typeof f()&quot;, expected);
+}
+
+&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="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps3expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps3html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var img = new Image();
+img.name = &quot;getElementsByTagName&quot;;
+document.body.appendChild(img);
+
+function f() {
+    return document.getElementsByTagName;
+}
+
+var expected = &quot;\&quot;object\&quot;&quot;;
+for (var i = 0; i &lt; 40; ++i) {
+    if (i == 35) {
+        document.body.removeChild(img);
+        expected = &quot;\&quot;function\&quot;&quot;;
+    }
+    shouldBe(&quot;typeof f()&quot;, expected);
+}
+
+&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="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps4expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps4html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+var obj = {};
+obj.__proto__ = document;
+document.foo = function () {};
+
+function f() {
+    return obj.foo;
+}
+
+var expected = &quot;\&quot;function\&quot;&quot;;
+for (var i = 0; i &lt; 40; ++i) {
+    if (i == 35) {
+        var img = new Image();
+        img.name = &quot;foo&quot;;
+        document.body.appendChild(img);
+        expected = &quot;\&quot;object\&quot;&quot;;
+    }
+    shouldBe(&quot;typeof f()&quot;, expected);
+}
+
+&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="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps5expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5-expected.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;function&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS typeof f() is &quot;object&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomprototypechaincachingwithimpuregetownpropertyslottraps5html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-5.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+description(&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;);
+
+document.foo = function () {};
+
+function f() {
+    return document.foo;
+}
+
+var expected = &quot;\&quot;function\&quot;&quot;;
+for (var i = 0; i &lt; 50; ++i) {
+    if (i == 45) {
+        var img = new Image();
+        img.name = &quot;foo&quot;;
+        document.body.appendChild(img);
+        expected = &quot;\&quot;object\&quot;&quot;;
+    }
+    v = f();
+    shouldBe(&quot;typeof f()&quot;, expected);
+}
+
+&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="trunkLayoutTestsjsdomscripttestsdfgprototypechaincachingwithimpuregetownpropertyslottrapsjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/LayoutTests/js/dom/script-tests/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps.js        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-description(
-&quot;Tests what happens when you make prototype chain accesses with impure GetOwnPropertySlot traps in the way.&quot;
-);
-
-var doc = document;
-
-function f() {
-    return doc.getElementsByTagName;
-}
-
-var expected = &quot;\&quot;function\&quot;&quot;;
-for (var i = 0; i &lt; 400; ++i) {
-    if (i == 350) {
-        var img = new Image();
-        img.name = &quot;getElementsByTagName&quot;;
-        document.body.appendChild(img);
-        expected = &quot;\&quot;object\&quot;&quot;;
-    }
-    shouldBe(&quot;typeof f()&quot;, expected);
-}
-
</del></span></pre></div>
<a id="trunkPerformanceTestsBindingsupdatenamegetterhtml"></a>
<div class="addfile"><h4>Added: trunk/PerformanceTests/Bindings/update-name-getter.html (0 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Bindings/update-name-getter.html                                (rev 0)
+++ trunk/PerformanceTests/Bindings/update-name-getter.html        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;img id=&quot;foo&quot; name=&quot;bar&quot;&gt;
+&lt;script src=&quot;../resources/runner.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+
+var imageElement = document.querySelector(&quot;img&quot;);
+
+imageElement.id = &quot;foo&quot;;
+
+PerfTestRunner.measureRunsPerSecond({
+    description: &quot;This benchmark covers 'getElementById' in Dromaeo/dom-query.html, and other DOM methods that return a Node object.&quot;,
+    run: function() {
+        for (var i = 0; i &lt; 100000; i++)
+            imageElement.id =  i % 2 ? &quot;foo1&quot; : &quot;foo0&quot;;
+}});
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/PerformanceTests/ChangeLog        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2013-12-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION: 2x regression on Dromaeo DOM query tests
+        https://bugs.webkit.org/show_bug.cgi?id=125377
+
+        Reviewed by Filip Pizlo.
+
+        Added a micro-benchmark for updating a named property on document.
+
+        * Bindings/update-name-getter.html: Added.
+        * Skipped:
+
</ins><span class="cx"> 2013-12-03  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Regions] Fix Layout/RegionsSelection.html in Mac platform
</span></span></pre></div>
<a id="trunkPerformanceTestsSkipped"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Skipped (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Skipped        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/PerformanceTests/Skipped        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx"> Interactive/SelectAll.html
</span><span class="cx"> Interactive/CopyAll.html
</span><span class="cx"> Interactive/DeletingInPasswordField.html
</span><ins>+Bindings/update-name-getter.html
</ins><span class="cx"> 
</span><span class="cx"> # Not enabled by default on some ports
</span><span class="cx"> Mutation
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/ChangeLog        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2013-12-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION: 2x regression on Dromaeo DOM query tests
+        https://bugs.webkit.org/show_bug.cgi?id=125377
+
+        Reviewed by Filip Pizlo.
+
+        The bug was caused by JSC not JIT'ing property access on &quot;document&quot; due to its type info having
+        HasImpureGetOwnPropertySlot flag.
+
+        Fixed the bug by new type info flag NewImpurePropertyFiresWatchpoints, which allows the baseline
+        JIT to generate byte code for access properties on an object with named properties (a.k.a.
+        custom name getter) in DOM. When a new named property appears on the object, VM is notified via
+        VM::addImpureProperty and fires StructureStubClearingWatchpoint added during the repatch.
+
+        * bytecode/GetByIdStatus.cpp:
+        (JSC::GetByIdStatus::computeFromLLInt): Take the slow path if we have any object with impure
+        properties in the prototype chain.
+        (JSC::GetByIdStatus::computeForChain): Ditto.
+
+        * jit/Repatch.cpp:
+        (JSC::repatchByIdSelfAccess): Throw away the byte code when a new impure property is added on any
+        object in the prototype chain via StructureStubClearingWatchpoint.
+        (JSC::generateProtoChainAccessStub): Ditto.
+        (JSC::tryCacheGetByID):
+        (JSC::tryBuildGetByIDList):
+        (JSC::tryRepatchIn): Ditto.
+
+        * runtime/JSTypeInfo.h: Added NewImpurePropertyFiresWatchpoints.
+        (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): Added.
+
+        * runtime/Operations.h:
+        (JSC::normalizePrototypeChainForChainAccess): Don't exit early if VM will be notified of new
+        impure property even if the object had impure properties.
+
+        * runtime/Structure.h:
+        (JSC::Structure::takesSlowPathInDFGForImpureProperty): Added. Wraps hasImpureGetOwnPropertySlot and
+        asserts that newImpurePropertyFiresWatchpoints is true whenever hasImpureGetOwnPropertySlot is true.
+
+        * runtime/VM.cpp:
+        (JSC::VM::registerWatchpointForImpureProperty): Added.
+        (JSC::VM::addImpureProperty): Added. HTMLDocument calls it to notify JSC of a new impure property.
+
+        * runtime/VM.h:
+
</ins><span class="cx"> 2013-12-15  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Upstream changes to FeatureDefines.xcconfig
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -48,7 +48,10 @@
</span><span class="cx">     Structure* structure = instruction[4].u.structure.get();
</span><span class="cx">     if (!structure)
</span><span class="cx">         return GetByIdStatus(NoInformation, false);
</span><del>-    
</del><ins>+
+    if (structure-&gt;takesSlowPathInDFGForImpureProperty())
+        return GetByIdStatus(NoInformation, false);
+
</ins><span class="cx">     unsigned attributesIgnored;
</span><span class="cx">     JSCell* specificValue;
</span><span class="cx">     PropertyOffset offset = structure-&gt;getConcurrently(
</span><span class="lines">@@ -79,7 +82,15 @@
</span><span class="cx">     // then we fall back on a polymorphic access.
</span><span class="cx">     if (!result.m_chain-&gt;isStillValid())
</span><span class="cx">         return;
</span><del>-    
</del><ins>+
+    if (result.m_chain-&gt;head()-&gt;takesSlowPathInDFGForImpureProperty())
+        return;
+    size_t chainSize = result.m_chain-&gt;size();
+    for (size_t i = 0; i &lt; chainSize; i++) {
+        if (result.m_chain-&gt;at(i)-&gt;takesSlowPathInDFGForImpureProperty())
+            return;
+    }
+
</ins><span class="cx">     JSObject* currentObject = result.m_chain-&gt;terminalPrototype();
</span><span class="cx">     Structure* currentStructure = result.m_chain-&gt;last();
</span><span class="cx">     
</span><span class="lines">@@ -154,6 +165,8 @@
</span><span class="cx">         
</span><span class="cx">     case access_get_by_id_self: {
</span><span class="cx">         Structure* structure = stubInfo-&gt;u.getByIdSelf.baseObjectStructure.get();
</span><ins>+        if (structure-&gt;takesSlowPathInDFGForImpureProperty())
+            return GetByIdStatus(TakesSlowPath, true);
</ins><span class="cx">         unsigned attributesIgnored;
</span><span class="cx">         JSCell* specificValue;
</span><span class="cx">         result.m_offset = structure-&gt;getConcurrently(
</span><span class="lines">@@ -176,6 +189,9 @@
</span><span class="cx">             ASSERT(list-&gt;list[i].isDirect);
</span><span class="cx">             
</span><span class="cx">             Structure* structure = list-&gt;list[i].base.get();
</span><ins>+            if (structure-&gt;takesSlowPathInDFGForImpureProperty())
+                return GetByIdStatus(TakesSlowPath, true);
+
</ins><span class="cx">             if (result.m_structureSet.contains(structure))
</span><span class="cx">                 continue;
</span><span class="cx">             
</span><span class="lines">@@ -267,7 +283,7 @@
</span><span class="cx">     
</span><span class="cx">     if (!structure-&gt;propertyAccessesAreCacheable())
</span><span class="cx">         return GetByIdStatus(TakesSlowPath);
</span><del>-    
</del><ins>+
</ins><span class="cx">     GetByIdStatus result;
</span><span class="cx">     result.m_wasSeenInJIT = false; // To my knowledge nobody that uses computeFor(VM&amp;, Structure*, StringImpl*) reads this field, but I might as well be honest: no, it wasn't seen in the JIT, since I computed it statically.
</span><span class="cx">     unsigned attributes;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitRepatchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/Repatch.cpp (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/Repatch.cpp        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/jit/Repatch.cpp        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;RepatchBuffer.h&quot;
</span><span class="cx"> #include &quot;ScratchRegisterAllocator.h&quot;
</span><span class="cx"> #include &quot;StructureRareDataInlines.h&quot;
</span><ins>+#include &quot;StructureStubClearingWatchpoint.h&quot;
</ins><span class="cx"> #include &quot;ThunkGenerators.h&quot;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -93,8 +94,12 @@
</span><span class="cx">     repatchCall(repatchBuffer, call, newCalleeFunction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void repatchByIdSelfAccess(CodeBlock* codeBlock, StructureStubInfo&amp; stubInfo, Structure* structure, PropertyOffset offset, const FunctionPtr &amp;slowPathFunction, bool compact)
</del><ins>+static void repatchByIdSelfAccess(VM&amp; vm, CodeBlock* codeBlock, StructureStubInfo&amp; stubInfo, Structure* structure, const Identifier&amp; propertyName, PropertyOffset offset,
+    const FunctionPtr &amp;slowPathFunction, bool compact)
</ins><span class="cx"> {
</span><ins>+    if (structure-&gt;typeInfo().newImpurePropertyFiresWatchpoints())
+        vm.registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock));
+
</ins><span class="cx">     RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx"> 
</span><span class="cx">     // Only optimize once!
</span><span class="lines">@@ -215,7 +220,7 @@
</span><span class="cx">     linkRestoreScratch(patchBuffer, needToRestoreScratch, success, fail, failureCases, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo&amp; stubInfo, StructureChain* chain, size_t count, PropertyOffset offset, Structure* structure, CodeLocationLabel successLabel, CodeLocationLabel slowCaseLabel, RefPtr&lt;JITStubRoutine&gt;&amp; stubRoutine)
</del><ins>+static void generateProtoChainAccessStub(ExecState* exec, StructureStubInfo&amp; stubInfo, StructureChain* chain, size_t count, PropertyOffset offset, Structure* structure, CodeLocationLabel successLabel, CodeLocationLabel slowCaseLabel, RefPtr&lt;JITStubRoutine&gt;&amp; stubRoutine, const Identifier&amp; propertyName)
</ins><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx"> 
</span><span class="lines">@@ -242,14 +247,21 @@
</span><span class="cx">     MacroAssembler::JumpList failureCases;
</span><span class="cx">     
</span><span class="cx">     failureCases.append(stubJit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::structureOffset()), MacroAssembler::TrustedImmPtr(structure)));
</span><del>-    
</del><ins>+
+    CodeBlock* codeBlock = exec-&gt;codeBlock();
+    if (structure-&gt;typeInfo().newImpurePropertyFiresWatchpoints())
+        vm-&gt;registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock));
+
</ins><span class="cx">     Structure* currStructure = structure;
</span><span class="cx">     WriteBarrier&lt;Structure&gt;* it = chain-&gt;head();
</span><span class="cx">     JSObject* protoObject = 0;
</span><span class="cx">     for (unsigned i = 0; i &lt; count; ++i, ++it) {
</span><span class="cx">         protoObject = asObject(currStructure-&gt;prototypeForLookup(exec));
</span><ins>+        Structure* protoStructure = protoObject-&gt;structure();
+        if (protoStructure-&gt;typeInfo().newImpurePropertyFiresWatchpoints())
+            vm-&gt;registerWatchpointForImpureProperty(propertyName, stubInfo.addWatchpoint(codeBlock));
</ins><span class="cx">         addStructureTransitionCheck(
</span><del>-            protoObject, protoObject-&gt;structure(), exec-&gt;codeBlock(), stubInfo, stubJit,
</del><ins>+            protoObject, protoStructure, codeBlock, stubInfo, stubJit,
</ins><span class="cx">             failureCases, scratchGPR);
</span><span class="cx">         currStructure = it-&gt;get();
</span><span class="cx">     }
</span><span class="lines">@@ -374,7 +386,7 @@
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        repatchByIdSelfAccess(codeBlock, stubInfo, structure, slot.cachedOffset(), operationGetByIdBuildList, true);
</del><ins>+        repatchByIdSelfAccess(*vm, codeBlock, stubInfo, structure, propertyName, slot.cachedOffset(), operationGetByIdBuildList, true);
</ins><span class="cx">         stubInfo.initGetByIdSelf(*vm, codeBlock-&gt;ownerExecutable(), structure);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -393,7 +405,7 @@
</span><span class="cx"> 
</span><span class="cx">     StructureChain* prototypeChain = structure-&gt;prototypeChain(exec);
</span><span class="cx">     
</span><del>-    generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase), stubInfo.stubRoutine);
</del><ins>+    generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase), stubInfo.stubRoutine, propertyName);
</ins><span class="cx">     
</span><span class="cx">     RepatchBuffer repatchBuffer(codeBlock);
</span><span class="cx">     replaceWithJump(repatchBuffer, stubInfo, stubInfo.stubRoutine-&gt;code().code());
</span><span class="lines">@@ -638,7 +650,7 @@
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;JITStubRoutine&gt; stubRoutine;
</span><span class="cx">     
</span><del>-    generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), slowCase, stubRoutine);
</del><ins>+    generateProtoChainAccessStub(exec, stubInfo, prototypeChain, count, offset, structure, stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToDone), slowCase, stubRoutine, ident);
</ins><span class="cx">     
</span><span class="cx">     polymorphicStructureList-&gt;list[listIndex].set(*vm, codeBlock-&gt;ownerExecutable(), stubRoutine, structure, true);
</span><span class="cx">     
</span><span class="lines">@@ -1045,7 +1057,7 @@
</span><span class="cx">         if (!MacroAssembler::isPtrAlignedAddressOffset(offsetRelativeToPatchedStorage(slot.cachedOffset())))
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        repatchByIdSelfAccess(codeBlock, stubInfo, structure, slot.cachedOffset(), appropriateListBuildingPutByIdFunction(slot, putKind), false);
</del><ins>+        repatchByIdSelfAccess(*vm, codeBlock, stubInfo, structure, ident, slot.cachedOffset(), appropriateListBuildingPutByIdFunction(slot, putKind), false);
</ins><span class="cx">         stubInfo.initPutByIdReplace(*vm, codeBlock-&gt;ownerExecutable(), structure);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -1223,14 +1235,21 @@
</span><span class="cx">             MacroAssembler::NotEqual,
</span><span class="cx">             MacroAssembler::Address(baseGPR, JSCell::structureOffset()),
</span><span class="cx">             MacroAssembler::TrustedImmPtr(structure)));
</span><del>-        
</del><ins>+
+        CodeBlock* codeBlock = exec-&gt;codeBlock();
+        if (structure-&gt;typeInfo().newImpurePropertyFiresWatchpoints())
+            vm-&gt;registerWatchpointForImpureProperty(ident, stubInfo.addWatchpoint(codeBlock));
+
</ins><span class="cx">         Structure* currStructure = structure;
</span><span class="cx">         WriteBarrier&lt;Structure&gt;* it = chain-&gt;head();
</span><span class="cx">         for (unsigned i = 0; i &lt; count; ++i, ++it) {
</span><span class="cx">             JSObject* prototype = asObject(currStructure-&gt;prototypeForLookup(exec));
</span><ins>+            Structure* protoStructure = prototype-&gt;structure();
</ins><span class="cx">             addStructureTransitionCheck(
</span><del>-                prototype, prototype-&gt;structure(), exec-&gt;codeBlock(), stubInfo, stubJit,
</del><ins>+                prototype, protoStructure, exec-&gt;codeBlock(), stubInfo, stubJit,
</ins><span class="cx">                 failureCases, scratchGPR);
</span><ins>+            if (protoStructure-&gt;typeInfo().newImpurePropertyFiresWatchpoints())
+                vm-&gt;registerWatchpointForImpureProperty(ident, stubInfo.addWatchpoint(codeBlock));
</ins><span class="cx">             currStructure = it-&gt;get();
</span><span class="cx">         }
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypeInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx">     static const unsigned OverridesGetPropertyNames = 1 &lt;&lt; 8;
</span><span class="cx">     static const unsigned ProhibitsPropertyCaching = 1 &lt;&lt; 9;
</span><span class="cx">     static const unsigned HasImpureGetOwnPropertySlot = 1 &lt;&lt; 10;
</span><del>-    static const unsigned StructureHasRareData = 1 &lt;&lt; 11;
</del><ins>+    static const unsigned NewImpurePropertyFiresWatchpoints = 1 &lt;&lt; 11;
+    static const unsigned StructureHasRareData = 1 &lt;&lt; 12;
</ins><span class="cx"> 
</span><span class="cx">     class TypeInfo {
</span><span class="cx">     public:
</span><span class="lines">@@ -83,6 +84,7 @@
</span><span class="cx">         bool overridesGetPropertyNames() const { return isSetOnFlags2(OverridesGetPropertyNames); }
</span><span class="cx">         bool prohibitsPropertyCaching() const { return isSetOnFlags2(ProhibitsPropertyCaching); }
</span><span class="cx">         bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); }
</span><ins>+        bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); }
</ins><span class="cx">         bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); }
</span><span class="cx"> 
</span><span class="cx">         static ptrdiff_t flagsOffset()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Operations.h (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Operations.h        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/runtime/Operations.h        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -217,8 +217,9 @@
</span><span class="cx">     while (!slotBase || slotBase != cell) {
</span><span class="cx">         if (cell-&gt;isProxy())
</span><span class="cx">             return InvalidPrototypeChain;
</span><del>-            
-        if (cell-&gt;structure()-&gt;typeInfo().hasImpureGetOwnPropertySlot())
</del><ins>+
+        const TypeInfo&amp; typeInfo = cell-&gt;structure()-&gt;typeInfo();
+        if (typeInfo.hasImpureGetOwnPropertySlot() &amp;&amp; !typeInfo.newImpurePropertyFiresWatchpoints())
</ins><span class="cx">             return InvalidPrototypeChain;
</span><span class="cx">             
</span><span class="cx">         JSValue v = cell-&gt;structure()-&gt;prototypeForLookup(callFrame);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStructureh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Structure.h (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Structure.h        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/runtime/Structure.h        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -134,6 +134,14 @@
</span><span class="cx"> 
</span><span class="cx">     bool propertyAccessesAreCacheable() { return m_dictionaryKind != UncachedDictionaryKind &amp;&amp; !typeInfo().prohibitsPropertyCaching(); }
</span><span class="cx"> 
</span><ins>+    // We use SlowPath in GetByIdStatus for structures that may get new impure properties later to prevent
+    // DFG from inlining property accesses since structures don't transition when a new impure property appears.
+    bool takesSlowPathInDFGForImpureProperty()
+    {
+        ASSERT(!typeInfo().hasImpureGetOwnPropertySlot() || typeInfo().newImpurePropertyFiresWatchpoints());
+        return typeInfo().hasImpureGetOwnPropertySlot();
+    }
+
</ins><span class="cx">     // Type accessors.
</span><span class="cx">     const TypeInfo&amp; typeInfo() const { ASSERT(structure()-&gt;classInfo() == info()); return m_typeInfo; }
</span><span class="cx">     bool isObject() const { return typeInfo().isObject(); }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -765,4 +765,18 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void VM::registerWatchpointForImpureProperty(const Identifier&amp; propertyName, Watchpoint* watchpoint)
+{
+    auto result = m_impurePropertyWatchpointSets.add(propertyName.string(), nullptr);
+    if (result.isNewEntry)
+        result.iterator-&gt;value = adoptRef(new WatchpointSet(IsWatched));
+    result.iterator-&gt;value-&gt;add(watchpoint);
+}
+
+void VM::addImpureProperty(const String&amp; propertyName)
+{
+    if (RefPtr&lt;WatchpointSet&gt; watchpointSet = m_impurePropertyWatchpointSets.take(propertyName))
+        watchpointSet-&gt;fireAll();
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -47,17 +47,20 @@
</span><span class="cx"> #include &quot;ThunkGenerators.h&quot;
</span><span class="cx"> #include &quot;TypedArrayController.h&quot;
</span><span class="cx"> #include &quot;Watchdog.h&quot;
</span><ins>+#include &quot;Watchpoint.h&quot;
</ins><span class="cx"> #include &quot;WeakRandom.h&quot;
</span><span class="cx"> #include &lt;wtf/BumpPointerAllocator.h&gt;
</span><span class="cx"> #include &lt;wtf/DateMath.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCountedArray.h&gt;
</span><span class="cx"> #include &lt;wtf/SimpleStats.h&gt;
</span><span class="cx"> #include &lt;wtf/StackBounds.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSpecific.h&gt;
</span><span class="cx"> #include &lt;wtf/WTFThreadData.h&gt;
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> #if ENABLE(REGEXP_TRACING)
</span><span class="cx"> #include &lt;wtf/ListHashSet.h&gt;
</span><span class="cx"> #endif
</span><span class="lines">@@ -69,6 +72,7 @@
</span><span class="cx">     class CommonIdentifiers;
</span><span class="cx">     class ExecState;
</span><span class="cx">     class HandleStack;
</span><ins>+    class Identifier;
</ins><span class="cx">     class IdentifierTable;
</span><span class="cx">     class Interpreter;
</span><span class="cx">     class JSGlobalObject;
</span><span class="lines">@@ -92,6 +96,8 @@
</span><span class="cx">     class UnlinkedFunctionExecutable;
</span><span class="cx">     class UnlinkedProgramCodeBlock;
</span><span class="cx">     class VMEntryScope;
</span><ins>+    class Watchpoint;
+    class WatchpointSet;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx">     namespace DFG {
</span><span class="lines">@@ -474,6 +480,10 @@
</span><span class="cx">         
</span><span class="cx">         JS_EXPORT_PRIVATE void discardAllCode();
</span><span class="cx"> 
</span><ins>+        void registerWatchpointForImpureProperty(const Identifier&amp;, Watchpoint*);
+        // FIXME: Use AtomicString once it got merged with Identifier.
+        JS_EXPORT_PRIVATE void addImpureProperty(const String&amp;);
+
</ins><span class="cx">     private:
</span><span class="cx">         friend class LLIntOffsetsExtractor;
</span><span class="cx">         friend class ClearExceptionScope;
</span><span class="lines">@@ -510,6 +520,8 @@
</span><span class="cx">         bool m_inDefineOwnProperty;
</span><span class="cx">         OwnPtr&lt;CodeCache&gt; m_codeCache;
</span><span class="cx">         RefCountedArray&lt;StackFrame&gt; m_exceptionStack;
</span><ins>+
+        HashMap&lt;String, RefPtr&lt;WatchpointSet&gt;&gt; m_impurePropertyWatchpointSets;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GC_VALIDATION)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/ChangeLog        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2013-12-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
+
+        REGRESSION: 2x regression on Dromaeo DOM query tests
+        https://bugs.webkit.org/show_bug.cgi?id=125377
+
+        Reviewed by Filip Pizlo.
+
+        The bug was caused by JSC not JIT'ing property accesses on document because of its having
+        custom named getter (named properties).  This resulted in resolution of methods on document
+        such as getElementById to happen inside the interpreter.
+
+        Fixed the bug by using the new JSC type info flag which tells JSC to JIT property access on
+        document, and then notifying JSC whenever a new named property appeared on document.
+
+        Tests: js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html
+               js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html
+               js/dom/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html
+               js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-2.html
+               js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-3.html
+               js/dom/prototype-chain-caching-with-impure-get-own-property-slot-traps-4.html
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::addImpureProperty): Wraps VM::addImpureProperty.
+        * bindings/js/JSDOMBinding.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader): Added the support for NewImpurePropertyFiresWatchpoints.
+        * bindings/scripts/IDLAttributes.txt: Ditto.
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::addDocumentNamedItem): Calls addImpureProperty.
+        * html/HTMLDocument.idl: Added NewImpurePropertyFiresWatchpoints.
+
</ins><span class="cx"> 2013-12-15  Brent Fulgham  &lt;bfulgham@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [WIn] Unreviewed build fix after r160599
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -50,6 +50,11 @@
</span><span class="cx"> STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DOMConstructorObject);
</span><span class="cx"> STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DOMConstructorWithDocument);
</span><span class="cx"> 
</span><ins>+void addImpureProperty(const AtomicString&amp; propertyName)
+{
+    JSDOMWindow::commonVM()-&gt;addImpureProperty(propertyName);
+}
+
</ins><span class="cx"> const JSC::HashTable&amp; getHashTableForGlobalData(VM&amp; vm, const JSC::HashTable&amp; staticTable)
</span><span class="cx"> {
</span><span class="cx">     return DOMObjectHashTableMap::mapFor(vm).get(staticTable);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -237,6 +237,8 @@
</span><span class="cx">     return index &gt;= exec-&gt;argumentCount() ? JSC::JSValue() : exec-&gt;argument(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void addImpureProperty(const AtomicString&amp;);
+
</ins><span class="cx"> const JSC::HashTable&amp; getHashTableForGlobalData(JSC::VM&amp;, const JSC::HashTable&amp; staticTable);
</span><span class="cx"> 
</span><span class="cx"> void reportException(JSC::ExecState*, JSC::JSValue exception, CachedScript* = 0);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -694,6 +694,9 @@
</span><span class="cx">     if ($hasImpureNamedGetter) {
</span><span class="cx">         $structureFlags{&quot;JSC::HasImpureGetOwnPropertySlot&quot;} = 1;
</span><span class="cx">     }
</span><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;NewImpurePropertyFiresWatchpoints&quot;}) {
+        $structureFlags{&quot;JSC::NewImpurePropertyFiresWatchpoints&quot;} = 1;
+    }
</ins><span class="cx"> 
</span><span class="cx">     # Getters
</span><span class="cx">     if ($hasGetter) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx"> JSWindowEventListener
</span><span class="cx"> MasqueradesAsUndefined
</span><span class="cx"> NamedConstructor=*
</span><ins>+NewImpurePropertyFiresWatchpoints
</ins><span class="cx"> NoInterfaceObject
</span><span class="cx"> NotEnumerable
</span><span class="cx"> NotDeletable
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.cpp (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.cpp        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/html/HTMLDocument.cpp        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #include &quot;HTMLFrameSetElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;JSDOMBinding.h&quot;
</ins><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -328,6 +329,7 @@
</span><span class="cx"> void HTMLDocument::addDocumentNamedItem(const AtomicStringImpl&amp; name, Element&amp; item)
</span><span class="cx"> {
</span><span class="cx">     m_documentNamedItem.add(name, item, *this);
</span><ins>+    addImpureProperty(AtomicString(const_cast&lt;AtomicStringImpl*&gt;(&amp;name)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLDocument::removeDocumentNamedItem(const AtomicStringImpl&amp; name, Element&amp; item)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.idl (160627 => 160628)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.idl        2013-12-16 04:58:10 UTC (rev 160627)
+++ trunk/Source/WebCore/html/HTMLDocument.idl        2013-12-16 05:56:25 UTC (rev 160628)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     CustomNamedGetter,
</span><ins>+    NewImpurePropertyFiresWatchpoints,
</ins><span class="cx"> ] interface HTMLDocument : Document {
</span><span class="cx">     [Custom] void open();
</span><span class="cx">     void close();
</span></span></pre>
</div>
</div>

</body>
</html>