<!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>[197815] 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/197815">197815</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-03-08 16:01:09 -0800 (Tue, 08 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement Function.name support for getters/setters and inferring name of function properties.
https://bugs.webkit.org/show_bug.cgi?id=154865

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

1. toString() no longer uses the value of Function.name as the name of the
   function in the returned string, because ...

    i. Function.name is supposed to be configurable.  Hence, it can be made
       writable and can be set to any JSValue, or deleted.
   ii. Function.prototype.toString() is supposed to produce a string that can be
       eval'ed.  Hence, for JS functions, the function name in the produced
       string must be a legal function name (and not some arbitrary value set in
       Function.name).  For example, while a number is a legal value for
       Function.name, it is not legal as the function name in the toString()
       string.

   Instead, we'll always use the original name from the JS source that the
   function was parsed from.

2. JSFunction::name() now always return the original name, not the value of
   the Function.name property.  As a result, it also no longer needs an
   ExecState* arg.

   If the original name is an empty string, JSFunction::name() will use the
   inferred name.

3. For JS functions, the original name can be attained from their
   FunctionExecutable object.

   For host/native functions (which do not have a FunctionExecutable), we get the
   &quot;original&quot; name from its NativeExecutable.

4. The m_hostFunctionStubMap now keys its NativeExecutable pointers using the
   original name, in addition to the native function and constructor pointers.

   This is needed because we want a different NativeExecutable for functions with
   a different name (to satisfy (3) above).

5. Changed JSBoundFunction to store the name of its bound function in its
   NativeExecutable.  This will later be used to generate the toString() string.
   It's Function.name value is eagerly initialized at construction time.

6. Function.name for getters/setters are now prefixed with &quot;get&quot;/&quot;set&quot;.
   This was done both for the JSBoundSlotBaseFunctions and JS definable get/set
   functions.

7. Added InternalFunction::m_originalName so that we can use it to generate the
   toString() string.  We're storing it as a JSString instead of a WTF::String
   only because we want InternalFunction to be continue to be trivially
   destructible.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::functionDetails):
* jit/JITThunks.cpp:
(JSC::JITThunks::finalize):
(JSC::JITThunks::hostFunctionStub):
* jit/JITThunks.h:
* runtime/Executable.h:
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::visitChildren):
(JSC::InternalFunction::name):
(JSC::InternalFunction::displayName):
* runtime/InternalFunction.h:
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::create):
(JSC::JSBoundFunction::visitChildren):
(JSC::JSBoundFunction::toStringName): Deleted.
* runtime/JSBoundFunction.h:
(JSC::JSBoundFunction::boundThis):
(JSC::JSBoundFunction::boundArgs):
(JSC::JSBoundFunction::createStructure):
* runtime/JSBoundSlotBaseFunction.cpp:
(JSC::boundSlotBaseFunctionCall):
(JSC::JSBoundSlotBaseFunction::create):
* runtime/JSFunction.cpp:
(JSC::JSFunction::initializeRareData):
(JSC::JSFunction::name):
(JSC::JSFunction::displayName):
(JSC::JSFunction::calculatedDisplayName):
(JSC::JSFunction::reifyName):
* runtime/JSFunction.h:
* tests/es6.yaml:

LayoutTests:

