コード例 #1
0
 /** Here the read should float after the loop. */
 public static int testLoop9Snippet(int a, int b) {
   container.a = b;
   for (int i = 0; i < a; i++) {
     container.a = i;
   }
   GraalDirectives.controlFlowAnchor();
   return container.a;
 }
コード例 #2
0
 /** Here the read should not float to the end. */
 public static int testLoop8Snippet(int a, int b) {
   int result = container.a;
   for (int i = 0; i < a; i++) {
     if (b < 0) {
       container.b = 10;
       break;
     } else {
       for (int j = 0; j < b; j++) {
         container.a = 0;
       }
     }
   }
   GraalDirectives.controlFlowAnchor();
   return result;
 }