Commit 07190e90 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[compiler] Replace Min/Max by std::min/max

After c90ff8bd this is purely
a cosmetic change.

Change-Id: If804f1b7558ab2f8096e576570f68b848df7423c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2509592Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70900}
parent cfba2e5d
......@@ -869,7 +869,7 @@ bool TurboAssembler::NeedExtraInstructionsOrRegisterBranch(
unresolved_branches_.insert(std::pair<int, FarBranchInfo>(
max_reachable_pc, FarBranchInfo(pc_offset(), label)));
// Also maintain the next pool check.
next_veneer_pool_check_ = Min(
next_veneer_pool_check_ = std::min(
next_veneer_pool_check_, max_reachable_pc - kVeneerDistanceCheckMargin);
}
return need_longer_range;
......
......@@ -29,7 +29,7 @@ class V8_EXPORT_PRIVATE RegisterConfiguration {
static constexpr int kMaxGeneralRegisters = 32;
static constexpr int kMaxFPRegisters = 32;
static constexpr int kMaxRegisters =
Max(kMaxFPRegisters, kMaxGeneralRegisters);
std::max(kMaxFPRegisters, kMaxGeneralRegisters);
// Default RegisterConfigurations for the target architecture.
static const RegisterConfiguration* Default();
......
......@@ -1001,8 +1001,8 @@ void TopLevelLiveRange::AddUseInterval(LifetimePosition start,
// that each new use interval either precedes, intersects with or touches
// the last added interval.
DCHECK(start <= first_interval_->end());
first_interval_->set_start(Min(start, first_interval_->start()));
first_interval_->set_end(Max(end, first_interval_->end()));
first_interval_->set_start(std::min(start, first_interval_->start()));
first_interval_->set_end(std::max(end, first_interval_->end()));
}
}
}
......@@ -3385,7 +3385,7 @@ void LinearScanAllocator::UpdateDeferredFixedRanges(SpillMode spill_mode,
for (auto active : active_live_ranges()) {
split_conflicting(range, active, [this](LiveRange* updated) {
next_active_ranges_change_ =
Min(updated->End(), next_active_ranges_change_);
std::min(updated->End(), next_active_ranges_change_);
});
}
for (int reg = 0; reg < num_registers(); ++reg) {
......@@ -3396,7 +3396,7 @@ void LinearScanAllocator::UpdateDeferredFixedRanges(SpillMode spill_mode,
for (auto inactive : inactive_live_ranges(reg)) {
split_conflicting(range, inactive, [this](LiveRange* updated) {
next_inactive_ranges_change_ =
Min(updated->End(), next_inactive_ranges_change_);
std::min(updated->End(), next_inactive_ranges_change_);
});
}
}
......@@ -4129,9 +4129,9 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current,
LifetimePosition::GapFromInstructionIndex(0);
} else {
use_pos[aliased_reg] =
Min(block_pos[aliased_reg],
range->NextLifetimePositionRegisterIsBeneficial(
current->Start()));
std::min(block_pos[aliased_reg],
range->NextLifetimePositionRegisterIsBeneficial(
current->Start()));
}
}
}
......@@ -4157,10 +4157,10 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current,
if (kSimpleFPAliasing || !check_fp_aliasing()) {
if (is_fixed) {
block_pos[cur_reg] = Min(block_pos[cur_reg], next_intersection);
use_pos[cur_reg] = Min(block_pos[cur_reg], use_pos[cur_reg]);
block_pos[cur_reg] = std::min(block_pos[cur_reg], next_intersection);
use_pos[cur_reg] = std::min(block_pos[cur_reg], use_pos[cur_reg]);
} else {
use_pos[cur_reg] = Min(use_pos[cur_reg], next_intersection);
use_pos[cur_reg] = std::min(use_pos[cur_reg], next_intersection);
}
} else {
int alias_base_index = -1;
......@@ -4171,11 +4171,12 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current,
int aliased_reg = alias_base_index + aliases;
if (is_fixed) {
block_pos[aliased_reg] =
Min(block_pos[aliased_reg], next_intersection);
std::min(block_pos[aliased_reg], next_intersection);
use_pos[aliased_reg] =
Min(block_pos[aliased_reg], use_pos[aliased_reg]);
std::min(block_pos[aliased_reg], use_pos[aliased_reg]);
} else {
use_pos[aliased_reg] = Min(use_pos[aliased_reg], next_intersection);
use_pos[aliased_reg] =
std::min(use_pos[aliased_reg], next_intersection);
}
}
}
......@@ -4206,8 +4207,9 @@ void LinearScanAllocator::AllocateBlockedReg(LiveRange* current,
if (spill_mode == SpillMode::kSpillDeferred) {
InstructionBlock* deferred_block =
code()->GetInstructionBlock(current->Start().ToInstructionIndex());
new_end = Min(new_end, LifetimePosition::GapFromInstructionIndex(
LastDeferredInstructionIndex(deferred_block)));
new_end =
std::min(new_end, LifetimePosition::GapFromInstructionIndex(
LastDeferredInstructionIndex(deferred_block)));
}
// We couldn't spill until the next register use. Split before the register
......@@ -4315,7 +4317,7 @@ void LinearScanAllocator::SplitAndSpillIntersecting(LiveRange* current,
if (next_pos == nullptr) {
SpillAfter(range, split_pos, spill_mode);
} else {
next_intersection = Min(next_intersection, next_pos->pos());
next_intersection = std::min(next_intersection, next_pos->pos());
SpillBetween(range, split_pos, next_intersection, spill_mode);
}
it = InactiveToHandled(it);
......@@ -4407,17 +4409,18 @@ void LinearScanAllocator::SpillBetweenUntil(LiveRange* range,
// second part, as that likely is the current position of the register
// allocator and we cannot add ranges to unhandled that start before
// the current position.
LifetimePosition split_start = Max(second_part->Start().End(), until);
LifetimePosition split_start = std::max(second_part->Start().End(), until);
// If end is an actual use (which it typically is) we have to split
// so that there is a gap before so that we have space for moving the
// value into its position.
// However, if we have no choice, split right where asked.
LifetimePosition third_part_end = Max(split_start, end.PrevStart().End());
LifetimePosition third_part_end =
std::max(split_start, end.PrevStart().End());
// Instead of spliting right after or even before the block boundary,
// split on the boumndary to avoid extra moves.
if (data()->IsBlockBoundary(end.Start())) {
third_part_end = Max(split_start, end.Start());
third_part_end = std::max(split_start, end.Start());
}
LiveRange* third_part =
......
......@@ -825,7 +825,7 @@ class V8_EXPORT_PRIVATE TopLevelLiveRange final : public LiveRange {
bits_ = HasSlotUseField::update(bits_, SlotUseKind::kNoSlotUse);
}
void register_slot_use(SlotUseKind value) {
bits_ = HasSlotUseField::update(bits_, Max(slot_use_kind(), value));
bits_ = HasSlotUseField::update(bits_, std::max(slot_use_kind(), value));
}
SlotUseKind slot_use_kind() const { return HasSlotUseField::decode(bits_); }
......@@ -895,7 +895,7 @@ class V8_EXPORT_PRIVATE TopLevelLiveRange final : public LiveRange {
InstructionOperand* operand);
void SetSpillOperand(InstructionOperand* operand);
void SetSpillStartIndex(int start) {
spill_start_index_ = Min(start, spill_start_index_);
spill_start_index_ = std::min(start, spill_start_index_);
}
// Omits any moves from spill_move_insertion_locations_ that can be skipped.
......
......@@ -1495,7 +1495,7 @@ Node* JSCreateLowering::AllocateAliasedArguments(
}
// Calculate number of argument values being aliased/mapped.
int mapped_count = Min(argument_count, parameter_count);
int mapped_count = std::min(argument_count, parameter_count);
*has_aliased_arguments = true;
// Prepare an iterator over argument values recorded in the frame state.
......
......@@ -218,9 +218,9 @@ void Node::InsertInputs(Zone* zone, int index, int count) {
DCHECK_LT(0, count);
DCHECK_LT(index, InputCount());
for (int i = 0; i < count; i++) {
AppendInput(zone, InputAt(Max(InputCount() - count, 0)));
AppendInput(zone, InputAt(std::max(InputCount() - count, 0)));
}
for (int i = InputCount() - count - 1; i >= Max(index, count); --i) {
for (int i = InputCount() - count - 1; i >= std::max(index, count); --i) {
ReplaceInput(i, InputAt(i - count));
}
for (int i = 0; i < count; i++) {
......
......@@ -3096,7 +3096,7 @@ void TranslatedState::CreateArgumentsElementsTranslatedValues(
if (type == CreateArgumentsType::kMappedArguments) {
// If the actual number of arguments is less than the number of formal
// parameters, we have fewer holes to fill to not overshoot the length.
number_of_holes = Min(formal_parameter_count_, length);
number_of_holes = std::min(formal_parameter_count_, length);
}
for (int i = 0; i < number_of_holes; ++i) {
frame.Add(TranslatedValue::NewTagged(this, roots.the_hole_value()));
......
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