src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java

Print this page




  49             try {
  50                 if (terminate != 0) {
  51                     throw BREAK_EX;
  52                 } else {
  53                     throw CONTINUE_EX;
  54                 }
  55             } catch (RuntimeException e) {
  56                 if (e == BREAK_EX) {
  57                     break;
  58                 } else if (e == CONTINUE_EX) {
  59                     continue;
  60                 }
  61                 throw e;
  62             }
  63         }
  64         return RETURN_VALUE;
  65     }
  66 
  67     @Test
  68     public void test() {
  69         Assume.assumeTrue(GraalOptions.GenLoopSafepoints.getValue());
  70         synchronized (SafepointRethrowDeoptTest.class) {
  71             // needs static fields
  72             terminate = 1;
  73 
  74             InstalledCode installed = getCode(getResolvedJavaMethod("execute"));
  75 
  76             terminate = 0;
  77             entered = 0;
  78             CountDownLatch cdl = new CountDownLatch(1);
  79             Thread t1 = new Thread(() -> {
  80                 try {
  81                     cdl.await();
  82                     while (entered == 0) {
  83                         /* spin */
  84                     }
  85                     installed.invalidate();
  86                 } catch (InterruptedException e) {
  87                     Assert.fail("interrupted");
  88                 } finally {
  89                     terminate = 1;




  49             try {
  50                 if (terminate != 0) {
  51                     throw BREAK_EX;
  52                 } else {
  53                     throw CONTINUE_EX;
  54                 }
  55             } catch (RuntimeException e) {
  56                 if (e == BREAK_EX) {
  57                     break;
  58                 } else if (e == CONTINUE_EX) {
  59                     continue;
  60                 }
  61                 throw e;
  62             }
  63         }
  64         return RETURN_VALUE;
  65     }
  66 
  67     @Test
  68     public void test() {
  69         Assume.assumeTrue(GraalOptions.GenLoopSafepoints.getValue(getInitialOptions()));
  70         synchronized (SafepointRethrowDeoptTest.class) {
  71             // needs static fields
  72             terminate = 1;
  73 
  74             InstalledCode installed = getCode(getResolvedJavaMethod("execute"));
  75 
  76             terminate = 0;
  77             entered = 0;
  78             CountDownLatch cdl = new CountDownLatch(1);
  79             Thread t1 = new Thread(() -> {
  80                 try {
  81                     cdl.await();
  82                     while (entered == 0) {
  83                         /* spin */
  84                     }
  85                     installed.invalidate();
  86                 } catch (InterruptedException e) {
  87                     Assert.fail("interrupted");
  88                 } finally {
  89                     terminate = 1;


src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File