ART: Remove redundant MoveInstructionBefore method
Change-Id: If53d7011197cc6b9c1702a3d98ef11b59eb76f0c
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 150d6b0..ae3c4b0 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -785,22 +785,6 @@
RemoveInstruction(initial);
}
-void HBasicBlock::MoveInstructionBefore(HInstruction* insn, HInstruction* cursor) {
- DCHECK(!cursor->IsPhi());
- DCHECK(!insn->IsPhi());
- DCHECK(!insn->IsControlFlow());
- DCHECK(insn->CanBeMoved());
- DCHECK(!insn->HasSideEffects());
-
- HBasicBlock* from_block = insn->GetBlock();
- HBasicBlock* to_block = cursor->GetBlock();
- DCHECK(from_block != to_block);
-
- from_block->RemoveInstruction(insn, /* ensure_safety */ false);
- insn->SetBlock(to_block);
- to_block->instructions_.InsertInstructionBefore(insn, cursor);
-}
-
static void Add(HInstructionList* instruction_list,
HBasicBlock* block,
HInstruction* instruction) {
@@ -1352,6 +1336,11 @@
}
void HInstruction::MoveBefore(HInstruction* cursor) {
+ DCHECK(!IsPhi());
+ DCHECK(!IsControlFlow());
+ DCHECK(CanBeMoved());
+ DCHECK(!cursor->IsPhi());
+
next_->previous_ = previous_;
if (previous_ != nullptr) {
previous_->next_ = next_;