Changeset 274942 in webkit
- Timestamp:
- Mar 24, 2021, 9:56:42 AM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r274935 r274942 1 2021-03-24 Saam Barati <sbarati@apple.com> 2 3 r271034 added code in constant folding phase that's unreachable given current invariants of our ICs and PutByIdStatus 4 https://bugs.webkit.org/show_bug.cgi?id=223625 5 6 Reviewed by Yusuke Suzuki. 7 8 The code was doing a lot of wrong things by making bad assumptions about the 9 invariants of PutByIdVariants. Replace PutByIdVariants never have object 10 property condition sets, since we always replace on the self object (and don't 11 look at the prototype chain). This patch clears up the code to make it 12 clearer what the invariants are. 13 14 With respect to the original fix about not emitting a PutByOffset for a 15 Replace on a Structure that has an unfired replacement watchpoint set, 16 that was already handled by the PutByIdStatus::computeFor variant we're 17 calling inside of constant folding. It will return TakesSlowPathif it 18 encounters a Replace where the Structure still has an unfired watchpoint. 19 20 * dfg/DFGConstantFoldingPhase.cpp: 21 (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset): 22 1 23 2021-03-24 Yusuke Suzuki <ysuzuki@apple.com> 2 24 -
trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
r271034 r274942 1420 1420 TransitionVector transitions; 1421 1421 for (const PutByIdVariant& variant : status.variants()) { 1422 for (const ObjectPropertyCondition& condition : variant.conditionSet()) { 1423 if (m_graph.watchCondition(condition)) 1424 continue; 1425 1426 Structure* structure = condition.object()->structure(m_graph.m_vm); 1427 if (!condition.structureEnsuresValidity(structure)) 1428 return; 1429 1430 if (variant.kind() == PutByIdVariant::Replace) { 1431 auto* watchpoints = structure->propertyReplacementWatchpointSet(condition.offset()); 1432 if (!watchpoints || watchpoints->isStillValid()) 1422 if (variant.kind() == PutByIdVariant::Transition) { 1423 for (const ObjectPropertyCondition& condition : variant.conditionSet()) { 1424 if (m_graph.watchCondition(condition)) 1425 continue; 1426 1427 Structure* structure = condition.object()->structure(m_graph.m_vm); 1428 if (!condition.structureEnsuresValidity(structure)) 1433 1429 return; 1434 } 1435 1436 m_insertionSet.insertNode( 1437 indexInBlock, SpecNone, CheckStructure, node->origin, 1438 OpInfo(m_graph.addStructureSet(structure)), 1439 m_insertionSet.insertConstantForUse( 1440 indexInBlock, node->origin, condition.object(), KnownCellUse)); 1441 } 1442 1443 if (variant.kind() == PutByIdVariant::Transition) { 1430 1431 m_insertionSet.insertNode( 1432 indexInBlock, SpecNone, CheckStructure, node->origin, 1433 OpInfo(m_graph.addStructureSet(structure)), 1434 m_insertionSet.insertConstantForUse( 1435 indexInBlock, node->origin, condition.object(), KnownCellUse)); 1436 } 1437 1444 1438 ASSERT(privateFieldPutKind.isNone() || privateFieldPutKind.isDefine()); 1445 1439 RegisteredStructure newStructure = m_graph.registerStructure(variant.newStructure()); … … 1451 1445 ASSERT(variant.kind() == PutByIdVariant::Replace); 1452 1446 ASSERT(privateFieldPutKind.isNone() || privateFieldPutKind.isSet()); 1447 DFG_ASSERT(m_graph, node, variant.conditionSet().isEmpty()); 1453 1448 newSet.merge(*m_graph.addStructureSet(variant.oldStructure())); 1454 1449 }
Note:
See TracChangeset
for help on using the changeset viewer.