Commit 064703fb authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Fix compiler classes, removing unnecessary copies.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: I33858c6f6bb577f39f697a1d3094990a57044fca
Reviewed-on: https://chromium-review.googlesource.com/1228065
Commit-Queue: Florian Sattler <sattlerf@google.com>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55990}
parent 064c3833
......@@ -666,7 +666,7 @@ bool BytecodeAnalysis::ResumeJumpTargetsAreValid() {
valid = false;
}
// Check loops.
for (const std::pair<int, LoopInfo>& loop_info : header_to_info_) {
for (const std::pair<const int, LoopInfo>& loop_info : header_to_info_) {
if (!loop_info.second.resume_jump_targets().empty()) {
PrintF(stderr,
"Found %zu resume targets at loop at offset %d, but no resume "
......@@ -700,7 +700,7 @@ bool BytecodeAnalysis::ResumeJumpTargetsAreValid() {
valid = false;
}
// Check loops.
for (const std::pair<int, LoopInfo>& loop_info : header_to_info_) {
for (const std::pair<const int, LoopInfo>& loop_info : header_to_info_) {
if (!ResumeJumpTargetLeavesResolveSuspendIds(
loop_info.first, loop_info.second.resume_jump_targets(),
&unresolved_suspend_ids)) {
......@@ -714,7 +714,7 @@ bool BytecodeAnalysis::ResumeJumpTargetsAreValid() {
"Found suspend ids that are not resolved by a final leaf resume "
"jump:\n");
for (const std::pair<int, int>& target : unresolved_suspend_ids) {
for (const std::pair<const int, int>& target : unresolved_suspend_ids) {
PrintF(stderr, " %d -> %d\n", target.first, target.second);
}
valid = false;
......
......@@ -1403,8 +1403,8 @@ void CodeAssembler::Branch(SloppyTNode<IntegralT> condition, Label* true_label,
}
void CodeAssembler::Branch(TNode<BoolT> condition,
std::function<void()> true_body,
std::function<void()> false_body) {
const std::function<void()>& true_body,
const std::function<void()>& false_body) {
int32_t constant;
if (ToInt32Constant(condition, constant)) {
return constant ? true_body() : false_body();
......@@ -1421,7 +1421,7 @@ void CodeAssembler::Branch(TNode<BoolT> condition,
}
void CodeAssembler::Branch(TNode<BoolT> condition, Label* true_label,
std::function<void()> false_body) {
const std::function<void()>& false_body) {
int32_t constant;
if (ToInt32Constant(condition, constant)) {
return constant ? Goto(true_label) : false_body();
......@@ -1434,7 +1434,7 @@ void CodeAssembler::Branch(TNode<BoolT> condition, Label* true_label,
}
void CodeAssembler::Branch(TNode<BoolT> condition,
std::function<void()> true_body,
const std::function<void()>& true_body,
Label* false_label) {
int32_t constant;
if (ToInt32Constant(condition, constant)) {
......
......@@ -780,11 +780,11 @@ class V8_EXPORT_PRIVATE CodeAssembler {
void Branch(SloppyTNode<IntegralT> condition, Label* true_label,
Label* false_label);
void Branch(TNode<BoolT> condition, std::function<void()> true_body,
std::function<void()> false_body);
void Branch(TNode<BoolT> condition, const std::function<void()>& true_body,
const std::function<void()>& false_body);
void Branch(TNode<BoolT> condition, Label* true_label,
std::function<void()> false_body);
void Branch(TNode<BoolT> condition, std::function<void()> true_body,
const std::function<void()>& false_body);
void Branch(TNode<BoolT> condition, const std::function<void()>& true_body,
Label* false_label);
void Switch(Node* index, Label* default_label, const int32_t* case_values,
......
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