Commit 738b5c27 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Replace std::bind2nd usage with a lambda to fix C++17 build

Bug: v8:7218
Change-Id: I69a7f7340becc66aebe83448632f4fd47cd0ea7a
Reviewed-on: https://chromium-review.googlesource.com/827901Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50143}
parent 1e7bd2e2
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "src/compiler/gap-resolver.h" #include "src/compiler/gap-resolver.h"
#include <algorithm> #include <algorithm>
#include <functional>
#include <set> #include <set>
namespace v8 { namespace v8 {
...@@ -19,10 +18,6 @@ namespace { ...@@ -19,10 +18,6 @@ namespace {
const int kFloat32Bit = REP_BIT(MachineRepresentation::kFloat32); const int kFloat32Bit = REP_BIT(MachineRepresentation::kFloat32);
const int kFloat64Bit = REP_BIT(MachineRepresentation::kFloat64); const int kFloat64Bit = REP_BIT(MachineRepresentation::kFloat64);
inline bool Blocks(MoveOperands* move, InstructionOperand destination) {
return !move->IsEliminated() && move->source().InterferesWith(destination);
}
// Splits a FP move between two location operands into the equivalent series of // Splits a FP move between two location operands into the equivalent series of
// moves between smaller sub-operands, e.g. a double move to two single moves. // moves between smaller sub-operands, e.g. a double move to two single moves.
// This helps reduce the number of cycles that would normally occur under FP // This helps reduce the number of cycles that would normally occur under FP
...@@ -197,8 +192,11 @@ void GapResolver::PerformMove(ParallelMove* moves, MoveOperands* move) { ...@@ -197,8 +192,11 @@ void GapResolver::PerformMove(ParallelMove* moves, MoveOperands* move) {
// The move may be blocked on a (at most one) pending move, in which case we // The move may be blocked on a (at most one) pending move, in which case we
// have a cycle. Search for such a blocking move and perform a swap to // have a cycle. Search for such a blocking move and perform a swap to
// resolve it. // resolve it.
auto blocker = std::find_if(moves->begin(), moves->end(), auto blocker =
std::bind2nd(std::ptr_fun(&Blocks), destination)); std::find_if(moves->begin(), moves->end(), [&](MoveOperands* move) {
return !move->IsEliminated() &&
move->source().InterferesWith(destination);
});
if (blocker == moves->end()) { if (blocker == moves->end()) {
// The easy case: This move is not blocked. // The easy case: This move is not blocked.
assembler_->AssembleMove(&source, &destination); assembler_->AssembleMove(&source, &destination);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment