Commit 282dec2f authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Pass a read-only value by const-reference rather than pointer

Change-Id: I7dbc632ea3eff419d6670519f7005382e2cadce4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1720815
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62951}
parent 8318fcfb
...@@ -265,17 +265,17 @@ void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState* out_liveness, ...@@ -265,17 +265,17 @@ void UpdateOutLiveness(Bytecode bytecode, BytecodeLivenessState* out_liveness,
} }
} }
void UpdateLiveness(Bytecode bytecode, BytecodeLiveness* liveness, void UpdateLiveness(Bytecode bytecode, BytecodeLiveness const& liveness,
BytecodeLivenessState** next_bytecode_in_liveness, BytecodeLivenessState** next_bytecode_in_liveness,
const interpreter::BytecodeArrayAccessor& accessor, const interpreter::BytecodeArrayAccessor& accessor,
Handle<BytecodeArray> bytecode_array, Handle<BytecodeArray> bytecode_array,
const BytecodeLivenessMap& liveness_map) { const BytecodeLivenessMap& liveness_map) {
UpdateOutLiveness(bytecode, liveness->out, *next_bytecode_in_liveness, UpdateOutLiveness(bytecode, liveness.out, *next_bytecode_in_liveness,
accessor, bytecode_array, liveness_map); accessor, bytecode_array, liveness_map);
liveness->in->CopyFrom(*liveness->out); liveness.in->CopyFrom(*liveness.out);
UpdateInLiveness(bytecode, liveness->in, accessor); UpdateInLiveness(bytecode, liveness.in, accessor);
*next_bytecode_in_liveness = liveness->in; *next_bytecode_in_liveness = liveness.in;
} }
void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments* assignments, void UpdateAssignments(Bytecode bytecode, BytecodeLoopAssignments* assignments,
...@@ -426,9 +426,9 @@ void BytecodeAnalysis::Analyze() { ...@@ -426,9 +426,9 @@ void BytecodeAnalysis::Analyze() {
} }
if (analyze_liveness_) { if (analyze_liveness_) {
BytecodeLiveness liveness = liveness_map_.InitializeLiveness( BytecodeLiveness const& liveness = liveness_map_.InitializeLiveness(
current_offset, bytecode_array()->register_count(), zone()); current_offset, bytecode_array()->register_count(), zone());
UpdateLiveness(bytecode, &liveness, &next_bytecode_in_liveness, iterator, UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
bytecode_array(), liveness_map_); bytecode_array(), liveness_map_);
} }
} }
...@@ -489,8 +489,9 @@ void BytecodeAnalysis::Analyze() { ...@@ -489,8 +489,9 @@ void BytecodeAnalysis::Analyze() {
for (; iterator.current_offset() > header_offset; --iterator) { for (; iterator.current_offset() > header_offset; --iterator) {
Bytecode bytecode = iterator.current_bytecode(); Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset(); int current_offset = iterator.current_offset();
BytecodeLiveness liveness = liveness_map_.GetLiveness(current_offset); BytecodeLiveness const& liveness =
UpdateLiveness(bytecode, &liveness, &next_bytecode_in_liveness, iterator, liveness_map_.GetLiveness(current_offset);
UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
bytecode_array(), liveness_map_); bytecode_array(), liveness_map_);
} }
// Now we are at the loop header. Since the in-liveness of the header // Now we are at the loop header. Since the in-liveness of the header
...@@ -530,13 +531,14 @@ void BytecodeAnalysis::Analyze() { ...@@ -530,13 +531,14 @@ void BytecodeAnalysis::Analyze() {
for (--iterator; iterator.IsValid(); --iterator) { for (--iterator; iterator.IsValid(); --iterator) {
Bytecode bytecode = iterator.current_bytecode(); Bytecode bytecode = iterator.current_bytecode();
int current_offset = iterator.current_offset(); int current_offset = iterator.current_offset();
BytecodeLiveness& liveness = liveness_map_.GetLiveness(current_offset); BytecodeLiveness const& liveness =
liveness_map_.GetLiveness(current_offset);
// There shouldn't be any more loops. // There shouldn't be any more loops.
DCHECK_NE(bytecode, Bytecode::kJumpLoop); DCHECK_NE(bytecode, Bytecode::kJumpLoop);
UpdateLiveness(bytecode, &liveness, &next_bytecode_in_liveness, UpdateLiveness(bytecode, liveness, &next_bytecode_in_liveness, iterator,
iterator, bytecode_array(), liveness_map_); bytecode_array(), liveness_map_);
} }
} }
} }
......
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