From 4dd96f56909ec35c83a3d468b0e47769988c1a1d Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Wed, 29 Feb 2012 01:26:58 +0800 Subject: Extract method-related information from CompilationUnit. Extract method-related information, such as class_loader, class_linker, dex_file, dex_cache, code_item, method_idx, and access_flags from art::CompilationUnit, so that we can use them in 2 different code generators. Change-Id: I20631cc73b6f01e9646a983156f3fcb066d732db --- src/compiler_llvm/compiler_llvm.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/compiler_llvm/compiler_llvm.cc') diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 038e826a09..6099841a49 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -19,6 +19,7 @@ #include "compiler.h" #include "ir_builder.h" #include "method_compiler.h" +#include "oat_compilation_unit.h" #include "upcall_compiler.h" #include @@ -81,22 +82,11 @@ void CompilerLLVM::WriteBitcodeToFile(std::string const &filepath) { } -CompiledMethod* -CompilerLLVM::CompileDexMethod(DexFile::CodeItem const* code_item, - uint32_t access_flags, - uint32_t method_idx, - ClassLoader const* class_loader, - DexFile const& dex_file) { - +CompiledMethod* CompilerLLVM::CompileDexMethod(OatCompilationUnit* oat_compilation_unit) { MutexLock GUARD(compiler_lock_); - ClassLinker *class_linker = Runtime::Current()->GetClassLinker(); - DexCache *dex_cache = class_linker->FindDexCache(dex_file); - UniquePtr method_compiler( - new MethodCompiler(insn_set_, compiler_, class_linker, class_loader, - &dex_file, dex_cache, code_item, method_idx, - access_flags)); + new MethodCompiler(insn_set_, compiler_, oat_compilation_unit)); return method_compiler->Compile(); } -- cgit v1.2.3-59-g8ed1b