Title: [221470] trunk
- Revision
- 221470
- Author
- [email protected]
- Date
- 2017-08-31 20:05:39 -0700 (Thu, 31 Aug 2017)
Log Message
Graph::methodOfGettingAValueProfileFor compares NodeOrigin instead of the semantic CodeOrigin
https://bugs.webkit.org/show_bug.cgi?id=176206
Reviewed by Keith Miller.
JSTests:
* stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js: Added.
(a):
(b):
(foo):
Source/_javascript_Core:
Mark fixed the main issue in Graph::methodOfGettingAValueProfileFor in r208560
when he fixed it from overwriting invalid parts of the ArithProfile when the
currentNode and the operandNode are from the same bytecode. However, the
mechanism used to determine same bytecode was comparing NodeOrigin. That's
slightly wrong. We need to compare semantic origin, since two NodeOrigins can
have the same semantic origin, but differ only in exitOK. For example,
in the below IR, the DoubleRep and the Phi have the same semantic
origin, but different NodeOrigins.
43 Phi(JS|PureInt, NonBoolInt32|NonIntAsdouble, W:SideState, bc#63, ExitInvalid)
58 ExitOK(MustGen, W:SideState, bc#63)
51 DoubleRep(Check:Number:Kill:@43, Double|PureInt, BytecodeDouble, Exits, bc#63)
54 ArithNegate(DoubleRep:Kill:@51<Double>, Double|UseAsOther|MayHaveDoubleResult, AnyIntAsDouble|NonIntAsdouble, NotSet, Exits, bc#63)
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
Modified Paths
Added Paths
Diff
Modified: trunk/JSTests/ChangeLog (221469 => 221470)
--- trunk/JSTests/ChangeLog 2017-09-01 02:59:19 UTC (rev 221469)
+++ trunk/JSTests/ChangeLog 2017-09-01 03:05:39 UTC (rev 221470)
@@ -1,3 +1,15 @@
+2017-08-31 Saam Barati <[email protected]>
+
+ Graph::methodOfGettingAValueProfileFor compares NodeOrigin instead of the semantic CodeOrigin
+ https://bugs.webkit.org/show_bug.cgi?id=176206
+
+ Reviewed by Keith Miller.
+
+ * stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js: Added.
+ (a):
+ (b):
+ (foo):
+
2017-08-31 Ryan Haddad <[email protected]>
Skip two slow JSC tests after r221422.
Added: trunk/JSTests/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js (0 => 221470)
--- trunk/JSTests/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js (rev 0)
+++ trunk/JSTests/stress/compare-semantic-origin-op-negate-method-of-getting-a-value-profile.js 2017-09-01 03:05:39 UTC (rev 221470)
@@ -0,0 +1,18 @@
+let flag = false;
+function a() { return flag ? {} : 10; }
+noInline(a);
+function b() { return 10.2; }
+noInline(b);
+
+function foo(x) {
+ let r = -(x ? a() : b());
+ return r;
+}
+noInline(foo);
+
+for (let i = 0; i < 100000; ++i)
+ foo(!!(i%2));
+
+flag = true;
+for (let i = 0; i < 100000; ++i)
+ foo(!!(i%2));
Modified: trunk/Source/_javascript_Core/ChangeLog (221469 => 221470)
--- trunk/Source/_javascript_Core/ChangeLog 2017-09-01 02:59:19 UTC (rev 221469)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-09-01 03:05:39 UTC (rev 221470)
@@ -1,3 +1,27 @@
+2017-08-31 Saam Barati <[email protected]>
+
+ Graph::methodOfGettingAValueProfileFor compares NodeOrigin instead of the semantic CodeOrigin
+ https://bugs.webkit.org/show_bug.cgi?id=176206
+
+ Reviewed by Keith Miller.
+
+ Mark fixed the main issue in Graph::methodOfGettingAValueProfileFor in r208560
+ when he fixed it from overwriting invalid parts of the ArithProfile when the
+ currentNode and the operandNode are from the same bytecode. However, the
+ mechanism used to determine same bytecode was comparing NodeOrigin. That's
+ slightly wrong. We need to compare semantic origin, since two NodeOrigins can
+ have the same semantic origin, but differ only in exitOK. For example,
+ in the below IR, the DoubleRep and the Phi have the same semantic
+ origin, but different NodeOrigins.
+
+ 43 Phi(JS|PureInt, NonBoolInt32|NonIntAsdouble, W:SideState, bc#63, ExitInvalid)
+ 58 ExitOK(MustGen, W:SideState, bc#63)
+ 51 DoubleRep(Check:Number:Kill:@43, Double|PureInt, BytecodeDouble, Exits, bc#63)
+ 54 ArithNegate(DoubleRep:Kill:@51<Double>, Double|UseAsOther|MayHaveDoubleResult, AnyIntAsDouble|NonIntAsdouble, NotSet, Exits, bc#63)
+
+ * dfg/DFGGraph.cpp:
+ (JSC::DFG::Graph::methodOfGettingAValueProfileFor):
+
2017-08-31 Don Olmstead <[email protected]>
[CMake] Make USE_CF conditional within Windows
Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (221469 => 221470)
--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2017-09-01 02:59:19 UTC (rev 221469)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2017-09-01 03:05:39 UTC (rev 221470)
@@ -1606,7 +1606,7 @@
{
for (Node* node = operandNode; node;) {
// currentNode is null when we're doing speculation checks for checkArgumentTypes().
- if (!currentNode || node->origin != currentNode->origin) {
+ if (!currentNode || node->origin.semantic != currentNode->origin.semantic) {
CodeBlock* profiledBlock = baselineCodeBlockFor(node->origin.semantic);
if (node->accessesStack(*this)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes