From 979305219eaee3dc7d297f7b3d181988f413cc6d Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Fri, 16 Feb 2018 09:18:48 -0800 Subject: [PATCH] delete liveness workarond. (#16416) --- src/jit/liveness.cpp | 54 +--------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/src/jit/liveness.cpp b/src/jit/liveness.cpp index ba479dc..6793bf5 100644 --- a/src/jit/liveness.cpp +++ b/src/jit/liveness.cpp @@ -1977,45 +1977,6 @@ void Compiler::fgComputeLife(VARSET_TP& life, } } -static bool HasAnyThrowableNodes(Compiler* compiler, BasicBlock* block, jitstd::vector& disabledNodes) -{ - - LIR::Range& blockRange = LIR::AsRange(block); - GenTree* currentNode = blockRange.LastNode(); - GenTree* endNode = blockRange.FirstNonPhiNode()->gtPrev; - - size_t left = disabledNodes.size(); - - while (currentNode != endNode) - { - for (size_t i = 0; i < disabledNodes.size(); ++i) - { - if (disabledNodes[i] == currentNode) - { - --left; - disabledNodes[i] = nullptr; - break; - } - } - - if (currentNode->OperMayThrow(compiler)) - { - return true; - } - - if (left == 0) - { - return false; - } - - currentNode = currentNode->gtPrev; - } - - // If we reach here that means that there is an affecting node outside the current block - // so return true - return true; -} - void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALARG_TP volatileVars) { // Don't kill volatile vars and vars in scope. @@ -2045,9 +2006,7 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR JITDUMP("Removing dead call:\n"); DISPNODE(call); - jitstd::vector disabledNodes(getAllocator()); - - node->VisitOperands([&disabledNodes](GenTree* operand) -> GenTree::VisitResult { + node->VisitOperands([](GenTree* operand) -> GenTree::VisitResult { if (operand->IsValue()) { operand->SetUnusedValue(); @@ -2057,9 +2016,6 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR // these nodes. if (operand->OperIs(GT_PUTARG_STK)) { - - // collect stack-affecting nodes - disabledNodes.push_back(operand); operand->AsPutArgStk()->gtOp1->SetUnusedValue(); operand->gtBashToNOP(); } @@ -2067,14 +2023,6 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR return GenTree::VisitResult::Continue; }); - if (!disabledNodes.empty()) - { - if (HasAnyThrowableNodes(this, block, disabledNodes)) - { - codeGen->setFramePointerRequired(true); - } - } - blockRange.Remove(node); // Removing a call does not affect liveness unless it is a tail call in a nethod with P/Invokes or -- 2.7.4