Changeset 271246 in webkit
- Timestamp:
- Jan 7, 2021, 11:50:27 AM (6 years ago)
- Location:
- branches/safari-610-branch/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
-
branches/safari-610-branch/Source/JavaScriptCore/ChangeLog
r271030 r271246 1 2021-01-07 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r271034. rdar://problem/72894016 4 5 DFG should make sure replacement watchpoint is fired before folding to PutByOffset 6 https://bugs.webkit.org/show_bug.cgi?id=220031 7 <rdar://72045350> 8 9 Reviewed by Saam Barati. 10 11 * dfg/DFGByteCodeParser.cpp: 12 (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent): 13 (JSC::DFG::ByteCodeParser::checkPresence): 14 (JSC::DFG::ByteCodeParser::checkPresenceForReplace): 15 (JSC::DFG::ByteCodeParser::load): 16 (JSC::DFG::ByteCodeParser::store): 17 (JSC::DFG::ByteCodeParser::presenceLike): Deleted. 18 (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted. 19 * dfg/DFGConstantFoldingPhase.cpp: 20 (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset): 21 * runtime/Structure.cpp: 22 (JSC::Structure::dump const): 23 24 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271034 268f45cc-cd09-0410-ab3c-d52691b4dbfc 25 26 2020-12-21 Keith Miller <keith_miller@apple.com> 27 28 DFG should make sure replacement watchpoint is fired before folding to PutByOffset 29 https://bugs.webkit.org/show_bug.cgi?id=220031 30 <rdar://72045350> 31 32 Reviewed by Saam Barati. 33 34 * dfg/DFGByteCodeParser.cpp: 35 (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent): 36 (JSC::DFG::ByteCodeParser::checkPresence): 37 (JSC::DFG::ByteCodeParser::checkPresenceForReplace): 38 (JSC::DFG::ByteCodeParser::load): 39 (JSC::DFG::ByteCodeParser::store): 40 (JSC::DFG::ByteCodeParser::presenceLike): Deleted. 41 (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted. 42 * dfg/DFGConstantFoldingPhase.cpp: 43 (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset): 44 * runtime/Structure.cpp: 45 (JSC::Structure::dump const): 46 1 47 2020-12-16 Mark Lam <mark.lam@apple.com> 2 48 -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r265934 r271246 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. … … 4394 4394 } 4395 4395 4396 ObjectPropertyCondition ByteCodeParser::presence Like(4396 ObjectPropertyCondition ByteCodeParser::presenceConditionIfConsistent( 4397 4397 JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4398 4398 { … … 4412 4412 } 4413 4413 4414 bool ByteCodeParser::checkPresence Like(4414 bool ByteCodeParser::checkPresence( 4415 4415 JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4416 4416 { 4417 return check(presence Like(knownBase, uid, offset, set));4417 return check(presenceConditionIfConsistent(knownBase, uid, offset, set)); 4418 4418 } 4419 4419 4420 void ByteCodeParser::checkPresence Like(4420 void ByteCodeParser::checkPresenceForReplace( 4421 4421 Node* base, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set) 4422 4422 { 4423 4423 if (JSObject* knownBase = base->dynamicCastConstant<JSObject*>(*m_vm)) { 4424 if (checkPresenceLike(knownBase, uid, offset, set)) 4424 auto condition = presenceConditionIfConsistent(knownBase, uid, offset, set); 4425 if (check(condition)) { 4426 auto* watchpointSet = knownBase->structure(*m_vm)->propertyReplacementWatchpointSet(condition.offset()); 4427 // This means that we probably have a stale cache and we should gather more information. 4428 if (!watchpointSet || watchpointSet->isStillValid()) 4429 addToGraph(ForceOSRExit); 4425 4430 return; 4431 } 4426 4432 } 4427 4433 … … 4476 4482 4477 4483 ObjectPropertyCondition presenceCondition = 4478 presence Like(knownBase, uid, variant.offset(), variant.structureSet());4484 presenceConditionIfConsistent(knownBase, uid, variant.offset(), variant.structureSet()); 4479 4485 if (presenceCondition) { 4480 4486 ObjectPropertyCondition equivalenceCondition = … … 4533 4539 RELEASE_ASSERT(variant.kind() == PutByIdVariant::Replace); 4534 4540 4535 checkPresence Like(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure());4541 checkPresenceForReplace(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure()); 4536 4542 return handlePutByOffset(base, identifier, variant.offset(), value); 4537 4543 } -
branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
r265934 r271246 705 705 } 706 706 707 if (variant.kind() == PutByIdVariant::Replace) { 708 auto* watchpoints = structure->propertyReplacementWatchpointSet(condition.offset()); 709 if (!watchpoints || watchpoints->isStillValid()) 710 return; 711 } 712 707 713 m_insertionSet.insertNode( 708 714 indexInBlock, SpecNone, CheckStructure, node->origin, -
branches/safari-610-branch/Source/JavaScriptCore/runtime/Structure.cpp
r265934 r271246 1359 1359 out.print(", Shady leaf"); 1360 1360 1361 if (transitionWatchpointSet().isBeingWatched()) 1362 out.print(" (Watched)"); 1363 1361 1364 out.print("]"); 1362 1365 }
Note:
See TracChangeset
for help on using the changeset viewer.