Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Friends | List of all members
dart::ParallelMoveResolver Class Reference

#include <parallel_move_resolver.h>

Inheritance diagram for dart::ParallelMoveResolver:
dart::ValueObject

Public Member Functions

 ParallelMoveResolver ()
 
void Resolve (ParallelMoveInstr *parallel_move)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Friends

class MoveSchedule
 
class ParallelMoveEmitter
 
class FlowGraphDeserializer
 

Detailed Description

Definition at line 21 of file parallel_move_resolver.h.

Constructor & Destructor Documentation

◆ ParallelMoveResolver()

dart::ParallelMoveResolver::ParallelMoveResolver ( )

Definition at line 84 of file parallel_move_resolver.cc.

84: moves_(32) {}

Member Function Documentation

◆ Resolve()

void dart::ParallelMoveResolver::Resolve ( ParallelMoveInstr parallel_move)

Definition at line 86 of file parallel_move_resolver.cc.

86 {
87 ASSERT(moves_.is_empty());
88
89 // Build up a worklist of moves.
90 BuildInitialMoveList(parallel_move);
91
92 const InstructionSource& move_source = InstructionSource(
93 TokenPosition::kParallelMove, parallel_move->inlining_id());
94 for (intptr_t i = 0; i < moves_.length(); ++i) {
95 const MoveOperands& move = moves_[i];
96 // Skip constants to perform them last. They don't block other moves
97 // and skipping such moves with register destinations keeps those
98 // registers free for the whole algorithm.
99 if (!move.IsEliminated() && !move.src().IsConstant()) {
100 PerformMove(move_source, i);
101 }
102 }
103
104 // Perform the moves with constant sources.
105 for (const auto& move : moves_) {
106 if (!move.IsEliminated()) {
107 ASSERT(move.src().IsConstant());
108 scheduled_ops_.Add({OpKind::kMove, move});
109 }
110 }
111 moves_.Clear();
112
113 // Schedule is ready. Update parallel move itself.
114 parallel_move->set_move_schedule(MoveSchedule::From(scheduled_ops_));
115 scheduled_ops_.Clear();
116}
void Add(const T &value)
static const MoveSchedule & From(const GrowableArray< ParallelMoveResolver::Op > &ops)
#define ASSERT(E)

Friends And Related Function Documentation

◆ FlowGraphDeserializer

friend class FlowGraphDeserializer
friend

Definition at line 64 of file parallel_move_resolver.h.

◆ MoveSchedule

friend class MoveSchedule
friend

Definition at line 62 of file parallel_move_resolver.h.

◆ ParallelMoveEmitter

friend class ParallelMoveEmitter
friend

Definition at line 63 of file parallel_move_resolver.h.


The documentation for this class was generated from the following files: