summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-02-24 14:58:29 +0000
committer Vladimir Marko <vmarko@google.com> 2017-02-27 16:31:42 +0000
commite00e5590a9cfb72c89294dd7a5480e5fa69a90b9 (patch)
tree7eb9254bd6cfe10b2c4005e9cdec3a7cfbb2f442 /runtime/class_linker.cc
parent06f658ab309a5f1930b8a6bc306ef79d0ef0616e (diff)
Fix java.lang.Void.TYPE (void.class) initialization.
Do not rely on the DexCache resolved types now that entries can be evicted. Test: 157-void-class Test: testrunner.py --host Bug: 35652776 Bug: 30627598 Change-Id: Ic384174ae1849072568dd6d2ff9cc60d7f7f1880
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc29
1 files changed, 0 insertions, 29 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 9b0ffaf031..9fefed64db 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -752,22 +752,6 @@ bool ClassLinker::InitWithoutImage(std::vector<std::unique_ptr<const DexFile>> b
FindSystemClass(self, "[Ljava/lang/StackTraceElement;"));
mirror::StackTraceElement::SetClass(GetClassRoot(kJavaLangStackTraceElement));
- // Ensure void type is resolved in the core's dex cache so java.lang.Void is correctly
- // initialized.
- {
- const DexFile& dex_file = java_lang_Object->GetDexFile();
- const DexFile::TypeId* void_type_id = dex_file.FindTypeId("V");
- CHECK(void_type_id != nullptr);
- dex::TypeIndex void_type_idx = dex_file.GetIndexForTypeId(*void_type_id);
- // Now we resolve void type so the dex cache contains it. We use java.lang.Object class
- // as referrer so the used dex cache is core's one.
- ObjPtr<mirror::Class> resolved_type = ResolveType(dex_file,
- void_type_idx,
- java_lang_Object.Get());
- CHECK_EQ(resolved_type, GetClassRoot(kPrimitiveVoid));
- self->AssertNoPendingException();
- }
-
// Create conflict tables that depend on the class linker.
runtime->FixupConflictTables();
@@ -4162,19 +4146,6 @@ bool ClassLinker::VerifyClassUsingOatFile(const DexFile& dex_file,
return false;
}
- // We may be running with a preopted oat file but without image. In this case,
- // we don't skip verification of skip_access_checks classes to ensure we initialize
- // dex caches with all types resolved during verification.
- // We need to trust image classes, as these might be coming out of a pre-opted, quickened boot
- // image (that we just failed loading), and the verifier can't be run on quickened opcodes when
- // the runtime isn't started. On the other hand, app classes can be re-verified even if they are
- // already pre-opted, as then the runtime is started.
- if (!Runtime::Current()->IsAotCompiler() &&
- !Runtime::Current()->GetHeap()->HasBootImageSpace() &&
- klass->GetClassLoader() != nullptr) {
- return false;
- }
-
uint16_t class_def_index = klass->GetDexClassDefIndex();
oat_file_class_status = oat_dex_file->GetOatClass(class_def_index).GetStatus();
if (oat_file_class_status == mirror::Class::kStatusVerified ||