< prev index next >

test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java

Print this page




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8136421
  27  * @requires vm.jvmci
  28  * @library /test/lib /
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  * @modules java.base/jdk.internal.org.objectweb.asm
  32  *          java.base/jdk.internal.org.objectweb.asm.tree
  33  *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  34  *          jdk.internal.vm.ci/jdk.vm.ci.code
  35  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  36  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI

  37  *                   compiler.jvmci.compilerToVM.GetExceptionTableTest
  38  */
  39 
  40 package compiler.jvmci.compilerToVM;
  41 
  42 import compiler.jvmci.common.CTVMUtilities;
  43 import jdk.test.lib.Asserts;
  44 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  45 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  46 
  47 import java.io.IOException;
  48 import java.lang.reflect.Executable;
  49 import java.net.Socket;
  50 import java.util.HashMap;
  51 import java.util.Map;
  52 
  53 public class GetExceptionTableTest {
  54 
  55     public static final int TRY_CATCH_COUNT = 3;
  56     public static final int TRY_CATCH_FINALLY_COUNT = 8;


 120             } catch (Exception ex) {
 121                 return 4;
 122             } finally {
 123                 return 0;
 124             }
 125         }
 126 
 127         public static int tryWithResourcesDummy() throws Throwable {
 128             try (Socket socket = new Socket()) {
 129                 throw new Exception("Dummy exception");
 130             } catch (ArithmeticException ex) {
 131                 return 1;
 132             } catch (IOException ex) {
 133                 return 2;
 134             } catch (Exception ex) {
 135                 return 3;
 136             }
 137         }
 138     }
 139 }
 140 


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8136421
  27  * @requires vm.jvmci
  28  * @library /test/lib /
  29  * @library ../common/patches
  30  * @modules java.base/jdk.internal.misc
  31  * @modules java.base/jdk.internal.org.objectweb.asm
  32  *          java.base/jdk.internal.org.objectweb.asm.tree
  33  *          jdk.internal.vm.ci/jdk.vm.ci.hotspot
  34  *          jdk.internal.vm.ci/jdk.vm.ci.code
  35  * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  36  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  37  *                   -Djvmci.Compiler=null
  38  *                   compiler.jvmci.compilerToVM.GetExceptionTableTest
  39  */
  40 
  41 package compiler.jvmci.compilerToVM;
  42 
  43 import compiler.jvmci.common.CTVMUtilities;
  44 import jdk.test.lib.Asserts;
  45 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  46 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  47 
  48 import java.io.IOException;
  49 import java.lang.reflect.Executable;
  50 import java.net.Socket;
  51 import java.util.HashMap;
  52 import java.util.Map;
  53 
  54 public class GetExceptionTableTest {
  55 
  56     public static final int TRY_CATCH_COUNT = 3;
  57     public static final int TRY_CATCH_FINALLY_COUNT = 8;


 121             } catch (Exception ex) {
 122                 return 4;
 123             } finally {
 124                 return 0;
 125             }
 126         }
 127 
 128         public static int tryWithResourcesDummy() throws Throwable {
 129             try (Socket socket = new Socket()) {
 130                 throw new Exception("Dummy exception");
 131             } catch (ArithmeticException ex) {
 132                 return 1;
 133             } catch (IOException ex) {
 134                 return 2;
 135             } catch (Exception ex) {
 136                 return 3;
 137             }
 138         }
 139     }
 140 }

< prev index next >