4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package compiler.jvmci.compilerToVM; 25 26 import jdk.test.lib.Asserts; 27 import jdk.test.lib.util.Pair; 28 import jdk.test.lib.Utils; 29 import jdk.vm.ci.code.InstalledCode; 30 import jdk.vm.ci.code.InvalidInstalledCodeException; 31 import jdk.vm.ci.hotspot.CompilerToVMHelper; 32 import sun.hotspot.code.NMethod; 33 34 import java.lang.reflect.Constructor; 35 import java.lang.reflect.Modifier; 36 import java.util.ArrayList; 37 import java.util.List; 38 39 /* 40 * @test 41 * @bug 8136421 42 * @requires vm.jvmci 43 * @library /test/lib / 44 * @library ../common/patches 45 * @modules java.base/jdk.internal.misc 46 * @modules java.base/jdk.internal.org.objectweb.asm 47 * java.base/jdk.internal.org.objectweb.asm.tree 48 * jdk.vm.ci/jdk.vm.ci.hotspot 49 * jdk.vm.ci/jdk.vm.ci.code 50 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox 51 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 52 * sun.hotspot.WhiteBox$WhiteBoxPermission 53 * @run main/othervm -Xbootclasspath/a:. 54 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI 55 * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI 56 * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest 57 */ 58 59 public class ExecuteInstalledCodeTest { 60 61 public static void main(String[] args) { 62 ExecuteInstalledCodeTest test = new ExecuteInstalledCodeTest(); 63 List<CompileCodeTestCase> testCases = new ArrayList<>(); 64 testCases.addAll(CompileCodeTestCase.generate(/* bci = */ -1)); 65 testCases .stream() 66 // ignore <init> of abstract class -- 8138793 67 .filter(e -> !(e.executable instanceof Constructor 68 && Modifier.isAbstract( 69 e.executable.getDeclaringClass() 70 .getModifiers()))) 71 .forEach(test::checkSanity); 72 } 73 74 private void checkSanity(CompileCodeTestCase testCase) { 75 System.out.println(testCase); 76 // to have a clean state 77 testCase.deoptimize(); | 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @bug 8136421 27 * @requires vm.jvmci 28 * @library /test/lib / 29 * @library ../common/patches 30 * @modules java.base/jdk.internal.misc 31 * @modules java.base/jdk.internal.org.objectweb.asm 32 * java.base/jdk.internal.org.objectweb.asm.tree 33 * jdk.internal.vm.ci/jdk.vm.ci.hotspot 34 * jdk.internal.vm.ci/jdk.vm.ci.code 35 * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox 36 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 37 * sun.hotspot.WhiteBox$WhiteBoxPermission 38 * @run main/othervm -Xbootclasspath/a:. 39 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI 40 * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI 41 * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest 42 */ 43 44 package compiler.jvmci.compilerToVM; 45 46 import jdk.test.lib.Asserts; 47 import jdk.test.lib.util.Pair; 48 import jdk.test.lib.Utils; 49 import jdk.vm.ci.code.InstalledCode; 50 import jdk.vm.ci.code.InvalidInstalledCodeException; 51 import jdk.vm.ci.hotspot.CompilerToVMHelper; 52 import sun.hotspot.code.NMethod; 53 54 import java.lang.reflect.Constructor; 55 import java.lang.reflect.Modifier; 56 import java.util.ArrayList; 57 import java.util.List; 58 59 public class ExecuteInstalledCodeTest { 60 61 public static void main(String[] args) { 62 ExecuteInstalledCodeTest test = new ExecuteInstalledCodeTest(); 63 List<CompileCodeTestCase> testCases = new ArrayList<>(); 64 testCases.addAll(CompileCodeTestCase.generate(/* bci = */ -1)); 65 testCases .stream() 66 // ignore <init> of abstract class -- 8138793 67 .filter(e -> !(e.executable instanceof Constructor 68 && Modifier.isAbstract( 69 e.executable.getDeclaringClass() 70 .getModifiers()))) 71 .forEach(test::checkSanity); 72 } 73 74 private void checkSanity(CompileCodeTestCase testCase) { 75 System.out.println(testCase); 76 // to have a clean state 77 testCase.deoptimize(); |