Give Compiler a back reference to the driver.
The compiler driver is a single object delegating work to the compiler, rather
than passing it through to every Compiler call make it a member of Compiler so
that it maybe queried. This simplifies the Compiler API and makes the
relationship to CompilerDriver more explicit.
Remove reference arguments that contravene code style.
Change-Id: Iba47f2e3cbda679a7ec7588f26188d77643aa2c6
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index 9f439eb..5a22170 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -52,7 +52,7 @@
// registers, a reference to the method object is supplied as part of this
// convention.
//
-CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver& compiler,
+CompiledMethod* ArtJniCompileMethodInternal(CompilerDriver* driver,
uint32_t access_flags, uint32_t method_idx,
const DexFile& dex_file) {
const bool is_native = (access_flags & kAccNative) != 0;
@@ -60,7 +60,7 @@
const bool is_static = (access_flags & kAccStatic) != 0;
const bool is_synchronized = (access_flags & kAccSynchronized) != 0;
const char* shorty = dex_file.GetMethodShorty(dex_file.GetMethodId(method_idx));
- InstructionSet instruction_set = compiler.GetInstructionSet();
+ InstructionSet instruction_set = driver->GetInstructionSet();
if (instruction_set == kThumb2) {
instruction_set = kArm;
}
@@ -423,7 +423,7 @@
std::vector<uint8_t> managed_code(cs);
MemoryRegion code(&managed_code[0], managed_code.size());
__ FinalizeInstructions(code);
- return new CompiledMethod(compiler,
+ return new CompiledMethod(driver,
instruction_set,
managed_code,
frame_size,
@@ -536,7 +536,7 @@
} // namespace art
-extern "C" art::CompiledMethod* ArtQuickJniCompileMethod(art::CompilerDriver& compiler,
+extern "C" art::CompiledMethod* ArtQuickJniCompileMethod(art::CompilerDriver* compiler,
uint32_t access_flags, uint32_t method_idx,
const art::DexFile& dex_file) {
return ArtJniCompileMethodInternal(compiler, access_flags, method_idx, dex_file);