Introduce a 'baseline' variant for the compiler.

Implemented as a stripped down version of the optimizing compiler,
not running any optimization.

Adjust code to still work with expectations in code generators.

bug: 111397239

Test: test.py --baseline
Change-Id: I4328283825f9a890616e7496ed4c1e77d6bcc5dd
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index 8cc6cf1..3ab9afc 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -47,6 +47,7 @@
       boot_image_(false),
       core_image_(false),
       app_image_(false),
+      baseline_(false),
       debuggable_(false),
       generate_debug_info_(kDefaultGenerateDebugInfo),
       generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index 34aceba..e9cbf74 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -193,6 +193,10 @@
     return boot_image_;
   }
 
+  bool IsBaseline() const {
+    return baseline_;
+  }
+
   // Are we compiling a core image (small boot image only used for ART testing)?
   bool IsCoreImage() const {
     // Ensure that `core_image_` => `boot_image_`.
@@ -346,6 +350,7 @@
   bool boot_image_;
   bool core_image_;
   bool app_image_;
+  bool baseline_;
   bool debuggable_;
   bool generate_debug_info_;
   bool generate_mini_debug_info_;
diff --git a/compiler/driver/compiler_options_map-inl.h b/compiler/driver/compiler_options_map-inl.h
index 32fc887..9914d81 100644
--- a/compiler/driver/compiler_options_map-inl.h
+++ b/compiler/driver/compiler_options_map-inl.h
@@ -58,6 +58,9 @@
   if (map.Exists(Base::Debuggable)) {
     options->debuggable_ = true;
   }
+  if (map.Exists(Base::Baseline)) {
+    options->baseline_ = true;
+  }
   map.AssignIfExists(Base::TopKProfileThreshold, &options->top_k_profile_threshold_);
   map.AssignIfExists(Base::AbortOnHardVerifierFailure, &options->abort_on_hard_verifier_failure_);
   map.AssignIfExists(Base::AbortOnSoftVerifierFailure, &options->abort_on_soft_verifier_failure_);
@@ -159,6 +162,9 @@
       .Define("--debuggable")
           .IntoKey(Map::Debuggable)
 
+      .Define("--baseline")
+          .IntoKey(Map::Baseline)
+
       .Define("--top-k-profile-threshold=_")
           .template WithType<double>().WithRange(0.0, 100.0)
           .IntoKey(Map::TopKProfileThreshold)
diff --git a/compiler/driver/compiler_options_map.def b/compiler/driver/compiler_options_map.def
index 529d43f..238cd46 100644
--- a/compiler/driver/compiler_options_map.def
+++ b/compiler/driver/compiler_options_map.def
@@ -48,6 +48,7 @@
 COMPILER_OPTIONS_KEY (bool,                        GenerateMiniDebugInfo)
 COMPILER_OPTIONS_KEY (bool,                        GenerateBuildID)
 COMPILER_OPTIONS_KEY (Unit,                        Debuggable)
+COMPILER_OPTIONS_KEY (Unit,                        Baseline)
 COMPILER_OPTIONS_KEY (double,                      TopKProfileThreshold)
 COMPILER_OPTIONS_KEY (bool,                        AbortOnHardVerifierFailure)
 COMPILER_OPTIONS_KEY (bool,                        AbortOnSoftVerifierFailure)