From 0c3c2668ef44fdbd18d97f9134a85d1a7d561aa4 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 15 Oct 2015 13:53:04 +0100 Subject: Use DlMallocSpace for the JIT code cache. - Also tidy up some code in the JIT compiler. - And mprotect code space to be writable only when allocating. Change-Id: I46ea5c029aec489f2af63452de31db3736aebc20 --- compiler/driver/compiler_driver.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 74f19a1029..a2ef9740d1 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -594,7 +594,7 @@ static void CompileMethod(Thread* self, } } else if ((access_flags & kAccAbstract) != 0) { // Abstract methods don't have code. - } else { + } else if (Runtime::Current()->IsAotCompiler()) { const VerifiedMethod* verified_method = driver->GetVerificationResults()->GetVerifiedMethod(method_ref); bool compile = compilation_enabled && @@ -633,6 +633,13 @@ static void CompileMethod(Thread* self, ? dex_to_dex_compilation_level : optimizer::DexToDexCompilationLevel::kRequired); } + } else { + // This is for the JIT compiler, which has already ensured the class is verified. + // We can go straight to compiling. + DCHECK(Runtime::Current()->UseJit()); + compiled_method = driver->GetCompiler()->Compile(code_item, access_flags, invoke_type, + class_def_idx, method_idx, class_loader, + dex_file, dex_cache); } if (kTimeCompileMethod) { uint64_t duration_ns = NanoTime() - start_ns; -- cgit v1.2.3-59-g8ed1b