< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java

Print this page




 276             obj.y = three;
 277             notInlineable();
 278         }
 279         return ((Integer) obj.x).intValue() <= 3 ? 1 : 0;
 280     }
 281 
 282     static class MyException extends RuntimeException {
 283 
 284         private static final long serialVersionUID = 0L;
 285 
 286         protected Integer value;
 287 
 288         MyException(Integer value) {
 289             super((Throwable) null);
 290             this.value = value;
 291         }
 292 
 293         @SuppressWarnings("sync-override")
 294         @Override
 295         public final Throwable fillInStackTrace() {
 296             return null;
 297         }
 298     }
 299 
 300     @Test
 301     public void testMergeAllocationsException() {
 302         testEscapeAnalysis("testMergeAllocationsExceptionSnippet", JavaConstant.forInt(1), false);
 303     }
 304 
 305     public int testMergeAllocationsExceptionSnippet(int a) {
 306         MyException obj;
 307         Integer one = 1;
 308         if (a < 0) {
 309             obj = new MyException(one);
 310             notInlineable();
 311         } else {
 312             obj = new MyException(one);
 313             notInlineable();
 314         }
 315         return obj.value <= 3 ? 1 : 0;
 316     }




 276             obj.y = three;
 277             notInlineable();
 278         }
 279         return ((Integer) obj.x).intValue() <= 3 ? 1 : 0;
 280     }
 281 
 282     static class MyException extends RuntimeException {
 283 
 284         private static final long serialVersionUID = 0L;
 285 
 286         protected Integer value;
 287 
 288         MyException(Integer value) {
 289             super((Throwable) null);
 290             this.value = value;
 291         }
 292 
 293         @SuppressWarnings("sync-override")
 294         @Override
 295         public final Throwable fillInStackTrace() {
 296             return this;
 297         }
 298     }
 299 
 300     @Test
 301     public void testMergeAllocationsException() {
 302         testEscapeAnalysis("testMergeAllocationsExceptionSnippet", JavaConstant.forInt(1), false);
 303     }
 304 
 305     public int testMergeAllocationsExceptionSnippet(int a) {
 306         MyException obj;
 307         Integer one = 1;
 308         if (a < 0) {
 309             obj = new MyException(one);
 310             notInlineable();
 311         } else {
 312             obj = new MyException(one);
 313             notInlineable();
 314         }
 315         return obj.value <= 3 ? 1 : 0;
 316     }


< prev index next >