Log at places we fail to compile.

Useful when diagnosing some compiler issues / limitations.

Test: test.py

Change-Id: I8759d0e78b0682b300ddcadfe02793432cab2036
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index 61840cc..214b253 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -1349,6 +1349,8 @@
   uint16_t field_index;
   if (instruction.IsQuickened()) {
     if (!CanDecodeQuickenedInfo()) {
+      VLOG(compiler) << "Not compiled: Could not decode quickened instruction "
+                     << instruction.Opcode();
       return false;
     }
     field_index = LookupQuickenedInfo(quicken_index);
@@ -1485,7 +1487,6 @@
                                                         dex_compilation_unit_->GetDexCache(),
                                                         class_loader,
                                                         is_static);
-
   if (UNLIKELY(resolved_field == nullptr)) {
     // Clean up any exception left by type resolution.
     soa.Self()->ClearException();
@@ -1521,7 +1522,7 @@
   return resolved_field;
 }
 
-bool HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction,
+void HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction,
                                                  uint32_t dex_pc,
                                                  bool is_put) {
   uint32_t source_or_dest_reg = instruction.VRegA_21c();
@@ -1535,7 +1536,7 @@
                     MethodCompilationStat::kUnresolvedField);
     DataType::Type field_type = GetFieldAccessType(*dex_file_, field_index);
     BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type);
-    return true;
+    return;
   }
 
   DataType::Type field_type = GetFieldAccessType(*dex_file_, field_index);
@@ -1553,7 +1554,7 @@
     MaybeRecordStat(compilation_stats_,
                     MethodCompilationStat::kUnresolvedFieldNotAFastAccess);
     BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type);
-    return true;
+    return;
   }
 
   HInstruction* cls = constant;
@@ -1589,7 +1590,6 @@
                                                        dex_pc));
     UpdateLocal(source_or_dest_reg, current_block_->GetLastInstruction());
   }
-  return true;
 }
 
 void HInstructionBuilder::BuildCheckedDivRem(uint16_t out_vreg,
@@ -2056,6 +2056,8 @@
       uint16_t method_idx;
       if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_QUICK) {
         if (!CanDecodeQuickenedInfo()) {
+          VLOG(compiler) << "Not compiled: Could not decode quickened instruction "
+                         << instruction.Opcode();
           return false;
         }
         method_idx = LookupQuickenedInfo(quicken_index);
@@ -2081,6 +2083,8 @@
       uint16_t method_idx;
       if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_RANGE_QUICK) {
         if (!CanDecodeQuickenedInfo()) {
+          VLOG(compiler) << "Not compiled: Could not decode quickened instruction "
+                         << instruction.Opcode();
           return false;
         }
         method_idx = LookupQuickenedInfo(quicken_index);
@@ -2756,7 +2760,7 @@
     case Instruction::IGET_CHAR_QUICK:
     case Instruction::IGET_SHORT:
     case Instruction::IGET_SHORT_QUICK: {
-      if (!BuildInstanceFieldAccess(instruction, dex_pc, false, quicken_index)) {
+      if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put */ false, quicken_index)) {
         return false;
       }
       break;
@@ -2776,7 +2780,7 @@
     case Instruction::IPUT_CHAR_QUICK:
     case Instruction::IPUT_SHORT:
     case Instruction::IPUT_SHORT_QUICK: {
-      if (!BuildInstanceFieldAccess(instruction, dex_pc, true, quicken_index)) {
+      if (!BuildInstanceFieldAccess(instruction, dex_pc, /* is_put */ true, quicken_index)) {
         return false;
       }
       break;
@@ -2789,9 +2793,7 @@
     case Instruction::SGET_BYTE:
     case Instruction::SGET_CHAR:
     case Instruction::SGET_SHORT: {
-      if (!BuildStaticFieldAccess(instruction, dex_pc, false)) {
-        return false;
-      }
+      BuildStaticFieldAccess(instruction, dex_pc, /* is_put */ false);
       break;
     }
 
@@ -2802,9 +2804,7 @@
     case Instruction::SPUT_BYTE:
     case Instruction::SPUT_CHAR:
     case Instruction::SPUT_SHORT: {
-      if (!BuildStaticFieldAccess(instruction, dex_pc, true)) {
-        return false;
-      }
+      BuildStaticFieldAccess(instruction, dex_pc, /* is_put */ true);
       break;
     }