< prev index next >

test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java

Print this page

        

@@ -23,12 +23,18 @@
 
 /**
  * @test
  * @bug 8073956
  * @summary Tests C2 EA with allocated object escaping through a call.
- * @run main/othervm -XX:CompileCommand=dontinline,TestEscapeThroughInvoke::create TestEscapeThroughInvoke
+ *
+ * @run main/othervm
+ *      -XX:CompileCommand=dontinline,compiler.escapeAnalysis.TestEscapeThroughInvoke::create
+ *      compiler.escapeAnalysis.TestEscapeThroughInvoke
  */
+
+package compiler.escapeAnalysis;
+
 public class TestEscapeThroughInvoke {
     private A a;
 
     public static void main(String[] args) {
         TestEscapeThroughInvoke test = new TestEscapeThroughInvoke();

@@ -53,22 +59,23 @@
     private A create(Integer dummy) {
         A result = new A(dummy);
         result.saveInto(a, dummy); // result escapes into 'a' here
         return result;
     }
-}
 
-class A {
+    static class A {
     private A saved;
 
-    public A(Integer dummy) { }
+        public A(Integer dummy) {
+        }
 
     public void saveInto(A other, Integer dummy) {
         other.saved = this;
     }
 
     public void check(A other) {
         if (this.saved != other) {
             throw new RuntimeException("TEST FAILED: Objects not equal.");
         }
     }
+    }
 }
< prev index next >