<!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>[188498] 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/188498">188498</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-14 16:50:25 -0700 (Fri, 14 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>ES6 class syntax should allow computed name method
https://bugs.webkit.org/show_bug.cgi?id=142690
Reviewed by Saam Barati.
Source/JavaScriptCore:
Added a new "attributes" attribute to op_put_getter_by_id, op_put_setter_by_id, op_put_getter_setter to specify
the property descriptor options so that we can use use op_put_setter_by_id and op_put_getter_setter to define
getters and setters for classes. Without this, getters and setters could erroneously override methods.
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDirectPutById):
(JSC::BytecodeGenerator::emitPutGetterById):
(JSC::BytecodeGenerator::emitPutSetterById):
(JSC::BytecodeGenerator::emitPutGetterSetter):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode): Always use emitPutGetterSetter to emit getters and setters for classes
as done for object literals.
(JSC::PropertyListNode::emitPutConstantProperty):
(JSC::ClassExprNode::emitBytecode):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter):
(JSC::JIT::emit_op_del_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter):
(JSC::JIT::emit_op_del_by_id):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::createPropertyList):
* parser/NodeConstructors.h:
(JSC::PropertyNode::PropertyNode):
* parser/Nodes.h:
(JSC::PropertyNode::expressionName):
(JSC::PropertyNode::name):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass): Added the support for computed property name. We don't support computed names
for getters and setters.
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createProperty):
* runtime/JSObject.cpp:
(JSC::JSObject::allowsAccessFrom):
(JSC::JSObject::putGetter):
(JSC::JSObject::putSetter):
* runtime/JSObject.h:
* runtime/PropertyDescriptor.h:
LayoutTests:
Added test cases for computed method names.
* js/class-syntax-method-names-expected.txt:
* js/script-tests/class-syntax-method-names.js:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsclasssyntaxmethodnamesexpectedtxt">trunk/LayoutTests/js/class-syntax-method-names-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsclasssyntaxmethodnamesjs">trunk/LayoutTests/js/script-tests/class-syntax-method-names.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitCCallHelpersh">trunk/Source/JavaScriptCore/jit/CCallHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITh">trunk/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITInlinesh">trunk/Source/JavaScriptCore/jit/JITInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationsh">trunk/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITPropertyAccesscpp">trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITPropertyAccess32_64cpp">trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserASTBuilderh">trunk/Source/JavaScriptCore/parser/ASTBuilder.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodeConstructorsh">trunk/Source/JavaScriptCore/parser/NodeConstructors.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserNodesh">trunk/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParsercpp">trunk/Source/JavaScriptCore/parser/Parser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserSyntaxCheckerh">trunk/Source/JavaScriptCore/parser/SyntaxChecker.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjecth">trunk/Source/JavaScriptCore/runtime/JSObject.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/LayoutTests/ChangeLog        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-08-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ ES6 class syntax should allow computed name method
+ https://bugs.webkit.org/show_bug.cgi?id=142690
+
+ Reviewed by Saam Barati.
+
+ Added test cases for computed method names.
+
+ * js/class-syntax-method-names-expected.txt:
+ * js/script-tests/class-syntax-method-names.js:
+
</ins><span class="cx"> 2015-08-14 Eric Carlson <eric.carlson@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] video-buffered-range-contains-currentTime.html is flakey after r188390
</span></span></pre></div>
<a id="trunkLayoutTestsjsclasssyntaxmethodnamesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/class-syntax-method-names-expected.txt (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/class-syntax-method-names-expected.txt        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/LayoutTests/js/class-syntax-method-names-expected.txt        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -3,6 +3,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><ins>+Instance methods
</ins><span class="cx"> PASS class A { 0.1() { return 1; } }; (new A)[0.1]() is 1
</span><span class="cx"> PASS class A { get() { return 2; } }; (new A).get() is 2
</span><span class="cx"> PASS class A { set() { return 3; } }; (new A).set() is 3
</span><span class="lines">@@ -10,6 +11,8 @@
</span><span class="cx"> PASS class A { get set() { return 5; } }; (new A).set is 5
</span><span class="cx"> PASS setterValue = undefined; class A { set get(x) { setterValue = x; } }; (new A).get = 6; setterValue is 6
</span><span class="cx"> PASS setterValue = undefined; class A { set set(x) { setterValue = x; } }; (new A).set = 7; setterValue is 7
</span><ins>+
+Static methods
</ins><span class="cx"> PASS class A { static 0.1() { return 101; } }; A[0.1]() is 101
</span><span class="cx"> PASS class A { static get() { return 102; } }; A.get() is 102
</span><span class="cx"> PASS class A { static set() { return 103; } }; A.set() is 103
</span><span class="lines">@@ -17,6 +20,66 @@
</span><span class="cx"> PASS class A { static get set() { return 105; } }; A.set is 105
</span><span class="cx"> PASS setterValue = undefined; class A { static set get(x) { setterValue = x; } }; A.get = 106; setterValue is 106
</span><span class="cx"> PASS setterValue = undefined; class A { static set set(x) { setterValue = x; } }; A.set = 107; setterValue is 107
</span><ins>+
+Instance methods with computed names
+PASS class A { ['a' + 'b']() { return 211; } }; (new A).ab() is 211
+PASS class A { ['a' + 0]() { return 212; } }; (new A).a0() is 212
+PASS class A { [0.1]() { return 213; } }; (new A)[0.1]() is 213
+PASS class A { [1]() { return 214; } }; (new A)[1]() is 214
+PASS A = createClassWithInstanceMethod('foo', 215); (new A)['foo']() is 215
+PASS A = createClassWithInstanceMethod('foo', 216); B = createClassWithInstanceMethod('bar', 217); [(new A)['foo'](), (new B)['bar']()] is [216, 217]
+
+Static methods with computed names
+PASS class A { static ['a' + 'b']() { return 311; } }; A.ab() is 311
+PASS class A { static ['a' + 0]() { return 312; } }; A.a0() is 312
+PASS class A { static [0.1]() { return 313; } }; A[0.1]() is 313
+PASS class A { static [1]() { return 314; } }; A[1]() is 314
+PASS A = createClassWithStaticMethod('foo', 315); A['foo']() is 315
+PASS A = createClassWithStaticMethod('foo', 316); B = createClassWithStaticMethod('bar', 317); [A['foo'](), B['bar']()] is [316, 317]
+
+Instance methods with duplicated names
+PASS class A { ab() { return 401 } ab() { return 402; } }; (new A).ab() is 402
+PASS class A { 'a'() { return 403 } 'a'() { return 404; } }; (new A).a() is 404
+PASS class A { 1() { return 405 } 1() { return 406; } }; (new A)[1]() is 406
+PASS class A { 0.1() { return 407 } 0.1() { return 408; } }; (new A)[0.1]() is 408
+PASS class A { ab() { return 409 } ['a' + 'b']() { return 410; } }; (new A).ab() is 410
+PASS class A { ['ab']() { return 411 } ab() { return 412; } }; (new A).ab() is 412
+PASS class A { a() { return 413 } ['a']() { return 414; } a() { return 415; } }; (new A).a() is 415
+PASS class A { ['b']() { return 416 } b() { return 417; } ['b']() { return 418; } }; (new A).b() is 418
+PASS class A { a() { return 419 } get a() { return 420; } }; (new A).a is 420
+PASS class A { get a() { return 421 } a() { return 422 } }; (new A).a() is 422
+PASS setterValue = undefined; class A { a() { return 423 } set a(x) { setterValue = x } }; (new A).a = 424; setterValue is 424
+PASS setterValue = undefined; class A { set a(x) { setterValue = x } a() { return 425 } }; (new A).a() is 425
+PASS setterValue = undefined; class A { get foo() { return 426 } set foo(x) { setterValue = x; } }; a = new A; a.foo = a.foo; setterValue is 426
+PASS class A { get foo() { } foo() { } set foo(x) { } }; valueTypes((new A).__proto__, 'foo') is ['value']
+PASS class A { set foo(x) { } foo() { } get foo() { } }; valueTypes((new A).__proto__, 'foo') is ['value']
+PASS class A { foo() { } get foo() { } set foo(x) { } }; valueTypes((new A).__proto__, 'foo') is ['get', 'set']
+PASS class A { foo() { } set foo(x) { } get foo() { } }; valueTypes((new A).__proto__, 'foo') is ['get', 'set']
+PASS class A { get foo() { } set foo(x) { } foo() { } }; valueTypes((new A).__proto__, 'foo') is ['value']
+PASS class A { set foo(x) { } get foo() { } foo() { } }; valueTypes((new A).__proto__, 'foo') is ['value']
+
+Static methods with duplicated names
+PASS class A { static ab() { return 501 } static ab() { return 502; } }; A.ab() is 502
+PASS class A { static 'a'() { return 503 } static 'a'() { return 504; } }; A.a() is 504
+PASS class A { static 1() { return 505 } static 1() { return 506; } }; A[1]() is 506
+PASS class A { static 0.1() { return 507 } static 0.1() { return 508; } }; A[0.1]() is 508
+PASS class A { static ab() { return 509 } static ['a' + 'b']() { return 510; } }; A.ab() is 510
+PASS class A { static ['ab']() { return 511 } static ab() { return 512; } }; A.ab() is 512
+PASS class A { static a() { return 513 } static ['a']() { return 514; } static a() { return 515; } }; A.a() is 515
+PASS class A { static ['b']() { return 516 } static b() { return 517; } static ['b']() { return 518; } }; A.b() is 518
+PASS class A { static a() { return 519 } static get a() { return 520; } }; A.a is 520
+PASS class A { static get a() { return 521 } static a() { return 522 } }; A.a() is 522
+PASS setterValue = undefined; class A { static a() { return 523 } static set a(x) { setterValue = x } }; A.a = 524; setterValue is 524
+PASS setterValue = undefined; class A { static set a(x) { setterValue = x } static a() { return 525 } }; A.a() is 525
+PASS setterValue = undefined; class A { static get foo() { return 526 } static set foo(x) { setterValue = x; } }; A.foo = A.foo; setterValue is 526
+PASS class A { static get foo() { } static foo() { } static set foo(x) { } }; valueTypes(A, 'foo') is ['value']
+PASS class A { static set foo(x) { } static foo() { } static get foo() { } }; valueTypes(A, 'foo') is ['value']
+PASS class A { static foo() { } static get foo() { } static set foo(x) { } }; valueTypes(A, 'foo') is ['get', 'set']
+PASS class A { static foo() { } static set foo(x) { } static get foo() { } }; valueTypes(A, 'foo') is ['get', 'set']
+PASS class A { static get foo() { } static set foo(x) { } static foo() { } }; valueTypes(A, 'foo') is ['value']
+PASS class A { static set foo(x) { } static get foo() { } static foo() { } }; valueTypes(A, 'foo') is ['value']
+
+Static methods with duplicated names
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsclasssyntaxmethodnamesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/class-syntax-method-names.js (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/class-syntax-method-names.js        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/LayoutTests/js/script-tests/class-syntax-method-names.js        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> description('Tests for various method names');
</span><span class="cx">
</span><ins>+debug('Instance methods');
</ins><span class="cx"> shouldBe("class A { 0.1() { return 1; } }; (new A)[0.1]()", "1");
</span><span class="cx"> shouldBe("class A { get() { return 2; } }; (new A).get()", "2");
</span><span class="cx"> shouldBe("class A { set() { return 3; } }; (new A).set()", "3");
</span><span class="lines">@@ -8,6 +9,8 @@
</span><span class="cx"> shouldBe("setterValue = undefined; class A { set get(x) { setterValue = x; } }; (new A).get = 6; setterValue", "6");
</span><span class="cx"> shouldBe("setterValue = undefined; class A { set set(x) { setterValue = x; } }; (new A).set = 7; setterValue", "7");
</span><span class="cx">
</span><ins>+debug('');
+debug('Static methods');
</ins><span class="cx"> shouldBe("class A { static 0.1() { return 101; } }; A[0.1]()", "101");
</span><span class="cx"> shouldBe("class A { static get() { return 102; } }; A.get()", "102");
</span><span class="cx"> shouldBe("class A { static set() { return 103; } }; A.set()", "103");
</span><span class="lines">@@ -15,3 +18,74 @@
</span><span class="cx"> shouldBe("class A { static get set() { return 105; } }; A.set", "105");
</span><span class="cx"> shouldBe("setterValue = undefined; class A { static set get(x) { setterValue = x; } }; A.get = 106; setterValue", "106");
</span><span class="cx"> shouldBe("setterValue = undefined; class A { static set set(x) { setterValue = x; } }; A.set = 107; setterValue", "107");
</span><ins>+
+debug('');
+debug('Instance methods with computed names');
+shouldBe("class A { ['a' + 'b']() { return 211; } }; (new A).ab()", "211");
+shouldBe("class A { ['a' + 0]() { return 212; } }; (new A).a0()", "212");
+shouldBe("class A { [0.1]() { return 213; } }; (new A)[0.1]()", "213");
+shouldBe("class A { [1]() { return 214; } }; (new A)[1]()", "214");
+function createClassWithInstanceMethod(name, value) { return class { [name]() { return value; } } };
+shouldBe("A = createClassWithInstanceMethod('foo', 215); (new A)['foo']()", "215");
+shouldBe("A = createClassWithInstanceMethod('foo', 216); B = createClassWithInstanceMethod('bar', 217); [(new A)['foo'](), (new B)['bar']()]", "[216, 217]");
+
+debug('');
+debug('Static methods with computed names');
+shouldBe("class A { static ['a' + 'b']() { return 311; } }; A.ab()", "311");
+shouldBe("class A { static ['a' + 0]() { return 312; } }; A.a0()", "312");
+shouldBe("class A { static [0.1]() { return 313; } }; A[0.1]()", "313");
+shouldBe("class A { static [1]() { return 314; } }; A[1]()", "314");
+function createClassWithStaticMethod(name, value) { return class { static [name]() { return value; } } };
+shouldBe("A = createClassWithStaticMethod('foo', 315); A['foo']()", "315");
+shouldBe("A = createClassWithStaticMethod('foo', 316); B = createClassWithStaticMethod('bar', 317); [A['foo'](), B['bar']()]", "[316, 317]");
+
+debug('');
+debug('Instance methods with duplicated names');
+shouldBe("class A { ab() { return 401 } ab() { return 402; } }; (new A).ab()", "402");
+shouldBe("class A { 'a'() { return 403 } 'a'() { return 404; } }; (new A).a()", "404");
+shouldBe("class A { 1() { return 405 } 1() { return 406; } }; (new A)[1]()", "406");
+shouldBe("class A { 0.1() { return 407 } 0.1() { return 408; } }; (new A)[0.1]()", "408");
+shouldBe("class A { ab() { return 409 } ['a' + 'b']() { return 410; } }; (new A).ab()", "410");
+shouldBe("class A { ['ab']() { return 411 } ab() { return 412; } }; (new A).ab()", "412");
+shouldBe("class A { a() { return 413 } ['a']() { return 414; } a() { return 415; } }; (new A).a()", "415");
+shouldBe("class A { ['b']() { return 416 } b() { return 417; } ['b']() { return 418; } }; (new A).b()", "418");
+shouldBe("class A { a() { return 419 } get a() { return 420; } }; (new A).a", "420");
+shouldBe("class A { get a() { return 421 } a() { return 422 } }; (new A).a()", "422");
+shouldBe("setterValue = undefined; class A { a() { return 423 } set a(x) { setterValue = x } }; (new A).a = 424; setterValue", "424");
+shouldBe("setterValue = undefined; class A { set a(x) { setterValue = x } a() { return 425 } }; (new A).a()", "425");
+shouldBe("setterValue = undefined; class A { get foo() { return 426 } set foo(x) { setterValue = x; } }; a = new A; a.foo = a.foo; setterValue", "426");
+function valueTypes(object, proeprtyName) {
+ descriptor = Object.getOwnPropertyDescriptor(object, proeprtyName);
+ return ['value', 'get', 'set'].filter(function (name) { return name in descriptor; });
+}
+shouldBe("class A { get foo() { } foo() { } set foo(x) { } }; valueTypes((new A).__proto__, 'foo')", "['value']");
+shouldBe("class A { set foo(x) { } foo() { } get foo() { } }; valueTypes((new A).__proto__, 'foo')", "['value']");
+shouldBe("class A { foo() { } get foo() { } set foo(x) { } }; valueTypes((new A).__proto__, 'foo')", "['get', 'set']");
+shouldBe("class A { foo() { } set foo(x) { } get foo() { } }; valueTypes((new A).__proto__, 'foo')", "['get', 'set']");
+shouldBe("class A { get foo() { } set foo(x) { } foo() { } }; valueTypes((new A).__proto__, 'foo')", "['value']");
+shouldBe("class A { set foo(x) { } get foo() { } foo() { } }; valueTypes((new A).__proto__, 'foo')", "['value']");
+
+debug('');
+debug('Static methods with duplicated names');
+shouldBe("class A { static ab() { return 501 } static ab() { return 502; } }; A.ab()", "502");
+shouldBe("class A { static 'a'() { return 503 } static 'a'() { return 504; } }; A.a()", "504");
+shouldBe("class A { static 1() { return 505 } static 1() { return 506; } }; A[1]()", "506");
+shouldBe("class A { static 0.1() { return 507 } static 0.1() { return 508; } }; A[0.1]()", "508");
+shouldBe("class A { static ab() { return 509 } static ['a' + 'b']() { return 510; } }; A.ab()", "510");
+shouldBe("class A { static ['ab']() { return 511 } static ab() { return 512; } }; A.ab()", "512");
+shouldBe("class A { static a() { return 513 } static ['a']() { return 514; } static a() { return 515; } }; A.a()", "515");
+shouldBe("class A { static ['b']() { return 516 } static b() { return 517; } static ['b']() { return 518; } }; A.b()", "518");
+shouldBe("class A { static a() { return 519 } static get a() { return 520; } }; A.a", "520");
+shouldBe("class A { static get a() { return 521 } static a() { return 522 } }; A.a()", "522");
+shouldBe("setterValue = undefined; class A { static a() { return 523 } static set a(x) { setterValue = x } }; A.a = 524; setterValue", "524");
+shouldBe("setterValue = undefined; class A { static set a(x) { setterValue = x } static a() { return 525 } }; A.a()", "525");
+shouldBe("setterValue = undefined; class A { static get foo() { return 526 } static set foo(x) { setterValue = x; } }; A.foo = A.foo; setterValue", "526");
+shouldBe("class A { static get foo() { } static foo() { } static set foo(x) { } }; valueTypes(A, 'foo')", "['value']");
+shouldBe("class A { static set foo(x) { } static foo() { } static get foo() { } }; valueTypes(A, 'foo')", "['value']");
+shouldBe("class A { static foo() { } static get foo() { } static set foo(x) { } }; valueTypes(A, 'foo')", "['get', 'set']");
+shouldBe("class A { static foo() { } static set foo(x) { } static get foo() { } }; valueTypes(A, 'foo')", "['get', 'set']");
+shouldBe("class A { static get foo() { } static set foo(x) { } static foo() { } }; valueTypes(A, 'foo')", "['value']");
+shouldBe("class A { static set foo(x) { } static get foo() { } static foo() { } }; valueTypes(A, 'foo')", "['value']");
+
+debug('');
+debug('Static methods with duplicated names');
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2015-08-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ ES6 class syntax should allow computed name method
+ https://bugs.webkit.org/show_bug.cgi?id=142690
+
+ Reviewed by Saam Barati.
+
+ Added a new "attributes" attribute to op_put_getter_by_id, op_put_setter_by_id, op_put_getter_setter to specify
+ the property descriptor options so that we can use use op_put_setter_by_id and op_put_getter_setter to define
+ getters and setters for classes. Without this, getters and setters could erroneously override methods.
+
+ * bytecode/BytecodeList.json:
+ * bytecode/BytecodeUseDef.h:
+ (JSC::computeUsesForBytecodeOffset):
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dumpBytecode):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::emitDirectPutById):
+ (JSC::BytecodeGenerator::emitPutGetterById):
+ (JSC::BytecodeGenerator::emitPutSetterById):
+ (JSC::BytecodeGenerator::emitPutGetterSetter):
+ * bytecompiler/BytecodeGenerator.h:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::PropertyListNode::emitBytecode): Always use emitPutGetterSetter to emit getters and setters for classes
+ as done for object literals.
+ (JSC::PropertyListNode::emitPutConstantProperty):
+ (JSC::ClassExprNode::emitBytecode):
+ * jit/CCallHelpers.h:
+ (JSC::CCallHelpers::setupArgumentsWithExecState):
+ * jit/JIT.h:
+ * jit/JITInlines.h:
+ (JSC::JIT::callOperation):
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * jit/JITPropertyAccess.cpp:
+ (JSC::JIT::emit_op_put_getter_by_id):
+ (JSC::JIT::emit_op_put_setter_by_id):
+ (JSC::JIT::emit_op_put_getter_setter):
+ (JSC::JIT::emit_op_del_by_id):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_put_getter_by_id):
+ (JSC::JIT::emit_op_put_setter_by_id):
+ (JSC::JIT::emit_op_put_getter_setter):
+ (JSC::JIT::emit_op_del_by_id):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LowLevelInterpreter.asm:
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::createProperty):
+ (JSC::ASTBuilder::createPropertyList):
+ * parser/NodeConstructors.h:
+ (JSC::PropertyNode::PropertyNode):
+ * parser/Nodes.h:
+ (JSC::PropertyNode::expressionName):
+ (JSC::PropertyNode::name):
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseClass): Added the support for computed property name. We don't support computed names
+ for getters and setters.
+ * parser/SyntaxChecker.h:
+ (JSC::SyntaxChecker::createProperty):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::allowsAccessFrom):
+ (JSC::JSObject::putGetter):
+ (JSC::JSObject::putSetter):
+ * runtime/JSObject.h:
+ * runtime/PropertyDescriptor.h:
+
</ins><span class="cx"> 2015-08-13 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> Add InspectorInstrumentation builtin object to instrument the code in JS builtins like Promises
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -71,9 +71,9 @@
</span><span class="cx"> { "name" : "op_put_by_val_direct", "length" : 5 },
</span><span class="cx"> { "name" : "op_del_by_val", "length" : 4 },
</span><span class="cx"> { "name" : "op_put_by_index", "length" : 4 },
</span><del>- { "name" : "op_put_getter_by_id", "length" : 4 },
- { "name" : "op_put_setter_by_id", "length" : 4 },
- { "name" : "op_put_getter_setter", "length" : 5 },
</del><ins>+ { "name" : "op_put_getter_by_id", "length" : 5 },
+ { "name" : "op_put_setter_by_id", "length" : 5 },
+ { "name" : "op_put_getter_setter", "length" : 6 },
</ins><span class="cx"> { "name" : "op_jmp", "length" : 2 },
</span><span class="cx"> { "name" : "op_jtrue", "length" : 3 },
</span><span class="cx"> { "name" : "op_jfalse", "length" : 3 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -98,18 +98,22 @@
</span><span class="cx"> case op_put_by_id_transition_normal_out_of_line:
</span><span class="cx"> case op_put_by_id_out_of_line:
</span><span class="cx"> case op_put_by_id:
</span><del>- case op_put_getter_by_id:
- case op_put_setter_by_id:
</del><span class="cx"> case op_put_to_scope:
</span><span class="cx"> case op_put_to_arguments: {
</span><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[3].u.operand);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+ case op_put_getter_by_id:
+ case op_put_setter_by_id: {
+ functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
+ functor(codeBlock, instruction, opcodeID, instruction[4].u.operand);
+ return;
+ }
</ins><span class="cx"> case op_put_getter_setter: {
</span><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
</span><del>- functor(codeBlock, instruction, opcodeID, instruction[3].u.operand);
</del><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[4].u.operand);
</span><ins>+ functor(codeBlock, instruction, opcodeID, instruction[5].u.operand);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> case op_get_property_enumerator:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1082,26 +1082,29 @@
</span><span class="cx"> case op_put_getter_by_id: {
</span><span class="cx"> int r0 = (++it)->u.operand;
</span><span class="cx"> int id0 = (++it)->u.operand;
</span><ins>+ int n0 = (++it)->u.operand;
</ins><span class="cx"> int r1 = (++it)->u.operand;
</span><span class="cx"> printLocationAndOp(out, exec, location, it, "put_getter_by_id");
</span><del>- out.printf("%s, %s, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), registerName(r1).data());
</del><ins>+ out.printf("%s, %s, %d, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), n0, registerName(r1).data());
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case op_put_setter_by_id: {
</span><span class="cx"> int r0 = (++it)->u.operand;
</span><span class="cx"> int id0 = (++it)->u.operand;
</span><ins>+ int n0 = (++it)->u.operand;
</ins><span class="cx"> int r1 = (++it)->u.operand;
</span><span class="cx"> printLocationAndOp(out, exec, location, it, "put_setter_by_id");
</span><del>- out.printf("%s, %s, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), registerName(r1).data());
</del><ins>+ out.printf("%s, %s, %d, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), n0, registerName(r1).data());
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case op_put_getter_setter: {
</span><span class="cx"> int r0 = (++it)->u.operand;
</span><span class="cx"> int id0 = (++it)->u.operand;
</span><ins>+ int n0 = (++it)->u.operand;
</ins><span class="cx"> int r1 = (++it)->u.operand;
</span><span class="cx"> int r2 = (++it)->u.operand;
</span><span class="cx"> printLocationAndOp(out, exec, location, it, "put_getter_setter");
</span><del>- out.printf("%s, %s, %s, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), registerName(r1).data(), registerName(r2).data());
</del><ins>+ out.printf("%s, %s, %d, %s, %s", registerName(r0).data(), idName(id0, identifier(id0)).data(), n0, registerName(r1).data(), registerName(r2).data());
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case op_del_by_id: {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1948,7 +1948,7 @@
</span><span class="cx"> return value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BytecodeGenerator::emitPutGetterById(RegisterID* base, const Identifier& property, RegisterID* getter)
</del><ins>+void BytecodeGenerator::emitPutGetterById(RegisterID* base, const Identifier& property, unsigned attributes, RegisterID* getter)
</ins><span class="cx"> {
</span><span class="cx"> unsigned propertyIndex = addConstant(property);
</span><span class="cx"> m_staticPropertyAnalyzer.putById(base->index(), propertyIndex);
</span><span class="lines">@@ -1956,10 +1956,11 @@
</span><span class="cx"> emitOpcode(op_put_getter_by_id);
</span><span class="cx"> instructions().append(base->index());
</span><span class="cx"> instructions().append(propertyIndex);
</span><ins>+ instructions().append(attributes);
</ins><span class="cx"> instructions().append(getter->index());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BytecodeGenerator::emitPutSetterById(RegisterID* base, const Identifier& property, RegisterID* setter)
</del><ins>+void BytecodeGenerator::emitPutSetterById(RegisterID* base, const Identifier& property, unsigned attributes, RegisterID* setter)
</ins><span class="cx"> {
</span><span class="cx"> unsigned propertyIndex = addConstant(property);
</span><span class="cx"> m_staticPropertyAnalyzer.putById(base->index(), propertyIndex);
</span><span class="lines">@@ -1967,10 +1968,11 @@
</span><span class="cx"> emitOpcode(op_put_setter_by_id);
</span><span class="cx"> instructions().append(base->index());
</span><span class="cx"> instructions().append(propertyIndex);
</span><ins>+ instructions().append(attributes);
</ins><span class="cx"> instructions().append(setter->index());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BytecodeGenerator::emitPutGetterSetter(RegisterID* base, const Identifier& property, RegisterID* getter, RegisterID* setter)
</del><ins>+void BytecodeGenerator::emitPutGetterSetter(RegisterID* base, const Identifier& property, unsigned attributes, RegisterID* getter, RegisterID* setter)
</ins><span class="cx"> {
</span><span class="cx"> unsigned propertyIndex = addConstant(property);
</span><span class="cx">
</span><span class="lines">@@ -1979,6 +1981,7 @@
</span><span class="cx"> emitOpcode(op_put_getter_setter);
</span><span class="cx"> instructions().append(base->index());
</span><span class="cx"> instructions().append(propertyIndex);
</span><ins>+ instructions().append(attributes);
</ins><span class="cx"> instructions().append(getter->index());
</span><span class="cx"> instructions().append(setter->index());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -508,9 +508,9 @@
</span><span class="cx"> RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterID* property);
</span><span class="cx"> RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID* value);
</span><span class="cx">
</span><del>- void emitPutGetterById(RegisterID* base, const Identifier& property, RegisterID* getter);
- void emitPutSetterById(RegisterID* base, const Identifier& property, RegisterID* setter);
- void emitPutGetterSetter(RegisterID* base, const Identifier& property, RegisterID* getter, RegisterID* setter);
</del><ins>+ void emitPutGetterById(RegisterID* base, const Identifier& property, unsigned propertyDescriptorOptions, RegisterID* getter);
+ void emitPutSetterById(RegisterID* base, const Identifier& property, unsigned propertyDescriptorOptions, RegisterID* setter);
+ void emitPutGetterSetter(RegisterID* base, const Identifier& property, unsigned attributes, RegisterID* getter, RegisterID* setter);
</ins><span class="cx">
</span><span class="cx"> ExpectedFunction expectedFunctionForIdentifier(const Identifier&);
</span><span class="cx"> RegisterID* emitCall(RegisterID* dst, RegisterID* func, ExpectedFunction, CallArguments&, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -497,9 +497,9 @@
</span><span class="cx"> // This is a get/set property which may be overridden by a computed property later.
</span><span class="cx"> if (hasComputedProperty) {
</span><span class="cx"> if (node->m_type & PropertyNode::Getter)
</span><del>- generator.emitPutGetterById(dst, *node->name(), value);
</del><ins>+ generator.emitPutGetterById(dst, *node->name(), Accessor, value);
</ins><span class="cx"> else
</span><del>- generator.emitPutSetterById(dst, *node->name(), value);
</del><ins>+ generator.emitPutSetterById(dst, *node->name(), Accessor, value);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -544,12 +544,7 @@
</span><span class="cx"> if (isClassProperty && pair.second)
</span><span class="cx"> emitPutHomeObject(generator, secondReg, dst);
</span><span class="cx">
</span><del>- if (isClassProperty) {
- RefPtr<RegisterID> propertyNameRegister = generator.emitLoad(generator.newTemporary(), *node->name());
- generator.emitCallDefineProperty(dst, propertyNameRegister.get(),
- nullptr, getterReg.get(), setterReg.get(), BytecodeGenerator::PropertyConfigurable, m_position);
- } else
- generator.emitPutGetterSetter(dst, *node->name(), getterReg.get(), setterReg.get());
</del><ins>+ generator.emitPutGetterSetter(dst, *node->name(), isClassProperty ? (Accessor | DontEnum) : Accessor, getterReg.get(), setterReg.get());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitCCallHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/CCallHelpers.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/CCallHelpers.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/CCallHelpers.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -302,13 +302,14 @@
</span><span class="cx"> addCallArgument(arg3);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, GPRReg arg3)
</del><ins>+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, GPRReg arg3, TrustedImm32 arg4)
</ins><span class="cx"> {
</span><span class="cx"> resetCallArguments();
</span><span class="cx"> addCallArgument(GPRInfo::callFrameRegister);
</span><span class="cx"> addCallArgument(arg1);
</span><span class="cx"> addCallArgument(arg2);
</span><span class="cx"> addCallArgument(arg3);
</span><ins>+ addCallArgument(arg4);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImm32 arg2, TrustedImmPtr arg3)
</span><span class="lines">@@ -1918,6 +1919,14 @@
</span><span class="cx"> move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, TrustedImm32 arg3, GPRReg arg4, GPRReg arg5)
+ {
+ setupThreeStubArgsGPR<GPRInfo::argumentGPR1, GPRInfo::argumentGPR4, GPRInfo::argumentGPR5>(arg1, arg4, arg5);
+ move(arg2, GPRInfo::argumentGPR2);
+ move(arg3, GPRInfo::argumentGPR3);
+ move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
+ }
+
</ins><span class="cx"> ALWAYS_INLINE void setupArgumentsWithExecState(GPRReg arg1, TrustedImmPtr arg2, GPRReg arg3, GPRReg arg4)
</span><span class="cx"> {
</span><span class="cx"> setupStubArguments134(arg1, arg3, arg4);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JIT.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -744,8 +744,8 @@
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_E);
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_EC, RegisterID);
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_ECC, RegisterID, RegisterID);
</span><del>- MacroAssembler::Call callOperation(V_JITOperation_ECIC, RegisterID, const Identifier*, RegisterID);
- MacroAssembler::Call callOperation(V_JITOperation_ECICC, RegisterID, const Identifier*, RegisterID, RegisterID);
</del><ins>+ MacroAssembler::Call callOperation(V_JITOperation_ECIZC, RegisterID, const Identifier*, int32_t, RegisterID);
+ MacroAssembler::Call callOperation(V_JITOperation_ECIZCC, RegisterID, const Identifier*, int32_t, RegisterID, RegisterID);
</ins><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EE, RegisterID);
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_EZSymtabJ, int, SymbolTable*, RegisterID);
</span><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EZSymtabJ, int, SymbolTable*, RegisterID);
</span><span class="lines">@@ -755,8 +755,8 @@
</span><span class="cx"> #else
</span><span class="cx"> MacroAssembler::Call callOperationNoExceptionCheck(V_JITOperation_EJ, RegisterID, RegisterID);
</span><span class="cx"> #endif
</span><del>- MacroAssembler::Call callOperation(V_JITOperation_EJIdJ, RegisterID, const Identifier*, RegisterID);
- MacroAssembler::Call callOperation(V_JITOperation_EJIdJJ, RegisterID, const Identifier*, RegisterID, RegisterID);
</del><ins>+ MacroAssembler::Call callOperation(V_JITOperation_EJIdZJ, RegisterID, const Identifier*, int32_t, RegisterID);
+ MacroAssembler::Call callOperation(V_JITOperation_EJIdZJJ, RegisterID, const Identifier*, int32_t, RegisterID, RegisterID);
</ins><span class="cx"> #if USE(JSVALUE64)
</span><span class="cx"> MacroAssembler::Call callOperation(F_JITOperation_EFJZZ, RegisterID, RegisterID, int32_t, RegisterID);
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, UniquedStringImpl*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITInlines.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITInlines.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JITInlines.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -514,15 +514,15 @@
</span><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJIdJ operation, RegisterID regOp1, const Identifier* identOp2, RegisterID regOp3)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJIdZJ operation, RegisterID regOp1, const Identifier* identOp2, int32_t op3, RegisterID regOp4)
</ins><span class="cx"> {
</span><del>- setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), regOp3);
</del><ins>+ setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4);
</ins><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJIdJJ operation, RegisterID regOp1, const Identifier* identOp2, RegisterID regOp3, RegisterID regOp4)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_EJIdZJJ operation, RegisterID regOp1, const Identifier* identOp2, int32_t op3, RegisterID regOp4, RegisterID regOp5)
</ins><span class="cx"> {
</span><del>- setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), regOp3, regOp4);
</del><ins>+ setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4, regOp5);
</ins><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -642,15 +642,15 @@
</span><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ECIC operation, RegisterID regOp1, const Identifier* identOp2, RegisterID regOp3)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ECIZC operation, RegisterID regOp1, const Identifier* identOp2, int32_t op3, RegisterID regOp4)
</ins><span class="cx"> {
</span><del>- setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), regOp3);
</del><ins>+ setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4);
</ins><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ECICC operation, RegisterID regOp1, const Identifier* identOp2, RegisterID regOp3, RegisterID regOp4)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ECIZCC operation, RegisterID regOp1, const Identifier* identOp2, int32_t op3, RegisterID regOp4, RegisterID regOp5)
</ins><span class="cx"> {
</span><del>- setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), regOp3, regOp4);
</del><ins>+ setupArgumentsWithExecState(regOp1, TrustedImmPtr(identOp2), TrustedImm32(op3), regOp4, regOp5);
</ins><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1245,7 +1245,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(JSVALUE64)
</span><del>-void JIT_OPERATION operationPutGetterById(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, EncodedJSValue encodedGetterValue)
</del><ins>+void JIT_OPERATION operationPutGetterById(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, int32_t options, EncodedJSValue encodedGetterValue)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1255,10 +1255,10 @@
</span><span class="cx">
</span><span class="cx"> JSValue getter = JSValue::decode(encodedGetterValue);
</span><span class="cx"> ASSERT(getter.isObject());
</span><del>- baseObj->putGetter(exec, *identifier, asObject(getter));
</del><ins>+ baseObj->putGetter(exec, *identifier, asObject(getter), options);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void JIT_OPERATION operationPutSetterById(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, EncodedJSValue encodedSetterValue)
</del><ins>+void JIT_OPERATION operationPutSetterById(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, int32_t options, EncodedJSValue encodedSetterValue)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1268,10 +1268,11 @@
</span><span class="cx">
</span><span class="cx"> JSValue setter = JSValue::decode(encodedSetterValue);
</span><span class="cx"> ASSERT(setter.isObject());
</span><del>- baseObj->putSetter(exec, *identifier, asObject(setter));
</del><ins>+ baseObj->putSetter(exec, *identifier, asObject(setter), options);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void JIT_OPERATION operationPutGetterSetter(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, EncodedJSValue encodedGetterValue, EncodedJSValue encodedSetterValue)
</del><ins>+void JIT_OPERATION operationPutGetterSetter(ExecState* exec, EncodedJSValue encodedObjectValue, Identifier* identifier, int32_t attribute,
+ EncodedJSValue encodedGetterValue, EncodedJSValue encodedSetterValue)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1291,10 +1292,10 @@
</span><span class="cx"> accessor->setGetter(vm, exec->lexicalGlobalObject(), asObject(getter));
</span><span class="cx"> if (!setter.isUndefined())
</span><span class="cx"> accessor->setSetter(vm, exec->lexicalGlobalObject(), asObject(setter));
</span><del>- baseObj->putDirectAccessor(exec, *identifier, accessor, Accessor);
</del><ins>+ baseObj->putDirectAccessor(exec, *identifier, accessor, attribute);
</ins><span class="cx"> }
</span><span class="cx"> #else
</span><del>-void JIT_OPERATION operationPutGetterById(ExecState* exec, JSCell* object, Identifier* identifier, JSCell* getter)
</del><ins>+void JIT_OPERATION operationPutGetterById(ExecState* exec, JSCell* object, Identifier* identifier, int32_t options, JSCell* getter)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1303,10 +1304,10 @@
</span><span class="cx"> JSObject* baseObj = object->getObject();
</span><span class="cx">
</span><span class="cx"> ASSERT(getter->isObject());
</span><del>- baseObj->putGetter(exec, *identifier, getter);
</del><ins>+ baseObj->putGetter(exec, *identifier, getter, options);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void JIT_OPERATION operationPutSetterById(ExecState* exec, JSCell* object, Identifier* identifier, JSCell* setter)
</del><ins>+void JIT_OPERATION operationPutSetterById(ExecState* exec, JSCell* object, Identifier* identifier, int32_t options, JSCell* setter)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1315,10 +1316,10 @@
</span><span class="cx"> JSObject* baseObj = object->getObject();
</span><span class="cx">
</span><span class="cx"> ASSERT(setter->isObject());
</span><del>- baseObj->putSetter(exec, *identifier, setter);
</del><ins>+ baseObj->putSetter(exec, *identifier, setter, options);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void JIT_OPERATION operationPutGetterSetter(ExecState* exec, JSCell* object, Identifier* identifier, JSCell* getter, JSCell* setter)
</del><ins>+void JIT_OPERATION operationPutGetterSetter(ExecState* exec, JSCell* object, Identifier* identifier, int32_t attribute, JSCell* getter, JSCell* setter)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="lines">@@ -1336,7 +1337,7 @@
</span><span class="cx"> accessor->setGetter(vm, exec->lexicalGlobalObject(), getter->getObject());
</span><span class="cx"> if (setter)
</span><span class="cx"> accessor->setSetter(vm, exec->lexicalGlobalObject(), setter->getObject());
</span><del>- baseObj->putDirectAccessor(exec, *identifier, accessor, Accessor);
</del><ins>+ baseObj->putDirectAccessor(exec, *identifier, accessor, attribute);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -183,8 +183,8 @@
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECb)(ExecState*, CodeBlock*);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECC)(ExecState*, JSCell*, JSCell*);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECIcf)(ExecState*, JSCell*, InlineCallFrame*);
</span><del>-typedef void JIT_OPERATION (*V_JITOperation_ECIC)(ExecState*, JSCell*, Identifier*, JSCell*);
-typedef void JIT_OPERATION (*V_JITOperation_ECICC)(ExecState*, JSCell*, Identifier*, JSCell*, JSCell*);
</del><ins>+typedef void JIT_OPERATION (*V_JITOperation_ECIZC)(ExecState*, JSCell*, Identifier*, int32_t, JSCell*);
+typedef void JIT_OPERATION (*V_JITOperation_ECIZCC)(ExecState*, JSCell*, Identifier*, int32_t, JSCell*, JSCell*);
</ins><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECCIcf)(ExecState*, JSCell*, JSCell*, InlineCallFrame*);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECJJ)(ExecState*, JSCell*, EncodedJSValue, EncodedJSValue);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_ECPSPS)(ExecState*, JSCell*, void*, size_t, void*, size_t);
</span><span class="lines">@@ -193,8 +193,8 @@
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EZSymtabJ)(ExecState*, int32_t, SymbolTable*, EncodedJSValue);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJ)(ExecState*, EncodedJSValue);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJCI)(ExecState*, EncodedJSValue, JSCell*, UniquedStringImpl*);
</span><del>-typedef void JIT_OPERATION (*V_JITOperation_EJIdJ)(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue);
-typedef void JIT_OPERATION (*V_JITOperation_EJIdJJ)(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue, EncodedJSValue);
</del><ins>+typedef void JIT_OPERATION (*V_JITOperation_EJIdZJ)(ExecState*, EncodedJSValue, Identifier*, int32_t, EncodedJSValue);
+typedef void JIT_OPERATION (*V_JITOperation_EJIdZJJ)(ExecState*, EncodedJSValue, Identifier*, int32_t, EncodedJSValue, EncodedJSValue);
</ins><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJJJ)(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJJJAp)(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue, ArrayProfile*);
</span><span class="cx"> typedef void JIT_OPERATION (*V_JITOperation_EJJJBy)(ExecState*, EncodedJSValue, EncodedJSValue, EncodedJSValue, ByValInfo*);
</span><span class="lines">@@ -299,13 +299,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> void JIT_OPERATION operationPutByIndex(ExecState*, EncodedJSValue, int32_t, EncodedJSValue);
</span><span class="cx"> #if USE(JSVALUE64)
</span><del>-void JIT_OPERATION operationPutGetterById(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue) WTF_INTERNAL;
-void JIT_OPERATION operationPutSetterById(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue) WTF_INTERNAL;
-void JIT_OPERATION operationPutGetterSetter(ExecState*, EncodedJSValue, Identifier*, EncodedJSValue, EncodedJSValue) WTF_INTERNAL;
</del><ins>+void JIT_OPERATION operationPutGetterById(ExecState*, EncodedJSValue, Identifier*, int32_t options, EncodedJSValue) WTF_INTERNAL;
+void JIT_OPERATION operationPutSetterById(ExecState*, EncodedJSValue, Identifier*, int32_t options, EncodedJSValue) WTF_INTERNAL;
+void JIT_OPERATION operationPutGetterSetter(ExecState*, EncodedJSValue, Identifier*, int32_t attribute, EncodedJSValue, EncodedJSValue) WTF_INTERNAL;
</ins><span class="cx"> #else
</span><del>-void JIT_OPERATION operationPutGetterById(ExecState*, JSCell*, Identifier*, JSCell*) WTF_INTERNAL;
-void JIT_OPERATION operationPutSetterById(ExecState*, JSCell*, Identifier*, JSCell*) WTF_INTERNAL;
-void JIT_OPERATION operationPutGetterSetter(ExecState*, JSCell*, Identifier*, JSCell*, JSCell*) WTF_INTERNAL;
</del><ins>+void JIT_OPERATION operationPutGetterById(ExecState*, JSCell*, Identifier*, int32_t options, JSCell*) WTF_INTERNAL;
+void JIT_OPERATION operationPutSetterById(ExecState*, JSCell*, Identifier*, int32_t options, JSCell*) WTF_INTERNAL;
+void JIT_OPERATION operationPutGetterSetter(ExecState*, JSCell*, Identifier*, int32_t attribute, JSCell*, JSCell*) WTF_INTERNAL;
</ins><span class="cx"> #endif
</span><span class="cx"> void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationPopScope(ExecState*, int32_t) WTF_INTERNAL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITPropertyAccesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -483,23 +483,26 @@
</span><span class="cx"> void JIT::emit_op_put_getter_by_id(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx"> emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
</span><del>- emitGetVirtualRegister(currentInstruction[3].u.operand, regT1);
- callOperation(operationPutGetterById, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), regT1);
</del><ins>+ int32_t options = currentInstruction[3].u.operand;
+ emitGetVirtualRegister(currentInstruction[4].u.operand, regT1);
+ callOperation(operationPutGetterById, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), options, regT1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_put_setter_by_id(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx"> emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
</span><del>- emitGetVirtualRegister(currentInstruction[3].u.operand, regT1);
- callOperation(operationPutSetterById, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), regT1);
</del><ins>+ int32_t options = currentInstruction[3].u.operand;
+ emitGetVirtualRegister(currentInstruction[4].u.operand, regT1);
+ callOperation(operationPutSetterById, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), options, regT1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_put_getter_setter(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx"> emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
</span><del>- emitGetVirtualRegister(currentInstruction[3].u.operand, regT1);
- emitGetVirtualRegister(currentInstruction[4].u.operand, regT2);
- callOperation(operationPutGetterSetter, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), regT1, regT2);
</del><ins>+ int32_t attribute = currentInstruction[3].u.operand;
+ emitGetVirtualRegister(currentInstruction[4].u.operand, regT1);
+ emitGetVirtualRegister(currentInstruction[5].u.operand, regT2);
+ callOperation(operationPutGetterSetter, regT0, &m_codeBlock->identifier(currentInstruction[2].u.operand), attribute, regT1, regT2);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_del_by_id(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITPropertyAccess32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -61,35 +61,38 @@
</span><span class="cx"> {
</span><span class="cx"> int base = currentInstruction[1].u.operand;
</span><span class="cx"> int property = currentInstruction[2].u.operand;
</span><del>- int getter = currentInstruction[3].u.operand;
</del><ins>+ int options = currentInstruction[3].u.operand;
+ int getter = currentInstruction[4].u.operand;
</ins><span class="cx">
</span><span class="cx"> emitLoadPayload(base, regT1);
</span><span class="cx"> emitLoadPayload(getter, regT3);
</span><del>- callOperation(operationPutGetterById, regT1, &m_codeBlock->identifier(property), regT3);
</del><ins>+ callOperation(operationPutGetterById, regT1, &m_codeBlock->identifier(property), options, regT3);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_put_setter_by_id(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx"> int base = currentInstruction[1].u.operand;
</span><span class="cx"> int property = currentInstruction[2].u.operand;
</span><del>- int setter = currentInstruction[3].u.operand;
</del><ins>+ unsigned options = currentInstruction[3].u.operand;
+ int setter = currentInstruction[4].u.operand;
</ins><span class="cx">
</span><span class="cx"> emitLoadPayload(base, regT1);
</span><span class="cx"> emitLoadPayload(setter, regT3);
</span><del>- callOperation(operationPutSetterById, regT1, &m_codeBlock->identifier(property), regT3);
</del><ins>+ callOperation(operationPutSetterById, regT1, &m_codeBlock->identifier(property), options, regT3);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_put_getter_setter(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx"> int base = currentInstruction[1].u.operand;
</span><span class="cx"> int property = currentInstruction[2].u.operand;
</span><del>- int getter = currentInstruction[3].u.operand;
- int setter = currentInstruction[4].u.operand;
</del><ins>+ unsigned attribute = currentInstruction[3].u.operand;
+ int getter = currentInstruction[4].u.operand;
+ int setter = currentInstruction[5].u.operand;
</ins><span class="cx">
</span><span class="cx"> emitLoadPayload(base, regT1);
</span><span class="cx"> emitLoadPayload(getter, regT3);
</span><span class="cx"> emitLoadPayload(setter, regT4);
</span><del>- callOperation(operationPutGetterSetter, regT1, &m_codeBlock->identifier(property), regT3, regT4);
</del><ins>+ callOperation(operationPutGetterSetter, regT1, &m_codeBlock->identifier(property), attribute, regT3, regT4);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_del_by_id(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -847,11 +847,13 @@
</span><span class="cx"> LLINT_BEGIN();
</span><span class="cx"> ASSERT(LLINT_OP(1).jsValue().isObject());
</span><span class="cx"> JSObject* baseObj = asObject(LLINT_OP(1).jsValue());
</span><del>-
- JSValue getter = LLINT_OP(3).jsValue();
</del><ins>+
+ unsigned options = pc[3].u.operand;
+
+ JSValue getter = LLINT_OP(4).jsValue();
</ins><span class="cx"> ASSERT(getter.isObject());
</span><del>-
- baseObj->putGetter(exec, exec->codeBlock()->identifier(pc[2].u.operand), asObject(getter));
</del><ins>+
+ baseObj->putGetter(exec, exec->codeBlock()->identifier(pc[2].u.operand), asObject(getter), options);
</ins><span class="cx"> LLINT_END();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -860,11 +862,13 @@
</span><span class="cx"> LLINT_BEGIN();
</span><span class="cx"> ASSERT(LLINT_OP(1).jsValue().isObject());
</span><span class="cx"> JSObject* baseObj = asObject(LLINT_OP(1).jsValue());
</span><del>-
- JSValue setter = LLINT_OP(3).jsValue();
</del><ins>+
+ unsigned options = pc[3].u.operand;
+
+ JSValue setter = LLINT_OP(4).jsValue();
</ins><span class="cx"> ASSERT(setter.isObject());
</span><del>-
- baseObj->putSetter(exec, exec->codeBlock()->identifier(pc[2].u.operand), asObject(setter));
</del><ins>+
+ baseObj->putSetter(exec, exec->codeBlock()->identifier(pc[2].u.operand), asObject(setter), options);
</ins><span class="cx"> LLINT_END();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -876,9 +880,9 @@
</span><span class="cx">
</span><span class="cx"> GetterSetter* accessor = GetterSetter::create(vm, exec->lexicalGlobalObject());
</span><span class="cx"> LLINT_CHECK_EXCEPTION();
</span><del>-
- JSValue getter = LLINT_OP(3).jsValue();
- JSValue setter = LLINT_OP(4).jsValue();
</del><ins>+
+ JSValue getter = LLINT_OP(4).jsValue();
+ JSValue setter = LLINT_OP(5).jsValue();
</ins><span class="cx"> ASSERT(getter.isObject() || getter.isUndefined());
</span><span class="cx"> ASSERT(setter.isObject() || setter.isUndefined());
</span><span class="cx"> ASSERT(getter.isObject() || setter.isObject());
</span><span class="lines">@@ -890,7 +894,7 @@
</span><span class="cx"> baseObj->putDirectAccessor(
</span><span class="cx"> exec,
</span><span class="cx"> exec->codeBlock()->identifier(pc[2].u.operand),
</span><del>- accessor, Accessor);
</del><ins>+ accessor, pc[3].u.operand);
</ins><span class="cx"> LLINT_END();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1062,19 +1062,19 @@
</span><span class="cx"> _llint_op_put_getter_by_id:
</span><span class="cx"> traceExecution()
</span><span class="cx"> callSlowPath(_llint_slow_path_put_getter_by_id)
</span><del>- dispatch(4)
</del><ins>+ dispatch(5)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> _llint_op_put_setter_by_id:
</span><span class="cx"> traceExecution()
</span><span class="cx"> callSlowPath(_llint_slow_path_put_setter_by_id)
</span><del>- dispatch(4)
</del><ins>+ dispatch(5)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> _llint_op_put_getter_setter:
</span><span class="cx"> traceExecution()
</span><span class="cx"> callSlowPath(_llint_slow_path_put_getter_setter)
</span><del>- dispatch(5)
</del><ins>+ dispatch(6)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> _llint_op_jtrue:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserASTBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ASTBuilder.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/parser/ASTBuilder.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx"> {
</span><span class="cx"> return new (m_parserArena) PropertyNode(parserArena.identifierArena().makeNumericIdentifier(vm, propertyName), node, type, putType);
</span><span class="cx"> }
</span><del>- PropertyNode* createProperty(ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool) { return new (m_parserArena) PropertyNode(propertyName, node, type, putType); }
</del><ins>+ PropertyNode* createProperty(ExpressionNode* propertyName, ExpressionNode* node, PropertyNode::Type type, PropertyNode::PutType putType, bool, SuperBinding superBinding = SuperBinding::NotNeeded) { return new (m_parserArena) PropertyNode(propertyName, node, type, putType, superBinding); }
</ins><span class="cx"> PropertyListNode* createPropertyList(const JSTokenLocation& location, PropertyNode* property) { return new (m_parserArena) PropertyListNode(location, property); }
</span><span class="cx"> PropertyListNode* createPropertyList(const JSTokenLocation& location, PropertyNode* property, PropertyListNode* tail) { return new (m_parserArena) PropertyListNode(location, property, tail); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodeConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/NodeConstructors.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/parser/NodeConstructors.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -231,12 +231,12 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- inline PropertyNode::PropertyNode(ExpressionNode* name, ExpressionNode* assign, Type type, PutType putType)
</del><ins>+ inline PropertyNode::PropertyNode(ExpressionNode* name, ExpressionNode* assign, Type type, PutType putType, SuperBinding superBinding = SuperBinding::NotNeeded)
</ins><span class="cx"> : m_name(0)
</span><span class="cx"> , m_expression(name)
</span><span class="cx"> , m_assign(assign)
</span><span class="cx"> , m_type(type)
</span><del>- , m_needsSuperBinding(false)
</del><ins>+ , m_needsSuperBinding(superBinding == SuperBinding::Needed)
</ins><span class="cx"> , m_putType(putType)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Nodes.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Nodes.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/parser/Nodes.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -614,7 +614,7 @@
</span><span class="cx"> enum PutType { Unknown, KnownDirect };
</span><span class="cx">
</span><span class="cx"> PropertyNode(const Identifier&, ExpressionNode*, Type, PutType, SuperBinding);
</span><del>- PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, PutType);
</del><ins>+ PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, PutType, SuperBinding);
</ins><span class="cx">
</span><span class="cx"> ExpressionNode* expressionName() const { return m_expression; }
</span><span class="cx"> const Identifier* name() const { return m_name; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/Parser.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/Parser.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/parser/Parser.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1961,7 +1961,8 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: Figure out a way to share more code with parseProperty.
</span><span class="cx"> const CommonIdentifiers& propertyNames = *m_vm->propertyNames;
</span><del>- const Identifier* ident = nullptr;
</del><ins>+ const Identifier* ident = &propertyNames.nullIdentifier;
+ TreeExpression computedPropertyName = 0;
</ins><span class="cx"> bool isGetter = false;
</span><span class="cx"> bool isSetter = false;
</span><span class="cx"> switch (m_token.m_type) {
</span><span class="lines">@@ -1985,6 +1986,12 @@
</span><span class="cx"> ASSERT(ident);
</span><span class="cx"> next();
</span><span class="cx"> break;
</span><ins>+ case OPENBRACKET:
+ next();
+ computedPropertyName = parseAssignmentExpression(context);
+ failIfFalse(computedPropertyName, "Cannot parse computed property name");
+ handleProductionOrFail(CLOSEBRACKET, "]", "end", "computed property name");
+ break;
</ins><span class="cx"> default:
</span><span class="cx"> failDueToUnexpectedToken();
</span><span class="cx"> }
</span><span class="lines">@@ -1999,7 +2006,7 @@
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> methodInfo;
</span><span class="cx"> bool isConstructor = !isStaticMethod && *ident == propertyNames.constructor;
</span><span class="cx"> failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
</span><del>- failIfTrue(!ident || (declareVariable(ident) & DeclarationResult::InvalidStrictMode), "Cannot declare a method named '", methodInfo.name->impl(), "'");
</del><ins>+ failIfTrue(!computedPropertyName && (declareVariable(ident) & DeclarationResult::InvalidStrictMode), "Cannot declare a method named '", methodInfo.name->impl(), "'");
</ins><span class="cx"> methodInfo.name = isConstructor ? className : ident;
</span><span class="cx">
</span><span class="cx"> TreeExpression method = context.createFunctionExpr(methodLocation, methodInfo);
</span><span class="lines">@@ -2012,7 +2019,11 @@
</span><span class="cx"> // FIXME: Syntax error when super() is called
</span><span class="cx"> semanticFailIfTrue(isStaticMethod && methodInfo.name && *methodInfo.name == propertyNames.prototype,
</span><span class="cx"> "Cannot declare a static method named 'prototype'");
</span><del>- property = context.createProperty(methodInfo.name, method, PropertyNode::Constant, PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed);
</del><ins>+ if (computedPropertyName) {
+ property = context.createProperty(computedPropertyName, method, static_cast<PropertyNode::Type>(PropertyNode::Constant | PropertyNode::Computed),
+ PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed);
+ } else
+ property = context.createProperty(methodInfo.name, method, PropertyNode::Constant, PropertyNode::Unknown, alwaysStrictInsideClass, SuperBinding::Needed);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TreePropertyList& tail = isStaticMethod ? staticMethodsTail : instanceMethodsTail;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserSyntaxCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/SyntaxChecker.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/SyntaxChecker.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/parser/SyntaxChecker.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx"> return Property(type);
</span><span class="cx"> return Property(&parserArena.identifierArena().makeNumericIdentifier(vm, name), type);
</span><span class="cx"> }
</span><del>- Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, bool)
</del><ins>+ Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding = SuperBinding::NotNeeded)
</ins><span class="cx"> {
</span><span class="cx"> return Property(type);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -1198,21 +1198,31 @@
</span><span class="cx"> return globalObject->globalObjectMethodTable()->allowsAccessFrom(globalObject, exec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSObject::putGetter(ExecState* exec, PropertyName propertyName, JSValue getter)
</del><ins>+void JSObject::putGetter(ExecState* exec, PropertyName propertyName, JSValue getter, unsigned attributes)
</ins><span class="cx"> {
</span><span class="cx"> PropertyDescriptor descriptor;
</span><span class="cx"> descriptor.setGetter(getter);
</span><del>- descriptor.setEnumerable(true);
- descriptor.setConfigurable(true);
</del><ins>+
+ ASSERT(attributes & Accessor);
+ if (!(attributes & ReadOnly))
+ descriptor.setConfigurable(true);
+ if (!(attributes & DontEnum))
+ descriptor.setEnumerable(true);
+
</ins><span class="cx"> defineOwnProperty(this, exec, propertyName, descriptor, false);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSObject::putSetter(ExecState* exec, PropertyName propertyName, JSValue setter)
</del><ins>+void JSObject::putSetter(ExecState* exec, PropertyName propertyName, JSValue setter, unsigned attributes)
</ins><span class="cx"> {
</span><span class="cx"> PropertyDescriptor descriptor;
</span><span class="cx"> descriptor.setSetter(setter);
</span><del>- descriptor.setEnumerable(true);
- descriptor.setConfigurable(true);
</del><ins>+
+ ASSERT(attributes & Accessor);
+ if (!(attributes & ReadOnly))
+ descriptor.setConfigurable(true);
+ if (!(attributes & DontEnum))
+ descriptor.setEnumerable(true);
+
</ins><span class="cx"> defineOwnProperty(this, exec, propertyName, descriptor, false);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (188497 => 188498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-08-14 22:24:26 UTC (rev 188497)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-08-14 23:50:25 UTC (rev 188498)
</span><span class="lines">@@ -467,8 +467,8 @@
</span><span class="cx"> void putDirectAccessor(ExecState*, PropertyName, JSValue, unsigned attributes);
</span><span class="cx"> JS_EXPORT_PRIVATE void putDirectCustomAccessor(VM&, PropertyName, JSValue, unsigned attributes);
</span><span class="cx">
</span><del>- void putGetter(ExecState*, PropertyName, JSValue);
- void putSetter(ExecState*, PropertyName, JSValue);
</del><ins>+ void putGetter(ExecState*, PropertyName, JSValue, unsigned attributes);
+ void putSetter(ExecState*, PropertyName, JSValue, unsigned attributes);
</ins><span class="cx">
</span><span class="cx"> JS_EXPORT_PRIVATE bool hasProperty(ExecState*, PropertyName) const;
</span><span class="cx"> JS_EXPORT_PRIVATE bool hasProperty(ExecState*, unsigned propertyName) const;
</span></span></pre>
</div>
</div>
</body>
</html>