Report types loaded during init to the native debugger
The runtime loads a lot of type before it creates the jit from the
boot image and from hard coded source code (e.g. primitive arrays).
This change emits type information for these types after the jit has
been created. At the same time we remove the type info generation
that happens during AOT compilation because that type information can
be modified by a class loader at runtime.
Change-Id: Ie5b3b3df9d01c7200a1f670a98d9cbee796234e9
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc
index a4b9c6c..8fdbf4a 100644
--- a/compiler/jit/jit_compiler.cc
+++ b/compiler/jit/jit_compiler.cc
@@ -67,12 +67,13 @@
return jit_compiler->CompileMethod(self, method);
}
-extern "C" void jit_type_loaded(void* handle, mirror::Class* type)
+extern "C" void jit_types_loaded(void* handle, mirror::Class** types, size_t count)
SHARED_REQUIRES(Locks::mutator_lock_) {
auto* jit_compiler = reinterpret_cast<JitCompiler*>(handle);
DCHECK(jit_compiler != nullptr);
if (jit_compiler->GetCompilerOptions()->GetGenerateDebugInfo()) {
- ArrayRef<const uint8_t> elf_file = dwarf::WriteDebugElfFileForClass(kRuntimeISA, type);
+ const ArrayRef<mirror::Class*> types_array(types, count);
+ ArrayRef<const uint8_t> elf_file = dwarf::WriteDebugElfFileForClasses(kRuntimeISA, types_array);
CreateJITCodeEntry(std::unique_ptr<const uint8_t[]>(elf_file.data()), elf_file.size());
}
}