ART: Fix GetArgumentsSize
Fix the copy-paste mistake in GetArgumentsSize for abstract and
proxy methods. Use the usual computation derived from the shorty.
Bug: 34163329
Test: art/test/testrunner/testrunner.py --host -t 910
Change-Id: I71eaab70063303bea8eaa391ea067ebf8027820f
diff --git a/runtime/openjdkjvmti/ti_method.cc b/runtime/openjdkjvmti/ti_method.cc
index bc73029..01bf21d 100644
--- a/runtime/openjdkjvmti/ti_method.cc
+++ b/runtime/openjdkjvmti/ti_method.cc
@@ -61,8 +61,13 @@
art::ScopedObjectAccess soa(art::Thread::Current());
if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
- // This isn't specified as an error case, so return 0.
- *size_ptr = 0;
+ // Use the shorty.
+ art::ArtMethod* base_method = art_method->GetInterfaceMethodIfProxy(art::kRuntimePointerSize);
+ size_t arg_count = art::ArtMethod::NumArgRegisters(base_method->GetShorty());
+ if (!base_method->IsStatic()) {
+ arg_count++;
+ }
+ *size_ptr = static_cast<jint>(arg_count);
return ERR(NONE);
}
@@ -203,9 +208,9 @@
art::ScopedObjectAccess soa(art::Thread::Current());
if (art_method->IsProxyMethod() || art_method->IsAbstract()) {
- // This isn't specified as an error case, so return 0/0.
- *start_location_ptr = 0;
- *end_location_ptr = 0;
+ // This isn't specified as an error case, so return -1/-1 as the RI does.
+ *start_location_ptr = -1;
+ *end_location_ptr = -1;
return ERR(NONE);
}