Do a parallel move in BoundsCheckSlowPath.

The two locations of the index and length could overlap,
so we need a parallel move. Also factorize the code for
doing a parallel move based on two locations.

Change-Id: Iee8b3459e2eed6704d45e9a564fb2cd050741ea4
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index fc4ea4b..ac4fc67 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -33,6 +33,7 @@
 class Assembler;
 class CodeGenerator;
 class DexCompilationUnit;
+class ParallelMoveResolver;
 class SrcMap;
 
 class CodeAllocator {
@@ -165,6 +166,8 @@
   // of the architecture.
   static size_t GetCacheOffset(uint32_t index);
 
+  void EmitParallelMoves(Location from1, Location to1, Location from2, Location to2);
+
  protected:
   CodeGenerator(HGraph* graph,
                 size_t number_of_core_registers,
@@ -197,6 +200,8 @@
 
   virtual Location GetStackLocation(HLoadLocal* load) const = 0;
 
+  virtual ParallelMoveResolver* GetMoveResolver() = 0;
+
   // Frame size required for this method.
   uint32_t frame_size_;
   uint32_t core_spill_mask_;