Compile filter for small applications and methods

Adds a filter per method and program size (in method count). Right now, options are treated
as runtime options...but we might want to change this and separate options for compilers and
runtime.

Change-Id: I8c3e925116119af8ffa95ff09f77bcfdd173767b
diff --git a/src/runtime.h b/src/runtime.h
index c7ccda1..ac9b50b 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -61,6 +61,9 @@
  public:
   typedef std::vector<std::pair<std::string, const void*> > Options;
 
+  static const size_t kDefaultSmallModeMethodThreshold = 10;
+  static const size_t kDefaultSmallModeMethodDexSizeLimit = 100;
+
   class ParsedOptions {
    public:
     // returns null if problem parsing and ignore_unrecognized is false
@@ -95,6 +98,9 @@
     void (*hook_exit_)(jint status);
     void (*hook_abort_)();
     std::vector<std::string> properties_;
+    bool small_mode_;
+    size_t small_mode_method_threshold_;
+    size_t small_mode_method_dex_size_limit_;
 
    private:
     ParsedOptions() {}
@@ -116,6 +122,23 @@
     return is_concurrent_gc_enabled_;
   }
 
+  bool IsSmallMode() const {
+      return small_mode_;
+  }
+
+
+  void SetSmallMode(bool small_mode) {
+      small_mode_ = small_mode;
+  }
+
+  size_t GetSmallModeMethodThreshold() const {
+      return small_mode_method_threshold_;
+  }
+
+  size_t GetSmallModeMethodDexSizeLimit() const {
+      return small_mode_method_dex_size_limit_;
+  }
+
   const std::string& GetHostPrefix() const {
     DCHECK(!IsStarted());
     return host_prefix_;
@@ -339,6 +362,10 @@
   bool is_zygote_;
   bool is_concurrent_gc_enabled_;
 
+  bool small_mode_;
+  size_t small_mode_method_threshold_;
+  size_t small_mode_method_dex_size_limit_;
+
   // The host prefix is used during cross compilation. It is removed
   // from the start of host paths such as:
   //    $ANDROID_PRODUCT_OUT/system/framework/boot.oat