Index: runtime/vm/flow_graph_compiler.h |
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h |
index 4184ecdb1453a280dea64de6039dfc769532ca4a..5d64d404d80a9368a0d8cb0866b4b774b9cb2bd0 100644 |
--- a/runtime/vm/flow_graph_compiler.h |
+++ b/runtime/vm/flow_graph_compiler.h |
@@ -32,11 +32,13 @@ class DeoptimizationStub; |
class FrameRegisterAllocator : public ValueObject { |
public: |
FrameRegisterAllocator(FlowGraphCompiler* compiler, |
- bool keep_values_in_registers) |
+ bool keep_values_in_registers, |
+ bool is_ssa) |
: compiler_(compiler), |
stack_(kNumberOfCpuRegisters), |
registers_(), |
- keep_values_in_registers_(keep_values_in_registers) { |
+ keep_values_in_registers_(keep_values_in_registers && !is_ssa), |
+ is_ssa_(is_ssa) { |
for (int i = 0; i < kNumberOfCpuRegisters; i++) { |
registers_[i] = NULL; |
} |
@@ -90,10 +92,44 @@ class FrameRegisterAllocator : public ValueObject { |
BindInstr* registers_[kNumberOfCpuRegisters]; |
const bool keep_values_in_registers_; |
+ const bool is_ssa_; |
DISALLOW_COPY_AND_ASSIGN(FrameRegisterAllocator); |
}; |
+ |
+class ParallelMoveResolver : public ValueObject { |
+ public: |
+ explicit ParallelMoveResolver(FlowGraphCompiler* compiler); |
+ |
+ // Resolve a set of parallel moves, emitting assembler instructions. |
+ void EmitNativeCode(ParallelMoveInstr* parallel_move); |
+ |
+ private: |
+ // Build the initial list of moves. |
+ void BuildInitialMoveList(ParallelMoveInstr* parallel_move); |
+ |
+ // Perform the move at the moves_ index in question (possibly requiring |
+ // other moves to satisfy dependencies). |
+ void PerformMove(int index); |
+ |
+ // Emit a move and remove it from the move graph. |
+ void EmitMove(int index); |
+ |
+ // Execute a move by emitting a swap of two operands. The move from |
+ // source to destination is removed from the move graph. |
+ void EmitSwap(int index); |
+ |
+ // Verify the move list before performing moves. |
+ void Verify(); |
+ |
+ FlowGraphCompiler* compiler_; |
+ |
+ // List of moves not yet resolved. |
+ GrowableArray<MoveOperands> moves_; |
+}; |
+ |
+ |
} // namespace dart |
#if defined(TARGET_ARCH_IA32) |