summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/common_runtime_test.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index c7cee4708b..84865973c6 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -34,6 +34,7 @@
#include "gc_root-inl.h"
#include "gc/heap.h"
#include "gtest/gtest.h"
+#include "interpreter/unstarted_runtime.h"
#include "jni_internal.h"
#include "mirror/class_loader.h"
#include "mem_map.h"
@@ -108,6 +109,8 @@ void ScratchFile::Unlink() {
CHECK_EQ(0, unlink_result);
}
+static bool unstarted_initialized_ = false;
+
CommonRuntimeTest::CommonRuntimeTest() {}
CommonRuntimeTest::~CommonRuntimeTest() {
// Ensure the dex files are cleaned up before the runtime.
@@ -239,7 +242,10 @@ void CommonRuntimeTest::SetUp() {
// Initialize maps for unstarted runtime. This needs to be here, as running clinits needs this
// set up.
- interpreter::UnstartedRuntimeInitialize();
+ if (!unstarted_initialized_) {
+ interpreter::UnstartedRuntimeInitialize();
+ unstarted_initialized_ = true;
+ }
class_linker_->RunRootClinits();
boot_class_path_ = class_linker_->GetBootClassPath();