Commit 1334b2bd authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Make {JumpThreading} independent of Isolate.

R=clemensh@chromium.org

Change-Id: I1045885ad1efe2b1dd7a9e2b83d1f5323e77dcbb
Reviewed-on: https://chromium-review.googlesource.com/1134988Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54403}
parent b6c4508c
......@@ -155,13 +155,12 @@ bool JumpThreading::ComputeForwarding(Zone* local_zone,
return state.forwarded;
}
void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result,
void JumpThreading::ApplyForwarding(Zone* local_zone,
ZoneVector<RpoNumber>& result,
InstructionSequence* code) {
if (!FLAG_turbo_jt) return;
Zone local_zone(code->isolate()->allocator(), ZONE_NAME);
ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone);
ZoneVector<bool> skip(static_cast<int>(result.size()), false, local_zone);
// Skip empty blocks when the previous block doesn't fall through.
bool prev_fallthru = true;
......
......@@ -22,7 +22,8 @@ class JumpThreading {
// Rewrite the instructions to forward jumps and branches.
// May also negate some branches.
static void ApplyForwarding(ZoneVector<RpoNumber>& forwarding,
static void ApplyForwarding(Zone* local_zone,
ZoneVector<RpoNumber>& forwarding,
InstructionSequence* code);
};
......
......@@ -1852,7 +1852,7 @@ struct JumpThreadingPhase {
ZoneVector<RpoNumber> result(temp_zone);
if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence(),
frame_at_start)) {
JumpThreading::ApplyForwarding(result, data->sequence());
JumpThreading::ApplyForwarding(temp_zone, result, data->sequence());
}
}
};
......
......@@ -617,7 +617,7 @@ void ApplyForwarding(TestCode& code, int size, int* forward) {
for (int i = 0; i < size; i++) {
vector.push_back(RpoNumber::FromInt(forward[i]));
}
JumpThreading::ApplyForwarding(vector, &code.sequence_);
JumpThreading::ApplyForwarding(code.main_zone(), vector, &code.sequence_);
}
......
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