Changeset 253144 in webkit
- Timestamp:
- Dec 4, 2019 10:26:06 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r253137 r253144 1 2019-12-04 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] AI should convert IsCellWithType to constant when Structure set is finite 4 https://bugs.webkit.org/show_bug.cgi?id=204141 5 6 Reviewed by Mark Lam. 7 8 * stress/generator-cell-with-type.js: Added. 9 (shouldBe): 10 (shouldThrow): 11 (test): 12 (i.shouldThrow): 13 * stress/is-cell-with-type-should-check-non-cell-cases.js: Added. 14 (getter): 15 (foo): 16 1 17 2019-12-04 Mark Lam <mark.lam@apple.com> 2 18 -
trunk/Source/JavaScriptCore/ChangeLog
r253143 r253144 1 2019-12-04 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] AI should convert IsCellWithType to constant when Structure set is finite 4 https://bugs.webkit.org/show_bug.cgi?id=204141 5 6 Reviewed by Mark Lam. 7 8 We should fold IsCellWithType if Structure set is finite since we have a chance to know what JSType is. 9 The difference from the last patch is that we have `if (!(child.m_type & ~SpecCell))` check. Even if 10 structures meet the requirement, this structures do not guarantee that non cell types never come. We 11 should ensure it by using proven type. 12 13 * dfg/DFGAbstractInterpreterInlines.h: 14 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): 15 1 16 2019-12-04 Yusuke Suzuki <ysuzuki@apple.com> 2 17 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r253124 r253144 1444 1444 if (constantWasSet) 1445 1445 break; 1446 } 1447 1448 if (!(child.m_type & ~SpecCell)) { 1449 if (child.m_structure.isFinite()) { 1450 bool constantWasSet = false; 1451 switch (node->op()) { 1452 case IsCellWithType: { 1453 bool ok = true; 1454 Optional<bool> result; 1455 child.m_structure.forEach( 1456 [&](RegisteredStructure structure) { 1457 bool matched = structure->typeInfo().type() == node->queriedType(); 1458 if (!result) 1459 result = matched; 1460 else { 1461 if (result.value() != matched) 1462 ok = false; 1463 } 1464 }); 1465 if (ok && result) { 1466 setConstant(node, jsBoolean(result.value())); 1467 constantWasSet = true; 1468 } 1469 break; 1470 } 1471 default: 1472 break; 1473 } 1474 if (constantWasSet) 1475 break; 1476 } 1446 1477 } 1447 1478
Note: See TracChangeset
for help on using the changeset viewer.