Changeset 284585 in webkit
- Timestamp:
- Oct 20, 2021, 5:00:20 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGIntegerRangeOptimizationPhase.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r284576 r284585 1 2021-10-20 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] ArithAbs should care about INT32_MIN 4 https://bugs.webkit.org/show_bug.cgi?id=232051 5 rdar://84338648 6 7 Reviewed by Michael Saboff. 8 9 ArithAbs (without overflow check) can return negative value if the input is INT32_MIN with Int32Use. 10 11 * dfg/DFGIntegerRangeOptimizationPhase.cpp: 12 1 13 2021-10-20 Justin Michaud <justin_michaud@apple.com> 2 14 -
trunk/Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp
r284573 r284585 1401 1401 if (node->child1().useKind() != Int32Use) 1402 1402 break; 1403 setRelationship(Relationship(node, m_zero, Relationship::GreaterThan, -1)); 1403 1404 // If ArithAbs cares about overflow, then INT32_MIN input will cause OSR exit. 1405 // Thus we can safely say `x >= 0`. 1406 if (shouldCheckOverflow(node->arithMode())) { 1407 setRelationship(Relationship(node, m_zero, Relationship::GreaterThan, -1)); 1408 break; 1409 } 1410 1411 // If ArithAbs does not care about overflow, it can return INT32_MIN if the input is INT32_MIN. 1412 // If minValue is not INT32_MIN, we can still say it is `x >= 0`. 1413 int minValue = std::numeric_limits<int>::min(); 1414 auto iter = m_relationships.find(node->child1().node()); 1415 if (iter != m_relationships.end()) { 1416 for (Relationship relationship : iter->value) 1417 minValue = std::max(minValue, relationship.minValueOfLeft()); 1418 } 1419 1420 if (minValue > std::numeric_limits<int>::min()) 1421 setRelationship(Relationship(node, m_zero, Relationship::GreaterThan, -1)); 1404 1422 break; 1405 1423 }
Note:
See TracChangeset
for help on using the changeset viewer.