From 4e3d23aa1523718ea1fdf3a32516d2f9d81e84fe Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 22 May 2014 18:32:45 +0100 Subject: 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 --- compiler/optimizing/nodes.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index afaedd7f18..74ba5208c4 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) { -- cgit v1.2.3-59-g8ed1b