summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-05-22 18:32:45 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-05-23 10:00:44 +0100
commit4e3d23aa1523718ea1fdf3a32516d2f9d81e84fe (patch)
tree78593d033513a98486a409e7b23678ccced12cd5 /compiler/optimizing/nodes.cc
parent59f3f62534581311c7c403c832f56c272426a17c (diff)
downloadart-4e3d23aa1523718ea1fdf3a32516d2f9d81e84fe.zip
art-4e3d23aa1523718ea1fdf3a32516d2f9d81e84fe.tar.gz
art-4e3d23aa1523718ea1fdf3a32516d2f9d81e84fe.tar.bz2
Import Dart's parallel move resolver.
And write a few tests while at it. A parallel move resolver will be needed for performing multiple moves that are conceptually parallel, for example moves at a block exit that branches to a block with phi nodes. Change-Id: Ib95b247b4fc3f2c2fcab3b8c8d032abbd6104cd7
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index afaedd7..74ba520 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -291,6 +291,17 @@ bool HBasicBlock::Dominates(HBasicBlock* other) const {
return false;
}
+void HBasicBlock::InsertInstructionBefore(HInstruction* instruction, HInstruction* cursor) {
+ DCHECK(cursor->AsPhi() == nullptr);
+ DCHECK(instruction->AsPhi() == nullptr);
+ instruction->next_ = cursor;
+ instruction->previous_ = cursor->previous_;
+ cursor->previous_ = instruction;
+ if (GetFirstInstruction() == cursor) {
+ instructions_.first_instruction_ = instruction;
+ }
+}
+
static void Add(HInstructionList* instruction_list,
HBasicBlock* block,
HInstruction* instruction) {