diff options
author | Anwar Ghuloum <anwarg@google.com> | 2013-04-10 16:12:11 -0700 |
---|---|---|
committer | Anwar Ghuloum <anwarg@google.com> | 2013-04-16 10:24:36 -0700 |
commit | c4f105d75cd0cbc5145620068bbb8a819148e535 (patch) | |
tree | f34fce100c4fcd351e0de0bbccb4293df94d0804 /src/compiler | |
parent | ed1790e83352e54420018d1495eb010f7cd48a64 (diff) | |
download | android_art-c4f105d75cd0cbc5145620068bbb8a819148e535.tar.gz android_art-c4f105d75cd0cbc5145620068bbb8a819148e535.tar.bz2 android_art-c4f105d75cd0cbc5145620068bbb8a819148e535.zip |
Compile less stuff
Don't compile class initializers, compile programs with fewer than
commmand-line specified number of methods, mildly refactor SLOW_MODE,
rename into LIGHT_MODE.
Also, walks the image for uncompiled methods and fixes up with pointers to the
interpreter entry point.
(Removed hot method list and light method limit as these are experimental.)
Change-Id: I2ae33d8add84ab9f4d76f9d910cae422c81a7832
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/driver/compiler_driver.cc | 20 | ||||
-rw-r--r-- | src/compiler/driver/compiler_driver.h | 11 |
2 files changed, 21 insertions, 10 deletions
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc index 204f6391dc..f08e6297ef 100644 --- a/src/compiler/driver/compiler_driver.cc +++ b/src/compiler/driver/compiler_driver.cc @@ -284,9 +284,9 @@ 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, - const std::set<std::string>* image_classes, bool dump_stats, - bool dump_timings) + bool image, size_t thread_count, bool support_debugging, bool light_mode, + const std::set<std::string>* image_classes, + bool dump_stats, bool dump_timings) : compiler_backend_(compiler_backend), instruction_set_(instruction_set), freezing_constructor_lock_("freezing constructor lock"), @@ -295,6 +295,7 @@ 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), @@ -1612,10 +1613,15 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t CHECK(compiled_method != NULL); } else if ((access_flags & kAccAbstract) != 0) { } else { - bool dont_compile = false; -#if ART_SLOW_MODE - dont_compile = (image_classes_ == NULL) || (image_classes_->size() == 0); -#endif // ART_SLOW_MODE + std::string method_name(PrettyMethod(method_idx, dex_file, false)); + // In light mode we only compile image classes. + bool dont_compile = light_mode_ && ((image_classes_ == NULL) || (image_classes_->size() == 0)); + + // Don't compile class initializers, ever. + if ((access_flags & kAccConstructor) && (access_flags & kAccStatic)) { + dont_compile = true; + } + if (!dont_compile) { compiled_method = (*compiler_)(*this, code_item, access_flags, invoke_type, class_def_idx, method_idx, class_loader, dex_file); diff --git a/src/compiler/driver/compiler_driver.h b/src/compiler/driver/compiler_driver.h index 385bc0072b..fae6902699 100644 --- a/src/compiler/driver/compiler_driver.h +++ b/src/compiler/driver/compiler_driver.h @@ -67,9 +67,9 @@ 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, - const std::set<std::string>* image_classes, bool dump_stats, - bool dump_timings); + size_t thread_count, bool support_debugging, bool light_mode, + const std::set<std::string>* image_classes, + bool dump_stats, bool dump_timings); ~CompilerDriver(); @@ -84,6 +84,10 @@ class CompilerDriver { return support_debugging_; } + bool IsLightMode() const { + return light_mode_; + } + InstructionSet GetInstructionSet() const { return instruction_set_; } @@ -340,6 +344,7 @@ class CompilerDriver { bool image_; size_t thread_count_; bool support_debugging_; + const bool light_mode_; uint64_t start_ns_; UniquePtr<AOTCompilationStats> stats_; |