src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 52910 583fd71c47d6
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    32 import org.graalvm.compiler.nodes.ValueNode;
    32 import org.graalvm.compiler.nodes.ValueNode;
    33 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
    33 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext;
    34 import org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin;
    34 import org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin;
    35 import org.graalvm.compiler.options.OptionValues;
    35 import org.graalvm.compiler.options.OptionValues;
    36 import org.graalvm.compiler.phases.common.AbstractInliningPhase;
    36 import org.graalvm.compiler.phases.common.AbstractInliningPhase;
       
    37 import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
    37 import org.graalvm.compiler.test.ExportingClassLoader;
    38 import org.graalvm.compiler.test.ExportingClassLoader;
    38 import org.junit.Assert;
    39 import org.junit.Assert;
    39 import org.junit.Assume;
    40 import org.junit.Assume;
    40 import org.junit.Test;
    41 import org.junit.Test;
    41 import org.objectweb.asm.ClassWriter;
    42 import org.objectweb.asm.ClassWriter;
   101         return "SUCCESS";
   102         return "SUCCESS";
   102     }
   103     }
   103 
   104 
   104     @Test
   105     @Test
   105     public void test3() {
   106     public void test3() {
   106         Assume.assumeTrue("Only works on jdk8 right now", Java8OrEarlier);
   107         Assume.assumeTrue("Only works on jdk8 right now", JavaVersionUtil.JAVA_SPEC <= 8);
   107         ResolvedJavaMethod method = getResolvedJavaMethod("test3Snippet");
   108         ResolvedJavaMethod method = getResolvedJavaMethod("test3Snippet");
   108 
   109 
   109         for (int i = 0; i < 2; i++) {
   110         for (int i = 0; i < 2; i++) {
   110             Result actual;
   111             Result actual;
   111             boolean expectedCompiledCode = (method.getProfilingInfo().getDeoptimizationCount(DeoptimizationReason.NotCompiledExceptionHandler) != 0);
   112             boolean expectedCompiledCode = (method.getProfilingInfo().getDeoptimizationCount(DeoptimizationReason.NotCompiledExceptionHandler) != 0);