Don't treat proxy methods as compilable
If they are compilable it will add JIT samples and cause CHECK
failures in the profile saver.
Bug: 62349349
Test: test-art-host
Change-Id: I64055a4568ab704fa5b8ccfaf80687e9ff7b8e5b
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index aab9839..daefc88 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -4604,7 +4604,10 @@
DCHECK(out != nullptr);
out->CopyFrom(proxy_constructor, image_pointer_size_);
// Make this constructor public and fix the class to be our Proxy version
- out->SetAccessFlags((out->GetAccessFlags() & ~kAccProtected) | kAccPublic);
+ // Mark kAccCompileDontBother so that we don't take JIT samples for the method. b/62349349
+ out->SetAccessFlags((out->GetAccessFlags() & ~kAccProtected) |
+ kAccPublic |
+ kAccCompileDontBother);
out->SetDeclaringClass(klass.Get());
}
@@ -4638,7 +4641,8 @@
// preference to the invocation handler.
const uint32_t kRemoveFlags = kAccAbstract | kAccDefault | kAccDefaultConflict;
// Make the method final.
- const uint32_t kAddFlags = kAccFinal;
+ // Mark kAccCompileDontBother so that we don't take JIT samples for the method. b/62349349
+ const uint32_t kAddFlags = kAccFinal | kAccCompileDontBother;
out->SetAccessFlags((out->GetAccessFlags() & ~kRemoveFlags) | kAddFlags);
// Clear the dex_code_item_offset_. It needs to be 0 since proxy methods have no CodeItems but the