Support compiler filters for boot classpath
image_writer.cc
Remove assumption that all methods in the boot classpath are compiled
oat_writer.cc
Don't skip writing ArtMethod::quick_code_offset_ for methods that need resolution, leave that to ImageWriter
dex2oat.cc
Allow dex2dex compilation of image dex files by making the in memory pages writable in all cases, not just app case.
oatdump.cc
dump new OatHeader fields
use ImageSpace.GetImageFilename, not command line image filename, since location may be in dalvik-cache
remove inaccurate check about non-null GC map
quick_trampoline_entrypoints.cc
add and improve some DCHECKS that were useful while debugging
class_linker.cc
image_space.cc
fix double facepalm
parsed_options.cc
fix zygote logging to not skip values to two part options like -classpath <foo>
runtime.cc
wireup parsed compiler options to runtime
Change-Id: Iad314df0b80623c0663d61713d5098297ab9ac87
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 69e0950..e3114eb 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -635,15 +635,19 @@
// Use original code if it exists. Otherwise, set the code pointer to the resolution
// trampoline.
const byte* quick_code = GetOatAddress(orig->GetQuickOatCodeOffset());
- if (quick_code != nullptr) {
+ if (quick_code != nullptr &&
+ (!orig->IsStatic() || orig->IsConstructor() || orig->GetDeclaringClass()->IsInitialized())) {
+ // We have code for a non-static or initialized method, just use the code.
copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(quick_code);
+ } else if (quick_code == nullptr && orig->IsNative() && !orig->IsStatic()) {
+ // Non-static native method missing compiled code, use generic JNI version.
+ copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(GetOatAddress(quick_generic_jni_trampoline_offset_));
+ } else if (quick_code == nullptr && !orig->IsNative()) {
+ // We don't have code at all for a non-native method, use the interpreter.
+ copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(GetOatAddress(quick_to_interpreter_bridge_offset_));
} else {
- if (orig->IsNative() && !orig->IsStatic()) {
- // non-static native method missing compiled code, use generic JNI version
- copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(GetOatAddress(quick_generic_jni_trampoline_offset_));
- } else {
- copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(GetOatAddress(quick_resolution_trampoline_offset_));
- }
+ // We have code for a static method, but need to go through the resolution stub for class initialization.
+ copy->SetEntryPointFromQuickCompiledCode<kVerifyNone>(GetOatAddress(quick_resolution_trampoline_offset_));
}
const byte* portable_code = GetOatAddress(orig->GetPortableOatCodeOffset());
if (portable_code != nullptr) {