Modified: trunk/Source/_javascript_Core/ChangeLog (120555 => 120556)
--- trunk/Source/_javascript_Core/ChangeLog 2012-06-18 00:20:01 UTC (rev 120555)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-06-18 01:59:18 UTC (rev 120556)
@@ -1,3 +1,16 @@
+2012-06-17 Filip Pizlo <[email protected]>
+
+ DFG should attempt to use structure watchpoints for all inlined get_by_id's and put_by_id's
+ https://bugs.webkit.org/show_bug.cgi?id=89316
+
+ Reviewed by Oliver Hunt.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
+ (ByteCodeParser):
+ (JSC::DFG::ByteCodeParser::handleGetById):
+ (JSC::DFG::ByteCodeParser::parseBlock):
+
2012-06-15 Yong Li <[email protected]>
[BlackBerry] Put platform-specific GC policy in GCActivityCallback
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (120555 => 120556)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-06-18 00:20:01 UTC (rev 120555)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2012-06-18 01:59:18 UTC (rev 120556)
@@ -750,7 +750,7 @@
return call;
}
- void addStructureTransitionCheck(JSCell* object, Structure* structure)
+ NodeIndex addStructureTransitionCheck(JSCell* object, Structure* structure)
{
// Add a weak JS constant for the object regardless, since the code should
// be jettisoned if the object ever dies.
@@ -758,12 +758,19 @@
if (object->structure() == structure && structure->transitionWatchpointSetIsStillValid()) {
addToGraph(StructureTransitionWatchpoint, OpInfo(structure), objectIndex);
- return;
+ return objectIndex;
}
addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(structure)), objectIndex);
+
+ return objectIndex;
}
+ NodeIndex addStructureTransitionCheck(JSCell* object)
+ {
+ return addStructureTransitionCheck(object, object->structure());
+ }
+
SpeculatedType getPredictionWithoutOSRExit(NodeIndex nodeIndex, unsigned bytecodeIndex)
{
UNUSED_PARAM(nodeIndex);
@@ -1591,8 +1598,7 @@
for (unsigned i = 0; i < getByIdStatus.chain().size(); ++i) {
currentObject = asObject(currentStructure->prototypeForLookup(m_inlineStackTop->m_codeBlock));
currentStructure = getByIdStatus.chain()[i];
- base = addToGraph(WeakJSConstant, OpInfo(currentObject));
- addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(currentStructure)), base);
+ base = addStructureTransitionCheck(currentObject, currentStructure);
}
useInlineStorage = currentStructure->isUsingInlineStorage();
} else
@@ -1610,8 +1616,7 @@
if (getByIdStatus.specificValue()) {
ASSERT(getByIdStatus.specificValue().isCell());
- set(destinationOperand,
- addToGraph(WeakJSConstant, OpInfo(getByIdStatus.specificValue().asCell())));
+ set(destinationOperand, cellConstant(getByIdStatus.specificValue().asCell()));
return;
}
@@ -2210,21 +2215,17 @@
addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(putByIdStatus.oldStructure())), base);
if (!direct) {
- if (!putByIdStatus.oldStructure()->storedPrototype().isNull())
- addToGraph(
- CheckStructure,
- OpInfo(m_graph.addStructureSet(putByIdStatus.oldStructure()->storedPrototype().asCell()->structure())),
- cellConstant(putByIdStatus.oldStructure()->storedPrototype().asCell()));
+ if (!putByIdStatus.oldStructure()->storedPrototype().isNull()) {
+ addStructureTransitionCheck(
+ putByIdStatus.oldStructure()->storedPrototype().asCell());
+ }
for (WriteBarrier<Structure>* it = putByIdStatus.structureChain()->head(); *it; ++it) {
JSValue prototype = (*it)->storedPrototype();
if (prototype.isNull())
continue;
ASSERT(prototype.isCell());
- addToGraph(
- CheckStructure,
- OpInfo(m_graph.addStructureSet(prototype.asCell()->structure())),
- cellConstant(prototype.asCell()));
+ addStructureTransitionCheck(prototype.asCell());
}
}
ASSERT(putByIdStatus.oldStructure()->transitionWatchpointSetHasBeenInvalidated());
@@ -2321,8 +2322,7 @@
JSValue specificValue = globalObject->registerAt(entry.getIndex()).get();
ASSERT(specificValue.isCell());
- set(currentInstruction[1].u.operand,
- addToGraph(WeakJSConstant, OpInfo(specificValue.asCell())));
+ set(currentInstruction[1].u.operand, cellConstant(specificValue.asCell()));
NEXT_OPCODE(op_get_global_var_watchable);
}