1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_COMPILER_JUMP_THREADING_H_
6 #define V8_COMPILER_JUMP_THREADING_H_
8 #include "src/compiler/instruction.h"
14 // Forwards jumps to empty basic blocks that end with a second jump to the
15 // destination of the second jump, transitively.
18 // Compute the forwarding map of basic blocks to their ultimate destination.
19 // Returns {true} if there is at least one block that is forwarded.
20 static bool ComputeForwarding(Zone* local_zone, ZoneVector<RpoNumber>& result,
21 InstructionSequence* code);
23 // Rewrite the instructions to forward jumps and branches.
24 // May also negate some branches.
25 static void ApplyForwarding(ZoneVector<RpoNumber>& forwarding,
26 InstructionSequence* code);
29 } // namespace compiler
30 } // namespace internal
33 #endif // V8_COMPILER_JUMP_THREADING_H