OSDN Git Service

Do HFieldGet first to avoid explicit null check.
authorNicolas Geoffray <ngeoffray@google.com>
Mon, 18 Jan 2016 15:24:53 +0000 (15:24 +0000)
committerNicolas Geoffray <ngeoffray@google.com>
Mon, 18 Jan 2016 15:39:39 +0000 (15:39 +0000)
Change-Id: If22f85d502e1dce428f8d341fcb64e27a886fb89

compiler/optimizing/inliner.cc

index 293282e..20c4f1f 100644 (file)
@@ -356,12 +356,12 @@ bool HInliner::TryInlineMonomorphicCall(HInvoke* invoke_instruction,
       compare, invoke_instruction->GetDexPc());
   // TODO: Extend reference type propagation to understand the guard.
   if (cursor != nullptr) {
-    bb_cursor->InsertInstructionAfter(load_class, cursor);
+    bb_cursor->InsertInstructionAfter(field_get, cursor);
   } else {
-    bb_cursor->InsertInstructionBefore(load_class, bb_cursor->GetFirstInstruction());
+    bb_cursor->InsertInstructionBefore(field_get, bb_cursor->GetFirstInstruction());
   }
-  bb_cursor->InsertInstructionAfter(field_get, load_class);
-  bb_cursor->InsertInstructionAfter(compare, field_get);
+  bb_cursor->InsertInstructionAfter(load_class, field_get);
+  bb_cursor->InsertInstructionAfter(compare, load_class);
   bb_cursor->InsertInstructionAfter(deoptimize, compare);
   deoptimize->CopyEnvironmentFrom(invoke_instruction->GetEnvironment());