summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/driver/compiler_driver.cc10
-rw-r--r--src/compiler/driver/compiler_driver.h7
2 files changed, 7 insertions, 10 deletions
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc
index 1660914ce3..3075a54988 100644
--- a/src/compiler/driver/compiler_driver.cc
+++ b/src/compiler/driver/compiler_driver.cc
@@ -283,7 +283,7 @@ static Fn FindFunction(const std::string& compiler_so_name, void* library, const
}
CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet instruction_set,
- bool image, size_t thread_count, bool support_debugging, bool light_mode,
+ bool image, size_t thread_count, bool support_debugging,
const std::set<std::string>* image_classes,
bool dump_stats, bool dump_timings)
: compiler_backend_(compiler_backend),
@@ -294,7 +294,6 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet
image_(image),
thread_count_(thread_count),
support_debugging_(support_debugging),
- light_mode_(light_mode),
start_ns_(0),
stats_(new AOTCompilationStats),
dump_stats_(dump_stats),
@@ -1566,12 +1565,15 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t
CHECK(compiled_method != NULL);
} else if ((access_flags & kAccAbstract) != 0) {
} else {
- // In light mode we only compile image classes.
- bool dont_compile = light_mode_ && ((image_classes_ == NULL) || (image_classes_->size() == 0));
+ // In small mode we only compile image classes.
+ bool dont_compile = Runtime::Current()->IsSmallMode() && ((image_classes_ == NULL) || (image_classes_->size() == 0));
// Don't compile class initializers, ever.
if (((access_flags & kAccConstructor) != 0) && ((access_flags & kAccStatic) != 0)) {
dont_compile = true;
+ } else if (code_item->insns_size_in_code_units_ < Runtime::Current()->GetSmallModeMethodDexSizeLimit()) {
+ // Do compile small methods.
+ dont_compile = false;
}
if (!dont_compile) {
diff --git a/src/compiler/driver/compiler_driver.h b/src/compiler/driver/compiler_driver.h
index a20e5ef585..7c37c6a083 100644
--- a/src/compiler/driver/compiler_driver.h
+++ b/src/compiler/driver/compiler_driver.h
@@ -67,7 +67,7 @@ class CompilerDriver {
// can assume will be in the image, with NULL implying all available
// classes.
explicit CompilerDriver(CompilerBackend compiler_backend, InstructionSet instruction_set, bool image,
- size_t thread_count, bool support_debugging, bool light_mode,
+ size_t thread_count, bool support_debugging,
const std::set<std::string>* image_classes,
bool dump_stats, bool dump_timings);
@@ -84,10 +84,6 @@ class CompilerDriver {
return support_debugging_;
}
- bool IsLightMode() const {
- return light_mode_;
- }
-
InstructionSet GetInstructionSet() const {
return instruction_set_;
}
@@ -331,7 +327,6 @@ class CompilerDriver {
bool image_;
size_t thread_count_;
bool support_debugging_;
- const bool light_mode_;
uint64_t start_ns_;
UniquePtr<AOTCompilationStats> stats_;