diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-29 13:56:36 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-03-29 20:29:12 -0700 |
commit | bb9c6b1c55e9e2308b4f5892a398a8837231fdbd (patch) | |
tree | b2ba358bd031b73050f22eea5bcccfc1f6f1add1 /runtime/common_runtime_test.cc | |
parent | f381645a336f7092ab6f5900c0a2cf183a9dbdf7 (diff) | |
download | art-bb9c6b1c55e9e2308b4f5892a398a8837231fdbd.zip art-bb9c6b1c55e9e2308b4f5892a398a8837231fdbd.tar.gz art-bb9c6b1c55e9e2308b4f5892a398a8837231fdbd.tar.bz2 |
ART: Refactor callbacks_ in common_runtime_test
The callback is now important for some runtime checks, and just
resetting callbacks_ is not correct anymore.
Change-Id: I2cb806f1916fd5ea190911a833ce460be557a428
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r-- | runtime/common_runtime_test.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc index 4104509..d400010 100644 --- a/runtime/common_runtime_test.cc +++ b/runtime/common_runtime_test.cc @@ -220,7 +220,6 @@ void CommonRuntimeTest::SetUp() { std::string min_heap_string(StringPrintf("-Xms%zdm", gc::Heap::kDefaultInitialSize / MB)); std::string max_heap_string(StringPrintf("-Xmx%zdm", gc::Heap::kDefaultMaximumSize / MB)); - callbacks_.reset(new NoopCompilerCallbacks()); RuntimeOptions options; std::string boot_class_path_string = "-Xbootclasspath:" + GetLibCoreDexFileName(); @@ -228,9 +227,16 @@ void CommonRuntimeTest::SetUp() { options.push_back(std::make_pair("-Xcheck:jni", nullptr)); options.push_back(std::make_pair(min_heap_string, nullptr)); options.push_back(std::make_pair(max_heap_string, nullptr)); - options.push_back(std::make_pair("compilercallbacks", callbacks_.get())); + + callbacks_.reset(new NoopCompilerCallbacks()); + SetUpRuntimeOptions(&options); + // Install compiler-callbacks if SetupRuntimeOptions hasn't deleted them. + if (callbacks_.get() != nullptr) { + options.push_back(std::make_pair("compilercallbacks", callbacks_.get())); + } + PreRuntimeCreate(); if (!Runtime::Create(options, false)) { LOG(FATAL) << "Failed to create runtime"; |