summaryrefslogtreecommitdiffstats
path: root/compiler/dex/frontend.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-01-22 20:39:27 -0800
committerAndreas Gampe <agampe@google.com>2015-01-26 14:30:40 -0800
commit0b9203e7996ee1856f620f95d95d8a273c43a3df (patch)
treea9715986cfdbb21e4d64f72b56fac255cc8b9309 /compiler/dex/frontend.cc
parent4dfe58d8f2d398963f31831a57fbd12e282e1196 (diff)
downloadart-0b9203e7996ee1856f620f95d95d8a273c43a3df.tar.gz
art-0b9203e7996ee1856f620f95d95d8a273c43a3df.tar.bz2
art-0b9203e7996ee1856f620f95d95d8a273c43a3df.zip
ART: Some Quick cleanup
Make several fields const in CompilationUnit. May benefit some Mir2Lir code that repeats tests, and in general immutability is good. Remove compiler_internals.h and refactor some other headers to reduce overly broad imports (and thus forced recompiles on changes). Change-Id: I898405907c68923581373b5981d8a85d2e5d185a
Diffstat (limited to 'compiler/dex/frontend.cc')
-rw-r--r--compiler/dex/frontend.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index dd8b4c8a3..0aaee4efc 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -21,7 +21,7 @@
#include "backend.h"
#include "base/dumpable.h"
#include "compiler.h"
-#include "compiler_internals.h"
+#include "dex_flags.h"
#include "driver/compiler_driver.h"
#include "driver/compiler_options.h"
#include "mirror/object.h"
@@ -90,16 +90,12 @@ static CompiledMethod* CompileMethod(CompilerDriver& driver,
DCHECK(driver.GetCompilerOptions().IsCompilationEnabled());
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- CompilationUnit cu(driver.GetArenaPool());
-
- cu.compiler_driver = &driver;
- cu.class_linker = class_linker;
- cu.instruction_set = driver.GetInstructionSet();
- if (cu.instruction_set == kArm) {
- cu.instruction_set = kThumb2;
+ InstructionSet instruction_set = driver.GetInstructionSet();
+ if (instruction_set == kArm) {
+ instruction_set = kThumb2;
}
- cu.target64 = Is64BitInstructionSet(cu.instruction_set);
- cu.compiler = compiler;
+ CompilationUnit cu(driver.GetArenaPool(), instruction_set, &driver, class_linker);
+
// TODO: Mips64 is not yet implemented.
CHECK((cu.instruction_set == kThumb2) ||
(cu.instruction_set == kArm64) ||
@@ -108,10 +104,12 @@ static CompiledMethod* CompileMethod(CompilerDriver& driver,
(cu.instruction_set == kMips));
// TODO: set this from command line
- cu.compiler_flip_match = false;
- bool use_match = !cu.compiler_method_match.empty();
- bool match = use_match && (cu.compiler_flip_match ^
- (PrettyMethod(method_idx, dex_file).find(cu.compiler_method_match) != std::string::npos));
+ constexpr bool compiler_flip_match = false;
+ const std::string compiler_method_match = "";
+
+ bool use_match = !compiler_method_match.empty();
+ bool match = use_match && (compiler_flip_match ^
+ (PrettyMethod(method_idx, dex_file).find(compiler_method_match) != std::string::npos));
if (!use_match || match) {
cu.disable_opt = kCompilerOptimizerDisableFlags;
cu.enable_debug = kCompilerDebugFlags;