<!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>[201702] 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/201702">201702</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2016-06-05 17:59:33 -0700 (Sun, 05 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
https://bugs.webkit.org/show_bug.cgi?id=158178
Reviewed by Darin Adler.
As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
Source/JavaScriptCore:
Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::getOwnPropertySlot):
- Override is still required for symbol table,
but regular property access is now via Base::getOwnPropertySlot.
* runtime/JSGlobalObject.h:
- add HasStaticPropertyTable to structureFlags.
Source/WebCore:
Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
- getStaticPropertySlot -> Base::getOwnPropertySlot.
* bindings/js/JSPluginElementFunctions.h:
(WebCore::pluginElementCustomGetOwnPropertySlot):
- Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
* bindings/scripts/CodeGeneratorJS.pm:
(PrototypeHasStaticPropertyTable):
- Was PrototypeOverridesGetOwnPropertySlot; prototypes now never need override getOwnPropertySlot so renaming accordingly.
(GenerateImplementation):
- Removed generation of getOwnPropertySlot body for DOMGlobalObjects.
(GeneratePrototypeDeclaration):
- For DOMGlobalObjects, set HasStaticPropertyTable instead of OverridesGetOwnPropertySlot & removed getOwnPropertySlot declaration.
(PrototypeOverridesGetOwnPropertySlot): Deleted.
Renamed to PrototypeHasStaticPropertyTable.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
- Updating bindings test results.
LayoutTests:
Switch JSGlobalObject & WebCore DOM instance bindings to use HasStaticPropertyTable.
* fast/dom/unforgeable-attributes-expected.txt:
- Progression, similar to the getOwnPropertyDescriptor test below. Previously we
were reporting an error with a message appropriate to a disallowed value->value
redefinition. This is actually a disallowed accessor->value reconfiguration, now
reporting the correct error message for this.
* http/tests/security/cross-origin-window-property-access-expected.txt:
- Newly reporting previously missing CORS error.
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:
- This test was previously incorrect - was expecting window.window property to
reflect as a value decriptor. This now reflect as an accesor descriptor. New
behaviour is correct per spec & matches Firefox.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomunforgeableattributesexpectedtxt">trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginwindowpropertyaccessexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomgetOwnPropertyDescriptorexpectedtxt">trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsresourcesgetOwnPropertyDescriptorjs">trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/ChangeLog        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2016-06-05 Gavin & Ellie Barraclough <barraclough@apple.com>
+
+ Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+ https://bugs.webkit.org/show_bug.cgi?id=158178
+
+ Reviewed by Darin Adler.
+
+ As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+ overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+ Switch JSGlobalObject & WebCore DOM instance bindings to use HasStaticPropertyTable.
+
+ * fast/dom/unforgeable-attributes-expected.txt:
+ - Progression, similar to the getOwnPropertyDescriptor test below. Previously we
+ were reporting an error with a message appropriate to a disallowed value->value
+ redefinition. This is actually a disallowed accessor->value reconfiguration, now
+ reporting the correct error message for this.
+ * http/tests/security/cross-origin-window-property-access-expected.txt:
+ - Newly reporting previously missing CORS error.
+ * js/dom/getOwnPropertyDescriptor-expected.txt:
+ * js/resources/getOwnPropertyDescriptor.js:
+ - This test was previously incorrect - was expecting window.window property to
+ reflect as a value decriptor. This now reflect as an accesor descriptor. New
+ behaviour is correct per spec & matches Firefox.
+
</ins><span class="cx"> 2016-06-05 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> TextIterator should ignore non-visible frames in findPlainText
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomunforgeableattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/fast/dom/unforgeable-attributes-expected.txt        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -18,13 +18,13 @@
</span><span class="cx"> Window.window
</span><span class="cx"> PASS testObject.hasOwnProperty(testPropertyName) is true
</span><span class="cx"> PASS testObject.__proto__.hasOwnProperty(testPropertyName) is false
</span><del>-PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change value of a readonly property..
</del><ins>+PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(testObject, testPropertyName).configurable is false
</span><span class="cx">
</span><span class="cx"> Window.document
</span><span class="cx"> PASS testObject.hasOwnProperty(testPropertyName) is true
</span><span class="cx"> PASS testObject.__proto__.hasOwnProperty(testPropertyName) is false
</span><del>-PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change value of a readonly property..
</del><ins>+PASS Object.defineProperty(testObject, testPropertyName, { value: 'test' }) threw exception TypeError: Attempting to change access mechanism for an unconfigurable property..
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(testObject, testPropertyName).configurable is false
</span><span class="cx">
</span><span class="cx"> Window.location
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginwindowpropertyaccessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx"> CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</span><ins>+CONSOLE MESSAGE: line 1: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</ins><span class="cx"> CONSOLE MESSAGE: line 15: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 15: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a frame with origin "http://localhost:8000". Protocols, domains, and ports must match.
</span><span class="cx"> Tests that using another window's property getter does not bypass cross-origin checks.
</span><span class="lines">@@ -10,7 +11,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-PASS Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window, "document").get.call').
</del><ins>+PASS Object.getOwnPropertyDescriptor(window, "document").get.call(crossOriginWindow) returned undefined.
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(window, "name").get.call(crossOriginWindow) returned undefined.
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(window, "menubar").get.call(crossOriginWindow) returned undefined.
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(window, "scrollbars").get.call(crossOriginWindow) returned undefined.
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomgetOwnPropertyDescriptorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -114,9 +114,10 @@
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Infinity').hasOwnProperty('set') is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Infinity').enumerable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'Infinity').configurable is false
</span><del>-PASS Object.getOwnPropertyDescriptor(global, 'window').value is global
-PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('set') is false
</del><ins>+PASS Object.getOwnPropertyDescriptor(global, 'window').get is globalWindowGetter
+PASS Object.getOwnPropertyDescriptor(global, 'window').set is undefined
+PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('value') is false
+PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('writable') is false
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'window').enumerable is true
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'window').configurable is false
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').value is XMLHttpRequest
</span></span></pre></div>
<a id="trunkLayoutTestsjsresourcesgetOwnPropertyDescriptorjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/LayoutTests/js/resources/getOwnPropertyDescriptor.js        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -41,7 +41,8 @@
</span><span class="cx"> descriptorShouldBe("global", "'undefined'", {writable: false, enumerable: false, configurable: false, value:"undefined"});
</span><span class="cx"> descriptorShouldBe("global", "'NaN'", {writable: false, enumerable: false, configurable: false, value:"NaN"});
</span><span class="cx"> descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"});
</span><del>-descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"});
</del><ins>+var globalWindowGetter = Object.getOwnPropertyDescriptor(global, 'window').get;
+descriptorShouldBe("global", "'window'", {get: 'globalWindowGetter', set: undefined, enumerable: true, configurable: false});
</ins><span class="cx"> descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"});
</span><span class="cx"> descriptorShouldBe("global", "0", {writable: true, enumerable: false, configurable: false, value:"global[0]"});
</span><span class="cx"> descriptorShouldBe("document.getElementsByTagName('div')", "0", {writable: false, enumerable: true, configurable: false, value:"document.getElementsByTagName('div')[0]"});
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-06-03 Gavin & Ellie Barraclough <barraclough@apple.com>
+
+ Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+ https://bugs.webkit.org/show_bug.cgi?id=158178
+
+ Reviewed by Darin Adler.
+
+ As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+ overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+ Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
+
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::getOwnPropertySlot):
+ - Override is still required for symbol table,
+ but regular property access is now via Base::getOwnPropertySlot.
+ * runtime/JSGlobalObject.h:
+ - add HasStaticPropertyTable to structureFlags.
+
</ins><span class="cx"> 2016-06-03 Benjamin Poulain <bpoulain@apple.com>
</span><span class="cx">
</span><span class="cx"> Eager FTL failure for strict comparison of NaN with number check
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -1178,10 +1178,9 @@
</span><span class="cx">
</span><span class="cx"> bool JSGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
</span><span class="cx"> {
</span><del>- JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
- if (getStaticPropertySlot<JSGlobalObject, Base>(exec, globalObjectTable, thisObject, propertyName, slot))
</del><ins>+ if (Base::getOwnPropertySlot(object, exec, propertyName, slot))
</ins><span class="cx"> return true;
</span><del>- return symbolTableGet(thisObject, propertyName, slot);
</del><ins>+ return symbolTableGet(jsCast<JSGlobalObject*>(object), propertyName, slot);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSGlobalObject::clearRareData(JSCell* cell)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -387,7 +387,7 @@
</span><span class="cx">
</span><span class="cx"> public:
</span><span class="cx"> typedef JSSegmentedVariableObject Base;
</span><del>- static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames | OverridesToThis;
</del><ins>+ static const unsigned StructureFlags = Base::StructureFlags | HasStaticPropertyTable | OverridesGetOwnPropertySlot | OverridesGetPropertyNames | OverridesToThis;
</ins><span class="cx">
</span><span class="cx"> static JSGlobalObject* create(VM& vm, Structure* structure)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/ChangeLog        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-06-03 Gavin & Ellie Barraclough <barraclough@apple.com>
+
+ Deprecate remaining uses of Lookup getStatic*, use HasStaticPropertyTable instead.
+ https://bugs.webkit.org/show_bug.cgi?id=158178
+
+ Reviewed by Darin Adler.
+
+ As of bug #158059 most JSC static table property access no longer requires getOwnPropertySlot to be
+ overridden. Port remaining calls to the getStatic* functions in Lookup.h over to the new mechanism.
+
+ Part 1: Switch JSGlobalObject & JSDOMWindow to use HasStaticPropertyTable.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ - getStaticPropertySlot -> Base::getOwnPropertySlot.
+ * bindings/js/JSPluginElementFunctions.h:
+ (WebCore::pluginElementCustomGetOwnPropertySlot):
+ - Switch call from getStaticValueSlot to Type::getOwnPropertySlot.
+ For any element where Type::hasStaticPropertyTable is true the HasStaticPropertyTable
+ structure flag will also be set, so Type::getOwnPropertySlot will do the same thing.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (PrototypeHasStaticPropertyTable):
+ - Was PrototypeOverridesGetOwnPropertySlot; prototypes now never need override getOwnPropertySlot so renaming accordingly.
+ (GenerateImplementation):
+ - Removed generation of getOwnPropertySlot body for DOMGlobalObjects.
+ (GeneratePrototypeDeclaration):
+ - For DOMGlobalObjects, set HasStaticPropertyTable instead of OverridesGetOwnPropertySlot & removed getOwnPropertySlot declaration.
+ (PrototypeOverridesGetOwnPropertySlot): Deleted.
+ Renamed to PrototypeHasStaticPropertyTable.
+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+ * bindings/scripts/test/JS/JSTestGlobalObject.h:
+ - Updating bindings test results.
+
</ins><span class="cx"> 2016-06-05 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Find on page finds too many matches
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">
</span><span class="cx"> // (2) Regular own properties.
</span><span class="cx"> PropertySlot slotCopy = slot;
</span><del>- if (getStaticPropertySlot<JSDOMWindow, Base>(exec, *JSDOMWindow::info()->staticPropHashTable, thisObject, propertyName, slot)) {
</del><ins>+ if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
</ins><span class="cx"> // Detect when we're getting the property 'showModalDialog', this is disabled, and has its original value.
</span><span class="cx"> bool isShowModalDialogAndShouldHide = propertyName == exec->propertyNames().showModalDialog
</span><span class="cx"> && !DOMWindow::canShowModalDialog(frame)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -702,7 +702,7 @@
</span><span class="cx"> return $numInstanceProperties > 0 || $hasComplexGetter;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub PrototypeOverridesGetOwnPropertySlot
</del><ins>+sub PrototypeHasStaticPropertyTable
</ins><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><span class="cx"> my $numPrototypeProperties = PrototypePropertyCount($interface);
</span><span class="lines">@@ -2267,70 +2267,43 @@
</span><span class="cx"> push(@implContent, "const ClassInfo ${className}Prototype::s_info = { \"${visibleInterfaceName}Prototype\", &Base::s_info, &${className}PrototypeTable, CREATE_METHOD_TABLE(${className}Prototype) };\n\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (PrototypeOverridesGetOwnPropertySlot($interface)) {
- my $prototypePropertyCount = PrototypePropertyCount($interface);
- my $prototypeFunctionCount = PrototypeFunctionCount($interface);
- my $prototypeAttributeCount = $prototypePropertyCount - $prototypeFunctionCount;
- if (IsDOMGlobalObject($interface)) {
- push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
- push(@implContent, "{\n");
- push(@implContent, " VM& vm = state->vm();\n");
- push(@implContent, " UNUSED_PARAM(vm);\n");
- push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(object);\n");
</del><ins>+ if (PrototypeHasStaticPropertyTable($interface) && !IsDOMGlobalObject($interface)) {
+ push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " Base::finishCreation(vm);\n");
+ push(@implContent, " reifyStaticProperties(vm, ${className}PrototypeTableValues, *this);\n");
</ins><span class="cx">
</span><del>- if ($numConstants eq 0 && $prototypePropertyCount eq 0) {
- push(@implContent, " return Base::getOwnPropertySlot(thisObject, state, propertyName, slot);\n");
- } elsif ($numConstants eq 0 && $prototypeAttributeCount eq 0) {
- push(@implContent, " return getStaticFunctionSlot<JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
- } elsif ($prototypePropertyCount eq 0) {
- push(@implContent, " return getStaticValueSlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
- } else {
- push(@implContent, " return getStaticPropertySlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
- }
- push(@implContent, "}\n\n");
- } elsif ($numConstants > 0 || $numPrototypeProperties > 0) {
- push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
- push(@implContent, "{\n");
- push(@implContent, " Base::finishCreation(vm);\n");
- push(@implContent, " reifyStaticProperties(vm, ${className}PrototypeTableValues, *this);\n");
</del><ins>+ my @runtimeEnabledProperties = @runtimeEnabledFunctions;
+ push(@runtimeEnabledProperties, @runtimeEnabledAttributes);
+ foreach my $functionOrAttribute (@runtimeEnabledProperties) {
+ my $signature = $functionOrAttribute->signature;
+ my $conditionalString = $codeGenerator->GenerateConditionalString($signature);
+ push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
+ AddToImplIncludes("RuntimeEnabledFeatures.h");
+ my $enable_function = GetRuntimeEnableFunctionName($signature);
+ my $name = $signature->name;
+ push(@implContent, " if (!${enable_function}()) {\n");
+ push(@implContent, " Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(\"$name\"), strlen(\"$name\"));\n");
+ push(@implContent, " removeDirect(vm, propertyName);\n");
+ push(@implContent, " }\n");
+ push(@implContent, "#endif\n") if $conditionalString;
+ }
</ins><span class="cx">
</span><del>- my @runtimeEnabledProperties = @runtimeEnabledFunctions;
- push(@runtimeEnabledProperties, @runtimeEnabledAttributes);
- foreach my $functionOrAttribute (@runtimeEnabledProperties) {
- my $signature = $functionOrAttribute->signature;
- my $conditionalString = $codeGenerator->GenerateConditionalString($signature);
- push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
- AddToImplIncludes("RuntimeEnabledFeatures.h");
- my $enable_function = GetRuntimeEnableFunctionName($signature);
- my $name = $signature->name;
- push(@implContent, " if (!${enable_function}()) {\n");
- push(@implContent, " Identifier propertyName = Identifier::fromString(&vm, reinterpret_cast<const LChar*>(\"$name\"), strlen(\"$name\"));\n");
- push(@implContent, " removeDirect(vm, propertyName);\n");
- push(@implContent, " }\n");
- push(@implContent, "#endif\n") if $conditionalString;
- }
</del><ins>+ my $firstPrivateFunction = 1;
+ foreach my $function (@{$interface->functions}) {
+ next unless ($function->signature->extendedAttributes->{"Private"});
+ AddToImplIncludes("WebCoreJSClientData.h");
+ push(@implContent, " JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);\n") if $firstPrivateFunction;
+ $firstPrivateFunction = 0;
+ push(@implContent, " putDirect(vm, clientData.builtinNames()." . $function->signature->name . "PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), " . GetFunctionName($interface, $className, $function) . "), ReadOnly | DontEnum);\n");
+ }
</ins><span class="cx">
</span><del>- my $firstPrivateFunction = 1;
- foreach my $function (@{$interface->functions}) {
- next unless ($function->signature->extendedAttributes->{"Private"});
- AddToImplIncludes("WebCoreJSClientData.h");
- push(@implContent, " JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);\n") if $firstPrivateFunction;
- $firstPrivateFunction = 0;
- push(@implContent, " putDirect(vm, clientData.builtinNames()." . $function->signature->name . "PrivateName(), JSFunction::create(vm, globalObject(), 0, String(), " . GetFunctionName($interface, $className, $function) . "), ReadOnly | DontEnum);\n");
- }
-
- if ($interface->iterable) {
- my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
- push(@implContent, " putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), ReadOnly | DontEnum);\n");
- }
-
- push(@implContent, "}\n\n");
- } else {
- push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
- push(@implContent, "{\n");
- push(@implContent, " Base::finishCreation(vm);\n");
- push(@implContent, "}\n\n");
</del><ins>+ if ($interface->iterable) {
+ my $functionName = GetFunctionName($interface, $className, @{$interface->iterable->functions}[0]);
+ push(@implContent, " putDirect(vm, vm.propertyNames->iteratorSymbol, JSFunction::create(vm, globalObject(), 0, ASCIILiteral(\"[Symbol.Iterator]\"), $functionName), ReadOnly | DontEnum);\n");
</ins><span class="cx"> }
</span><ins>+
+ push(@implContent, "}\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($interface->extendedAttributes->{"JSCustomNamedGetterOnPrototype"}) {
</span><span class="lines">@@ -4839,12 +4812,11 @@
</span><span class="cx"> push(@$outputArray, " {\n");
</span><span class="cx"> push(@$outputArray, " }\n");
</span><span class="cx">
</span><del>- if (PrototypeOverridesGetOwnPropertySlot($interface)) {
- push(@$outputArray, "\n");
</del><ins>+ if (PrototypeHasStaticPropertyTable($interface)) {
</ins><span class="cx"> if (IsDOMGlobalObject($interface)) {
</span><del>- push(@$outputArray, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
- $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
</del><ins>+ $structureFlags{"JSC::HasStaticPropertyTable"} = 1;
</ins><span class="cx"> } else {
</span><ins>+ push(@$outputArray, "\n");
</ins><span class="cx"> push(@$outputArray, " void finishCreation(JSC::VM&);\n");
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -108,14 +108,6 @@
</span><span class="cx"> static const HashTable JSTestGlobalObjectPrototypeTable = { 1, 1, true, JSTestGlobalObjectPrototypeTableValues, JSTestGlobalObjectPrototypeTableIndex };
</span><span class="cx"> const ClassInfo JSTestGlobalObjectPrototype::s_info = { "TestGlobalObjectPrototype", &Base::s_info, &JSTestGlobalObjectPrototypeTable, CREATE_METHOD_TABLE(JSTestGlobalObjectPrototype) };
</span><span class="cx">
</span><del>-bool JSTestGlobalObjectPrototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
-{
- VM& vm = state->vm();
- UNUSED_PARAM(vm);
- auto* thisObject = jsCast<JSTestGlobalObjectPrototype*>(object);
- return getStaticPropertySlot<JSTestGlobalObjectPrototype, JSObject>(state, JSTestGlobalObjectPrototypeTable, thisObject, propertyName, slot);
-}
-
</del><span class="cx"> const ClassInfo JSTestGlobalObject::s_info = { "TestGlobalObject", &Base::s_info, &JSTestGlobalObjectTable, CREATE_METHOD_TABLE(JSTestGlobalObject) };
</span><span class="cx">
</span><span class="cx"> JSTestGlobalObject::JSTestGlobalObject(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestGlobalObject>&& impl)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (201701 => 201702)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-06-05 19:48:26 UTC (rev 201701)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-06-06 00:59:33 UTC (rev 201702)
</span><span class="lines">@@ -111,10 +111,8 @@
</span><span class="cx"> : JSC::JSNonFinalObject(vm, structure)
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>-
- static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
</del><span class="cx"> public:
</span><del>- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
</del><ins>+ static const unsigned StructureFlags = JSC::HasStaticPropertyTable | Base::StructureFlags;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>