summaryrefslogtreecommitdiff
path: root/compiler/common_compiler_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/common_compiler_test.cc')
-rw-r--r--compiler/common_compiler_test.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index d59cb17909..a44b9ae523 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -173,7 +173,7 @@ void CommonCompilerTest::CompileMethod(ArtMethod* method) {
TimingLogger timings("CommonCompilerTest::CompileMethod", false, false);
TimingLogger::ScopedTiming t(__FUNCTION__, &timings);
CompiledMethodStorage storage(/*swap_fd=*/ -1);
- const CompiledMethod* compiled_method = nullptr;
+ CompiledMethod* compiled_method = nullptr;
{
DCHECK(!Runtime::Current()->IsStarted());
Thread* self = Thread::Current();
@@ -204,8 +204,12 @@ void CommonCompilerTest::CompileMethod(ArtMethod* method) {
}
compiler_options_->verification_results_ = nullptr;
}
- TimingLogger::ScopedTiming t2("MakeExecutable", &timings);
- MakeExecutable(method, compiled_method);
+ CHECK(method != nullptr);
+ {
+ TimingLogger::ScopedTiming t2("MakeExecutable", &timings);
+ MakeExecutable(method, compiled_method);
+ }
+ CompiledMethod::ReleaseSwapAllocatedCompiledMethod(&storage, compiled_method);
}
void CommonCompilerTest::CompileDirectMethod(Handle<mirror::ClassLoader> class_loader,