Fix SMALL_ART

On all art builds, the images classes must be compiled.  When doing
a small art build, it is necessary to override the default compiler
filter to force compilation.  A merge mistake broke this logic
for dalvik-dev.

Change-Id: I88186bd89d0ccb4316ee0910e9324ddc3e6a1f75
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 56b629c..ae00100 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2227,10 +2227,6 @@
   } else {
     bool compile = verifier::MethodVerifier::IsCandidateForCompilation(code_item, access_flags);
     if (compile) {
-      // If we're doing the image, override the compiler filter to force full compilation.
-      if ((image_classes_.get() != NULL) && (image_classes_->size() != 0)) {
-        Runtime::Current()->SetCompilerFilter(Runtime::kSpeed);
-      }
       CompilerFn compiler = compiler_;
 #ifdef ART_SEA_IR_MODE
       bool use_sea = Runtime::Current()->IsSeaIRMode();
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index b339974..b85378d 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -905,6 +905,11 @@
     }
   }
 
+  // If we're doing the image, override the compiler filter to force full compilation.
+  if (image && Runtime::Current()->GetCompilerFilter() == Runtime::kInterpretOnly) {
+    Runtime::Current()->SetCompilerFilter(Runtime::kSpeed);
+  }
+
   /*
    * If we're not in interpret-only mode, go ahead and compile small applications. Don't
    * bother to check if we're doing the image.