diff options
author | 2017-04-20 16:55:25 -0700 | |
---|---|---|
committer | 2017-04-24 08:51:03 -0700 | |
commit | 21b0c29e6a7e5a9d2d31db27aea2fa8615d56f3b (patch) | |
tree | c3ef02e266924d482825e7bf07e95b7638c396d6 | |
parent | 5df5acf4dc296d22a868a7c5010a7f5cf2350539 (diff) |
Remove unneeded shims and jni binding code
Bug: 37522517
Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I8670ab1bbf4b906c47d4edb2ad7349f9505da94a
126 files changed, 13 insertions, 1822 deletions
diff --git a/test/901-hello-ti-agent/src/art/Test901.java b/test/901-hello-ti-agent/src/art/Test901.java index 26f7399c31..eef2188612 100644 --- a/test/901-hello-ti-agent/src/art/Test901.java +++ b/test/901-hello-ti-agent/src/art/Test901.java @@ -18,8 +18,6 @@ package art; public class Test901 { public static void run() { - Main.bindAgentJNIForClass(Test901.class); - System.out.println("Hello, world!"); if (checkLivePhase()) { diff --git a/test/902-hello-transformation/src/art/Main.java b/test/902-hello-transformation/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/902-hello-transformation/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/902-hello-transformation/src/art/Redefinition.java b/test/902-hello-transformation/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/902-hello-transformation/src/art/Redefinition.java +++ b/test/902-hello-transformation/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/903-hello-tagging/src/art/Test903.java b/test/903-hello-tagging/src/art/Test903.java index 1691a947c5..49645dd050 100644 --- a/test/903-hello-tagging/src/art/Test903.java +++ b/test/903-hello-tagging/src/art/Test903.java @@ -22,8 +22,6 @@ import java.util.Arrays; public class Test903 { public static void run() { - Main.bindAgentJNIForClass(Test903.class); - doTest(); testGetTaggedObjects(); testTags(); diff --git a/test/904-object-allocation/src/art/Main.java b/test/904-object-allocation/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/904-object-allocation/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/904-object-allocation/src/art/Test904.java b/test/904-object-allocation/src/art/Test904.java index 70a4b9847f..fda89852c2 100644 --- a/test/904-object-allocation/src/art/Test904.java +++ b/test/904-object-allocation/src/art/Test904.java @@ -21,8 +21,6 @@ import java.util.Arrays; public class Test904 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test904.class); - // Use a list to ensure objects must be allocated. ArrayList<Object> l = new ArrayList<>(100); diff --git a/test/905-object-free/src/art/Test905.java b/test/905-object-free/src/art/Test905.java index 1ed7a0eb19..62b6e62669 100644 --- a/test/905-object-free/src/art/Test905.java +++ b/test/905-object-free/src/art/Test905.java @@ -21,7 +21,6 @@ import java.util.Arrays; public class Test905 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test905.class); doTest(); } diff --git a/test/906-iterate-heap/src/art/Test906.java b/test/906-iterate-heap/src/art/Test906.java index feebf9c118..fe18e38501 100644 --- a/test/906-iterate-heap/src/art/Test906.java +++ b/test/906-iterate-heap/src/art/Test906.java @@ -21,7 +21,6 @@ import java.util.Collections; public class Test906 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test906.class); doTest(); } diff --git a/test/907-get-loaded-classes/src/art/Main.java b/test/907-get-loaded-classes/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/907-get-loaded-classes/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/907-get-loaded-classes/src/art/Test907.java b/test/907-get-loaded-classes/src/art/Test907.java index d654428819..df9ce7ae9f 100644 --- a/test/907-get-loaded-classes/src/art/Test907.java +++ b/test/907-get-loaded-classes/src/art/Test907.java @@ -22,7 +22,6 @@ import java.util.HashSet; public class Test907 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test907.class); doTest(); } diff --git a/test/908-gc-start-finish/src/art/Main.java b/test/908-gc-start-finish/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/908-gc-start-finish/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/908-gc-start-finish/src/art/Test908.java b/test/908-gc-start-finish/src/art/Test908.java index ceaa98cd9f..db84a6cb1f 100644 --- a/test/908-gc-start-finish/src/art/Test908.java +++ b/test/908-gc-start-finish/src/art/Test908.java @@ -20,7 +20,6 @@ import java.util.ArrayList; public class Test908 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test908.class); doTest(); } diff --git a/test/909-attach-agent/src/art/Main.java b/test/909-attach-agent/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/909-attach-agent/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/910-methods/src/art/Main.java b/test/910-methods/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/910-methods/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/910-methods/src/art/Test910.java b/test/910-methods/src/art/Test910.java index aa6d13af9a..e1da27748d 100644 --- a/test/910-methods/src/art/Test910.java +++ b/test/910-methods/src/art/Test910.java @@ -22,7 +22,6 @@ import java.util.Arrays; public class Test910 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test910.class); doTest(); } diff --git a/test/911-get-stack-trace/expected.txt b/test/911-get-stack-trace/expected.txt index fb5f71bda2..8510ff90ad 100644 --- a/test/911-get-stack-trace/expected.txt +++ b/test/911-get-stack-trace/expected.txt @@ -22,7 +22,7 @@ From top bar (IIILart/ControlData;)J 0 26 foo (IIILart/ControlData;)I 0 21 doTest ()V 38 25 - run ()V 0 30 + run ()V 0 25 --------- print (Ljava/lang/Thread;II)V 0 38 printOrWait (IILart/ControlData;)V 6 41 @@ -42,7 +42,7 @@ From top bar (IIILart/ControlData;)J 0 26 foo (IIILart/ControlData;)I 0 21 doTest ()V 42 26 - run ()V 0 30 + run ()V 0 25 --------- getStackTrace (Ljava/lang/Thread;II)[[Ljava/lang/String; -1 -2 print (Ljava/lang/Thread;II)V 0 38 @@ -57,13 +57,13 @@ From top baz (IIILart/ControlData;)Ljava/lang/Object; 9 34 From bottom --------- - run ()V 0 30 + run ()V 0 25 --------- baz (IIILart/ControlData;)Ljava/lang/Object; 9 34 bar (IIILart/ControlData;)J 0 26 foo (IIILart/ControlData;)I 0 21 doTest ()V 65 32 - run ()V 0 30 + run ()V 0 25 --------- bar (IIILart/ControlData;)J 0 26 foo (IIILart/ControlData;)I 0 21 @@ -361,7 +361,7 @@ Test911 getAllStackTraces (I)[[Ljava/lang/Object; -1 -2 printAll (I)V 0 75 doTest ()V 128 59 - run ()V 24 42 + run ()V 24 37 --------- main @@ -596,7 +596,7 @@ Test911 getAllStackTraces (I)[[Ljava/lang/Object; -1 -2 printAll (I)V 0 75 doTest ()V 133 61 - run ()V 24 42 + run ()V 24 37 --------- main @@ -628,7 +628,7 @@ Test911 getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2 printList ([Ljava/lang/Thread;I)V 0 68 doTest ()V 116 54 - run ()V 32 46 + run ()V 32 41 --------- ThreadListTraces Thread 0 @@ -675,7 +675,7 @@ Test911 getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2 printList ([Ljava/lang/Thread;I)V 0 68 doTest ()V 121 56 - run ()V 32 46 + run ()V 32 41 --------- ThreadListTraces Thread 0 diff --git a/test/911-get-stack-trace/src/art/Main.java b/test/911-get-stack-trace/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/911-get-stack-trace/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/911-get-stack-trace/src/art/Test911.java b/test/911-get-stack-trace/src/art/Test911.java index ee5936823b..5774546533 100644 --- a/test/911-get-stack-trace/src/art/Test911.java +++ b/test/911-get-stack-trace/src/art/Test911.java @@ -18,11 +18,6 @@ package art; public class Test911 { public static void run() throws Exception { - Main.bindAgentJNIForClass(AllTraces.class); - Main.bindAgentJNIForClass(Frames.class); - Main.bindAgentJNIForClass(PrintThread.class); - Main.bindAgentJNIForClass(ThreadListTraces.class); - Thread t = new Thread("Test911") { @Override public void run() { diff --git a/test/912-classes/src/art/Test912.java b/test/912-classes/src/art/Test912.java index f3ff2b0668..9896eacfeb 100644 --- a/test/912-classes/src/art/Test912.java +++ b/test/912-classes/src/art/Test912.java @@ -25,7 +25,6 @@ import java.util.Comparator; public class Test912 { public static void run() throws Exception { - art.Main.bindAgentJNIForClass(Test912.class); doTest(); } diff --git a/test/912-classes/src/art/Test912Art.java b/test/912-classes/src/art/Test912Art.java index e4384734d8..6da3cadefe 100644 --- a/test/912-classes/src/art/Test912Art.java +++ b/test/912-classes/src/art/Test912Art.java @@ -25,7 +25,6 @@ import java.util.Comparator; public class Test912Art { public static void run() throws Exception { - art.Main.bindAgentJNIForClass(Test912Art.class); doTest(); } diff --git a/test/913-heaps/src/art/Test913.java b/test/913-heaps/src/art/Test913.java index d3b29cf2b5..8800b1a4d7 100644 --- a/test/913-heaps/src/art/Test913.java +++ b/test/913-heaps/src/art/Test913.java @@ -25,8 +25,6 @@ import java.util.concurrent.CountDownLatch; public class Test913 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test913.class); - doTest(); // Use a countdown latch for synchronization, as join() will introduce more roots. diff --git a/test/914-hello-obsolescence/src/art/Main.java b/test/914-hello-obsolescence/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/914-hello-obsolescence/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/914-hello-obsolescence/src/art/Redefinition.java b/test/914-hello-obsolescence/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/914-hello-obsolescence/src/art/Redefinition.java +++ b/test/914-hello-obsolescence/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/915-obsolete-2/src/art/Main.java b/test/915-obsolete-2/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/915-obsolete-2/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/915-obsolete-2/src/art/Redefinition.java b/test/915-obsolete-2/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/915-obsolete-2/src/art/Redefinition.java +++ b/test/915-obsolete-2/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/916-obsolete-jit/src/Main.java b/test/916-obsolete-jit/src/Main.java index cb202e400d..17a7a86ccc 100644 --- a/test/916-obsolete-jit/src/Main.java +++ b/test/916-obsolete-jit/src/Main.java @@ -116,7 +116,6 @@ public class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(new Transform(), new TestWatcher()); } diff --git a/test/916-obsolete-jit/src/art/Main.java b/test/916-obsolete-jit/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/916-obsolete-jit/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/916-obsolete-jit/src/art/Redefinition.java b/test/916-obsolete-jit/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/916-obsolete-jit/src/art/Redefinition.java +++ b/test/916-obsolete-jit/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/917-fields-transformation/src/art/Main.java b/test/917-fields-transformation/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/917-fields-transformation/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/917-fields-transformation/src/art/Redefinition.java b/test/917-fields-transformation/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/917-fields-transformation/src/art/Redefinition.java +++ b/test/917-fields-transformation/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/918-fields/src/art/Main.java b/test/918-fields/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/918-fields/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/918-fields/src/art/Test918.java b/test/918-fields/src/art/Test918.java index 89d518c82d..ca23c0357d 100644 --- a/test/918-fields/src/art/Test918.java +++ b/test/918-fields/src/art/Test918.java @@ -21,7 +21,6 @@ import java.util.Arrays; public class Test918 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test918.class); doTest(); } diff --git a/test/919-obsolete-fields/src/art/Main.java b/test/919-obsolete-fields/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/919-obsolete-fields/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/919-obsolete-fields/src/art/Redefinition.java b/test/919-obsolete-fields/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/919-obsolete-fields/src/art/Redefinition.java +++ b/test/919-obsolete-fields/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/920-objects/src/art/Main.java b/test/920-objects/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/920-objects/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/920-objects/src/art/Test920.java b/test/920-objects/src/art/Test920.java index 708e417e6b..03038a67c5 100644 --- a/test/920-objects/src/art/Test920.java +++ b/test/920-objects/src/art/Test920.java @@ -21,7 +21,6 @@ import java.util.Arrays; public class Test920 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test920.class); doTest(); } diff --git a/test/921-hello-failure/src/art/Main.java b/test/921-hello-failure/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/921-hello-failure/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/921-hello-failure/src/art/Redefinition.java b/test/921-hello-failure/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/921-hello-failure/src/art/Redefinition.java +++ b/test/921-hello-failure/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/922-properties/src/art/Main.java b/test/922-properties/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/922-properties/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/922-properties/src/art/Test922.java b/test/922-properties/src/art/Test922.java index 4b2204a86c..d105a21553 100644 --- a/test/922-properties/src/art/Test922.java +++ b/test/922-properties/src/art/Test922.java @@ -21,7 +21,6 @@ import java.util.TreeSet; public class Test922 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test922.class); doTest(); } diff --git a/test/923-monitors/src/art/Main.java b/test/923-monitors/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/923-monitors/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/923-monitors/src/art/Test923.java b/test/923-monitors/src/art/Test923.java index 02e86a6891..0995cf0488 100644 --- a/test/923-monitors/src/art/Test923.java +++ b/test/923-monitors/src/art/Test923.java @@ -23,7 +23,6 @@ import java.util.List; public class Test923 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test923.class); doTest(); } diff --git a/test/924-threads/src/art/Main.java b/test/924-threads/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/924-threads/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/924-threads/src/art/Test924.java b/test/924-threads/src/art/Test924.java index 5445939cbc..84b7c62264 100644 --- a/test/924-threads/src/art/Test924.java +++ b/test/924-threads/src/art/Test924.java @@ -29,8 +29,6 @@ import java.util.Set; public class Test924 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test924.class); - // Run the test on its own thread, so we have a known state for the "current" thread. Thread t = new Thread("TestThread") { @Override diff --git a/test/925-threadgroups/src/art/Main.java b/test/925-threadgroups/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/925-threadgroups/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/925-threadgroups/src/art/Test925.java b/test/925-threadgroups/src/art/Test925.java index 14ca7a79d2..8d1e66544a 100644 --- a/test/925-threadgroups/src/art/Test925.java +++ b/test/925-threadgroups/src/art/Test925.java @@ -25,7 +25,6 @@ import java.util.List; public class Test925 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test925.class); doTest(); } diff --git a/test/926-multi-obsolescence/src/art/Main.java b/test/926-multi-obsolescence/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/926-multi-obsolescence/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/926-multi-obsolescence/src/art/Redefinition.java b/test/926-multi-obsolescence/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/926-multi-obsolescence/src/art/Redefinition.java +++ b/test/926-multi-obsolescence/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/927-timers/src/art/Main.java b/test/927-timers/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/927-timers/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/927-timers/src/art/Test927.java b/test/927-timers/src/art/Test927.java index 1ed016070b..e5bd8f1740 100644 --- a/test/927-timers/src/art/Test927.java +++ b/test/927-timers/src/art/Test927.java @@ -20,7 +20,6 @@ import java.util.Arrays; public class Test927 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test927.class); doTest(); } diff --git a/test/928-jni-table/src/art/Main.java b/test/928-jni-table/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/928-jni-table/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/928-jni-table/src/art/Test928.java b/test/928-jni-table/src/art/Test928.java index 3f3935d383..0fbfb7ea94 100644 --- a/test/928-jni-table/src/art/Test928.java +++ b/test/928-jni-table/src/art/Test928.java @@ -18,7 +18,6 @@ package art; public class Test928 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test928.class); doJNITableTest(); System.out.println("Done"); diff --git a/test/929-search/src/Main.java b/test/929-search/src/Main.java index 4073c3f502..bbeb0816c8 100644 --- a/test/929-search/src/Main.java +++ b/test/929-search/src/Main.java @@ -18,7 +18,6 @@ import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { - art.Main.bindAgentJNIForClass(Main.class); doTest(); } diff --git a/test/929-search/src/art/Main.java b/test/929-search/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/929-search/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/930-hello-retransform/src/art/Main.java b/test/930-hello-retransform/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/930-hello-retransform/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/930-hello-retransform/src/art/Redefinition.java b/test/930-hello-retransform/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/930-hello-retransform/src/art/Redefinition.java +++ b/test/930-hello-retransform/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/931-agent-thread/src/art/Main.java b/test/931-agent-thread/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/931-agent-thread/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/931-agent-thread/src/art/Test931.java b/test/931-agent-thread/src/art/Test931.java index bc096a770f..be69466402 100644 --- a/test/931-agent-thread/src/art/Test931.java +++ b/test/931-agent-thread/src/art/Test931.java @@ -20,7 +20,6 @@ import java.util.Arrays; public class Test931 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test931.class); testAgentThread(); System.out.println("Done"); diff --git a/test/932-transform-saves/src/art/Main.java b/test/932-transform-saves/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/932-transform-saves/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/932-transform-saves/src/art/Redefinition.java b/test/932-transform-saves/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/932-transform-saves/src/art/Redefinition.java +++ b/test/932-transform-saves/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/933-misc-events/src/art/Main.java b/test/933-misc-events/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/933-misc-events/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/933-misc-events/src/art/Test933.java b/test/933-misc-events/src/art/Test933.java index afebbf8798..04f96e1e8c 100644 --- a/test/933-misc-events/src/art/Test933.java +++ b/test/933-misc-events/src/art/Test933.java @@ -18,7 +18,6 @@ package art; public class Test933 { public static void run() throws Exception { - Main.bindAgentJNIForClass(Test933.class); testSigQuit(); System.out.println("Done"); diff --git a/test/934-load-transform/src/Main.java b/test/934-load-transform/src/Main.java index 69c839fdb2..1401b7df01 100644 --- a/test/934-load-transform/src/Main.java +++ b/test/934-load-transform/src/Main.java @@ -70,7 +70,6 @@ class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); // Don't pop transformations. Make sure that even if 2 threads race to define the class both // will get the same result. setPopRetransformations(false); diff --git a/test/934-load-transform/src/art/Main.java b/test/934-load-transform/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/934-load-transform/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/934-load-transform/src/art/Redefinition.java b/test/934-load-transform/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/934-load-transform/src/art/Redefinition.java +++ b/test/934-load-transform/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/935-non-retransformable/src/art/Main.java b/test/935-non-retransformable/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/935-non-retransformable/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/935-non-retransformable/src/art/Redefinition.java b/test/935-non-retransformable/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/935-non-retransformable/src/art/Redefinition.java +++ b/test/935-non-retransformable/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/936-search-onload/src/Main.java b/test/936-search-onload/src/Main.java index 8d40753036..2e7a87193b 100644 --- a/test/936-search-onload/src/Main.java +++ b/test/936-search-onload/src/Main.java @@ -18,7 +18,6 @@ import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { - art.Main.bindAgentJNIForClass(Main.class); doTest(); } diff --git a/test/936-search-onload/src/art/Main.java b/test/936-search-onload/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/936-search-onload/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/937-hello-retransform-package/src/art/Main.java b/test/937-hello-retransform-package/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/937-hello-retransform-package/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/937-hello-retransform-package/src/art/Redefinition.java b/test/937-hello-retransform-package/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/937-hello-retransform-package/src/art/Redefinition.java +++ b/test/937-hello-retransform-package/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/938-load-transform-bcp/src/Main.java b/test/938-load-transform-bcp/src/Main.java index e560942729..69658c0cec 100644 --- a/test/938-load-transform-bcp/src/Main.java +++ b/test/938-load-transform-bcp/src/Main.java @@ -97,7 +97,6 @@ class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); setPopRetransformations(false); addCommonTransformationResult("java/util/OptionalLong", CLASS_BYTES, DEX_BYTES); enableCommonRetransformation(true); diff --git a/test/938-load-transform-bcp/src/art/Main.java b/test/938-load-transform-bcp/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/938-load-transform-bcp/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/938-load-transform-bcp/src/art/Redefinition.java b/test/938-load-transform-bcp/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/938-load-transform-bcp/src/art/Redefinition.java +++ b/test/938-load-transform-bcp/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/939-hello-transformation-bcp/src/art/Main.java b/test/939-hello-transformation-bcp/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/939-hello-transformation-bcp/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/939-hello-transformation-bcp/src/art/Redefinition.java b/test/939-hello-transformation-bcp/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/939-hello-transformation-bcp/src/art/Redefinition.java +++ b/test/939-hello-transformation-bcp/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/940-recursive-obsolete/src/art/Main.java b/test/940-recursive-obsolete/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/940-recursive-obsolete/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/940-recursive-obsolete/src/art/Redefinition.java b/test/940-recursive-obsolete/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/940-recursive-obsolete/src/art/Redefinition.java +++ b/test/940-recursive-obsolete/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/941-recurive-obsolete-jit/src/Main.java b/test/941-recurive-obsolete-jit/src/Main.java index 1c391a4db5..89d593b7cd 100644 --- a/test/941-recurive-obsolete-jit/src/Main.java +++ b/test/941-recurive-obsolete-jit/src/Main.java @@ -101,7 +101,6 @@ public class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(new Transform()); } diff --git a/test/941-recurive-obsolete-jit/src/art/Main.java b/test/941-recurive-obsolete-jit/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/941-recurive-obsolete-jit/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/941-recurive-obsolete-jit/src/art/Redefinition.java b/test/941-recurive-obsolete-jit/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/941-recurive-obsolete-jit/src/art/Redefinition.java +++ b/test/941-recurive-obsolete-jit/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/942-private-recursive/src/art/Main.java b/test/942-private-recursive/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/942-private-recursive/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/942-private-recursive/src/art/Redefinition.java b/test/942-private-recursive/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/942-private-recursive/src/art/Redefinition.java +++ b/test/942-private-recursive/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/943-private-recursive-jit/src/Main.java b/test/943-private-recursive-jit/src/Main.java index 01760ad0c1..871c63674f 100644 --- a/test/943-private-recursive-jit/src/Main.java +++ b/test/943-private-recursive-jit/src/Main.java @@ -111,7 +111,6 @@ public class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(new Transform()); } diff --git a/test/943-private-recursive-jit/src/art/Main.java b/test/943-private-recursive-jit/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/943-private-recursive-jit/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/943-private-recursive-jit/src/art/Redefinition.java b/test/943-private-recursive-jit/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/943-private-recursive-jit/src/art/Redefinition.java +++ b/test/943-private-recursive-jit/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/944-transform-classloaders/src/art/Main.java b/test/944-transform-classloaders/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/944-transform-classloaders/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/944-transform-classloaders/src/art/Redefinition.java b/test/944-transform-classloaders/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/944-transform-classloaders/src/art/Redefinition.java +++ b/test/944-transform-classloaders/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/945-obsolete-native/src/art/Main.java b/test/945-obsolete-native/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/945-obsolete-native/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/945-obsolete-native/src/art/Redefinition.java b/test/945-obsolete-native/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/945-obsolete-native/src/art/Redefinition.java +++ b/test/945-obsolete-native/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/945-obsolete-native/src/art/Test945.java b/test/945-obsolete-native/src/art/Test945.java index 6cf31f6d05..97fd0bb621 100644 --- a/test/945-obsolete-native/src/art/Test945.java +++ b/test/945-obsolete-native/src/art/Test945.java @@ -21,9 +21,9 @@ import java.util.Base64; public class Test945 { static class Transform { - static { - art.Main.bindAgentJNIForClass(Transform.class); - } + // static block to ensure that there is a <clinit> method. This used to be needed due to a bug. + // Since it's annoying to recompute the transformed bytes we will just leave this here. + static { } public void sayHi(Runnable r) { System.out.println("hello"); diff --git a/test/946-obsolete-throw/src/art/Main.java b/test/946-obsolete-throw/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/946-obsolete-throw/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/946-obsolete-throw/src/art/Redefinition.java b/test/946-obsolete-throw/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/946-obsolete-throw/src/art/Redefinition.java +++ b/test/946-obsolete-throw/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/947-reflect-method/src/art/Main.java b/test/947-reflect-method/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/947-reflect-method/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/947-reflect-method/src/art/Redefinition.java b/test/947-reflect-method/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/947-reflect-method/src/art/Redefinition.java +++ b/test/947-reflect-method/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/948-change-annotations/src/Main.java b/test/948-change-annotations/src/Main.java index 5d3406dacc..4fd2bfdb19 100644 --- a/test/948-change-annotations/src/Main.java +++ b/test/948-change-annotations/src/Main.java @@ -56,7 +56,6 @@ public class Main { "AAQgAAACAAAAmwIAAAAgAAABAAAApwIAAAAQAAABAAAAuAIAAA=="); public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(new RemoveAnnotationsTest()); doTest(new AddAnnotationsTest()); doTest(new ChangeAnnotationValues()); diff --git a/test/948-change-annotations/src/art/Main.java b/test/948-change-annotations/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/948-change-annotations/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/948-change-annotations/src/art/Redefinition.java b/test/948-change-annotations/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/948-change-annotations/src/art/Redefinition.java +++ b/test/948-change-annotations/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/949-in-memory-transform/src/art/Main.java b/test/949-in-memory-transform/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/949-in-memory-transform/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/949-in-memory-transform/src/art/Redefinition.java b/test/949-in-memory-transform/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/949-in-memory-transform/src/art/Redefinition.java +++ b/test/949-in-memory-transform/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/950-redefine-intrinsic/src/Main.java b/test/950-redefine-intrinsic/src/Main.java index 369a8f417e..d4f4e8f9b0 100644 --- a/test/950-redefine-intrinsic/src/Main.java +++ b/test/950-redefine-intrinsic/src/Main.java @@ -426,7 +426,6 @@ public class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(10000); } diff --git a/test/950-redefine-intrinsic/src/art/Main.java b/test/950-redefine-intrinsic/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/950-redefine-intrinsic/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/950-redefine-intrinsic/src/art/Redefinition.java b/test/950-redefine-intrinsic/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/950-redefine-intrinsic/src/art/Redefinition.java +++ b/test/950-redefine-intrinsic/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/951-threaded-obsolete/src/art/Main.java b/test/951-threaded-obsolete/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/951-threaded-obsolete/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/951-threaded-obsolete/src/art/Redefinition.java b/test/951-threaded-obsolete/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/951-threaded-obsolete/src/art/Redefinition.java +++ b/test/951-threaded-obsolete/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/980-redefine-object/src/Main.java b/test/980-redefine-object/src/Main.java index 63c0cab95e..2428b55a4e 100644 --- a/test/980-redefine-object/src/Main.java +++ b/test/980-redefine-object/src/Main.java @@ -316,7 +316,6 @@ public class Main { } public static void main(String[] args) { - art.Main.bindAgentJNIForClass(Main.class); doTest(); } diff --git a/test/980-redefine-object/src/art/Main.java b/test/980-redefine-object/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/980-redefine-object/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/980-redefine-object/src/art/Redefinition.java b/test/980-redefine-object/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/980-redefine-object/src/art/Redefinition.java +++ b/test/980-redefine-object/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/981-dedup-original-dex/src/art/Main.java b/test/981-dedup-original-dex/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/981-dedup-original-dex/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/981-dedup-original-dex/src/art/Redefinition.java b/test/981-dedup-original-dex/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/981-dedup-original-dex/src/art/Redefinition.java +++ b/test/981-dedup-original-dex/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/982-ok-no-retransform/src/art/Main.java b/test/982-ok-no-retransform/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/982-ok-no-retransform/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/982-ok-no-retransform/src/art/Redefinition.java b/test/982-ok-no-retransform/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/982-ok-no-retransform/src/art/Redefinition.java +++ b/test/982-ok-no-retransform/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/983-source-transform-verify/src/art/Main.java b/test/983-source-transform-verify/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/983-source-transform-verify/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/983-source-transform-verify/src/art/Redefinition.java b/test/983-source-transform-verify/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/983-source-transform-verify/src/art/Redefinition.java +++ b/test/983-source-transform-verify/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/984-obsolete-invoke/src/art/Main.java b/test/984-obsolete-invoke/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/984-obsolete-invoke/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/984-obsolete-invoke/src/art/Redefinition.java b/test/984-obsolete-invoke/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/984-obsolete-invoke/src/art/Redefinition.java +++ b/test/984-obsolete-invoke/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/984-obsolete-invoke/src/art/Test984.java b/test/984-obsolete-invoke/src/art/Test984.java index 3fe66f68bf..0b0767c1d9 100644 --- a/test/984-obsolete-invoke/src/art/Test984.java +++ b/test/984-obsolete-invoke/src/art/Test984.java @@ -72,7 +72,6 @@ public class Test984 { "AA=="); public static void run() { - art.Main.bindAgentJNIForClass(Test984.class); doTest(); } diff --git a/test/985-re-obsolete/src/art/Main.java b/test/985-re-obsolete/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/985-re-obsolete/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/985-re-obsolete/src/art/Redefinition.java b/test/985-re-obsolete/src/art/Redefinition.java index 0350ab42ad..56d2938a01 100644 --- a/test/985-re-obsolete/src/art/Redefinition.java +++ b/test/985-re-obsolete/src/art/Redefinition.java @@ -19,11 +19,6 @@ package art; import java.util.ArrayList; // Common Redefinition functions. Placed here for use by CTS public class Redefinition { - // Bind native functions. - static { - Main.bindAgentJNIForClass(Redefinition.class); - } - public static final class CommonClassDefinition { public final Class<?> target; public final byte[] class_file_bytes; diff --git a/test/986-native-method-bind/expected.txt b/test/986-native-method-bind/expected.txt index 3376e6f91b..a470285cea 100644 --- a/test/986-native-method-bind/expected.txt +++ b/test/986-native-method-bind/expected.txt @@ -2,6 +2,7 @@ private static native void art.Test986$Transform.sayHi2() = Java_art_Test986_000 Hello - 2 private static native void art.Test986$Transform.sayHi() = Java_art_Test986_00024Transform_sayHi__ -> NoReallySayGoodbye Bye +private static native void art.Test986.rebindTransformClass(java.lang.Class) = Java_art_Test986_rebindTransformClass -> Java_art_Test986_rebindTransformClass private static native void art.Test986$Transform.sayHi() = Java_art_Test986_00024Transform_sayHi__ -> Java_art_Test986_00024Transform_sayHi2 private static native void art.Test986$Transform.sayHi2() = Java_art_Test986_00024Transform_sayHi2 -> Java_art_Test986_00024Transform_sayHi2 Hello - 2 diff --git a/test/986-native-method-bind/src/art/Main.java b/test/986-native-method-bind/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/986-native-method-bind/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/986-native-method-bind/src/art/Test986.java b/test/986-native-method-bind/src/art/Test986.java index aac73d33ab..f621c9fea7 100644 --- a/test/986-native-method-bind/src/art/Test986.java +++ b/test/986-native-method-bind/src/art/Test986.java @@ -20,13 +20,6 @@ import java.lang.reflect.Method; import java.util.HashMap; public class Test986 { - static { - // NB This is called before any setup is done so we don't need to worry about getting bind - // events. - Main.bindAgentJNIForClass(Test986.class); - } - - private static final HashMap<Method, String> SymbolMap = new HashMap<>(); // A class with a native method we can play with. diff --git a/test/987-agent-bind/src/art/Main.java b/test/987-agent-bind/src/art/Main.java deleted file mode 100644 index 8b01920638..0000000000 --- a/test/987-agent-bind/src/art/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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); -} diff --git a/test/ti-agent/agent_startup.cc b/test/ti-agent/agent_startup.cc index be73de5967..d6fd266334 100644 --- a/test/ti-agent/agent_startup.cc +++ b/test/ti-agent/agent_startup.cc @@ -14,8 +14,6 @@ * limitations under the License. */ -#include "agent_startup.h" - #include "android-base/logging.h" #include "android-base/macros.h" @@ -26,75 +24,7 @@ namespace art { -static constexpr const char* kMainClass = "art/Main"; - -static StartCallback gCallback = nullptr; - -// TODO: Check this. This may not work on device. The classloader containing the app's classes -// may not have been created at this point (i.e., if it's not the system classloader). -static void JNICALL VMInitCallback(jvmtiEnv* callback_jvmti_env, - JNIEnv* jni_env, - jthread thread ATTRIBUTE_UNUSED) { - // Bind kMainClass native methods. - BindFunctions(callback_jvmti_env, jni_env, kMainClass); - - if (gCallback != nullptr) { - gCallback(callback_jvmti_env, jni_env); - gCallback = nullptr; - } - - // And delete the jvmtiEnv. - callback_jvmti_env->DisposeEnvironment(); -} - -// Install a phase callback that will bind JNI functions on VMInit. -void BindOnLoad(JavaVM* vm, StartCallback callback) { - // Use a new jvmtiEnv. Otherwise we might collide with table changes. - jvmtiEnv* install_env; - if (vm->GetEnv(reinterpret_cast<void**>(&install_env), JVMTI_VERSION_1_0) != 0) { - LOG(FATAL) << "Could not get jvmtiEnv"; - } - SetAllCapabilities(install_env); - - { - jvmtiEventCallbacks callbacks; - memset(&callbacks, 0, sizeof(jvmtiEventCallbacks)); - callbacks.VMInit = VMInitCallback; - - CheckJvmtiError(install_env, install_env->SetEventCallbacks(&callbacks, sizeof(callbacks))); - } - - CheckJvmtiError(install_env, install_env->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, - nullptr)); - - gCallback = callback; -} - -// Ensure binding of the Main class when the agent is started through OnAttach. -void BindOnAttach(JavaVM* vm, StartCallback callback) { - // Get a JNIEnv. As the thread is attached, we must not destroy it. - JNIEnv* env; - CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6)) - << "Could not get JNIEnv"; - - jvmtiEnv* bind_jvmti_env; - CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&bind_jvmti_env), JVMTI_VERSION_1_0)) - << "Could not get jvmtiEnv"; - SetAllCapabilities(bind_jvmti_env); - - BindFunctions(bind_jvmti_env, env, kMainClass); - - if (callback != nullptr) { - callback(bind_jvmti_env, env); - } - - if (bind_jvmti_env->DisposeEnvironment() != JVMTI_ERROR_NONE) { - LOG(FATAL) << "Could not dispose temporary jvmtiEnv"; - } -} - -// Utility functions for art.Main shim. +// Utility functions for binding jni methods. extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNI( JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jstring className, jobject classLoader) { ScopedUtfChars name(env, className); diff --git a/test/ti-agent/agent_startup.h b/test/ti-agent/agent_startup.h deleted file mode 100644 index 49633202ab..0000000000 --- a/test/ti-agent/agent_startup.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -#ifndef ART_TEST_TI_AGENT_AGENT_STARTUP_H_ -#define ART_TEST_TI_AGENT_AGENT_STARTUP_H_ - -#include <functional> - -#include "jni.h" -#include "jvmti.h" - -namespace art { - -using StartCallback = void(*)(jvmtiEnv*, JNIEnv*); - -// Ensure binding of the Main class when the agent is started through OnLoad. -void BindOnLoad(JavaVM* vm, StartCallback callback); - -// Ensure binding of the Main class when the agent is started through OnAttach. -void BindOnAttach(JavaVM* vm, StartCallback callback); - -} // namespace art - -#endif // ART_TEST_TI_AGENT_AGENT_STARTUP_H_ diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc index 3455409b2d..fd47f59905 100644 --- a/test/ti-agent/common_load.cc +++ b/test/ti-agent/common_load.cc @@ -20,7 +20,6 @@ #include "base/logging.h" #include "base/macros.h" -#include "agent_startup.h" #include "common_helper.h" #include "jni_binder.h" #include "jvmti_helper.h" @@ -117,8 +116,6 @@ extern "C" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm, char* options, void* SetIsJVM(remaining_options); - BindOnLoad(vm, nullptr); - AgentLib* lib = FindAgent(name_option); OnLoad fn = nullptr; if (lib == nullptr) { @@ -141,8 +138,6 @@ extern "C" JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm, char* options, void return -1; } - BindOnAttach(vm, nullptr); - AgentLib* lib = FindAgent(name_option); if (lib == nullptr) { printf("Unable to find agent named: %s, add it to the list in test/ti-agent/common_load.cc\n", |