Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (184366 => 184367)
--- trunk/Source/_javascript_Core/ChangeLog 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-05-15 03:51:52 UTC (rev 184367)
@@ -1,3 +1,27 @@
+2015-05-14 Filip Pizlo <[email protected]>
+
+ PutGlobalVar should reference the global object it's storing into
+ https://bugs.webkit.org/show_bug.cgi?id=145036
+
+ Reviewed by Michael Saboff.
+
+ This makes it easier to reason about store barrier insertion and elimination. This changes
+ the format of PutGlobalVar so that child1 is the global object and child2 is the value.
+ Previously it just had child1, and that was the value.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * dfg/DFGClobberize.h:
+ (JSC::DFG::clobberize):
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode):
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * ftl/FTLLowerDFGToLLVM.cpp:
+ (JSC::FTL::LowerDFGToLLVM::compilePutGlobalVar):
+
2015-05-14 Michael Catanzaro <[email protected]>
[CMake] Error out when ruby is too old
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (184366 => 184367)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2015-05-15 03:51:52 UTC (rev 184367)
@@ -3164,10 +3164,11 @@
case op_init_global_const: {
Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
+ JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject();
addToGraph(
PutGlobalVar,
- OpInfo(m_inlineStackTop->m_codeBlock->globalObject()->assertVariableIsInThisObject(currentInstruction[1].u.variablePointer)),
- value);
+ OpInfo(globalObject->assertVariableIsInThisObject(currentInstruction[1].u.variablePointer)),
+ weakJSConstant(globalObject), value);
NEXT_OPCODE(op_init_global_const);
}
@@ -3679,7 +3680,7 @@
ASSERT_UNUSED(entry, watchpoints == entry.watchpointSet());
}
Node* valueNode = get(VirtualRegister(value));
- addToGraph(PutGlobalVar, OpInfo(operand), valueNode);
+ addToGraph(PutGlobalVar, OpInfo(operand), weakJSConstant(globalObject), valueNode);
if (watchpoints && watchpoints->state() != IsInvalidated) {
// Must happen after the store. See comment for GetGlobalVar.
addToGraph(NotifyWrite, OpInfo(watchpoints));
Modified: trunk/Source/_javascript_Core/dfg/DFGClobberize.h (184366 => 184367)
--- trunk/Source/_javascript_Core/dfg/DFGClobberize.h 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/dfg/DFGClobberize.h 2015-05-15 03:51:52 UTC (rev 184367)
@@ -834,7 +834,7 @@
case PutGlobalVar:
write(AbstractHeap(Absolute, node->variablePointer()));
- def(HeapLocation(GlobalVariableLoc, AbstractHeap(Absolute, node->variablePointer())), node->child1().node());
+ def(HeapLocation(GlobalVariableLoc, AbstractHeap(Absolute, node->variablePointer())), node->child2().node());
return;
case NewArray:
Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (184366 => 184367)
--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2015-05-15 03:51:52 UTC (rev 184367)
@@ -1122,11 +1122,9 @@
break;
case PutGlobalVar: {
- Node* globalObjectNode = m_insertionSet.insertNode(
- m_indexInBlock, SpecNone, JSConstant, node->origin,
- OpInfo(m_graph.freeze(m_graph.globalObjectFor(node->origin.semantic))));
+ fixEdge<CellUse>(node->child1());
insertStoreBarrier(
- m_indexInBlock, Edge(globalObjectNode, KnownCellUse), node->child1());
+ m_indexInBlock, node->child1(), node->child2());
break;
}
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (184366 => 184367)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2015-05-15 03:51:52 UTC (rev 184367)
@@ -3995,7 +3995,7 @@
}
case PutGlobalVar: {
- JSValueOperand value(this, node->child1());
+ JSValueOperand value(this, node->child2());
// FIXME: if we happen to have a spare register - and _ONLY_ if we happen to have
// a spare register - a good optimization would be to put the register pointer into
Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (184366 => 184367)
--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2015-05-15 03:51:52 UTC (rev 184367)
@@ -4019,7 +4019,7 @@
}
case PutGlobalVar: {
- JSValueOperand value(this, node->child1());
+ JSValueOperand value(this, node->child2());
m_jit.store64(value.gpr(), node->variablePointer());
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (184366 => 184367)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2015-05-15 03:28:24 UTC (rev 184366)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2015-05-15 03:51:52 UTC (rev 184367)
@@ -3902,7 +3902,7 @@
void compilePutGlobalVar()
{
m_out.store64(
- lowJSValue(m_node->child1()), m_out.absolute(m_node->variablePointer()));
+ lowJSValue(m_node->child2()), m_out.absolute(m_node->variablePointer()));
}
void compileNotifyWrite()