summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yu-Ting Tseng <yutingtseng@google.com> 2025-03-03 15:14:40 -0800
committer Yu-Ting Tseng <yutingtseng@google.com> 2025-03-05 18:59:28 -0800
commita7f2b44e843cdf9033a22bdb1b30f8f25a4ea6f5 (patch)
tree817b7aeee0d868fcba32288b24992f53f263b4c2
parent0c209c52447c6f84e5af2a95d21126845ebc2b63 (diff)
Add a new API getExecutableMethodFileOffsets
This new API overloads the existing API of the same name and accepts "Executable" as the argument type (rather than "Method" for the existing one). This allows it to handle things like a constructor. The API reuses the existing implementation which already handles an Executable properly. Bug: 400457896 Test: TH Change-Id: I754e798da5b041edc3f9dcfe4a3476fea2a234bf
-rw-r--r--build/flags/art-flags.aconfig9
-rw-r--r--runtime/native/dalvik_system_VMDebug.cc6
2 files changed, 12 insertions, 3 deletions
diff --git a/build/flags/art-flags.aconfig b/build/flags/art-flags.aconfig
index 941c742195..919c6fa97d 100644
--- a/build/flags/art-flags.aconfig
+++ b/build/flags/art-flags.aconfig
@@ -55,6 +55,15 @@ flag {
}
flag {
+ namespace: "system_performance"
+ name: "executable_method_file_offsets_v2"
+ is_exported: true
+ description: "This flag includes the API for getting the compiled native executable offset info for a java executable"
+ bug: "400457896"
+ is_fixed_read_only: true
+}
+
+flag {
name: "art_service_v3"
namespace: "art_mainline"
description: "Flag for all new ART Service APIs added in the 25Q2 version of the ART module."
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 08cf0e6d4f..c3be52106c 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -318,9 +318,9 @@ static jlong VMDebug_countInstancesOfClass(JNIEnv* env,
static jobject VMDebug_getExecutableMethodFileOffsetsNative(JNIEnv* env,
jclass,
- jobject javaMethod) {
+ jobject javaExecutable) {
ScopedObjectAccess soa(env);
- ObjPtr<mirror::Executable> m = soa.Decode<mirror::Executable>(javaMethod);
+ ObjPtr<mirror::Executable> m = soa.Decode<mirror::Executable>(javaExecutable);
if (m == nullptr) {
soa.Self()->ThrowNewExceptionF("Ljava/lang/RuntimeException;",
"Could not find mirror::Executable for supplied jobject");
@@ -712,7 +712,7 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(
VMDebug,
getExecutableMethodFileOffsetsNative,
- "(Ljava/lang/reflect/Method;)Ldalvik/system/VMDebug$ExecutableMethodFileOffsets;"),
+ "(Ljava/lang/reflect/Executable;)Ldalvik/system/VMDebug$ExecutableMethodFileOffsets;"),
};
void register_dalvik_system_VMDebug(JNIEnv* env) {