Modified: trunk/Source/_javascript_Core/ChangeLog (187509 => 187510)
--- trunk/Source/_javascript_Core/ChangeLog 2015-07-28 20:46:49 UTC (rev 187509)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-07-28 20:50:18 UTC (rev 187510)
@@ -1,3 +1,19 @@
+2015-07-28 Filip Pizlo <[email protected]>
+
+ DFG::PutStackSinkingPhase should be more aggressive about its "no GetStack until put" rule
+ https://bugs.webkit.org/show_bug.cgi?id=147371
+
+ Reviewed by Mark Lam.
+
+ Two fixes:
+
+ - Make ConflictingFlush really mean that you can't load from the stack slot. This means not
+ using ConflictingFlush for arguments.
+
+ - Assert that a GetStack never sees ConflictingFlush.
+
+ * dfg/DFGPutStackSinkingPhase.cpp:
+
2015-07-28 Basile Clement <[email protected]>
Misleading error message: "At least one digit must occur after a decimal point"
Modified: trunk/Source/_javascript_Core/dfg/DFGPutStackSinkingPhase.cpp (187509 => 187510)
--- trunk/Source/_javascript_Core/dfg/DFGPutStackSinkingPhase.cpp 2015-07-28 20:46:49 UTC (rev 187509)
+++ trunk/Source/_javascript_Core/dfg/DFGPutStackSinkingPhase.cpp 2015-07-28 20:50:18 UTC (rev 187510)
@@ -216,9 +216,10 @@
deferredAtTail[block] =
Operands<FlushFormat>(OperandsLike, block->variablesAtHead);
}
+
+ for (unsigned local = deferredAtHead.atIndex(0).numberOfLocals(); local--;)
+ deferredAtHead.atIndex(0).local(local) = ConflictingFlush;
- deferredAtHead.atIndex(0).fill(ConflictingFlush);
-
do {
changed = false;
@@ -230,12 +231,18 @@
dataLog("Deferred at ", node, ":", deferred, "\n");
if (node->op() == GetStack) {
+ DFG_ASSERT(
+ m_graph, node,
+ deferred.operand(node->stackAccessData()->local) != ConflictingFlush);
+
// A GetStack doesn't affect anything, since we know which local we are reading
// from.
continue;
}
auto escapeHandler = [&] (VirtualRegister operand) {
+ if (verbose)
+ dataLog("For ", node, " escaping ", operand, "\n");
if (operand.isHeader())
return;
// We will materialize just before any reads.
@@ -406,6 +413,10 @@
StackAccessData* data = ""
FlushFormat format = deferred.operand(data->local);
if (!isConcrete(format)) {
+ DFG_ASSERT(
+ m_graph, node,
+ deferred.operand(data->local) != ConflictingFlush);
+
// This means there is no deferral. No deferral means that the most
// authoritative value for this stack slot is what is stored in the stack. So,
// keep the GetStack.
@@ -427,12 +438,18 @@
default: {
auto escapeHandler = [&] (VirtualRegister operand) {
+ if (verbose)
+ dataLog("For ", node, " escaping ", operand, "\n");
+
if (operand.isHeader())
return;
FlushFormat format = deferred.operand(operand);
- if (!isConcrete(format))
+ if (!isConcrete(format)) {
+ // It's dead now, rather than conflicting.
+ deferred.operand(operand) = DeadFlush;
return;
+ }
// Gotta insert a PutStack.
if (verbose)