< prev index next >

test/compiler/jsr292/NonInlinedCall/InvokeTest.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8072008
  27  * @library /testlibrary /test/lib / ../patches
  28  * @modules java.base/jdk.internal.misc
  29  * @modules java.base/jdk.internal.vm.annotation

  30  * @build java.base/java.lang.invoke.MethodHandleHelper
  31  * @build sun.hotspot.WhiteBox
  32  * @build compiler.jsr292.NonInlinedCall.InvokeTest
  33  * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
  34  *                                 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  35  *                                 -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
  36  *                                 compiler.jsr292.NonInlinedCall.InvokeTest
  37  */
  38 
  39 package compiler.jsr292.NonInlinedCall;
  40 



  41 import java.lang.invoke.MethodHandle;
  42 import java.lang.invoke.MethodHandleHelper;
  43 import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker;
  44 import java.lang.invoke.MethodHandles;
  45 import java.lang.invoke.MethodType;
  46 
  47 import jdk.internal.vm.annotation.DontInline;
  48 
  49 import sun.hotspot.WhiteBox;
  50 
  51 import static jdk.test.lib.Asserts.*;
  52 
  53 public class InvokeTest {
  54     static MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
  55 
  56     static final MethodHandle virtualMH;  // invokevirtual   T.f1
  57     static final MethodHandle staticMH;   // invokestatic    T.f2
  58     static final MethodHandle intfMH;     // invokeinterface I.f1
  59     static final MethodHandle specialMH;  // invokespecial   T.f4 T
  60     static final MethodHandle basicMH;
  61 
  62     static final WhiteBox WB = WhiteBox.getWhiteBox();
  63 
  64     static volatile boolean doDeopt = false;
  65 
  66     static {
  67         try {
  68             MethodType mtype = MethodType.methodType(Class.class);
  69 
  70             virtualMH  = LOOKUP.findVirtual(T.class, "f1", mtype);
  71             staticMH   = LOOKUP.findStatic (T.class, "f2", mtype);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8072008
  27  * @library /testlibrary /test/lib / ../patches
  28  * @modules java.base/jdk.internal.misc
  29  *          java.base/jdk.internal.vm.annotation
  30  *
  31  * @build java.base/java.lang.invoke.MethodHandleHelper
  32  *        sun.hotspot.WhiteBox
  33  *        compiler.jsr292.NonInlinedCall.InvokeTest
  34  * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions
  35  *                                 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  36  *                                 -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
  37  *                                 compiler.jsr292.NonInlinedCall.InvokeTest
  38  */
  39 
  40 package compiler.jsr292.NonInlinedCall;
  41 
  42 import jdk.internal.vm.annotation.DontInline;
  43 import sun.hotspot.WhiteBox;
  44 
  45 import java.lang.invoke.MethodHandle;
  46 import java.lang.invoke.MethodHandleHelper;
  47 import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker;
  48 import java.lang.invoke.MethodHandles;
  49 import java.lang.invoke.MethodType;
  50 
  51 import static jdk.test.lib.Asserts.assertEquals;




  52 
  53 public class InvokeTest {
  54     static MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP;
  55 
  56     static final MethodHandle virtualMH;  // invokevirtual   T.f1
  57     static final MethodHandle staticMH;   // invokestatic    T.f2
  58     static final MethodHandle intfMH;     // invokeinterface I.f1
  59     static final MethodHandle specialMH;  // invokespecial   T.f4 T
  60     static final MethodHandle basicMH;
  61 
  62     static final WhiteBox WB = WhiteBox.getWhiteBox();
  63 
  64     static volatile boolean doDeopt = false;
  65 
  66     static {
  67         try {
  68             MethodType mtype = MethodType.methodType(Class.class);
  69 
  70             virtualMH  = LOOKUP.findVirtual(T.class, "f1", mtype);
  71             staticMH   = LOOKUP.findStatic (T.class, "f2", mtype);


< prev index next >