Fix Monkeys failure
Ian's handy work: Interpreter was checking whether initializer was in
progress instead of falling through to ensureinitialized. Should have
instead check whether initialized and then fall through otherwise.
Change-Id: Idc2f4724ea7c675b1682c2c4c88402bd46cf092f
diff --git a/src/oatdump.cc b/src/oatdump.cc
index cba079a..37a995d 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -1003,7 +1003,7 @@
DCHECK(method->GetNativeGcMap() == NULL) << PrettyMethod(method);
DCHECK(method->GetMappingTable() == NULL) << PrettyMethod(method);
} else {
- DCHECK(method->GetNativeGcMap() != NULL) << PrettyMethod(method);
+ CHECK((method->GetCode() == NULL) || (method->GetNativeGcMap() != NULL));
const DexFile::CodeItem* code_item = MethodHelper(method).GetCodeItem();
size_t dex_instruction_bytes = code_item->insns_size_in_code_units_ * 2;
diff --git a/src/runtime_support.cc b/src/runtime_support.cc
index b601f8c..6ea05b4 100644
--- a/src/runtime_support.cc
+++ b/src/runtime_support.cc
@@ -207,11 +207,11 @@
// instance fields must be being accessed on an initialized class
return resolved_field;
} else {
- // If the class is already initializing, we must be inside <clinit>, or
- // we'd still be waiting for the lock.
- if (fields_class->IsInitializing()) {
+ // If the class is initialized we're done.
+ if (fields_class->IsInitialized()) {
return resolved_field;
} else if (Runtime::Current()->GetClassLinker()->EnsureInitialized(fields_class, true, true)) {
+ // otherwise let's ensure the class is initialized before resolving the field
return resolved_field;
} else {
DCHECK(self->IsExceptionPending()); // Throw exception and unwind