Fixed Android.common.mk #define setting for small art
We were seeing things compile when they shouldn't have. This fixes it. Plus added
a bit more documentation to options, set default values for the two small art related
thresholds to zero.
Change-Id: Id5db11962f3e30d8d4ee6b85d4cf7d6e66323adb
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 2453fa9..7ba2e4f 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -58,8 +58,8 @@
-Wstrict-aliasing=3 \
-fstrict-aliasing
-ifeq ($(ART_LIGHT_MODE),true)
- art_cflags += -DART_LIGHT_MODE=1
+ifeq ($(ART_SMALL_MODE),true)
+ art_cflags += -DART_SMALL_MODE=1
endif
# TODO: enable -std=gnu++0x for auto support when on Ubuntu 12.04 LTS (Precise Pangolin)
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc
index 67a55f6..5ddd0a6 100644
--- a/src/compiler/driver/compiler_driver.cc
+++ b/src/compiler/driver/compiler_driver.cc
@@ -1649,11 +1649,12 @@
} else if (code_item->insns_size_in_code_units_ < Runtime::Current()->GetSmallModeMethodDexSizeLimit()) {
// Do compile small methods.
dont_compile = false;
+ LOG(INFO) << "Compiling a small method: " << PrettyMethod(method_idx, dex_file);
}
if (!dont_compile) {
compiled_method = (*compiler_)(*this, code_item, access_flags, invoke_type, class_def_idx,
- method_idx, class_loader, dex_file);
+ method_idx, class_loader, dex_file);
CHECK(compiled_method != NULL) << PrettyMethod(method_idx, dex_file);
}
}
diff --git a/src/runtime.h b/src/runtime.h
index 0ada0a2..6f03fe0 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -61,8 +61,13 @@
public:
typedef std::vector<std::pair<std::string, const void*> > Options;
- static const size_t kDefaultSmallModeMethodThreshold = 30;
- static const size_t kDefaultSmallModeMethodDexSizeLimit = 100;
+ // In small mode, apps with fewer than this number of methods will be compiled
+ // anyways.
+ static const size_t kDefaultSmallModeMethodThreshold = 0;
+
+ // In small mode, methods smaller than this dex op count limit will get compiled
+ // anyways.
+ static const size_t kDefaultSmallModeMethodDexSizeLimit = 0;
class ParsedOptions {
public: