8141351: Create tests for direct invoke instructions testing
Summary: Tests for invoke* instructions
Reviewed-by: twisti
--- a/hotspot/make/test/JtregNative.gmk Wed Dec 16 13:21:19 2015 +0000
+++ b/hotspot/make/test/JtregNative.gmk Wed Dec 16 18:38:02 2015 +0300
@@ -47,6 +47,7 @@
$(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \
$(HOTSPOT_TOPDIR)/test/runtime/SameObject \
$(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
+ $(HOTSPOT_TOPDIR)/test/compiler/calls \
#
# Add conditional directories here when needed.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/CallInterface.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+/**
+ * A test interface used for InvokeInterface
+ */
+public interface CallInterface {
+ public boolean callee(int param1, long param2, float param3, double param4,
+ String param5);
+
+ public boolean calleeNative(int param1, long param2, float param3,
+ double param4, String param5);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/CallsBase.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import compiler.testlibrary.CompilerUtils;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import jdk.test.lib.Asserts;
+import sun.hotspot.WhiteBox;
+
+/**
+ * A common class for Invoke* classes
+ */
+public abstract class CallsBase {
+ public static final String CALL_ERR_MSG = "Call insuccessfull";
+ protected final Method calleeMethod;
+ protected final Method callerMethod;
+ protected final WhiteBox wb = WhiteBox.getWhiteBox();
+ protected int compileCallee = -1;
+ protected int compileCaller = -1;
+ protected boolean nativeCallee = false;
+ protected boolean nativeCaller = false;
+ protected boolean calleeVisited = false;
+ protected boolean checkCallerCompilationLevel;
+ protected boolean checkCalleeCompilationLevel;
+ protected int expectedCallerCompilationLevel;
+ protected int expectedCalleeCompilationLevel;
+
+ protected CallsBase() {
+ try {
+ callerMethod = getClass().getDeclaredMethod("caller");
+ calleeMethod = getClass().getDeclaredMethod("callee",
+ getCalleeParametersTypes());
+ wb.testSetDontInlineMethod(callerMethod, /* dontinline= */ true);
+ wb.testSetDontInlineMethod(calleeMethod, /* dontinline= */ true);
+ } catch (NoSuchMethodException e) {
+ throw new Error("TEST BUG: can't find test method", e);
+ }
+ }
+
+ /**
+ * Provides callee parameters types to search method
+ * @return array of types
+ */
+ protected Class[] getCalleeParametersTypes() {
+ return new Class[] {int.class, long.class, float.class,
+ double.class, String.class};
+ }
+
+ /**
+ * Loads native library(libCallsNative.so)
+ */
+ protected static void loadNativeLibrary() {
+ System.loadLibrary("CallsNative");
+ }
+
+ /**
+ * Checks if requested compilation levels are inside of current vm capabilities
+ * @return true if vm is capable of requested compilation levels
+ */
+ protected final boolean compilationLevelsSupported() {
+ int[] compLevels = CompilerUtils.getAvailableCompilationLevels();
+ boolean callerCompLevelSupported = compileCaller > 0
+ && Arrays.stream(compLevels)
+ .filter(elem -> elem == compileCaller)
+ .findAny()
+ .isPresent();
+ boolean calleeCompLevelSupported = compileCallee > 0
+ && Arrays.stream(compLevels)
+ .filter(elem -> elem == compileCallee)
+ .findAny()
+ .isPresent();
+ return callerCompLevelSupported && calleeCompLevelSupported;
+ }
+
+ /**
+ * Parse test arguments
+ * @param args test arguments
+ */
+ protected final void parseArgs(String args[]) {
+ for (int i = 0; i < args.length; i++) {
+ switch (args[i]) {
+ case "-nativeCallee":
+ nativeCallee = true;
+ break;
+ case "-nativeCaller":
+ nativeCaller = true;
+ break;
+ case "-compileCallee":
+ compileCallee = Integer.parseInt(args[++i]);
+ break;
+ case "-compileCaller":
+ compileCaller = Integer.parseInt(args[++i]);
+ break;
+ case "-checkCallerCompileLevel":
+ checkCallerCompilationLevel = true;
+ expectedCallerCompilationLevel = Integer.parseInt(args[++i]);
+ break;
+ case "-checkCalleeCompileLevel":
+ checkCalleeCompilationLevel = true;
+ expectedCalleeCompilationLevel = Integer.parseInt(args[++i]);
+ break;
+ default:
+ throw new Error("Can't parse test parameter:" + args[i]);
+ }
+ }
+ }
+
+ /**
+ * Run basic logic of a test by doing compile
+ * action(if needed). An arguments can be -compileCallee
+ * $calleeCompilationLevel and/or -compileCaller $callerCompilationLevel
+ * and/or -nativeCaller and/or -nativeCallee to indicate that native methods
+ * for caller/callee should be used
+ * @param args test args
+ */
+ protected final void runTest(String args[]) {
+ parseArgs(args);
+ if (compilationLevelsSupported()) {
+ if (nativeCaller || nativeCallee) {
+ CallsBase.loadNativeLibrary();
+ }
+ Object lock = getLockObject();
+ Asserts.assertNotNull(lock, "Lock object is null");
+ /* a following lock is needed in case several instances of this
+ test are launched in same vm */
+ synchronized (lock) {
+ if (compileCaller > 0 || compileCallee > 0) {
+ caller(); // call once to have everything loaded
+ calleeVisited = false; // reset state
+ }
+ // compile with requested level if needed
+ if (compileCallee > 0) {
+ compileMethod(calleeMethod, compileCallee);
+ }
+ if (checkCalleeCompilationLevel) {
+ Asserts.assertEQ(expectedCalleeCompilationLevel,
+ wb.getMethodCompilationLevel(calleeMethod),
+ "Unexpected callee compilation level");
+ }
+ if (compileCaller > 0) {
+ compileMethod(callerMethod, compileCaller);
+ }
+ if (checkCallerCompilationLevel) {
+ Asserts.assertEQ(expectedCallerCompilationLevel,
+ wb.getMethodCompilationLevel(callerMethod),
+ "Unexpected caller compilation level");
+ }
+ // do calling work
+ if (nativeCaller) {
+ callerNative();
+ } else {
+ caller();
+ }
+ }
+ } else {
+ System.out.println("WARNING: Requested compilation levels are "
+ + "out of current vm capabilities. Skipping.");
+ }
+ }
+
+ /**
+ * A method to compile another method, searching it by name in current class
+ * @param method a method to compile
+ * @param compLevel a compilation level
+ */
+ protected final void compileMethod(Method method, int compLevel) {
+ wb.deoptimizeMethod(method);
+ Asserts.assertTrue(wb.isMethodCompilable(method, compLevel));
+ wb.enqueueMethodForCompilation(method, compLevel);
+ }
+
+ /*
+ * @return Object to lock on during execution
+ */
+
+ protected abstract Object getLockObject();
+
+ protected abstract void caller();
+
+ protected abstract void callerNative();
+
+ /**
+ * A method checking values. Should be used to verify if all parameters are
+ * passed as expected. Parameter N should have a value indicating number "N"
+ * in respective type representation.
+ */
+ public static void checkValues(int param1, long param2, float param3,
+ double param4, String param5) {
+ Asserts.assertEQ(param1, 1);
+ Asserts.assertEQ(param2, 2L);
+ Asserts.assertEQ(param3, 3.0f);
+ Asserts.assertEQ(param4, 4.0d);
+ Asserts.assertEQ(param5, "5");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeDynamic.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import java.lang.invoke.CallSite;
+import java.lang.invoke.ConstantCallSite;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+/**
+ * A test class checking InvokeDynamic instruction.
+ * This is not quite "ready-to-use" class, since javac can't generate indy
+ * directly(only as part of lambda init) so, this class bytecode should be
+ * patched with method "caller" which uses indy. Other methods can be written in
+ * java for easier support and readability.
+ */
+
+public class InvokeDynamic extends CallsBase {
+ private static final Object LOCK = new Object();
+
+ public static void main(String args[]) {
+ new InvokeDynamic().runTest(args);
+ }
+
+ /**
+ * Caller method to call "callee" method. Must be overwritten with InvokeDynamicPatcher
+ */
+ @Override
+ public void caller() {
+ }
+
+ /**
+ * A bootstrap method for invokedynamic
+ * @param lookup a lookup object
+ * @param methodName methodName
+ * @param type method type
+ * @return CallSite for method
+ */
+ public static CallSite bootstrapMethod(MethodHandles.Lookup lookup,
+ String methodName, MethodType type) throws IllegalAccessException,
+ NoSuchMethodException {
+ MethodType mtype = MethodType.methodType(boolean.class,
+ new Class<?>[]{int.class, long.class, float.class,
+ double.class, String.class});
+ return new ConstantCallSite(lookup.findVirtual(lookup.lookupClass(),
+ methodName, mtype));
+ }
+
+ /**
+ * A callee method, assumed to be called by "caller"
+ */
+ public boolean callee(int param1, long param2, float param3, double param4,
+ String param5) {
+ calleeVisited = true;
+ CallsBase.checkValues(param1, param2, param3, param4, param5);
+ return true;
+ }
+
+ /**
+ * A native callee method, assumed to be called by "caller"
+ */
+ public native boolean calleeNative(int param1, long param2, float param3,
+ double param4, String param5);
+
+ /**
+ * Returns object to lock execution on
+ * @return lock object
+ */
+ @Override
+ protected Object getLockObject() {
+ return LOCK;
+ }
+
+ @Override
+ protected void callerNative() {
+ throw new Error("No native call for invokedynamic");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.lang.invoke.CallSite;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import jdk.internal.org.objectweb.asm.ClassReader;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Handle;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import jdk.internal.org.objectweb.asm.Opcodes;
+
+/**
+ * A class which patch InvokeDynamic class bytecode with invokydynamic
+ instruction, rewriting "caller" method to call "callee" method using
+ invokedynamic
+ */
+public class InvokeDynamicPatcher extends ClassVisitor {
+
+ private static final String CLASS = InvokeDynamic.class.getName()
+ .replace('.', '/');
+ private static final String CALLER_METHOD_NAME = "caller";
+ private static final String CALLEE_METHOD_NAME = "callee";
+ private static final String NATIVE_CALLEE_METHOD_NAME = "calleeNative";
+ private static final String BOOTSTRAP_METHOD_NAME = "bootstrapMethod";
+ private static final String CALL_NATIVE_FIELD = "nativeCallee";
+ private static final String CALL_NATIVE_FIELD_DESC = "Z";
+ private static final String CALLEE_METHOD_DESC
+ = "(L" + CLASS + ";IJFDLjava/lang/String;)Z";
+ private static final String ASSERTTRUE_METHOD_DESC
+ = "(ZLjava/lang/String;)V";
+ private static final String ASSERTS_CLASS = "jdk/test/lib/Asserts";
+ private static final String ASSERTTRUE_METHOD_NAME = "assertTrue";
+
+ public static void main(String args[]) {
+ ClassReader cr;
+ Path filePath;
+ try {
+ filePath = Paths.get(InvokeDynamic.class.getProtectionDomain().getCodeSource()
+ .getLocation().toURI()).resolve(CLASS + ".class");
+ } catch (URISyntaxException ex) {
+ throw new Error("TESTBUG: Can't get code source" + ex, ex);
+ }
+ try (FileInputStream fis = new FileInputStream(filePath.toFile())) {
+ cr = new ClassReader(fis);
+ } catch (IOException e) {
+ throw new Error("Error reading file", e);
+ }
+ ClassWriter cw = new ClassWriter(cr,
+ ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
+ cr.accept(new InvokeDynamicPatcher(Opcodes.ASM5, cw), 0);
+ try {
+ Files.write(filePath, cw.toByteArray(),
+ StandardOpenOption.WRITE);
+ } catch (IOException e) {
+ throw new Error(e);
+ }
+ }
+
+ public InvokeDynamicPatcher(int api, ClassWriter cw) {
+ super(api, cw);
+ }
+
+ @Override
+ public MethodVisitor visitMethod(final int access, final String name,
+ final String desc, final String signature,
+ final String[] exceptions) {
+ /* a code generate looks like
+ * 0: aload_0
+ * 1: ldc #125 // int 1
+ * 3: ldc2_w #126 // long 2l
+ * 6: ldc #128 // float 3.0f
+ * 8: ldc2_w #129 // double 4.0d
+ * 11: ldc #132 // String 5
+ * 13: aload_0
+ * 14: getfield #135 // Field nativeCallee:Z
+ * 17: ifeq 28
+ * 20: invokedynamic #181, 0 // InvokeDynamic #1:calleeNative:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z
+ * 25: goto 33
+ * 28: invokedynamic #183, 0 // InvokeDynamic #1:callee:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z
+ * 33: ldc #185 // String Call insuccessfull
+ * 35: invokestatic #191 // Method jdk/test/lib/Asserts.assertTrue:(ZLjava/lang/String;)V
+ * 38: return
+ *
+ * or, using java-like pseudo-code
+ * if (this.nativeCallee == false) {
+ * invokedynamic-call-return-value = invokedynamic-of-callee
+ * } else {
+ * invokedynamic-call-return-value = invokedynamic-of-nativeCallee
+ * }
+ * Asserts.assertTrue(invokedynamic-call-return-value, error-message);
+ * return;
+ */
+ if (name.equals(CALLER_METHOD_NAME)) {
+ MethodVisitor mv = cv.visitMethod(access, name, desc,
+ signature, exceptions);
+ Label nonNativeLabel = new Label();
+ Label checkLabel = new Label();
+ MethodType mtype = MethodType.methodType(CallSite.class,
+ MethodHandles.Lookup.class, String.class, MethodType.class);
+ Handle bootstrap = new Handle(Opcodes.H_INVOKESTATIC, CLASS,
+ BOOTSTRAP_METHOD_NAME, mtype.toMethodDescriptorString());
+ mv.visitCode();
+ // push callee parameters onto stack
+ mv.visitVarInsn(Opcodes.ALOAD, 0);//push "this"
+ mv.visitLdcInsn(1);
+ mv.visitLdcInsn(2L);
+ mv.visitLdcInsn(3.0f);
+ mv.visitLdcInsn(4.0d);
+ mv.visitLdcInsn("5");
+ // params loaded. let's decide what method to call
+ mv.visitVarInsn(Opcodes.ALOAD, 0); // push "this"
+ // get nativeCallee field
+ mv.visitFieldInsn(Opcodes.GETFIELD, CLASS, CALL_NATIVE_FIELD,
+ CALL_NATIVE_FIELD_DESC);
+ // if nativeCallee == false goto nonNativeLabel
+ mv.visitJumpInsn(Opcodes.IFEQ, nonNativeLabel);
+ // invokedynamic nativeCalleeMethod using bootstrap method
+ mv.visitInvokeDynamicInsn(NATIVE_CALLEE_METHOD_NAME,
+ CALLEE_METHOD_DESC, bootstrap);
+ // goto checkLabel
+ mv.visitJumpInsn(Opcodes.GOTO, checkLabel);
+ // label: nonNativeLabel
+ mv.visitLabel(nonNativeLabel);
+ // invokedynamic calleeMethod using bootstrap method
+ mv.visitInvokeDynamicInsn(CALLEE_METHOD_NAME, CALLEE_METHOD_DESC,
+ bootstrap);
+ mv.visitLabel(checkLabel);
+ mv.visitLdcInsn(CallsBase.CALL_ERR_MSG);
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, ASSERTS_CLASS,
+ ASSERTTRUE_METHOD_NAME, ASSERTTRUE_METHOD_DESC, false);
+ // label: return
+ mv.visitInsn(Opcodes.RETURN);
+ mv.visitMaxs(0, 0);
+ mv.visitEnd();
+ return null;
+ }
+ return super.visitMethod(access, name, desc, signature, exceptions);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeInterface.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import jdk.test.lib.Asserts;
+
+/**
+ * A test class checking InvokeInterface instruction
+ */
+public class InvokeInterface extends CallsBase implements CallInterface {
+ private static final Object LOCK = new Object();
+
+ public static void main(String args[]) {
+ new InvokeInterface().runTest(args);
+ }
+
+ /**
+ * A caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public void caller() {
+ // cast to CallInterface to force invokeinterface usage
+ if (nativeCallee) {
+ Asserts.assertTrue(((CallInterface) this)
+ .calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ } else {
+ Asserts.assertTrue(((CallInterface) this)
+ .callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ }
+ }
+
+ /**
+ * A callee method, assumed to be called by "caller"/"callerNative"
+ */
+ @Override
+ public boolean callee(int param1, long param2, float param3, double param4,
+ String param5) {
+ calleeVisited = true;
+ CallsBase.checkValues(param1, param2, param3, param4, param5);
+ return true;
+ }
+
+ /**
+ * A native callee method, assumed to be called by "caller"/"callerNative"
+ */
+ @Override
+ public native boolean calleeNative(int param1, long param2, float param3,
+ double param4, String param5);
+
+ /**
+ * Returns object to lock execution on
+ * @return lock object
+ */
+ @Override
+ protected Object getLockObject() {
+ return LOCK;
+ }
+
+ @Override
+ protected void callerNative() {
+ throw new Error("No native call for invokeinterface");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeSpecial.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import jdk.test.lib.Asserts;
+
+/**
+ * A test class checking InvokeSpecial instruction
+ */
+public class InvokeSpecial extends CallsBase {
+ private static final Object LOCK = new Object();
+
+ public static void main(String args[]) {
+ new InvokeSpecial().runTest(args);
+ }
+
+ /**
+ * A native caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public native void callerNative();
+
+ /**
+ * A caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public void caller() {
+ if (nativeCallee) {
+ Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ } else {
+ Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ }
+ }
+
+ /**
+ * A callee method, assumed to be called by "caller"/"callerNative"
+ */
+ private boolean callee(int param1, long param2, float param3, double param4,
+ String param5) {
+ calleeVisited = true;
+ CallsBase.checkValues(param1, param2, param3, param4, param5);
+ return true;
+ }
+
+ /**
+ * A native callee method, assumed to be called by "caller"/"callerNative"
+ */
+ public native boolean calleeNative(int param1, long param2, float param3,
+ double param4, String param5);
+
+ /**
+ * Returns object to lock execution on
+ * @return lock object
+ */
+ @Override
+ protected Object getLockObject() {
+ return LOCK;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeStatic.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import jdk.test.lib.Asserts;
+
+/**
+ * A test class checking InvokeStatic instruction
+ */
+public class InvokeStatic extends CallsBase {
+ private static final Object LOCK = new Object();
+
+ public static void main(String args[]) {
+ new InvokeStatic().runTest(args);
+ }
+
+ /**
+ * A native caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public native void callerNative();
+
+ /**
+ * A caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public void caller() {
+ if (nativeCallee) {
+ Asserts.assertTrue(calleeNative(this, 1, 2L, 3.0f, 4.0d, "5"),
+ CALL_ERR_MSG);
+ } else {
+ Asserts.assertTrue(callee(this, 1, 2L, 3.0f, 4.0d, "5"),
+ CALL_ERR_MSG);
+ }
+ }
+
+ /**
+ * A callee method, assumed to be called by "caller"/"callerNative"
+ */
+ public static boolean callee(InvokeStatic instance, int param1,
+ long param2, float param3, double param4, String param5) {
+ instance.calleeVisited = true;
+ CallsBase.checkValues(param1, param2, param3, param4, param5);
+ return true;
+ }
+
+ /**
+ * A native callee method, assumed to be called by "caller"/"callerNative"
+ */
+ public static native boolean calleeNative(InvokeStatic instance,
+ int param1, long param2, float param3, double param4, String param5);
+
+ /**
+ * Returns object to lock execution on
+ * @return lock object
+ */
+ @Override
+ protected Object getLockObject() {
+ return LOCK;
+ }
+
+ /**
+ * Provides callee parameters types to search method
+ * @return array of types
+ */
+ protected Class[] getCalleeParametersTypes() {
+ return new Class[]{InvokeStatic.class, int.class, long.class,
+ float.class, double.class, String.class};
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/InvokeVirtual.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package compiler.calls.common;
+
+import jdk.test.lib.Asserts;
+
+/**
+ * A test class checking InvokeVirtual instruction
+ */
+
+public class InvokeVirtual extends CallsBase {
+ private static final Object LOCK = new Object();
+
+ public static void main(String args[]) {
+ new InvokeVirtual().runTest(args);
+ }
+
+ /**
+ * A native caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public native void callerNative();
+
+ /**
+ * A caller method, assumed to called "callee"/"calleeNative"
+ */
+ @Override
+ public void caller() {
+ if (nativeCallee) {
+ Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ } else {
+ Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG);
+ }
+ }
+
+ /**
+ * A callee method, assumed to be called by "caller"/"callerNative"
+ */
+ public boolean callee(int param1, long param2, float param3, double param4,
+ String param5) {
+ calleeVisited = true;
+ CallsBase.checkValues(param1, param2, param3, param4, param5);
+ return true;
+ }
+
+ /**
+ * A native callee method, assumed to be called by "caller"/"callerNative"
+ */
+ public native boolean calleeNative(int param1, long param2, float param3,
+ double param4, String param5);
+
+ /**
+ * Returns object to lock execution on
+ * @return lock object
+ */
+ @Override
+ protected Object getLockObject() {
+ return LOCK;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/common/libCallsNative.c Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include <stdio.h>
+
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define METHOD_SIGNATURE "(IJFDLjava/lang/String;)Z"
+#define STATIC_CALLEE_SIGNATURE "(Lcompiler/calls/common/InvokeStatic;IJFDLjava/lang/String;)Z"
+#define BASE_CLASS "compiler/calls/common/CallsBase"
+
+#define CHECK_EXCEPTIONS if ((*env)->ExceptionCheck(env)) return
+#define CHECK_EXCEPTIONS_FALSE if ((*env)->ExceptionCheck(env)) return JNI_FALSE
+
+#define IS_STATIC 1
+#define NOT_STATIC 0
+
+jboolean doCalleeWork(JNIEnv *env, jobject self, jint param1, jlong param2,
+ jfloat param3, jdouble param4, jstring param5) {
+ jclass cls = (*env)->GetObjectClass(env, self);
+ jfieldID calleeVisitedID = (*env)->GetFieldID(env, cls, "calleeVisited", "Z");
+ jclass CheckCallsBaseClass;
+ jmethodID checkValuesID;
+ CHECK_EXCEPTIONS_FALSE;
+ (*env)->SetBooleanField(env, self, calleeVisitedID, JNI_TRUE);
+ CHECK_EXCEPTIONS_FALSE;
+ CheckCallsBaseClass = (*env)->FindClass(env, BASE_CLASS);
+ CHECK_EXCEPTIONS_FALSE;
+ checkValuesID = (*env)->GetStaticMethodID(env, CheckCallsBaseClass,
+ "checkValues", "(IJFDLjava/lang/String;)V");
+ CHECK_EXCEPTIONS_FALSE;
+ (*env)->CallStaticVoidMethod(env, CheckCallsBaseClass, checkValuesID,
+ param1, param2, param3, param4, param5);
+ return JNI_TRUE;
+}
+
+JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeDynamic_calleeNative(JNIEnv *env, jobject obj,
+ jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) {
+ return doCalleeWork(env, obj, param1, param2, param3, param4, param5);
+}
+
+JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeInterface_calleeNative(JNIEnv *env, jobject obj,
+ jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) {
+ return doCalleeWork(env, obj, param1, param2, param3, param4, param5);
+}
+
+JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeSpecial_calleeNative(JNIEnv *env, jobject obj,
+ jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) {
+ return doCalleeWork(env, obj, param1, param2, param3, param4, param5);
+}
+
+JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeVirtual_calleeNative(JNIEnv *env, jobject obj,
+ jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) {
+ return doCalleeWork(env, obj, param1, param2, param3, param4, param5);
+}
+
+JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeStatic_calleeNative(JNIEnv *env, jclass obj,
+ jobject self, jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) {
+ return doCalleeWork(env, self, param1, param2, param3, param4, param5);
+}
+
+void doCallerWork(JNIEnv *env, jobject obj, int isStatic) {
+ jclass cls = (*env)->GetObjectClass(env, obj);
+ jmethodID calleeMethodID = 0;
+ jfieldID errorMessageID;
+ jfieldID nativeCalleeID;
+ jobject errorMessage;
+ jmethodID assertTrue;
+ jboolean callNative;
+ jclass assertsClass;
+ jclass baseClass;
+ jboolean result;
+ char* methodName;
+ CHECK_EXCEPTIONS;
+ nativeCalleeID = (*env)->GetFieldID(env, cls, "nativeCallee", "Z");
+ CHECK_EXCEPTIONS;
+ callNative = (*env)->GetBooleanField(env, obj, nativeCalleeID);
+ CHECK_EXCEPTIONS;
+ methodName = (callNative == JNI_TRUE) ? "calleeNative" : "callee";
+ if (isStatic) {
+ calleeMethodID = (*env)->GetStaticMethodID(env, cls, methodName,
+ STATIC_CALLEE_SIGNATURE);
+ } else {
+ calleeMethodID = (*env)->GetMethodID(env, cls, methodName, METHOD_SIGNATURE);
+ }
+ CHECK_EXCEPTIONS;
+ if (isStatic) {
+ result = (*env)->CallStaticBooleanMethod(env, cls, calleeMethodID, obj,
+ (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5"));
+ } else {
+ result = (*env)->CallBooleanMethod(env, obj, calleeMethodID,
+ (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5"));
+ }
+ CHECK_EXCEPTIONS;
+ baseClass = (*env)->FindClass(env, BASE_CLASS);
+ CHECK_EXCEPTIONS;
+ errorMessageID = (*env)->GetStaticFieldID(env, baseClass,
+ "CALL_ERR_MSG", "Ljava/lang/String;");
+ CHECK_EXCEPTIONS;
+ errorMessage = (*env)->GetStaticObjectField(env, baseClass, errorMessageID);
+ CHECK_EXCEPTIONS;
+ assertsClass = (*env)->FindClass(env, "jdk/test/lib/Asserts");
+ CHECK_EXCEPTIONS;
+ assertTrue = (*env)->GetStaticMethodID(env, assertsClass,
+ "assertTrue", "(ZLjava/lang/String;)V");
+ (*env)->CallStaticVoidMethod(env, assertsClass, assertTrue, result,
+ errorMessage);
+}
+
+JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeSpecial_callerNative(JNIEnv *env, jobject obj) {
+ doCallerWork(env, obj, NOT_STATIC);
+}
+
+JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeVirtual_callerNative(JNIEnv *env, jobject obj) {
+ doCallerWork(env, obj, NOT_STATIC);
+}
+
+JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeStatic_callerNative(JNIEnv *env, jobject obj) {
+ doCallerWork(env, obj, IS_STATIC);
+}
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from compiled to compiled using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
+ * @summary check calls from compiled to interpreted using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeDynamic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
+ * @summary check calls from compiled to native using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from compiled to compiled using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface
+ * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface
+ * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
+ * @summary check calls from compiled to interpreted using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeInterface
+ * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
+ * @summary check calls from compiled to native using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from compiled to compiled using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
+ * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
+ * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
+ * @summary check calls from compiled to interpreted using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
+ * @summary check calls from compiled to native using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from compiled to compiled using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
+ * @summary check calls from compiled to interpreted using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
+ * @summary check calls from compiled to native using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from compiled to compiled using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
+ * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
+ * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0
+ * @summary check calls from compiled to interpreted using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee
+ * @summary check calls from compiled to native using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic
+ * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic
+ * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from interpreted to compiled using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic
+ * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
+ * @summary check calls from interpreted to interpreted using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeDynamic
+ * @build compiler.calls.common.InvokeDynamicPatcher
+ * @run driver compiler.calls.common.InvokeDynamicPatcher
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller compiler.calls.common.InvokeDynamic
+ * -checkCallerCompileLevel 0 -nativeCallee
+ * @summary check calls from interpreted to native using InvokeDynamic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface
+ * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface
+ * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from interpreted to compiled using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface
+ * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
+ * @summary check calls from interpreted to interpreted using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeInterface
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller compiler.calls.common.InvokeInterface
+ * -checkCallerCompileLevel 0 -nativeCallee
+ * @summary check calls from interpreted to native using InvokeInterface
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial
+ * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial
+ * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from interpreted to compiled using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
+ * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
+ * @summary check calls from interpreted to interpreted using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller compiler.calls.common.InvokeSpecial
+ * -checkCallerCompileLevel 0 -nativeCallee
+ * @summary check calls from interpreted to native using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic
+ * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic
+ * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from interpreted to compiled using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
+ * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
+ * @summary check calls from interpreted to interpreted using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller compiler.calls.common.InvokeStatic
+ * -checkCallerCompileLevel 0 -nativeCallee
+ * @summary check calls from interpreted to native using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual
+ * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual
+ * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from interpreted to compiled using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
+ * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0
+ * @summary check calls from interpreted to interpreted using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller compiler.calls.common.InvokeVirtual
+ * -checkCallerCompileLevel 0 -nativeCallee
+ * @summary check calls from interpreted to native using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeSpecial
+ * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from native to compiled using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial
+ * -nativeCaller -checkCalleeCompileLevel 0
+ * @summary check calls from native to interpreted using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeSpecial
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * compiler.calls.common.InvokeSpecial
+ * -nativeCaller -nativeCallee
+ * @summary check calls from native to native using InvokeSpecial
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeStatic
+ * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from native to compiled using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic
+ * -nativeCaller -checkCalleeCompileLevel 0
+ * @summary check calls from native to interpreted using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeStatic
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * compiler.calls.common.InvokeStatic
+ * -nativeCaller -nativeCallee
+ * @summary check calls from native to native using InvokeStatic
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -Xbatch compiler.calls.common.InvokeVirtual
+ * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4
+ * @summary check calls from native to compiled using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual
+ * -nativeCaller -checkCalleeCompileLevel 0
+ * @summary check calls from native to interpreted using InvokeVirtual
+ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java Wed Dec 16 18:38:02 2015 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @library /test/lib /testlibrary /
+ * @build compiler.calls.common.InvokeVirtual
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
+ * compiler.calls.common.InvokeVirtual
+ * -nativeCaller -nativeCallee
+ * @summary check calls from native to native using InvokeVirtual
+ */