<!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>[178928] 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/178928">178928</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-22 11:34:34 -0800 (Thu, 22 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/178894">r178894</a>.
https://bugs.webkit.org/show_bug.cgi?id=140775
Broke JSC and bindings tests (Requested by ap_ on #webkit).
Reverted changeset:
"put_by_val_direct need to check the property is index or not
for using putDirect / putDirectIndex"
https://bugs.webkit.org/show_bug.cgi?id=140426
http://trac.webkit.org/changeset/178894</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePutByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOperationscpp">trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitRepatchcpp">trunk/Source/JavaScriptCore/jit/Repatch.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArgumentscpp">trunk/Source/JavaScriptCore/runtime/Arguments.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArraycpp">trunk/Source/JavaScriptCore/runtime/JSArray.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValuecpp">trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.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>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringcpp">trunk/Source/JavaScriptCore/runtime/JSString.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringh">trunk/Source/JavaScriptCore/runtime/JSString.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeLiteralParsercpp">trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePropertyNameh">trunk/Source/JavaScriptCore/runtime/PropertyName.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePropertyNameArraycpp">trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringObjectcpp">trunk/Source/JavaScriptCore/runtime/StringObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStructurecpp">trunk/Source/JavaScriptCore/runtime/Structure.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLAllCollectionCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSFloat64Arraycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgeruntime_arraycpp">trunk/Source/WebCore/bridge/runtime_array.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsdfgputbyvaldirectwithedgenumbersexpectedtxt">trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdfgputbyvaldirectwithedgenumbershtml">trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsdfgputbyvaldirectwithedgenumbersjs">trunk/LayoutTests/js/script-tests/dfg-put-by-val-direct-with-edge-numbers.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/LayoutTests/ChangeLog        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-22 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r178894.
+ https://bugs.webkit.org/show_bug.cgi?id=140775
+
+ Broke JSC and bindings tests (Requested by ap_ on #webkit).
+
+ Reverted changeset:
+
+ "put_by_val_direct need to check the property is index or not
+ for using putDirect / putDirectIndex"
+ https://bugs.webkit.org/show_bug.cgi?id=140426
+ http://trac.webkit.org/changeset/178894
+
</ins><span class="cx"> 2015-01-22 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> BytecodeGenerator::initializeCapturedVariable() sets a misleading value for the 5th operand of op_put_to_scope.
</span></span></pre></div>
<a id="trunkLayoutTestsjsdfgputbyvaldirectwithedgenumbersexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers-expected.txt (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers-expected.txt        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers-expected.txt        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-Test that a object accepts DFG PutByValueDirect operation with edge numbers.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS lookupWithKey(-0x80000001) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(-0x80000000) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(-1) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(1) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0x7fffffff) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0x80000000) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0xfffffffd) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0xfffffffe) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0xffffffff) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0x100000000) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-2147483649") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-2147483648") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-1") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("0") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("1") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("2147483647") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("2147483648") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("4294967293") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("4294967294") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("4294967295") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("4294967296") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.MIN_VALUE) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.MAX_VALUE) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.MIN_SAFE_INTEGER) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.MAX_SAFE_INTEGER) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.POSITIVE_INFINITY) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.NEGATIVE_INFINITY) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.NaN) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(Number.EPSILON) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(+0.0) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(-0.0) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(0.1) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(-0.1) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(4.2) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey(-4.2) is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("5e-324") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("1.7976931348623157e+308") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-9007199254740991") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("9007199254740991") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("Infinity") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-Infinity") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("NaN") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("2.220446049250313e-16") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("+0.0") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-0.0") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("0.1") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-0.1") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("4.2") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey("-4.2") is 42 on all iterations including after DFG tier-up.
-PASS lookupWithKey2(toStringThrowsError) threw exception 'Error: ng' on all iterations including after DFG tier-up.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsjsdfgputbyvaldirectwithedgenumbershtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers.html (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers.html        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/LayoutTests/js/dfg-put-by-val-direct-with-edge-numbers.html        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../resources/js-test-pre.js"></script>
-</head>
-<body>
-<script src="script-tests/dfg-put-by-val-direct-with-edge-numbers.js"></script>
-<script src="../resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsdfgputbyvaldirectwithedgenumbersjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/script-tests/dfg-put-by-val-direct-with-edge-numbers.js (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/dfg-put-by-val-direct-with-edge-numbers.js        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/LayoutTests/js/script-tests/dfg-put-by-val-direct-with-edge-numbers.js        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,134 +0,0 @@
</span><del>-description(
-"Test that a object accepts DFG PutByValueDirect operation with edge numbers."
-);
-
-function lookupWithKey(key) {
- var object = {
- [key]: 42
- };
- return object[key];
-}
-
-[
- // integers
- '-0x80000001', // out of int32_t
- '-0x80000000', // int32_t min
- '-1', // negative
- '0', // zero
- '1', // positive
- '0x7fffffff', // int32_t max
- '0x80000000', // out of int32_t
- '0xfffffffd', // less than array max in JSObject
- '0xfffffffe', // array max in JSObject
- '0xffffffff', // uint32_t max, PropertyName::NotAnIndex
- '0x100000000', // out of uint32_t
-
- // stringified integers
- '"' + (-0x80000001).toString() + '"', // out of int32_t
- '"' + (-0x80000000).toString() + '"', // int32_t min
- '"' + (-1).toString() + '"', // negative
- '"' + (0).toString() + '"', // zero
- '"' + (1).toString() + '"', // positive
- '"' + (0x7fffffff).toString() + '"', // int32_t max
- '"' + (0x80000000).toString() + '"', // out of int32_t
- '"' + (0xfffffffd).toString() + '"', // less than array max in JSObject
- '"' + (0xfffffffe).toString() + '"', // array max in JSObject
- '"' + (0xffffffff).toString() + '"', // uint32_t max).toString() PropertyName::NotAnIndex
- '"' + (0x100000000).toString() + '"', // out of uint32_t
-
- // doubles
- 'Number.MIN_VALUE',
- 'Number.MAX_VALUE',
- 'Number.MIN_SAFE_INTEGER',
- 'Number.MAX_SAFE_INTEGER',
- 'Number.POSITIVE_INFINITY',
- 'Number.NEGATIVE_INFINITY',
- 'Number.NaN',
- 'Number.EPSILON',
- '+0.0',
- '-0.0',
- '0.1',
- '-0.1',
- '4.2',
- '-4.2',
-
- // stringified doules
- '"' + (Number.MIN_VALUE).toString() + '"',
- '"' + (Number.MAX_VALUE).toString() + '"',
- '"' + (Number.MIN_SAFE_INTEGER).toString() + '"',
- '"' + (Number.MAX_SAFE_INTEGER).toString() + '"',
- '"' + (Number.POSITIVE_INFINITY).toString() + '"',
- '"' + (Number.NEGATIVE_INFINITY).toString() + '"',
- '"NaN"',
- '"' + (Number.EPSILON).toString() + '"',
- '"+0.0"',
- '"-0.0"',
- '"0.1"',
- '"-0.1"',
- '"4.2"',
- '"-4.2"',
-].forEach(function (key) {
- dfgShouldBe(lookupWithKey, "lookupWithKey("+ key + ")", "42");
-});
-
-function dfgShouldThrow(theFunction, _a, _e)
-{
- if (typeof theFunction != "function" || typeof _a != "string" || typeof _e != "string")
- debug("WARN: dfgShouldThrow() expects a function and two strings");
- noInline(theFunction);
- var values = [], _av = undefined, notThrow = false;
-
- // Defend against tests that muck with numeric properties on array.prototype.
- values.__proto__ = null;
- values.push = Array.prototype.push;
-
- while (!dfgCompiled({f:theFunction})) {
- try {
- _av = eval(_a);
- notThrow = true;
- } catch (exception) {
- values.push(exception);
- }
- }
- try {
- _av = eval(_a);
- notThrow = true;
- } catch (exception) {
- values.push(exception);
- }
-
- var _ev = eval(_e);
- if (notThrow) {
- if (typeof _av == "undefined")
- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined.");
- else
- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + ".");
- } else {
- var allPassed = true;
- for (var i = 0; i < values.length; ++i) {
- var _av = values[i];
- if (typeof _e == "undefined" || _av == _ev)
- continue;
- testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + _av + ".");
- allPassed = false;
- }
- if (allPassed)
- testPassed(_a + " threw exception " + _e + " on all iterations including after DFG tier-up.");
- }
-
- return values.length;
-}
-
-function lookupWithKey2(key) {
- var object = {
- [key]: 42
- };
- return object[key];
-}
-
-var toStringThrowsError = {
- toString: function () {
- throw new Error('ng');
- }
-};
-dfgShouldThrow(lookupWithKey2, "lookupWithKey2(toStringThrowsError)", "'Error: ng'");
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-22 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r178894.
+ https://bugs.webkit.org/show_bug.cgi?id=140775
+
+ Broke JSC and bindings tests (Requested by ap_ on #webkit).
+
+ Reverted changeset:
+
+ "put_by_val_direct need to check the property is index or not
+ for using putDirect / putDirectIndex"
+ https://bugs.webkit.org/show_bug.cgi?id=140426
+ http://trac.webkit.org/changeset/178894
+
</ins><span class="cx"> 2015-01-22 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> BytecodeGenerator::initializeCapturedVariable() sets a misleading value for the 5th operand of op_put_to_scope.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx"> if (set.isEmpty())
</span><span class="cx"> return GetByIdStatus();
</span><span class="cx">
</span><del>- if (toUInt32FromStringImpl(uid))
</del><ins>+ if (toUInt32FromStringImpl(uid) != PropertyName::NotAnIndex)
</ins><span class="cx"> return GetByIdStatus(TakesSlowPath);
</span><span class="cx">
</span><span class="cx"> GetByIdStatus result;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePutByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx">
</span><span class="cx"> PutByIdStatus PutByIdStatus::computeFor(JSGlobalObject* globalObject, const StructureSet& set, AtomicStringImpl* uid, bool isDirect)
</span><span class="cx"> {
</span><del>- if (toUInt32FromStringImpl(uid))
</del><ins>+ if (toUInt32FromStringImpl(uid) != PropertyName::NotAnIndex)
</ins><span class="cx"> return PutByIdStatus(TakesSlowPath);
</span><span class="cx">
</span><span class="cx"> if (set.isEmpty())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1501,7 +1501,9 @@
</span><span class="cx"> instructions().append(0);
</span><span class="cx"> instructions().append(0);
</span><span class="cx"> instructions().append(0);
</span><del>- instructions().append(property != m_vm->propertyNames->underscoreProto && !PropertyName(property).asIndex());
</del><ins>+ instructions().append(
+ property != m_vm->propertyNames->underscoreProto
+ && PropertyName(property).asIndex() == PropertyName::NotAnIndex);
</ins><span class="cx"> return value;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -97,16 +97,14 @@
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="cx">
</span><span class="cx"> if (LIKELY(property.isUInt32())) {
</span><del>- uint32_t index = property.asUInt32();
- ASSERT_WITH_MESSAGE(index != PropertyName::NotAnIndex, "Since JSValue::isUInt32 returns true only when the boxed value is int32_t and positive, it doesn't return true for uint32_t max value that is PropertyName::NotAnIndex.");
- putByVal<strict, direct>(exec, baseValue, index, value);
</del><ins>+ putByVal<strict, direct>(exec, baseValue, property.asUInt32(), value);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (property.isDouble()) {
</span><span class="cx"> double propertyAsDouble = property.asDouble();
</span><span class="cx"> uint32_t propertyAsUInt32 = static_cast<uint32_t>(propertyAsDouble);
</span><del>- if (propertyAsDouble == propertyAsUInt32 && propertyAsUInt32 != PropertyName::NotAnIndex) {
</del><ins>+ if (propertyAsDouble == propertyAsUInt32) {
</ins><span class="cx"> putByVal<strict, direct>(exec, baseValue, propertyAsUInt32, value);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -124,19 +122,14 @@
</span><span class="cx">
</span><span class="cx"> // Don't put to an object if toString throws an exception.
</span><span class="cx"> Identifier ident = property.toString(exec)->toIdentifier(exec);
</span><del>- if (vm->exception())
- return;
-
- PutPropertySlot slot(baseValue, strict);
- if (direct) {
- PropertyName propertyName(ident);
- RELEASE_ASSERT(baseValue.isObject());
- if (Optional<uint32_t> index = propertyName.asIndex())
- asObject(baseValue)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- else
- asObject(baseValue)->putDirect(*vm, propertyName, value, slot);
- } else
- baseValue.put(exec, ident, value, slot);
</del><ins>+ if (!vm->exception()) {
+ PutPropertySlot slot(baseValue, strict);
+ if (direct) {
+ RELEASE_ASSERT(baseValue.isObject());
+ asObject(baseValue)->putDirect(*vm, ident, value, slot);
+ } else
+ baseValue.put(exec, ident, value, slot);
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<typename ViewClass>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #include "JSWithScope.h"
</span><span class="cx"> #include "LegacyProfiler.h"
</span><span class="cx"> #include "ObjectConstructor.h"
</span><del>-#include "PropertyName.h"
</del><span class="cx"> #include "Repatch.h"
</span><span class="cx"> #include "RepatchBuffer.h"
</span><span class="cx"> #include "TestRunnerUtils.h"
</span><span class="lines">@@ -481,41 +480,19 @@
</span><span class="cx">
</span><span class="cx"> static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue subscript, JSValue value)
</span><span class="cx"> {
</span><del>- bool isStrictMode = callFrame->codeBlock()->isStrictMode();
</del><span class="cx"> if (LIKELY(subscript.isUInt32())) {
</span><del>- uint32_t index = subscript.asUInt32();
- ASSERT_WITH_MESSAGE(index != PropertyName::NotAnIndex, "Since JSValue::isUInt32 returns true only when the boxed value is int32_t and positive, it doesn't return true for uint32_t max value that is PropertyName::NotAnIndex.");
- baseObject->putDirectIndex(callFrame, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- return;
- }
-
- if (subscript.isDouble()) {
- double subscriptAsDouble = subscript.asDouble();
- uint32_t subscriptAsUInt32 = static_cast<uint32_t>(subscriptAsDouble);
- if (subscriptAsDouble == subscriptAsUInt32 && subscriptAsUInt32 != PropertyName::NotAnIndex) {
- baseObject->putDirectIndex(callFrame, subscriptAsUInt32, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- return;
</del><ins>+ uint32_t i = subscript.asUInt32();
+ baseObject->putDirectIndex(callFrame, i, value);
+ } else if (isName(subscript)) {
+ PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode());
+ baseObject->putDirect(callFrame->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);
+ } else {
+ Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame);
+ if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception.
+ PutPropertySlot slot(baseObject, callFrame->codeBlock()->isStrictMode());
+ baseObject->putDirect(callFrame->vm(), property, value, slot);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>-
- if (isName(subscript)) {
- PutPropertySlot slot(baseObject, isStrictMode);
- baseObject->putDirect(callFrame->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);
- return;
- }
-
- // Don't put to an object if toString throws an exception.
- Identifier property = subscript.toString(callFrame)->toIdentifier(callFrame);
- if (callFrame->vm().exception())
- return;
-
- PropertyName propertyName(property);
- if (Optional<uint32_t> index = propertyName.asIndex())
- baseObject->putDirectIndex(callFrame, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- else {
- PutPropertySlot slot(baseObject, isStrictMode);
- baseObject->putDirect(callFrame->vm(), propertyName, value, slot);
- }
</del><span class="cx"> }
</span><span class="cx"> void JIT_OPERATION operationPutByVal(ExecState* exec, EncodedJSValue encodedBaseValue, EncodedJSValue encodedSubscript, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitRepatchcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/Repatch.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/Repatch.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/jit/Repatch.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -982,7 +982,7 @@
</span><span class="cx"> {
</span><span class="cx"> PropertyName pname(ident);
</span><span class="cx"> Structure* oldStructure = structure;
</span><del>- if (!oldStructure->isObject() || oldStructure->isDictionary() || pname.asIndex())
</del><ins>+ if (!oldStructure->isObject() || oldStructure->isDictionary() || pname.asIndex() != PropertyName::NotAnIndex)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> PropertyOffset propertyOffset;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -334,9 +334,10 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < thisObject->getLength()) {
- slot.setValue(thisObject, DontDelete | DontEnum, jsNumber(thisObject->m_vector[index.value()]));
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index < thisObject->getLength()) {
+ ASSERT(index != PropertyName::NotAnIndex);
+ slot.setValue(thisObject, DontDelete | DontEnum, jsNumber(thisObject->m_vector[index]));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -819,42 +819,19 @@
</span><span class="cx"> JSValue value = LLINT_OP_C(3).jsValue();
</span><span class="cx"> RELEASE_ASSERT(baseValue.isObject());
</span><span class="cx"> JSObject* baseObject = asObject(baseValue);
</span><del>- bool isStrictMode = exec->codeBlock()->isStrictMode();
</del><span class="cx"> if (LIKELY(subscript.isUInt32())) {
</span><del>- uint32_t index = subscript.asUInt32();
- ASSERT_WITH_MESSAGE(index != PropertyName::NotAnIndex, "Since JSValue::isUInt32 returns true only when the boxed value is int32_t and positive, it doesn't return true for uint32_t max value that is PropertyName::NotAnIndex.");
- baseObject->putDirectIndex(exec, index, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- LLINT_END();
- }
-
-
- if (subscript.isDouble()) {
- double subscriptAsDouble = subscript.asDouble();
- uint32_t subscriptAsUInt32 = static_cast<uint32_t>(subscriptAsDouble);
- if (subscriptAsDouble == subscriptAsUInt32 && subscriptAsUInt32 != PropertyName::NotAnIndex) {
- baseObject->putDirectIndex(exec, subscriptAsUInt32, value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- LLINT_END();
</del><ins>+ uint32_t i = subscript.asUInt32();
+ baseObject->putDirectIndex(exec, i, value);
+ } else if (isName(subscript)) {
+ PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode());
+ baseObject->putDirect(exec->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);
+ } else {
+ Identifier property = subscript.toString(exec)->toIdentifier(exec);
+ if (!exec->vm().exception()) { // Don't put to an object if toString threw an exception.
+ PutPropertySlot slot(baseObject, exec->codeBlock()->isStrictMode());
+ baseObject->putDirect(exec->vm(), property, value, slot);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>-
- if (isName(subscript)) {
- PutPropertySlot slot(baseObject, isStrictMode);
- baseObject->putDirect(exec->vm(), jsCast<NameInstance*>(subscript.asCell())->privateName(), value, slot);
- LLINT_END();
- }
-
- // Don't put to an object if toString throws an exception.
- Identifier property = subscript.toString(exec)->toIdentifier(exec);
- if (exec->vm().exception())
- LLINT_END();
-
- PropertyName propertyName(property);
- if (Optional<uint32_t> index = propertyName.asIndex())
- baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
- else {
- PutPropertySlot slot(baseObject, isStrictMode);
- baseObject->putDirect(exec->vm(), propertyName, value, slot);
- }
</del><span class="cx"> LLINT_END();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArgumentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Arguments.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Arguments.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/Arguments.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -161,11 +161,11 @@
</span><span class="cx"> bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
</span><span class="cx"> {
</span><span class="cx"> Arguments* thisObject = jsCast<Arguments*>(object);
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- if (JSValue value = thisObject->tryGetArgument(index.value())) {
- slot.setValue(thisObject, None, value);
- return true;
- }
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (JSValue value = thisObject->tryGetArgument(i)) {
+ RELEASE_ASSERT(i < PropertyName::NotAnIndex);
+ slot.setValue(thisObject, None, value);
+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->m_overrodeLength)) {
</span><span class="lines">@@ -224,8 +224,8 @@
</span><span class="cx"> void Arguments::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
</span><span class="cx"> {
</span><span class="cx"> Arguments* thisObject = jsCast<Arguments*>(cell);
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && thisObject->trySetArgument(exec->vm(), index.value(), value))
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (thisObject->trySetArgument(exec->vm(), i, value))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (propertyName == exec->propertyNames().length && !thisObject->m_overrodeLength) {
</span><span class="lines">@@ -267,11 +267,12 @@
</span><span class="cx"> return Base::deleteProperty(cell, exec, propertyName);
</span><span class="cx">
</span><span class="cx"> Arguments* thisObject = jsCast<Arguments*>(cell);
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < thisObject->m_numArguments) {
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i < thisObject->m_numArguments) {
+ RELEASE_ASSERT(i < PropertyName::NotAnIndex);
</ins><span class="cx"> if (!Base::deleteProperty(cell, exec, propertyName))
</span><span class="cx"> return false;
</span><del>- if (thisObject->tryDeleteArgument(exec->vm(), index.value()))
</del><ins>+ if (thisObject->tryDeleteArgument(exec->vm(), i))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -297,13 +298,13 @@
</span><span class="cx"> bool Arguments::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool shouldThrow)
</span><span class="cx"> {
</span><span class="cx"> Arguments* thisObject = jsCast<Arguments*>(object);
</span><del>- Optional<uint32_t> optionalIndex = propertyName.asIndex();
- if (optionalIndex && optionalIndex.value() < thisObject->m_numArguments) {
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i < thisObject->m_numArguments) {
+ RELEASE_ASSERT(i < PropertyName::NotAnIndex);
</ins><span class="cx"> // If the property is not yet present on the object, and is not yet marked as deleted, then add it now.
</span><del>- uint32_t index = optionalIndex.value();
</del><span class="cx"> PropertySlot slot(thisObject);
</span><del>- if (!thisObject->isDeletedArgument(index) && !JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
- JSValue value = thisObject->tryGetArgument(index);
</del><ins>+ if (!thisObject->isDeletedArgument(i) && !JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
+ JSValue value = thisObject->tryGetArgument(i);
</ins><span class="cx"> ASSERT(value);
</span><span class="cx"> object->putDirectMayBeIndex(exec, propertyName, value);
</span><span class="cx"> }
</span><span class="lines">@@ -312,20 +313,20 @@
</span><span class="cx">
</span><span class="cx"> // From ES 5.1, 10.6 Arguments Object
</span><span class="cx"> // 5. If the value of isMapped is not undefined, then
</span><del>- if (thisObject->isArgument(index)) {
</del><ins>+ if (thisObject->isArgument(i)) {
</ins><span class="cx"> // a. If IsAccessorDescriptor(Desc) is true, then
</span><span class="cx"> if (descriptor.isAccessorDescriptor()) {
</span><span class="cx"> // i. Call the [[Delete]] internal method of map passing P, and false as the arguments.
</span><del>- thisObject->tryDeleteArgument(exec->vm(), index);
</del><ins>+ thisObject->tryDeleteArgument(exec->vm(), i);
</ins><span class="cx"> } else { // b. Else
</span><span class="cx"> // i. If Desc.[[Value]] is present, then
</span><span class="cx"> // 1. Call the [[Put]] internal method of map passing P, Desc.[[Value]], and Throw as the arguments.
</span><span class="cx"> if (descriptor.value())
</span><del>- thisObject->trySetArgument(exec->vm(), index, descriptor.value());
</del><ins>+ thisObject->trySetArgument(exec->vm(), i, descriptor.value());
</ins><span class="cx"> // ii. If Desc.[[Writable]] is present and its value is false, then
</span><span class="cx"> // 1. Call the [[Delete]] internal method of map passing P and false as arguments.
</span><span class="cx"> if (descriptor.writablePresent() && !descriptor.writable())
</span><del>- thisObject->tryDeleteArgument(exec->vm(), index);
</del><ins>+ thisObject->tryDeleteArgument(exec->vm(), i);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -742,11 +742,10 @@
</span><span class="cx"> Vector<uint32_t, 0, UnsafeVectorOverflow> keys;
</span><span class="cx"> for (size_t i = 0; i < nameArray.size(); ++i) {
</span><span class="cx"> PropertyName name = nameArray[i];
</span><del>- Optional<uint32_t> optionalIndex = name.asIndex();
- if (!optionalIndex)
</del><ins>+ uint32_t index = name.asIndex();
+ if (index == PropertyName::NotAnIndex)
</ins><span class="cx"> continue;
</span><del>-
- uint32_t index = optionalIndex.value();
</del><ins>+
</ins><span class="cx"> JSValue value = getOrHole(thisObj, exec, index);
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArray.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArray.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSArray.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -158,9 +158,9 @@
</span><span class="cx">
</span><span class="cx"> // 4. Else if P is an array index (15.4), then
</span><span class="cx"> // a. Let index be ToUint32(P).
</span><del>- if (Optional<uint32_t> optionalIndex = propertyName.asIndex()) {
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
</ins><span class="cx"> // b. Reject if index >= oldLen and oldLenDesc.[[Writable]] is false.
</span><del>- uint32_t index = optionalIndex.value();
</del><span class="cx"> if (index >= array->length() && !array->isLengthWritable())
</span><span class="cx"> return reject(exec, throwException, "Attempting to define numeric property on array with non-writable length property.");
</span><span class="cx"> // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -119,8 +119,9 @@
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- putToPrimitiveByIndex(exec, index.value(), value, slot.isStrictMode());
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ putToPrimitiveByIndex(exec, index, value, slot.isStrictMode());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -302,9 +302,9 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && thisObject->canGetIndexQuickly(index.value())) {
- slot.setValue(thisObject, DontDelete | ReadOnly, thisObject->getIndexQuickly(index.value()));
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex && thisObject->canGetIndexQuickly(index)) {
+ slot.setValue(thisObject, DontDelete | ReadOnly, thisObject->getIndexQuickly(index));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -324,8 +324,9 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode());
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ putByIndex(thisObject, exec, index, value, slot.isStrictMode());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -342,7 +343,8 @@
</span><span class="cx"> // This is matching Firefox behavior. In particular, it rejects all attempts to
</span><span class="cx"> // defineOwnProperty for indexed properties on typed arrays, even if they're out
</span><span class="cx"> // of bounds.
</span><del>- if (propertyName == exec->propertyNames().length || propertyName.asIndex())
</del><ins>+ if (propertyName == exec->propertyNames().length
+ || propertyName.asIndex() != PropertyName::NotAnIndex)
</ins><span class="cx"> return reject(exec, shouldThrow, "Attempting to write to a read-only typed array property.");
</span><span class="cx">
</span><span class="cx"> return Base::defineOwnProperty(thisObject, exec, propertyName, descriptor, shouldThrow);
</span><span class="lines">@@ -354,7 +356,8 @@
</span><span class="cx"> {
</span><span class="cx"> JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(cell);
</span><span class="cx">
</span><del>- if (propertyName == exec->propertyNames().length || propertyName.asIndex())
</del><ins>+ if (propertyName == exec->propertyNames().length
+ || propertyName.asIndex() != PropertyName::NotAnIndex)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> return Base::deleteProperty(thisObject, exec, propertyName);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -339,8 +339,9 @@
</span><span class="cx">
</span><span class="cx"> // Try indexed put first. This is required for correctness, since loads on property names that appear like
</span><span class="cx"> // valid indices will never look in the named property storage.
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode());
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex) {
+ putByIndex(thisObject, exec, i, value, slot.isStrictMode());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1197,8 +1198,9 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(value.isGetterSetter() && (attributes & Accessor));
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- putDirectIndex(exec, index.value(), value, attributes, PutDirectIndexLikePutDirect);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ putDirectIndex(exec, index, value, attributes, PutDirectIndexLikePutDirect);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1207,7 +1209,7 @@
</span><span class="cx">
</span><span class="cx"> void JSObject::putDirectCustomAccessor(VM& vm, PropertyName propertyName, JSValue value, unsigned attributes)
</span><span class="cx"> {
</span><del>- ASSERT(!propertyName.asIndex());
</del><ins>+ ASSERT(propertyName.asIndex() == PropertyName::NotAnIndex);
</ins><span class="cx">
</span><span class="cx"> PutPropertySlot slot(this);
</span><span class="cx"> putDirectInternal<PutModeDefineOwnProperty>(vm, propertyName, value, attributes, slot);
</span><span class="lines">@@ -1255,8 +1257,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSObject* thisObject = jsCast<JSObject*>(cell);
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex())
- return thisObject->methodTable(exec->vm())->deletePropertyByIndex(thisObject, exec, index.value());
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex)
+ return thisObject->methodTable(exec->vm())->deletePropertyByIndex(thisObject, exec, i);
</ins><span class="cx">
</span><span class="cx"> if (!thisObject->staticFunctionsReified())
</span><span class="cx"> thisObject->reifyStaticFunctionsForDelete(exec);
</span><span class="lines">@@ -2499,10 +2502,11 @@
</span><span class="cx">
</span><span class="cx"> void JSObject::putDirectMayBeIndex(ExecState* exec, PropertyName propertyName, JSValue value)
</span><span class="cx"> {
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex())
- putDirectIndex(exec, index.value(), value);
</del><ins>+ unsigned asIndex = propertyName.asIndex();
+ if (asIndex == PropertyName::NotAnIndex)
+ putDirect(exec->vm(), propertyName, value);
</ins><span class="cx"> else
</span><del>- putDirect(exec->vm(), propertyName, value);
</del><ins>+ putDirectIndex(exec, asIndex, value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> class DefineOwnPropertyScope {
</span><span class="lines">@@ -2655,14 +2659,15 @@
</span><span class="cx"> bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool throwException)
</span><span class="cx"> {
</span><span class="cx"> // If it's an array index, then use the indexed property storage.
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
</ins><span class="cx"> // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
</span><span class="cx"> // d. Reject if succeeded is false.
</span><span class="cx"> // e. If index >= oldLen
</span><span class="cx"> // e.i. Set oldLenDesc.[[Value]] to index + 1.
</span><span class="cx"> // e.ii. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", oldLenDesc, and false as arguments. This call will always return true.
</span><span class="cx"> // f. Return true.
</span><del>- return object->defineOwnIndexedProperty(exec, index.value(), descriptor, throwException);
</del><ins>+ return object->defineOwnIndexedProperty(exec, index, descriptor, throwException);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return object->defineOwnNonIndexProperty(exec, propertyName, descriptor, throwException);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.h (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.h        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1244,8 +1244,9 @@
</span><span class="cx"> Structure& structure = *object->structure(vm);
</span><span class="cx"> if (object->inlineGetOwnPropertySlot(vm, structure, propertyName, slot))
</span><span class="cx"> return true;
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex())
- return getOwnPropertySlotByIndex(object, exec, index.value(), slot);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex)
+ return getOwnPropertySlotByIndex(object, exec, index, slot);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1273,8 +1274,9 @@
</span><span class="cx"> object = asObject(prototype);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex())
- return getPropertySlot(exec, index.value(), slot);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex)
+ return getPropertySlot(exec, index, slot);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1318,7 +1320,7 @@
</span><span class="cx"> ASSERT(value);
</span><span class="cx"> ASSERT(value.isGetterSetter() == !!(attributes & Accessor));
</span><span class="cx"> ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
</span><del>- ASSERT(!propertyName.asIndex());
</del><ins>+ ASSERT(propertyName.asIndex() == PropertyName::NotAnIndex);
</ins><span class="cx">
</span><span class="cx"> Structure* structure = this->structure(vm);
</span><span class="cx"> if (structure->isDictionary()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSString.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -425,9 +425,10 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < m_length) {
- descriptor.setDescriptor(getIndex(exec, index.value()), DontDelete | ReadOnly);
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i < m_length) {
+ ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail!
+ descriptor.setDescriptor(getIndex(exec, i), DontDelete | ReadOnly);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.h (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.h        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/JSString.h        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -626,9 +626,10 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < m_length) {
- slot.setValue(this, DontDelete | ReadOnly, getIndex(exec, index.value()));
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i < m_length) {
+ ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail!
+ slot.setValue(this, DontDelete | ReadOnly, getIndex(exec, i));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeLiteralParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -649,8 +649,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSObject* object = asObject(objectStack.last());
</span><span class="cx"> PropertyName ident = identifierStack.last();
</span><del>- if (Optional<uint32_t> index = ident.asIndex())
- object->putDirectIndex(m_exec, index.value(), lastValue);
</del><ins>+ unsigned i = ident.asIndex();
+ if (i != PropertyName::NotAnIndex)
+ object->putDirectIndex(m_exec, i, lastValue);
</ins><span class="cx"> else
</span><span class="cx"> object->putDirect(m_exec->vm(), ident, lastValue);
</span><span class="cx"> identifierStack.removeLast();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePropertyNameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PropertyName.h (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PropertyName.h        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/PropertyName.h        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -28,51 +28,48 @@
</span><span class="cx">
</span><span class="cx"> #include "Identifier.h"
</span><span class="cx"> #include "PrivateName.h"
</span><del>-#include <wtf/Optional.h>
</del><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><span class="cx"> template <typename CharType>
</span><del>-ALWAYS_INLINE Optional<uint32_t> toUInt32FromCharacters(const CharType* characters, unsigned length)
</del><ins>+ALWAYS_INLINE uint32_t toUInt32FromCharacters(const CharType* characters, unsigned length)
</ins><span class="cx"> {
</span><span class="cx"> // An empty string is not a number.
</span><span class="cx"> if (!length)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx">
</span><span class="cx"> // Get the first character, turning it into a digit.
</span><span class="cx"> uint32_t value = characters[0] - '0';
</span><span class="cx"> if (value > 9)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx">
</span><span class="cx"> // Check for leading zeros. If the first characher is 0, then the
</span><span class="cx"> // length of the string must be one - e.g. "042" is not equal to "42".
</span><span class="cx"> if (!value && length > 1)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx">
</span><span class="cx"> while (--length) {
</span><span class="cx"> // Multiply value by 10, checking for overflow out of 32 bits.
</span><span class="cx"> if (value > 0xFFFFFFFFU / 10)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx"> value *= 10;
</span><span class="cx">
</span><span class="cx"> // Get the next character, turning it into a digit.
</span><span class="cx"> uint32_t newValue = *(++characters) - '0';
</span><span class="cx"> if (newValue > 9)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx">
</span><span class="cx"> // Add in the old value, checking for overflow out of 32 bits.
</span><span class="cx"> newValue += value;
</span><span class="cx"> if (newValue < value)
</span><del>- return Nullopt;
</del><ins>+ return UINT_MAX;
</ins><span class="cx"> value = newValue;
</span><span class="cx"> }
</span><del>-
- if (value == UINT_MAX)
- return Nullopt;
</del><ins>+
</ins><span class="cx"> return value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE Optional<uint32_t> toUInt32FromStringImpl(StringImpl* impl)
</del><ins>+ALWAYS_INLINE uint32_t toUInt32FromStringImpl(StringImpl* impl)
</ins><span class="cx"> {
</span><span class="cx"> if (impl->is8Bit())
</span><span class="cx"> return toUInt32FromCharacters(impl->characters8(), impl->length());
</span><span class="lines">@@ -112,11 +109,11 @@
</span><span class="cx">
</span><span class="cx"> static const uint32_t NotAnIndex = UINT_MAX;
</span><span class="cx">
</span><del>- Optional<uint32_t> asIndex()
</del><ins>+ uint32_t asIndex()
</ins><span class="cx"> {
</span><del>- return m_impl ? toUInt32FromStringImpl(m_impl) : Nullopt;
</del><ins>+ return m_impl ? toUInt32FromStringImpl(m_impl) : NotAnIndex;
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> void dump(PrintStream& out) const
</span><span class="cx"> {
</span><span class="cx"> if (m_impl)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePropertyNameArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/PropertyNameArray.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!identifier || identifier == StringImpl::empty() || identifier->isAtomic());
</span><span class="cx"> if (!ASSERT_DISABLED) {
</span><del>- Optional<uint32_t> index = PropertyName(Identifier(m_vm, identifier)).asIndex();
- ASSERT_UNUSED(index, !index || index.value() >= m_previouslyEnumeratedLength);
</del><ins>+ uint32_t index = PropertyName(Identifier(m_vm, identifier)).asIndex();
+ ASSERT_UNUSED(index, index == PropertyName::NotAnIndex || index >= m_previouslyEnumeratedLength);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (m_alternateSet && m_alternateSet->contains(identifier))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringObject.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringObject.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/StringObject.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -128,8 +128,9 @@
</span><span class="cx"> StringObject* thisObject = jsCast<StringObject*>(cell);
</span><span class="cx"> if (propertyName == exec->propertyNames().length)
</span><span class="cx"> return false;
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && thisObject->internalValue()->canGetIndex(index.value())) {
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (thisObject->internalValue()->canGetIndex(i)) {
+ ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail!
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return JSObject::deleteProperty(thisObject, exec, propertyName);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStructurecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Structure.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Structure.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/JavaScriptCore/runtime/Structure.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1010,7 +1010,8 @@
</span><span class="cx">
</span><span class="cx"> bool Structure::prototypeChainMayInterceptStoreTo(VM& vm, PropertyName propertyName)
</span><span class="cx"> {
</span><del>- if (propertyName.asIndex())
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i != PropertyName::NotAnIndex)
</ins><span class="cx"> return anyObjectInChainMayInterceptIndexedAccesses();
</span><span class="cx">
</span><span class="cx"> for (Structure* current = this; ;) {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/ChangeLog        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-01-22 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r178894.
+ https://bugs.webkit.org/show_bug.cgi?id=140775
+
+ Broke JSC and bindings tests (Requested by ap_ on #webkit).
+
+ Reverted changeset:
+
+ "put_by_val_direct need to check the property is index or not
+ for using putDirect / putDirectIndex"
+ https://bugs.webkit.org/show_bug.cgi?id=140426
+ http://trac.webkit.org/changeset/178894
+
</ins><span class="cx"> 2015-01-22 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Fix iphoneos SDK builds for ios-ews queue
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -214,10 +214,11 @@
</span><span class="cx"> // We need to test the correct priority order.
</span><span class="cx">
</span><span class="cx"> // allow window[1] or parent[1] etc. (#56983)
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < thisObject->impl().frame()->tree().scopedChildCount()) {
</del><ins>+ unsigned i = propertyName.asIndex();
+ if (i < thisObject->impl().frame()->tree().scopedChildCount()) {
+ ASSERT(i != PropertyName::NotAnIndex);
</ins><span class="cx"> slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum,
</span><del>- toJS(exec, thisObject->impl().frame()->tree().scopedChild(index.value())->document()->domWindow()));
</del><ins>+ toJS(exec, thisObject->impl().frame()->tree().scopedChild(i)->document()->domWindow()));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLAllCollectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -65,8 +65,9 @@
</span><span class="cx"> if (exec->argumentCount() == 1) {
</span><span class="cx"> // Support for document.all(<index>) etc.
</span><span class="cx"> String string = exec->argument(0).toString(exec)->value(exec);
</span><del>- if (Optional<uint32_t> index = toUInt32FromStringImpl(string.impl()))
- return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection.item(index.value())));
</del><ins>+ unsigned index = toUInt32FromStringImpl(string.impl());
+ if (index != PropertyName::NotAnIndex)
+ return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection.item(index)));
</ins><span class="cx">
</span><span class="cx"> // Support for document.images('<name>') etc.
</span><span class="cx"> return JSValue::encode(namedItems(exec, jsCollection, Identifier(exec, string)));
</span><span class="lines">@@ -74,8 +75,9 @@
</span><span class="cx">
</span><span class="cx"> // The second arg, if set, is the index of the item we want
</span><span class="cx"> String string = exec->argument(0).toString(exec)->value(exec);
</span><del>- if (Optional<uint32_t> index = toUInt32FromStringImpl(exec->argument(1).toWTFString(exec).impl())) {
- if (auto* item = collection.namedItemWithIndex(string, index.value()))
</del><ins>+ unsigned index = toUInt32FromStringImpl(exec->argument(1).toWTFString(exec).impl());
+ if (index != PropertyName::NotAnIndex) {
+ if (auto* item = collection.namedItemWithIndex(string, index))
</ins><span class="cx"> return JSValue::encode(toJS(exec, jsCollection->globalObject(), item));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -101,8 +103,9 @@
</span><span class="cx">
</span><span class="cx"> JSValue JSHTMLAllCollection::item(ExecState* exec)
</span><span class="cx"> {
</span><del>- if (Optional<uint32_t> index = toUInt32FromStringImpl(exec->argument(0).toString(exec)->value(exec).impl()))
- return toJS(exec, globalObject(), impl().item(index.value()));
</del><ins>+ uint32_t index = toUInt32FromStringImpl(exec->argument(0).toString(exec)->value(exec).impl());
+ if (index != PropertyName::NotAnIndex)
+ return toJS(exec, globalObject(), impl().item(index));
</ins><span class="cx"> return namedItems(exec, this, Identifier(exec, exec->argument(0).toString(exec)->value(exec)));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -360,16 +360,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($indexedGetterFunction) {
</span><del>- push(@getOwnPropertySlotImpl, " Optional<uint32_t> optionalIndex = propertyName.asIndex();\n");
</del><ins>+ push(@getOwnPropertySlotImpl, " unsigned index = propertyName.asIndex();\n");
</ins><span class="cx">
</span><span class="cx"> # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
</span><span class="cx"> # where the index is out of range.
</span><span class="cx"> if ($indexedGetterFunction->signature->type eq "DOMString") {
</span><del>- push(@getOwnPropertySlotImpl, " if (optionalIndex) {\n");
</del><ins>+ push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex) {\n");
</ins><span class="cx"> } else {
</span><del>- push(@getOwnPropertySlotImpl, " if (optionalIndex && optionalIndex.value() < thisObject->impl().length()) {\n");
</del><ins>+ push(@getOwnPropertySlotImpl, " if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {\n");
</ins><span class="cx"> }
</span><del>- push(@getOwnPropertySlotImpl, " unsigned index = optionalIndex.value();\n");
</del><span class="cx"> # Assume that if there's a setter, the index will be writable
</span><span class="cx"> if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
</span><span class="cx"> push(@getOwnPropertySlotImpl, " unsigned attributes = ${namespaceMaybe}DontDelete;\n");
</span><span class="lines">@@ -2449,8 +2448,9 @@
</span><span class="cx"> push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");
</span><span class="cx"> push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
</span><span class="cx"> if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
</span><del>- push(@implContent, " if (Optional<uint32_t> index = propertyName.asIndex()) {\n");
- push(@implContent, " thisObject->indexSetter(exec, index.value(), value);\n");
</del><ins>+ push(@implContent, " unsigned index = propertyName.asIndex();\n");
+ push(@implContent, " if (index != PropertyName::NotAnIndex) {\n");
+ push(@implContent, " thisObject->indexSetter(exec, index, value);\n");
</ins><span class="cx"> push(@implContent, " return;\n");
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSFloat64Arraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -174,9 +174,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
- slot.setValue(thisObject, thisObject->getByIndex(exec, index.value()));
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex && index < static_cast<Float64Array*>(thisObject->impl())->length()) {
+ slot.setValue(thisObject, thisObject->getByIndex(exec, index));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return getStaticValueSlot<JSFloat64Array, Base>(exec, getJSFloat64ArrayTable(exec), thisObject, propertyName, slot);
</span><span class="lines">@@ -186,9 +186,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
- descriptor.setDescriptor(thisObject->getByIndex(exec, index.value()), DontDelete);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex && index < static_cast<Float64Array*>(thisObject->impl())->length()) {
+ descriptor.setDescriptor(thisObject->getByIndex(exec, index), DontDelete);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return getStaticValueDescriptor<JSFloat64Array, Base>(exec, getJSFloat64ArrayTable(exec), thisObject, propertyName, descriptor);
</span><span class="lines">@@ -215,8 +215,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(cell);
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- thisObject->indexSetter(exec, index.value(), value);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ thisObject->indexSetter(exec, index, value);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> Base::put(thisObject, exec, propertyName, value, slot);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -180,10 +180,10 @@
</span><span class="cx"> slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < thisObject->impl().length()) {
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex && index < thisObject->impl().length()) {
</ins><span class="cx"> unsigned attributes = DontDelete | ReadOnly;
</span><del>- slot.setValue(thisObject, attributes, toJS(exec, thisObject->globalObject(), thisObject->impl().item(index.value())));
</del><ins>+ slot.setValue(thisObject, attributes, toJS(exec, thisObject->globalObject(), thisObject->impl().item(index)));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (canGetItemsForName(exec, &thisObject->impl(), propertyName)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeruntime_arraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/runtime_array.cpp (178927 => 178928)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/runtime_array.cpp        2015-01-22 19:27:25 UTC (rev 178927)
+++ trunk/Source/WebCore/bridge/runtime_array.cpp        2015-01-22 19:34:34 UTC (rev 178928)
</span><span class="lines">@@ -89,10 +89,11 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Optional<uint32_t> index = propertyName.asIndex();
- if (index && index.value() < thisObject->getLength()) {
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index < thisObject->getLength()) {
+ ASSERT(index != PropertyName::NotAnIndex);
</ins><span class="cx"> slot.setValue(thisObject, DontDelete | DontEnum,
</span><del>- thisObject->getConcreteArray()->valueAt(exec, index.value()));
</del><ins>+ thisObject->getConcreteArray()->valueAt(exec, index));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -119,8 +120,9 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Optional<uint32_t> index = propertyName.asIndex()) {
- thisObject->getConcreteArray()->setValueAt(exec, index.value(), value);
</del><ins>+ unsigned index = propertyName.asIndex();
+ if (index != PropertyName::NotAnIndex) {
+ thisObject->getConcreteArray()->setValueAt(exec, index, value);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>