summaryrefslogtreecommitdiffstats
path: root/src/compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.cc')
-rw-r--r--src/compiler.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler.cc b/src/compiler.cc
index 5507c36..bac39ef 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1173,7 +1173,10 @@ void Compiler::InitializeClassesWithoutClinit(const ClassLoader* class_loader, c
if (klass != NULL) {
if (klass->IsVerified()) {
// Only try to initialize classes that were successfully verified.
- class_linker->EnsureInitialized(klass, false);
+ bool compiling_boot = Runtime::Current()->GetHeap()->GetSpaces().size() == 1;
+ bool can_init_static_fields = compiling_boot &&
+ IsImageClass(descriptor);
+ class_linker->EnsureInitialized(klass, false, can_init_static_fields);
}
// record the final class status if necessary
Class::Status status = klass->GetStatus();