summaryrefslogtreecommitdiff
path: root/test/904-object-allocation/src
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-04-07 09:28:48 -0700
committer Andreas Gampe <agampe@google.com> 2017-04-07 09:32:09 -0700
commit2bbf16da51c6a61da8ccd3c8d4d8382f6bbc9623 (patch)
treeff8c0e57713c76b72885f352511c512831bddc86 /test/904-object-allocation/src
parent672082ab6edf7c12a1d7b1d9303aa0aa4fcce089 (diff)
ART: Add JVMTI test shim
Add shim to expose basic native binding methods. Bug: 32072923 Test: m test-art-host Change-Id: Ifcb9e3f66fce8002dd7d5ecb4de1729ab8939d0d
Diffstat (limited to 'test/904-object-allocation/src')
-rw-r--r--test/904-object-allocation/src/art/Main.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/904-object-allocation/src/art/Main.java b/test/904-object-allocation/src/art/Main.java
new file mode 100644
index 0000000000..8b01920638
--- /dev/null
+++ b/test/904-object-allocation/src/art/Main.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package art;
+
+// Binder class so the agent's C code has something that can be bound and exposed to tests.
+// In a package to separate cleanly and work around CTS reference issues (though this class
+// should be replaced in the CTS version).
+public class Main {
+ // Load the given class with the given classloader, and bind all native methods to corresponding
+ // C methods in the agent. Will abort if any of the steps fail.
+ public static native void bindAgentJNI(String className, ClassLoader classLoader);
+ // Same as above, giving the class directly.
+ public static native void bindAgentJNIForClass(Class<?> klass);
+}