Allocate local variable on the stack.
Change-Id: I14ce622686d44e975e2760e2f1c1e0e64e83125f
diff --git a/src/compiler.cc b/src/compiler.cc
index 40874f5..4b03433 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -979,14 +979,14 @@
ClassLinker *class_linker = Runtime::Current()->GetClassLinker();
DexCache *dex_cache = class_linker->FindDexCache(dex_file);
- UniquePtr<OatCompilationUnit> oat_compilation_unit(
- new OatCompilationUnit(class_loader, class_linker, dex_file, *dex_cache, code_item,
- method_idx, access_flags));
+ OatCompilationUnit oat_compilation_unit(
+ class_loader, class_linker, dex_file, *dex_cache, code_item,
+ method_idx, access_flags);
#endif
if ((access_flags & kAccNative) != 0) {
#if defined(ART_USE_LLVM_COMPILER)
- compiled_method = compiler_llvm_->CompileNativeMethod(oat_compilation_unit.get());
+ compiled_method = compiler_llvm_->CompileNativeMethod(&oat_compilation_unit);
#else
compiled_method = jni_compiler_.Compile(access_flags, method_idx, class_loader, dex_file);
#endif
@@ -994,7 +994,7 @@
} else if ((access_flags & kAccAbstract) != 0) {
} else {
#if defined(ART_USE_LLVM_COMPILER)
- compiled_method = compiler_llvm_->CompileDexMethod(oat_compilation_unit.get());
+ compiled_method = compiler_llvm_->CompileDexMethod(&oat_compilation_unit);
#else
compiled_method = oatCompileMethod(*this, code_item, access_flags, method_idx, class_loader,
dex_file, kThumb2);