Diff
Modified: branches/safari-601.1.32.2-branch/Source/_javascript_Core/ChangeLog (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/ChangeLog 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/ChangeLog 2015-05-19 01:06:06 UTC (rev 184533)
@@ -1,5 +1,33 @@
2015-05-18 Matthew Hanson <[email protected]>
+ Merge r184367. rdar://problem/20979071
+
+ 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-18 Matthew Hanson <[email protected]>
+
Merge custom patch. rdar://problem/20950052
2015-05-15 Dean Jackson <[email protected]>
Modified: branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2015-05-19 01:06:06 UTC (rev 184533)
@@ -3123,10 +3123,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);
}
@@ -3638,7 +3639,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: branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGClobberize.h (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGClobberize.h 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGClobberize.h 2015-05-19 01:06:06 UTC (rev 184533)
@@ -832,7 +832,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: branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGFixupPhase.cpp 2015-05-19 01:06:06 UTC (rev 184533)
@@ -1055,9 +1055,7 @@
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());
speculateForBarrier(node->child2());
break;
}
Modified: branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp 2015-05-19 01:06:06 UTC (rev 184533)
@@ -3966,7 +3966,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: branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp 2015-05-19 01:06:06 UTC (rev 184533)
@@ -4005,7 +4005,7 @@
}
case PutGlobalVar: {
- JSValueOperand value(this, node->child1());
+ JSValueOperand value(this, node->child2());
m_jit.store64(value.gpr(), node->variablePointer());
Modified: branches/safari-601.1.32.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (184532 => 184533)
--- branches/safari-601.1.32.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2015-05-19 01:00:31 UTC (rev 184532)
+++ branches/safari-601.1.32.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp 2015-05-19 01:06:06 UTC (rev 184533)
@@ -3852,7 +3852,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()