Changeset 271034 in webkit
- Timestamp:
- Dec 21, 2020, 11:54:14 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGByteCodeParser.cpp (modified) (6 diffs)
-
dfg/DFGConstantFoldingPhase.cpp (modified) (1 diff)
-
runtime/Structure.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r270993 r271034 1 2020-12-21 Keith Miller <keith_miller@apple.com> 2 3 DFG should make sure replacement watchpoint is fired before folding to PutByOffset 4 https://bugs.webkit.org/show_bug.cgi?id=220031 5 <rdar://72045350> 6 7 Reviewed by Saam Barati. 8 9 * dfg/DFGByteCodeParser.cpp: 10 (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent): 11 (JSC::DFG::ByteCodeParser::checkPresence): 12 (JSC::DFG::ByteCodeParser::checkPresenceForReplace): 13 (JSC::DFG::ByteCodeParser::load): 14 (JSC::DFG::ByteCodeParser::store): 15 (JSC::DFG::ByteCodeParser::presenceLike): Deleted. 16 (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted. 17 * dfg/DFGConstantFoldingPhase.cpp: 18 (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset): 19 * runtime/Structure.cpp: 20 (JSC::Structure::dump const): 21 1 22 2020-12-18 Mark Lam <mark.lam@apple.com> 2 23 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r270874 r271034 228 228 // Create a presence ObjectPropertyCondition based on some known offset and structure set. Does not 229 229 // check the validity of the condition, but it may return a null one if it encounters a contradiction. 230 ObjectPropertyCondition presence Like(230 ObjectPropertyCondition presenceConditionIfConsistent( 231 231 JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&); 232 232 … … 234 234 // way as in all of the structures in the set. It may emit code instead of just setting a watchpoint. 235 235 // Returns true if this all works out. 236 bool checkPresence Like(JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&);237 void checkPresence Like(Node* base, UniquedStringImpl*, PropertyOffset, const StructureSet&);236 bool checkPresence(JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&); 237 void checkPresenceForReplace(Node* base, UniquedStringImpl*, PropertyOffset, const StructureSet&); 238 238 239 239 // Works with both GetByIdVariant and the setter form of PutByIdVariant. … … 4387 4387 } 4388 4388 4389 ObjectPropertyCondition ByteCodeParser::presence Like(4389 ObjectPropertyCondition ByteCodeParser::presenceConditionIfConsistent( 4390 4390 JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4391 4391 { … … 4405 4405 } 4406 4406 4407 bool ByteCodeParser::checkPresence Like(4407 bool ByteCodeParser::checkPresence( 4408 4408 JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4409 4409 { 4410 return check(presence Like(knownBase, uid, offset, set));4410 return check(presenceConditionIfConsistent(knownBase, uid, offset, set)); 4411 4411 } 4412 4412 4413 void ByteCodeParser::checkPresence Like(4413 void ByteCodeParser::checkPresenceForReplace( 4414 4414 Node* base, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4415 4415 { 4416 4416 if (JSObject* knownBase = base->dynamicCastConstant<JSObject*>(*m_vm)) { 4417 if (checkPresenceLike(knownBase, uid, offset, set)) 4417 auto condition = presenceConditionIfConsistent(knownBase, uid, offset, set); 4418 if (check(condition)) { 4419 auto* watchpointSet = knownBase->structure(*m_vm)->propertyReplacementWatchpointSet(condition.offset()); 4420 // This means that we probably have a stale cache and we should gather more information. 4421 if (!watchpointSet || watchpointSet->isStillValid()) 4422 addToGraph(ForceOSRExit); 4418 4423 return; 4424 } 4419 4425 } 4420 4426 … … 4469 4475 4470 4476 ObjectPropertyCondition presenceCondition = 4471 presence Like(knownBase, uid, variant.offset(), variant.structureSet());4477 presenceConditionIfConsistent(knownBase, uid, variant.offset(), variant.structureSet()); 4472 4478 if (presenceCondition) { 4473 4479 ObjectPropertyCondition equivalenceCondition = … … 4526 4532 RELEASE_ASSERT(variant.kind() == PutByIdVariant::Replace); 4527 4533 4528 checkPresence Like(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure());4534 checkPresenceForReplace(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure()); 4529 4535 return handlePutByOffset(base, identifier, variant.offset(), value); 4530 4536 } -
trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
r268794 r271034 1428 1428 return; 1429 1429 1430 if (variant.kind() == PutByIdVariant::Replace) { 1431 auto* watchpoints = structure->propertyReplacementWatchpointSet(condition.offset()); 1432 if (!watchpoints || watchpoints->isStillValid()) 1433 return; 1434 } 1435 1430 1436 m_insertionSet.insertNode( 1431 1437 indexInBlock, SpecNone, CheckStructure, node->origin, -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r267040 r271034 1409 1409 out.print(", Shady leaf"); 1410 1410 1411 if (transitionWatchpointSet().isBeingWatched()) 1412 out.print(" (Watched)"); 1413 1411 1414 out.print("]"); 1412 1415 }
Note:
See TracChangeset
for help on using the changeset viewer.