* js/function-toString-vs-name-expected.txt: Added.
* js/function-toString-vs-name.html: Added.
* js/script-tests/function-toString-vs-name.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectgetpropertiesexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortreadyStateexpectedtxt">trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-readyState-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortremovedexpectedtxt">trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-removed-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortupdatingexpectedtxt">trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-updating-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmachttptestsmediamediasourcemediasourcesourcebuffermodeexpectedtxt">trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITThunkscpp">trunk/Source/JavaScriptCore/jit/JITThunks.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITThunksh">trunk/Source/JavaScriptCore/jit/JITThunks.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutableh">trunk/Source/JavaScriptCore/runtime/Executable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeFunctionPrototypecpp">trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInternalFunctioncpp">trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInternalFunctionh">trunk/Source/JavaScriptCore/runtime/InternalFunction.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSBoundFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSBoundFunctionh">trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSBoundSlotBaseFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValuecpp">trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctionh">trunk/Source/JavaScriptCore/runtime/JSFunction.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestses6yaml">trunk/Source/JavaScriptCore/tests/es6.yaml</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsfunctiontoStringvsnameexpectedtxt">trunk/LayoutTests/js/function-toString-vs-name-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsfunctiontoStringvsnamehtml">trunk/LayoutTests/js/function-toString-vs-name.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsfunctiontoStringvsnamejs">trunk/LayoutTests/js/script-tests/function-toString-vs-name.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/ChangeLog        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-03-08  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Implement Function.name support for getters/setters and inferring name of function properties.
+        https://bugs.webkit.org/show_bug.cgi?id=154865
+
+        Reviewed by Geoffrey Garen.
+
+        * js/function-toString-vs-name-expected.txt: Added.
+        * js/function-toString-vs-name.html: Added.
+        * js/script-tests/function-toString-vs-name.js: Added.
+
</ins><span class="cx"> 2016-03-08  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Font size computed style is innaccurate
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectgetpropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> -----------------------------------------------------
</span><span class="cx"> EXPRESSION: window.boundFunction
</span><span class="cx"> type: function
</span><del>-description: function () {
</del><ins>+description: function unboundFunction() {
</ins><span class="cx">     [native code]
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsfunctiontoStringvsnameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/function-toString-vs-name-expected.txt (0 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/function-toString-vs-name-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/function-toString-vs-name-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsfunctiontoStringvsnamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/function-toString-vs-name.html (0 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/function-toString-vs-name.html                                (rev 0)
+++ trunk/LayoutTests/js/function-toString-vs-name.html        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/function-toString-vs-name.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsfunctiontoStringvsnamejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/function-toString-vs-name.js (0 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/function-toString-vs-name.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/function-toString-vs-name.js        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -0,0 +1,419 @@
</span><ins>+// isWhiteSpace() and stripSpaces() are borrowed from
+// kde/script-tests/inbuilt_function_tostring.js and modified.
+
+let section;
+let failures = &quot;&quot;;
+let failureCount = 0;
+
+function isWhiteSpace(string) {
+    let cc = string.charCodeAt(0);
+    switch (cc) {
+        case (0x0009):
+        case (0x000B):
+        case (0x000C):
+        case (0x0020):
+        case (0x000A):
+        case (0x000D):
+        case (59): // let's strip out semicolons, too
+            return true;
+            break;
+        default:
+            return false;
+    }
+}
+
+function minimizeSpaces(s) {
+    let currentChar;
+    let strippedString;
+    let previousCharIsWhiteSpace = false;
+    for (currentChar = 0, strippedString = &quot;&quot;; currentChar &lt; s.length; currentChar++) {
+        let ch = s.charAt(currentChar);
+        if (!isWhiteSpace(ch)) {
+            if (previousCharIsWhiteSpace &amp;&amp;
+                (ch == '(' || ch == ')' || ch == '{' || ch == '}' || ch == '[' || ch == ']'))
+                strippedString = strippedString.slice(0, strippedString.length - 1);
+            strippedString += ch;
+            previousCharIsWhiteSpace = false;
+        } else if (!previousCharIsWhiteSpace) {
+            strippedString += ' ';
+            previousCharIsWhiteSpace = true;
+        }
+    }
+    return strippedString;
+}
+
+function shouldBe(desc, funcName, actual, expected) {
+    if (typeof(actual) !== typeof(expected)) {
+        failures += (&quot;   &quot; + section + &quot;: &quot; + desc + &quot;'&quot; + funcName + &quot;': typeof expected: &quot; + typeof(expected) + &quot;, typeof actual: &quot; + typeof(actual) + &quot;\n&quot;);
+        failures += (&quot;       expected: '&quot; + expected + &quot;', actual: '&quot; + actual + &quot;'\n&quot;);
+        failureCount++;
+    } else if (typeof(actual) !== typeof(expected) || actual !== expected) {
+        failures += (&quot;   &quot; + section + &quot;: &quot; + desc + &quot;'&quot; + funcName + &quot;': expected: '&quot; + expected + &quot;', actual: '&quot; + actual + &quot;'\n&quot;);
+        failureCount++;
+    }
+}
+
+function toString(x) {
+    if (typeof x === &quot;symbol&quot;)
+        return x.toString();
+    return &quot;&quot; + x;
+}
+
+function test(func, expectedName, expectedToString) {
+    shouldBe(&quot;Function.name on &quot;, expectedName, func.name, expectedName);
+
+    let str = func.toString();
+    shouldBe(&quot;Function#toString on &quot;, expectedName, minimizeSpaces(str), minimizeSpaces(expectedToString));
+
+    let origDesc = Object.getOwnPropertyDescriptor(func, &quot;name&quot;);
+    shouldBe(&quot;Function.name configurability of &quot;, expectedName, origDesc.configurable, true);
+    shouldBe(&quot;Function.name writability of &quot;, expectedName, origDesc.writable, false);
+    shouldBe(&quot;Function.name enumerability of &quot;, expectedName, origDesc.enumerable, false);
+
+    // We should not be able to change Function.name while it is not writable.
+    let origFuncName = func.name;
+    let modifiedFuncName = &quot;modified_&quot; + toString(origFuncName);
+    func.name = modifiedFuncName;
+    shouldBe(&quot;Function.name (after attempted write) on &quot;, expectedName, func.name, expectedName);
+
+    // We should be able to change Function.name after making it writable.
+    Object.defineProperty(func, &quot;name&quot;, { writable: true });
+    let modifiedDesc = Object.getOwnPropertyDescriptor(func, &quot;name&quot;);
+    shouldBe(&quot;Function.name writability (after made writable) of &quot;, expectedName, modifiedDesc.writable, true);
+
+    func.name = modifiedFuncName;
+    shouldBe(&quot;Function.name (after attempted write again) on &quot;, expectedName, func.name, modifiedFuncName);
+
+    // But the toString name should not have changed.
+    str = func.toString();
+    shouldBe(&quot;Function#toString (after attempted write) on &quot;, expectedName, minimizeSpaces(str), minimizeSpaces(expectedToString));
+
+    // Put things back to the original state.
+    Object.defineProperty(func, &quot;name&quot;, origDesc);
+}
+
+section = &quot;builtin function&quot;;
+{
+    test(Array.prototype.every, &quot;every&quot;, &quot;function every() { [native code] }&quot;);
+    test(Array.prototype.forEach, &quot;forEach&quot;, &quot;function forEach() { [native code] }&quot;);
+    test(Array.prototype.some, &quot;some&quot;, &quot;function some() { [native code] }&quot;);
+
+    section = &quot;bound builtin function&quot;;
+    {
+        let o = {}
+        let boundEvery = Array.prototype.every.bind(o);
+        test(boundEvery, &quot;bound every&quot;, &quot;function every() { [native code] }&quot;);
+        let boundForEach = Array.prototype.forEach.bind(o);
+        test(boundForEach, &quot;bound forEach&quot;, &quot;function forEach() { [native code] }&quot;);
+    }
+}
+
+section = &quot;native function&quot;;
+{
+    test(Array.prototype.splice, &quot;splice&quot;, &quot;function splice() { [native code] }&quot;);
+    test(Array.prototype.unshift, &quot;unshift&quot;, &quot;function unshift() { [native code] }&quot;);
+    test(Array.prototype.indexOf, &quot;indexOf&quot;, &quot;function indexOf() { [native code] }&quot;);
+
+    section = &quot;bound native function&quot;;
+    {
+        let o = {}
+        let boundSplice = Array.prototype.splice.bind(o);
+        test(boundSplice, &quot;bound splice&quot;, &quot;function splice() { [native code] }&quot;);
+        let boundUnshift = Array.prototype.unshift.bind(o);
+        test(boundUnshift, &quot;bound unshift&quot;, &quot;function unshift() { [native code] }&quot;);
+    }
+}
+
+section = &quot;InternalFunction&quot;;
+{
+    test(Array, &quot;Array&quot;, &quot;function Array() { [native code] }&quot;);
+    test(Boolean, &quot;Boolean&quot;, &quot;function Boolean() { [native code] }&quot;);
+
+    section = &quot;bound InternalFunction&quot;;
+    {
+        let o = {}
+        let boundArray = Array.bind(o);
+        test(boundArray, &quot;bound Array&quot;, &quot;function Array() { [native code] }&quot;);
+        let boundBoolean = Boolean.bind(o);
+        test(boundBoolean, &quot;bound Boolean&quot;, &quot;function Boolean() { [native code] }&quot;);
+    }
+}
+
+section = &quot;JS function&quot;;
+{
+    function foo1() {}
+    test(foo1, &quot;foo1&quot;, &quot;function foo1() {}&quot;);
+
+    let foo2 = function() {}
+    test(foo2, &quot;foo2&quot;, &quot;function() {}&quot;);
+
+    let foo3 = (function() {
+        function goo3() {}
+        return goo3;
+    }) ();
+    test(foo3, &quot;goo3&quot;, &quot;function goo3() {}&quot;);
+
+    let foo4 = (function() {
+        return (function() {});
+    }) ();
+    test(foo4, &quot;&quot;, &quot;function() {}&quot;);
+
+    // Test functions in object properties.
+    section = &quot;Object property&quot;;
+    let o = {
+        prop1: function() {},
+        prop2: function namedProp2() {}
+    };
+    test(o.prop1, &quot;prop1&quot;, &quot;function() {}&quot;);
+    test(o.prop2, &quot;namedProp2&quot;, &quot;function namedProp2() {}&quot;);
+
+    section = &quot;bound JS function&quot;;
+    {
+        let o = {}
+        let boundFoo1 = foo1.bind(o);
+        test(boundFoo1, &quot;bound foo1&quot;, &quot;function foo1() { [native code] }&quot;);
+        let boundFoo2 = foo2.bind(o);
+        test(boundFoo2, &quot;bound foo2&quot;, &quot;function foo2() { [native code] }&quot;);
+        let boundFoo3 = foo3.bind(o);
+        test(boundFoo3, &quot;bound goo3&quot;, &quot;function goo3() { [native code] }&quot;);
+        let boundFoo4 = foo4.bind(o);
+        test(boundFoo4, &quot;bound &quot;, &quot;function () { [native code] }&quot;);
+
+        test((function(){}).bind({}), &quot;bound &quot;, &quot;function () { [native code] }&quot;);
+    }
+}
+
+section = &quot;object shorthand method&quot;;
+{
+    let o = {
+        prop1() {},
+        prop2(x) {}
+    };
+    test(o.prop1, &quot;prop1&quot;, &quot;function prop1() {}&quot;);
+    test(o.prop2, &quot;prop2&quot;, &quot;function prop2(x) {}&quot;);
+
+    section = &quot;bound object shorthand method&quot;;
+    {
+        let boundProp1 = o.prop1.bind(o);
+        test(boundProp1, &quot;bound prop1&quot;, &quot;function prop1() { [native code] }&quot;);
+        let boundProp2 = o.prop2.bind(o);
+        test(boundProp2, &quot;bound prop2&quot;, &quot;function prop2() { [native code] }&quot;);
+    }
+}
+
+// FIXME: Uncomment these when we've added support for Function.name of computed properties.
+// section = &quot;Object computed string property&quot;;
+// {
+//     let str1 = &quot;foo&quot;;
+//     let str2 = &quot;&quot;;
+//     let o = {    
+//         [str1]: function() {},
+//         [str2]: function() {}
+//     };
+//     test(o[str1], &quot;foo&quot;, &quot;function() {}&quot;);
+//     test(o[str2], &quot;&quot;, &quot;function() {}&quot;);
+// }
+// 
+// let sym1 = Symbol(&quot;foo&quot;);
+// let sym2 = Symbol();
+
+// section = &quot;Object computed symbol property&quot;;
+// {
+//     let o = {    
+//         [sym1]: function() {},
+//         [sym2]: function() {}
+//     };
+//     test(o[sym1], &quot;[foo]&quot;, &quot;function() {}&quot;);
+//     test(o[sym2], &quot;&quot;, &quot;function() {}&quot;);
+// }
+
+// section = &quot;Object computed symbol property with shorthand function&quot;;
+// {
+//     let o = {
+//         [sym1]() {},
+//         [sym2]() {}
+//     };
+//     test(o[sym1], &quot;[foo]&quot;, &quot;function() {}&quot;);
+//     test(o[sym2], &quot;&quot;, &quot;function() {}&quot;);
+// }
+
+// section = &quot;Object computed symbol property with get/set function&quot;;
+// {
+//     let o = {
+//         get [sym1]() {},
+//         set [sym1](x) {},
+//         get [sym2]() {},
+//         set [sym2](x) {}
+//     };
+//     let desc = Object.getOwnPropertyDescriptor(o, sym1);
+//     test(desc.get, &quot;get [foo]&quot;, &quot;function() {}&quot;);
+//     test(desc.set, &quot;set [foo]&quot;, &quot;function(x) {}&quot;);
+// 
+//     desc = Object.getOwnPropertyDescriptor(o, sym2);
+//     test(desc.get, &quot;get &quot;, &quot;function() {}&quot;);
+//     test(desc.set, &quot;set &quot;, &quot;function(x) {}&quot;);
+// }
+
+// Test functions in destructuring assignments.
+section = &quot;destructuring assignment&quot;;
+{
+    let prop1;
+    let prop2;
+    { prop1 = function() {}, prop2 = function namedProp2() {} }
+    test(prop1, &quot;prop1&quot;, &quot;function() {}&quot;);
+    test(prop2, &quot;namedProp2&quot;, &quot;function namedProp2() {}&quot;);
+
+    section = &quot;bound destructuring assignment&quot;;
+    {
+        let o = {}
+        let bound1 = prop1.bind(o);
+        test(bound1, &quot;bound prop1&quot;, &quot;function prop1() { [native code] }&quot;);
+
+        let bound2 = prop2.bind(o);
+        test(bound2, &quot;bound namedProp2&quot;, &quot;function namedProp2() { [native code] }&quot;);
+    }
+}
+
+section = &quot;dynamically created function&quot;;
+{
+    let dynamic1 = new Function(&quot;&quot;);
+    test(dynamic1, &quot;anonymous&quot;, &quot;function anonymous() {}&quot;);
+
+    let dynamic2 = new Function(&quot;&quot;);
+    dynamic2.name = &quot;Goo2&quot;;
+    test(dynamic2, &quot;anonymous&quot;, &quot;function anonymous() {}&quot;);
+
+    section = &quot;bound dynamically created function&quot;;
+    {
+        let o = {}
+        let bound1 = dynamic1.bind(o);
+        test(bound1, &quot;bound anonymous&quot;, &quot;function anonymous() { [native code] }&quot;);
+
+        let bound2 = dynamic2.bind(o);
+        test(bound2, &quot;bound anonymous&quot;, &quot;function anonymous() { [native code] }&quot;);
+    }
+}
+
+section = &quot;JSBoundSlotBaseFunction&quot;;
+{
+    if (typeof document !== &quot;undefined&quot;) {
+        let desc = Object.getOwnPropertyDescriptor(document, &quot;location&quot;);
+        test(desc.get, &quot;get location&quot;, &quot;function location() { [native code] }&quot;);
+        test(desc.set, &quot;set location&quot;, &quot;function location() { [native code] }&quot;);
+
+        section = &quot;bound JSBoundSlotBaseFunction&quot;;
+        {
+            let o = {}
+            let bound1 = desc.get.bind(o);
+            test(bound1, &quot;bound get location&quot;, &quot;function get location() { [native code] }&quot;);
+
+            let bound2 = desc.set.bind(o);
+            test(bound2, &quot;bound set location&quot;, &quot;function set location() { [native code] }&quot;);
+        }
+    }
+}
+
+section = &quot;get/set function&quot;;
+{
+    let o = { get foo() {}, set foo(x){} };
+    let desc = Object.getOwnPropertyDescriptor(o, &quot;foo&quot;);
+    test(desc.get, &quot;get foo&quot;, &quot;function() {}&quot;);
+    test(desc.set, &quot;set foo&quot;, &quot;function(x) {}&quot;);
+
+    let o1 = { get &quot;bar&quot;() {}, set &quot;bar&quot;(x){} };
+    let desc1 = Object.getOwnPropertyDescriptor(o1, &quot;bar&quot;);
+    test(desc1.get, &quot;get bar&quot;, &quot;function() {}&quot;);
+    test(desc1.set, &quot;set bar&quot;, &quot;function(x) {}&quot;);
+
+    let o2 = { get 100() {}, set 100(x){} };
+    let desc2 = Object.getOwnPropertyDescriptor(o2, 100);
+    test(desc2.get, &quot;get &quot;, &quot;function() {}&quot;);
+    test(desc2.set, &quot;set &quot;, &quot;function(x) {}&quot;);
+
+    let o3 = { get [100]() {}, set [100](x){} };
+    let desc3 = Object.getOwnPropertyDescriptor(o3, 100);
+    test(desc3.get, &quot;get &quot;, &quot;function() {}&quot;);
+    test(desc3.set, &quot;set &quot;, &quot;function(x) {}&quot;);
+
+    section = &quot;bound get/set function&quot;;
+    {
+        let bound1;
+        let bound2;
+
+        bound1 = desc.get.bind(o);
+        test(bound1, &quot;bound get foo&quot;, &quot;function get foo() { [native code] }&quot;);
+        bound2 = desc.set.bind(o);
+        test(bound2, &quot;bound set foo&quot;, &quot;function set foo() { [native code] }&quot;);
+
+        bound1 = desc1.get.bind(o);
+        test(bound1, &quot;bound get bar&quot;, &quot;function get bar() { [native code] }&quot;);
+        bound2 = desc1.set.bind(o);
+        test(bound2, &quot;bound set bar&quot;, &quot;function set bar() { [native code] }&quot;);
+
+        bound1 = desc2.get.bind(o);
+        test(bound1, &quot;bound get &quot;, &quot;function get () { [native code] }&quot;);
+        bound2 = desc2.set.bind(o);
+        test(bound2, &quot;bound set &quot;, &quot;function set () { [native code] }&quot;);
+
+        bound1 = desc3.get.bind(o);
+        test(bound1, &quot;bound get &quot;, &quot;function get () { [native code] }&quot;);
+        bound2 = desc3.set.bind(o);
+        test(bound2, &quot;bound set &quot;, &quot;function set () { [native code] }&quot;);
+    }
+}
+
+// https://tc39.github.io/ecma262/#sec-function.prototype.bind
+//     9. Let targetName be ? Get(Target, &quot;name&quot;).
+//    10. If Type(targetName) is not String, let targetName be the empty string.
+//    11. Perform SetFunctionName(F, targetName, &quot;bound&quot;).
+section = &quot;bound functions with non-string names&quot;;
+{
+    let foo = function() {};
+    let bound;
+
+    function setName(func, newName) {
+        Object.defineProperty(func, &quot;name&quot;, { writable:true });
+        func.name = newName;
+        Object.defineProperty(func, &quot;name&quot;, { writable:false });
+    }
+
+    setName(foo, undefined);
+    test(foo, undefined, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    setName(foo, null);
+    test(foo, null, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    setName(foo, true);
+    test(foo, true, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    setName(foo, false);
+    test(foo, false, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    setName(foo, 1234.567);
+    test(foo, 1234.567, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    let anonSym = Symbol();
+    setName(foo, anonSym);
+    test(foo, anonSym, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+
+    let sym = Symbol(&quot;baz&quot;);
+    setName(foo, sym);
+    test(foo, sym, &quot;function() {}&quot;);
+    bound = foo.bind({});
+    test(bound, &quot;bound &quot;, &quot;function () { [native code] }&quot;);    
+}
+
+if (failureCount)
+    throw Error(&quot;Found &quot; + failureCount + &quot; failures:\n&quot; + failures);
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortreadyStateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-readyState-expected.txt (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-readyState-expected.txt        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-readyState-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-readyState.html:20:29
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> isTypeSupported@http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-readyState.html:19:18
</span><del>-bound isTypeSupported@[native code]
</del><ins>+isTypeSupported@[native code]
</ins><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-readyState.html:42:36
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> async_test@http://127.0.0.1:8000/w3c/resources/testharness.js:460:26
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortremovedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-removed-expected.txt (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-removed-expected.txt        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-removed-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-removed.html:19:29
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> isTypeSupported@http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-removed.html:18:18
</span><del>-bound isTypeSupported@[native code]
</del><ins>+isTypeSupported@[native code]
</ins><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-removed.html:28:36
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> async_test@http://127.0.0.1:8000/w3c/resources/testharness.js:460:26
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmachttptestsmediamediasourceSourceBufferabortupdatingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-updating-expected.txt (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-updating-expected.txt        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/platform/mac/http/tests/media/media-source/SourceBuffer-abort-updating-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-updating.html:33:29
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> isTypeSupported@http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-updating.html:32:18
</span><del>-bound isTypeSupported@[native code]
</del><ins>+isTypeSupported@[native code]
</ins><span class="cx"> http://127.0.0.1:8000/media/media-source/SourceBuffer-abort-updating.html:42:36
</span><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> async_test@http://127.0.0.1:8000/w3c/resources/testharness.js:460:26
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmachttptestsmediamediasourcemediasourcesourcebuffermodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/LayoutTests/platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> assert_throws@http://127.0.0.1:8000/w3c/resources/testharness.js:947:19
</span><span class="cx"> http://127.0.0.1:8000/media/media-source/mediasource-sourcebuffer-mode.html:114:32
</span><span class="cx"> handleWaitCallback_@http://127.0.0.1:8000/media/media-source/mediasource-util.js:97:17
</span><del>-bound @[native code]
</del><ins>+handleWaitCallback_@[native code]
</ins><span class="cx"> step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
</span><span class="cx"> http://127.0.0.1:8000/w3c/resources/testharness.js:1189:33)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -1,3 +1,92 @@
</span><ins>+2016-03-08  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Implement Function.name support for getters/setters and inferring name of function properties.
+        https://bugs.webkit.org/show_bug.cgi?id=154865
+
+        Reviewed by Geoffrey Garen.
+
+        1. toString() no longer uses the value of Function.name as the name of the
+           function in the returned string, because ...
+
+            i. Function.name is supposed to be configurable.  Hence, it can be made
+               writable and can be set to any JSValue, or deleted.
+           ii. Function.prototype.toString() is supposed to produce a string that can be
+               eval'ed.  Hence, for JS functions, the function name in the produced
+               string must be a legal function name (and not some arbitrary value set in
+               Function.name).  For example, while a number is a legal value for
+               Function.name, it is not legal as the function name in the toString()
+               string.
+
+           Instead, we'll always use the original name from the JS source that the
+           function was parsed from.
+
+        2. JSFunction::name() now always return the original name, not the value of
+           the Function.name property.  As a result, it also no longer needs an
+           ExecState* arg.
+
+           If the original name is an empty string, JSFunction::name() will use the
+           inferred name.
+
+        3. For JS functions, the original name can be attained from their
+           FunctionExecutable object.
+
+           For host/native functions (which do not have a FunctionExecutable), we get the
+           &quot;original&quot; name from its NativeExecutable.
+
+        4. The m_hostFunctionStubMap now keys its NativeExecutable pointers using the
+           original name, in addition to the native function and constructor pointers.
+
+           This is needed because we want a different NativeExecutable for functions with
+           a different name (to satisfy (3) above).
+
+        5. Changed JSBoundFunction to store the name of its bound function in its
+           NativeExecutable.  This will later be used to generate the toString() string.
+           It's Function.name value is eagerly initialized at construction time.
+
+        6. Function.name for getters/setters are now prefixed with &quot;get&quot;/&quot;set&quot;.
+           This was done both for the JSBoundSlotBaseFunctions and JS definable get/set
+           functions.
+
+        7. Added InternalFunction::m_originalName so that we can use it to generate the
+           toString() string.  We're storing it as a JSString instead of a WTF::String
+           only because we want InternalFunction to be continue to be trivially
+           destructible.
+
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::functionDetails):
+        * jit/JITThunks.cpp:
+        (JSC::JITThunks::finalize):
+        (JSC::JITThunks::hostFunctionStub):
+        * jit/JITThunks.h:
+        * runtime/Executable.h:
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncToString):
+        * runtime/InternalFunction.cpp:
+        (JSC::InternalFunction::finishCreation):
+        (JSC::InternalFunction::visitChildren):
+        (JSC::InternalFunction::name):
+        (JSC::InternalFunction::displayName):
+        * runtime/InternalFunction.h:
+        * runtime/JSBoundFunction.cpp:
+        (JSC::JSBoundFunction::create):
+        (JSC::JSBoundFunction::visitChildren):
+        (JSC::JSBoundFunction::toStringName): Deleted.
+        * runtime/JSBoundFunction.h:
+        (JSC::JSBoundFunction::boundThis):
+        (JSC::JSBoundFunction::boundArgs):
+        (JSC::JSBoundFunction::createStructure):
+        * runtime/JSBoundSlotBaseFunction.cpp:
+        (JSC::boundSlotBaseFunctionCall):
+        (JSC::JSBoundSlotBaseFunction::create):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::initializeRareData):
+        (JSC::JSFunction::name):
+        (JSC::JSFunction::displayName):
+        (JSC::JSFunction::calculatedDisplayName):
+        (JSC::JSFunction::reifyName):
+        * runtime/JSFunction.h:
+        * tests/es6.yaml:
+
</ins><span class="cx"> 2016-03-08  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r197793 and r197799.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><span class="cx">     result-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;location&quot;), location);
</span><span class="cx"> 
</span><del>-    String name = function-&gt;name(exec);
</del><ins>+    String name = function-&gt;name();
</ins><span class="cx">     if (!name.isEmpty())
</span><span class="cx">         result-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;name&quot;), jsString(exec, name));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITThunkscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITThunks.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITThunks.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/jit/JITThunks.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -79,14 +79,14 @@
</span><span class="cx"> void JITThunks::finalize(Handle&lt;Unknown&gt; handle, void*)
</span><span class="cx"> {
</span><span class="cx">     auto* nativeExecutable = jsCast&lt;NativeExecutable*&gt;(handle.get().asCell());
</span><del>-    weakRemove(*m_hostFunctionStubMap, std::make_pair(nativeExecutable-&gt;function(), nativeExecutable-&gt;constructor()), nativeExecutable);
</del><ins>+    weakRemove(*m_hostFunctionStubMap, std::make_tuple(nativeExecutable-&gt;function(), nativeExecutable-&gt;constructor(), nativeExecutable-&gt;name()), nativeExecutable);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NativeExecutable* JITThunks::hostFunctionStub(VM* vm, NativeFunction function, NativeFunction constructor, const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!isCompilationThread());
</span><span class="cx"> 
</span><del>-    if (NativeExecutable* nativeExecutable = m_hostFunctionStubMap-&gt;get(std::make_pair(function, constructor)))
</del><ins>+    if (NativeExecutable* nativeExecutable = m_hostFunctionStubMap-&gt;get(std::make_tuple(function, constructor, name)))
</ins><span class="cx">         return nativeExecutable;
</span><span class="cx"> 
</span><span class="cx">     NativeExecutable* nativeExecutable = NativeExecutable::create(
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">         function,
</span><span class="cx">         adoptRef(new NativeJITCode(MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct(vm)), JITCode::HostCallThunk)),
</span><span class="cx">         constructor, NoIntrinsic, name);
</span><del>-    weakAdd(*m_hostFunctionStubMap, std::make_pair(function, constructor), Weak&lt;NativeExecutable&gt;(nativeExecutable, this));
</del><ins>+    weakAdd(*m_hostFunctionStubMap, std::make_tuple(function, constructor, name), Weak&lt;NativeExecutable&gt;(nativeExecutable, this));
</ins><span class="cx">     return nativeExecutable;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     ASSERT(!isCompilationThread());    
</span><span class="cx">     ASSERT(vm-&gt;canUseJIT());
</span><span class="cx"> 
</span><del>-    if (NativeExecutable* nativeExecutable = m_hostFunctionStubMap-&gt;get(std::make_pair(function, &amp;callHostFunctionAsConstructor)))
</del><ins>+    if (NativeExecutable* nativeExecutable = m_hostFunctionStubMap-&gt;get(std::make_tuple(function, &amp;callHostFunctionAsConstructor, name)))
</ins><span class="cx">         return nativeExecutable;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;JITCode&gt; forCall;
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     RefPtr&lt;JITCode&gt; forConstruct = adoptRef(new NativeJITCode(MacroAssemblerCodeRef::createSelfManagedCodeRef(ctiNativeConstruct(vm)), JITCode::HostCallThunk));
</span><span class="cx">     
</span><span class="cx">     NativeExecutable* nativeExecutable = NativeExecutable::create(*vm, forCall, function, forConstruct, callHostFunctionAsConstructor, intrinsic, name);
</span><del>-    weakAdd(*m_hostFunctionStubMap, std::make_pair(function, &amp;callHostFunctionAsConstructor), Weak&lt;NativeExecutable&gt;(nativeExecutable, this));
</del><ins>+    weakAdd(*m_hostFunctionStubMap, std::make_tuple(function, &amp;callHostFunctionAsConstructor, name), Weak&lt;NativeExecutable&gt;(nativeExecutable, this));
</ins><span class="cx">     return nativeExecutable;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITThunksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITThunks.h (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITThunks.h        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/jit/JITThunks.h        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;Weak.h&quot;
</span><span class="cx"> #include &quot;WeakHandleOwner.h&quot;
</span><span class="cx"> #include &quot;WeakInlines.h&quot;
</span><ins>+#include &lt;tuple&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadingPrimitives.h&gt;
</span><span class="lines">@@ -67,7 +68,39 @@
</span><span class="cx">     
</span><span class="cx">     typedef HashMap&lt;ThunkGenerator, MacroAssemblerCodeRef&gt; CTIStubMap;
</span><span class="cx">     CTIStubMap m_ctiStubMap;
</span><del>-    typedef HashMap&lt;std::pair&lt;NativeFunction, NativeFunction&gt;, Weak&lt;NativeExecutable&gt;&gt; HostFunctionStubMap;
</del><ins>+
+    typedef std::tuple&lt;NativeFunction, NativeFunction, String&gt; HostFunctionKey;
+
+    struct HostFunctionHash {
+        static unsigned hash(const HostFunctionKey&amp; key)
+        {
+            unsigned hash = WTF::pairIntHash(hashPointer(std::get&lt;0&gt;(key)), hashPointer(std::get&lt;1&gt;(key)));
+            if (!std::get&lt;2&gt;(key).isNull())
+                hash = WTF::pairIntHash(hash, DefaultHash&lt;String&gt;::Hash::hash(std::get&lt;2&gt;(key)));
+            return hash;
+        }
+        static bool equal(const HostFunctionKey&amp; a, const HostFunctionKey&amp; b)
+        {
+            return (std::get&lt;0&gt;(a) == std::get&lt;0&gt;(b)) &amp;&amp; (std::get&lt;1&gt;(a) == std::get&lt;1&gt;(b)) &amp;&amp; (std::get&lt;2&gt;(a) == std::get&lt;2&gt;(b));
+        }
+        static const bool safeToCompareToEmptyOrDeleted = true;
+
+    private:
+        static inline unsigned hashPointer(NativeFunction p)
+        {
+            return DefaultHash&lt;NativeFunction&gt;::Hash::hash(p);
+        }
+    };
+
+    struct HostFunctionHashTrait : WTF::GenericHashTraits&lt;HostFunctionKey&gt; {
+        static const bool emptyValueIsZero = true;
+        static EmptyValueType emptyValue() { return std::make_tuple(nullptr, nullptr, String()); }
+
+        static void constructDeletedValue(HostFunctionKey&amp; slot) { std::get&lt;0&gt;(slot) = reinterpret_cast&lt;NativeFunction&gt;(-1); }
+        static bool isDeletedValue(const HostFunctionKey&amp; value) { return std::get&lt;0&gt;(value) == reinterpret_cast&lt;NativeFunction&gt;(-1); }
+    };
+    
+    typedef HashMap&lt;HostFunctionKey, Weak&lt;NativeExecutable&gt;, HostFunctionHash, HostFunctionHashTrait&gt; HostFunctionStubMap;
</ins><span class="cx">     std::unique_ptr&lt;HostFunctionStubMap&gt; m_hostFunctionStubMap;
</span><span class="cx">     Lock m_lock;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.h (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.h        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/Executable.h        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -663,10 +663,15 @@
</span><span class="cx">     bool isBuiltinFunction() const { return m_unlinkedExecutable-&gt;isBuiltinFunction(); }
</span><span class="cx">     ConstructAbility constructAbility() const { return m_unlinkedExecutable-&gt;constructAbility(); }
</span><span class="cx">     bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }
</span><ins>+    bool isGetter() const { return parseMode() == SourceParseMode::GetterMode; }
+    bool isSetter() const { return parseMode() == SourceParseMode::SetterMode; }
</ins><span class="cx">     DerivedContextType derivedContextType() const { return m_unlinkedExecutable-&gt;derivedContextType(); }
</span><span class="cx">     bool isClassConstructorFunction() const { return m_unlinkedExecutable-&gt;isClassConstructorFunction(); }
</span><span class="cx">     const Identifier&amp; name() { return m_unlinkedExecutable-&gt;name(); }
</span><span class="cx">     const Identifier&amp; inferredName() { return m_unlinkedExecutable-&gt;inferredName(); }
</span><ins>+    // FIXME: ecmaName() needs to be reimplement to be based on ES6 rules of determining the inferred
+    // Function.name from non-computed names. https://bugs.webkit.org/show_bug.cgi?id=155203
+    const Identifier&amp; ecmaName() { return inferredName(); }
</ins><span class="cx">     size_t parameterCount() const { return m_unlinkedExecutable-&gt;parameterCount(); } // Excluding 'this'!
</span><span class="cx">     SourceParseMode parseMode() const { return m_unlinkedExecutable-&gt;parseMode(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeFunctionPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -85,14 +85,8 @@
</span><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     if (thisValue.inherits(JSFunction::info())) {
</span><span class="cx">         JSFunction* function = jsCast&lt;JSFunction*&gt;(thisValue);
</span><del>-        if (function-&gt;isHostOrBuiltinFunction()) {
-            String name;
-            if (JSBoundFunction* boundFunction = jsDynamicCast&lt;JSBoundFunction*&gt;(function))
-                name = boundFunction-&gt;toStringName(exec);
-            else
-                name = function-&gt;name(exec);
-            return JSValue::encode(jsMakeNontrivialString(exec, &quot;function &quot;, name, &quot;() {\n    [native code]\n}&quot;));
-        }
</del><ins>+        if (function-&gt;isHostOrBuiltinFunction())
+            return JSValue::encode(jsMakeNontrivialString(exec, &quot;function &quot;, function-&gt;name(), &quot;() {\n    [native code]\n}&quot;));
</ins><span class="cx"> 
</span><span class="cx">         FunctionExecutable* executable = function-&gt;jsExecutable();
</span><span class="cx">         
</span><span class="lines">@@ -101,7 +95,7 @@
</span><span class="cx">         StringView source = executable-&gt;source().provider()-&gt;getRange(
</span><span class="cx">             executable-&gt;parametersStartOffset(),
</span><span class="cx">             executable-&gt;parametersStartOffset() + executable-&gt;source().length());
</span><del>-        return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function-&gt;name(exec), source));
</del><ins>+        return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function-&gt;name(), source));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (thisValue.inherits(InternalFunction::info())) {
</span><span class="lines">@@ -167,7 +161,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSString* name = target.get(exec, exec-&gt;propertyNames().name).toString(exec);
</del><ins>+    JSValue nameProp = target.get(exec, exec-&gt;propertyNames().name);
+    JSString* name = nameProp.isString() ? nameProp.toString(exec) : jsEmptyString(exec);
</ins><span class="cx">     return JSValue::encode(JSBoundFunction::create(vm, exec, globalObject, targetObject, exec-&gt;argument(0), boundArgs, length, name-&gt;value(exec)));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInternalFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -44,14 +44,27 @@
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     ASSERT(methodTable()-&gt;getCallData != InternalFunction::info()-&gt;methodTable.getCallData);
</span><del>-    putDirect(vm, vm.propertyNames-&gt;name, jsString(&amp;vm, name), DontDelete | ReadOnly | DontEnum);
</del><ins>+    JSString* nameString = jsString(&amp;vm, name);
+    m_originalName.set(vm, this, nameString);
+    putDirect(vm, vm.propertyNames-&gt;name, nameString, ReadOnly | DontEnum);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-const String&amp; InternalFunction::name(ExecState* exec)
</del><ins>+void InternalFunction::visitChildren(JSCell* cell, SlotVisitor&amp; visitor)
</ins><span class="cx"> {
</span><del>-    return asString(getDirect(exec-&gt;vm(), exec-&gt;vm().propertyNames-&gt;name))-&gt;tryGetValue();
</del><ins>+    InternalFunction* thisObject = jsCast&lt;InternalFunction*&gt;(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    
+    visitor.append(&amp;thisObject-&gt;m_originalName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const String&amp; InternalFunction::name(ExecState*)
+{
+    const String&amp; name = m_originalName-&gt;tryGetValue();
+    ASSERT(name); // m_originalName was built from a String, and hence, there is no rope to resolve.
+    return name;
+}
+
</ins><span class="cx"> const String InternalFunction::displayName(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     JSValue displayName = getDirect(exec-&gt;vm(), exec-&gt;vm().propertyNames-&gt;displayName);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInternalFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InternalFunction.h (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InternalFunction.h        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/InternalFunction.h        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -38,6 +38,8 @@
</span><span class="cx"> 
</span><span class="cx">     DECLARE_EXPORT_INFO;
</span><span class="cx"> 
</span><ins>+    JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&amp;);
+
</ins><span class="cx">     JS_EXPORT_PRIVATE const String&amp; name(ExecState*);
</span><span class="cx">     const String displayName(ExecState*);
</span><span class="cx">     const String calculatedDisplayName(ExecState*);
</span><span class="lines">@@ -55,6 +57,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE void finishCreation(VM&amp;, const String&amp; name);
</span><span class="cx"> 
</span><span class="cx">     static CallType getCallData(JSCell*, CallData&amp;);
</span><ins>+    WriteBarrier&lt;JSString&gt; m_originalName;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> InternalFunction* asInternalFunction(JSValue);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSBoundFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">     ConstructData constructData;
</span><span class="cx">     ConstructType constructType = JSC::getConstructData(targetFunction, constructData);
</span><span class="cx">     bool canConstruct = constructType != ConstructType::None;
</span><del>-    NativeExecutable* executable = vm.getHostFunction(boundFunctionCall, canConstruct ? boundFunctionConstruct : callHostFunctionAsConstructor, ASCIILiteral(&quot;Function.prototype.bind result&quot;));
</del><ins>+    NativeExecutable* executable = vm.getHostFunction(boundFunctionCall, canConstruct ? boundFunctionConstruct : callHostFunctionAsConstructor, name);
</ins><span class="cx">     Structure* structure = getBoundFunctionStructure(vm, exec, globalObject, targetFunction);
</span><span class="cx">     if (UNLIKELY(vm.exception()))
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -167,9 +167,4 @@
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_boundArgs);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String JSBoundFunction::toStringName(ExecState* exec)
-{
-    return m_targetFunction-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;name).toWTFString(exec);
-}
-
</del><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSBoundFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     typedef JSFunction Base;
</span><span class="cx">     const static unsigned StructureFlags = ~ImplementsDefaultHasInstance &amp; Base::StructureFlags;
</span><span class="cx"> 
</span><del>-    static JSBoundFunction* create(VM&amp;, ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&amp;);
</del><ins>+    static JSBoundFunction* create(VM&amp;, ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int, const String&amp; name);
</ins><span class="cx">     
</span><span class="cx">     static bool customHasInstance(JSObject*, ExecState*, JSValue);
</span><span class="cx"> 
</span><span class="lines">@@ -48,9 +48,7 @@
</span><span class="cx">     JSValue boundThis() { return m_boundThis.get(); }
</span><span class="cx">     JSValue boundArgs() { return m_boundArgs.get(); }
</span><span class="cx"> 
</span><del>-    String toStringName(ExecState*);
-
-    static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype) 
</del><ins>+    static Structure* createStructure(VM&amp; vm, JSGlobalObject* globalObject, JSValue prototype)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(globalObject);
</span><span class="cx">         return Structure::create(vm, globalObject, prototype, TypeInfo(JSFunctionType, StructureFlags), info()); 
</span><span class="lines">@@ -64,7 +62,7 @@
</span><span class="cx"> private:
</span><span class="cx">     JSBoundFunction(VM&amp;, JSGlobalObject*, Structure*, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs);
</span><span class="cx">     
</span><del>-    void finishCreation(VM&amp;, NativeExecutable*, int, const String&amp;);
</del><ins>+    void finishCreation(VM&amp;, NativeExecutable*, int length, const String&amp; name);
</ins><span class="cx"> 
</span><span class="cx">     WriteBarrier&lt;JSObject&gt; m_targetFunction;
</span><span class="cx">     WriteBarrier&lt;Unknown&gt; m_boundThis;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSBoundSlotBaseFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSBoundSlotBaseFunction.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     if (!getter)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><del>-    const String&amp; name = boundSlotBaseFunction-&gt;name(exec);
</del><ins>+    const String&amp; name = boundSlotBaseFunction-&gt;name();
</ins><span class="cx">     return getter(exec, JSValue::encode(exec-&gt;thisValue()), PropertyName(Identifier::fromString(exec, name)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -67,7 +67,8 @@
</span><span class="cx">     JSBoundSlotBaseFunction* function = new (NotNull, allocateCell&lt;JSBoundSlotBaseFunction&gt;(vm.heap)) JSBoundSlotBaseFunction(vm, globalObject, globalObject-&gt;boundSlotBaseFunctionStructure(), type);
</span><span class="cx"> 
</span><span class="cx">     // Can't do this during initialization because getHostFunction might do a GC allocation.
</span><del>-    function-&gt;finishCreation(vm, executable, boundSlotBase, getterSetter, name);
</del><ins>+    String prefix = (type == Type::Getter) ? &quot;get &quot; : &quot;set &quot;;
+    function-&gt;finishCreation(vm, executable, boundSlotBase, getterSetter, makeString(prefix, name));
</ins><span class="cx">     return function;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -207,6 +207,7 @@
</span><span class="cx">     if (prototype-&gt;attemptToInterceptPutByIndexOnHoleForPrototype(exec, *this, propertyName, value, shouldThrow))
</span><span class="cx">         return;
</span><span class="cx">     
</span><ins>+    if (shouldThrow &amp;&amp; !exec-&gt;hadException())
</ins><span class="cx">     if (shouldThrow)
</span><span class="cx">         throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.cpp (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -177,9 +177,13 @@
</span><span class="cx">     return m_rareData.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String JSFunction::name(ExecState* exec)
</del><ins>+String JSFunction::name()
</ins><span class="cx"> {
</span><del>-    return get(exec, exec-&gt;vm().propertyNames-&gt;name).toWTFString(exec);
</del><ins>+    if (isHostFunction()) {
+        NativeExecutable* executable = jsCast&lt;NativeExecutable*&gt;(this-&gt;executable());
+        return executable-&gt;name();
+    }
+    return jsExecutable()-&gt;name().string();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String JSFunction::displayName(ExecState* exec)
</span><span class="lines">@@ -199,7 +203,7 @@
</span><span class="cx">     if (!explicitName.isEmpty())
</span><span class="cx">         return explicitName;
</span><span class="cx">     
</span><del>-    const String actualName = name(exec);
</del><ins>+    const String actualName = name();
</ins><span class="cx">     if (!actualName.isEmpty() || isHostOrBuiltinFunction())
</span><span class="cx">         return actualName;
</span><span class="cx">     
</span><span class="lines">@@ -589,9 +593,19 @@
</span><span class="cx">     ASSERT(!hasReifiedName());
</span><span class="cx">     ASSERT(!isHostFunction());
</span><span class="cx">     unsigned initialAttributes = DontEnum | ReadOnly;
</span><del>-    const Identifier&amp; identifier = exec-&gt;propertyNames().name;
-    putDirect(vm, identifier, jsString(exec, jsExecutable()-&gt;name().string()), initialAttributes);
</del><ins>+    const Identifier&amp; propID = exec-&gt;propertyNames().name;
</ins><span class="cx"> 
</span><ins>+    const Identifier&amp; nameID = jsExecutable()-&gt;name();
+    String name = nameID.string();
+    if (name.isEmpty())
+        name = jsExecutable()-&gt;ecmaName().string();
+
+    if (jsExecutable()-&gt;isGetter())
+        name = makeString(&quot;get &quot;, name);
+    else if (jsExecutable()-&gt;isSetter())
+        name = makeString(&quot;set &quot;, name);
+
+    putDirect(vm, propID, jsString(exec, name), initialAttributes);
</ins><span class="cx">     rareData-&gt;setHasReifiedName();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.h (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.h        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.h        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE static JSFunction* createBuiltinFunction(VM&amp;, FunctionExecutable*, JSGlobalObject*);
</span><span class="cx">     static JSFunction* createBuiltinFunction(VM&amp;, FunctionExecutable*, JSGlobalObject*, const String&amp; name);
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE String name(ExecState*);
</del><ins>+    JS_EXPORT_PRIVATE String name();
</ins><span class="cx">     JS_EXPORT_PRIVATE String displayName(ExecState*);
</span><span class="cx">     const String calculatedDisplayName(ExecState*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestses6yaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/es6.yaml (197814 => 197815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-08 23:59:18 UTC (rev 197814)
+++ trunk/Source/JavaScriptCore/tests/es6.yaml        2016-03-09 00:01:09 UTC (rev 197815)
</span><span class="lines">@@ -791,7 +791,7 @@
</span><span class="cx"> - path: es6/Function_is_subclassable_Function.prototype.call.js
</span><span class="cx">   cmd: runES6 :normal
</span><span class="cx"> - path: es6/function_name_property_accessor_properties.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/function_name_property_bound_functions.js
</span><span class="cx">   cmd: runES6 :normal
</span><span class="cx"> - path: es6/function_name_property_class_expressions.js
</span><span class="lines">@@ -811,7 +811,7 @@
</span><span class="cx"> - path: es6/function_name_property_variables_class.js
</span><span class="cx">   cmd: runES6 :fail
</span><span class="cx"> - path: es6/function_name_property_variables_function.js
</span><del>-  cmd: runES6 :fail
</del><ins>+  cmd: runES6 :normal
</ins><span class="cx"> - path: es6/generators_%GeneratorPrototype%.constructor.js
</span><span class="cx">   cmd: runES6 :normal
</span><span class="cx"> - path: es6/generators_%GeneratorPrototype%.js
</span></span></pre>
</div>
</div>

</body>
</html>