comparison modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp @ 11208:db2c977a840b

8220147: Cherry pick GTK WebKit 2.22.7 changes Reviewed-by: mbilla, kcr
author arajkumar
date Fri, 08 Mar 2019 14:03:47 +0530
parents 2c80e5ef751e
children a1fb556cdd7d
comparison
equal deleted inserted replaced
4:7440b412ff02 5:b686f4d5af89
1008 bool run() 1008 bool run()
1009 { 1009 {
1010 ASSERT(m_graph.m_form == SSA); 1010 ASSERT(m_graph.m_form == SSA);
1011 1011
1012 // Before we do anything, make sure that we have a zero constant at the top. 1012 // Before we do anything, make sure that we have a zero constant at the top.
1013 for (Node* node : *m_graph.block(0)) {
1014 if (node->isInt32Constant() && !node->asInt32()) {
1015 m_zero = node;
1016 break;
1017 }
1018 }
1019 if (!m_zero) {
1020 m_zero = m_insertionSet.insertConstant(0, m_graph.block(0)->at(0)->origin, jsNumber(0)); 1013 m_zero = m_insertionSet.insertConstant(0, m_graph.block(0)->at(0)->origin, jsNumber(0));
1021 m_insertionSet.execute(m_graph.block(0)); 1014 m_insertionSet.execute(m_graph.block(0));
1022 }
1023 1015
1024 if (DFGIntegerRangeOptimizationPhaseInternal::verbose) { 1016 if (DFGIntegerRangeOptimizationPhaseInternal::verbose) {
1025 dataLog("Graph before integer range optimization:\n"); 1017 dataLog("Graph before integer range optimization:\n");
1026 m_graph.dump(); 1018 m_graph.dump();
1027 } 1019 }
1328 } 1320 }
1329 } 1321 }
1330 1322
1331 if (nonNegative && lessThanLength) { 1323 if (nonNegative && lessThanLength) {
1332 executeNode(block->at(nodeIndex)); 1324 executeNode(block->at(nodeIndex));
1333 node->remove(m_graph); 1325 node->convertToIdentityOn(m_zero);
1334 changed = true; 1326 changed = true;
1335 } 1327 }
1336 break; 1328 break;
1337 } 1329 }
1338 1330