Merge "Another ART_TEST_ANDROID_ROOT fix."
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index bded51b..d29d248 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -37,7 +37,8 @@
   core_pic_infix :=
 
   ifeq ($(1),optimizing)
-    core_compile_options += --compiler-backend=Optimizing
+    # TODO: Use optimizing once all backends can compile a boot image.
+    core_compile_options += --compiler-backend=Quick
     core_infix := -optimizing
   endif
   ifeq ($(1),interpreter)
@@ -125,7 +126,7 @@
   core_pic_infix :=
 
   ifeq ($(1),optimizing)
-    core_compile_options += --compiler-backend=Optimizing
+    core_compile_options += --compiler-backend=Quick
     core_infix := -optimizing
   endif
   ifeq ($(1),interpreter)
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index fe999c2..5d504c6 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -538,7 +538,6 @@
   M(DoubleConstant)                                        \
   M(Div)                                                   \
   M(FloatConstant)                                         \
-  M(Mul)                                                   \
   M(LoadClass)                                             \
   M(Neg)                                                   \
   M(NewArray)                                              \
@@ -986,6 +985,44 @@
   // Will be generated at use site.
 }
 
+void LocationsBuilderARM64::VisitMul(HMul* mul) {
+  LocationSummary* locations =
+      new (GetGraph()->GetArena()) LocationSummary(mul, LocationSummary::kNoCall);
+  switch (mul->GetResultType()) {
+    case Primitive::kPrimInt:
+    case Primitive::kPrimLong:
+      locations->SetInAt(0, Location::RequiresRegister());
+      locations->SetInAt(1, Location::RequiresRegister());
+      locations->SetOut(Location::RequiresRegister());
+      break;
+
+    case Primitive::kPrimFloat:
+    case Primitive::kPrimDouble:
+      LOG(FATAL) << "Unimplemented mul type " << mul->GetResultType();
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected mul type " << mul->GetResultType();
+  }
+}
+
+void InstructionCodeGeneratorARM64::VisitMul(HMul* mul) {
+  switch (mul->GetResultType()) {
+    case Primitive::kPrimInt:
+    case Primitive::kPrimLong:
+      __ Mul(OutputRegister(mul), InputRegisterAt(mul, 0), InputRegisterAt(mul, 1));
+      break;
+
+    case Primitive::kPrimFloat:
+    case Primitive::kPrimDouble:
+      LOG(FATAL) << "Unimplemented mul type " << mul->GetResultType();
+      break;
+
+    default:
+      LOG(FATAL) << "Unexpected mul type " << mul->GetResultType();
+  }
+}
+
 void LocationsBuilderARM64::VisitNewInstance(HNewInstance* instruction) {
   LocationSummary* locations =
       new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kCall);
diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc
index 03951e2..803a09b 100644
--- a/compiler/optimizing/codegen_test.cc
+++ b/compiler/optimizing/codegen_test.cc
@@ -408,11 +408,7 @@
 MUL_TEST(LONG, MulLong);
 #endif
 
-#if defined(__aarch64__)
-TEST(CodegenTest, DISABLED_ReturnMulIntLit8) {
-#else
 TEST(CodegenTest, ReturnMulIntLit8) {
-#endif
   const uint16_t data[] = ONE_REGISTER_CODE_ITEM(
     Instruction::CONST_4 | 4 << 12 | 0 << 8,
     Instruction::MUL_INT_LIT8, 3 << 8 | 0,
@@ -421,11 +417,7 @@
   TestCode(data, true, 12);
 }
 
-#if defined(__aarch64__)
-TEST(CodegenTest, DISABLED_ReturnMulIntLit16) {
-#else
 TEST(CodegenTest, ReturnMulIntLit16) {
-#endif
   const uint16_t data[] = ONE_REGISTER_CODE_ITEM(
     Instruction::CONST_4 | 4 << 12 | 0 << 8,
     Instruction::MUL_INT_LIT16, 3,
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index f0eb351..0efd71b 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -554,6 +554,12 @@
   ifeq ($(9),no-image)
     test_groups += ART_RUN_TEST_$$(uc_host_or_target)_NO_IMAGE_RULES
     run_test_options += --no-image
+    # Add the core dependency. This is required for pre-building.
+    ifeq ($(1),host)
+      prereq_rule += $(HOST_CORE_IMAGE_$(4)_no-pic_$(12))
+    else
+      prereq_rule += $(TARGET_CORE_IMAGE_$(4)_no-pic_$(12))
+    endif
   else
     ifeq ($(9),image)
       test_groups += ART_RUN_TEST_$$(uc_host_or_target)_IMAGE_RULES
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 9b1af70..39f28c8 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -210,10 +210,8 @@
 
 if [ "$HAVE_IMAGE" = "n" ]; then
     DALVIKVM_BOOT_OPT="-Ximage:/system/non-existant/core.art"
-    DEX2OAT_BOOT_OPT="--boot-image=/system/non-existant/core.art"
 else
     DALVIKVM_BOOT_OPT="-Ximage:${BOOT_IMAGE}"
-    DEX2OAT_BOOT_OPT="--boot-image=${BOOT_IMAGE}"
 fi
 
 
@@ -272,7 +270,7 @@
 if [ "$PREBUILD" = "y" ]; then
   dex2oat_cmdline="$INVOKE_WITH $ANDROID_ROOT/bin/dex2oatd \
                       $COMPILE_FLAGS \
-                      $DEX2OAT_BOOT_OPT \
+                      --boot-image=${BOOT_IMAGE} \
                       --dex-file=$DEX_LOCATION/$TEST_NAME.jar \
                       --oat-file=$DEX_LOCATION/dalvik-cache/$ISA/$(echo $DEX_LOCATION/$TEST_NAME.jar/classes.dex | cut -d/ -f 2- | sed "s:/:@:g") \
                       --instruction-set=$ISA"