Add support for new-instance and invoke-direct.

Change-Id: I2daed646904f7711972a7da15d88be7573426932
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 0554876..d90405a 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -193,7 +193,8 @@
       break;
     }
 
-    case Instruction::INVOKE_STATIC: {
+    case Instruction::INVOKE_STATIC:
+    case Instruction::INVOKE_DIRECT: {
       uint32_t method_idx = instruction.VRegB_35c();
       const DexFile::MethodId& method_id = dex_file_->GetMethodId(method_idx);
       uint32_t return_type_idx = dex_file_->GetProtoId(method_id.proto_idx_).return_type_idx_;
@@ -204,6 +205,7 @@
         return false;
       }
 
+      // Treat invoke-direct like static calls for now.
       HInvokeStatic* invoke = new (arena_) HInvokeStatic(
           arena_, number_of_arguments, dex_offset, method_idx);
 
@@ -221,7 +223,8 @@
       break;
     }
 
-    case Instruction::INVOKE_STATIC_RANGE: {
+    case Instruction::INVOKE_STATIC_RANGE:
+    case Instruction::INVOKE_DIRECT_RANGE: {
       uint32_t method_idx = instruction.VRegB_3rc();
       const DexFile::MethodId& method_id = dex_file_->GetMethodId(method_idx);
       uint32_t return_type_idx = dex_file_->GetProtoId(method_id.proto_idx_).return_type_idx_;
@@ -232,6 +235,7 @@
         return false;
       }
 
+      // Treat invoke-direct like static calls for now.
       HInvokeStatic* invoke = new (arena_) HInvokeStatic(
           arena_, number_of_arguments, dex_offset, method_idx);
       int32_t register_index = instruction.VRegC();
@@ -277,6 +281,13 @@
       break;
     }
 
+    case Instruction::NEW_INSTANCE: {
+      current_block_->AddInstruction(
+          new (arena_) HNewInstance(dex_offset, instruction.VRegB_21c()));
+      UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
+      break;
+    }
+
     case Instruction::NOP:
       break;