[optimizing] Use baseline when debuggable is set.

SSA form conflicts with JDWP's SetValue functionality. Because
we do not deopt all the call stack, we may call SetValue on a
compiled frame, which doesn't work with optimizing. Simplest
solution for now is to just use baseline.

Change-Id: I91738b363eec8fef145486bd96681aea73a1baa8
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 475d98c..e47b4f6 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -222,7 +222,8 @@
 OptimizingCompiler::OptimizingCompiler(CompilerDriver* driver)
     : Compiler(driver, kMaximumCompilationTimeBeforeWarning),
       run_optimizations_(
-          driver->GetCompilerOptions().GetCompilerFilter() != CompilerOptions::kTime),
+          (driver->GetCompilerOptions().GetCompilerFilter() != CompilerOptions::kTime)
+          && !driver->GetCompilerOptions().GetDebuggable()),
       compilation_stats_() {}
 
 void OptimizingCompiler::Init() {
@@ -463,7 +464,7 @@
   // For testing purposes, we put a special marker on method names that should be compiled
   // with this compiler. This makes sure we're not regressing.
   bool shouldCompile = method_name.find("$opt$") != std::string::npos;
-  bool shouldOptimize = method_name.find("$opt$reg$") != std::string::npos;
+  bool shouldOptimize = method_name.find("$opt$reg$") != std::string::npos && run_optimizations_;
 
   std::unique_ptr<CodeGenerator> codegen(
       CodeGenerator::Create(graph,