test/compiler/jsr292/NonInlinedCall/GCTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff test/compiler/jsr292/NonInlinedCall

test/compiler/jsr292/NonInlinedCall/GCTest.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 8072008
  27  * @library /testlibrary /../../test/lib
  28  * @build GCTest NonInlinedReinvoker
  29  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  30  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  31  *                              java.lang.invoke.GCTest
  32  *                              java.lang.invoke.GCTest$T
  33  *                              java.lang.invoke.NonInlinedReinvoker
  34  *                              jdk.test.lib.Asserts
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
  36  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  37  *                   -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
  38  *                      java.lang.invoke.GCTest
  39  */
  40 package java.lang.invoke;
  41 
  42 import sun.hotspot.WhiteBox;
  43 
  44 import jdk.internal.vm.annotation.DontInline;
  45 import jdk.internal.vm.annotation.Stable;
  46 
  47 import java.lang.ref.*;
  48 import static jdk.test.lib.Asserts.*;
  49 
  50 public class GCTest {
  51     static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP;
  52 
  53     static class T {
  54         static int f1() { return 0; }
  55         static int f2() { return 1; }
  56     }
  57 
  58     static @Stable MethodHandle mh;
  59     static PhantomReference<LambdaForm> lform;
  60 
  61     static final ReferenceQueue<LambdaForm> rq = new ReferenceQueue<>();
  62     static final WhiteBox WB = WhiteBox.getWhiteBox();
  63 
  64     @DontInline
  65     static int invokeBasic() {
  66         try {




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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 8072008
  27  * @library /testlibrary /test/lib
  28  * @compile GCTest.java NonInlinedReinvoker.java
  29  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  30  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  31  *                              java.lang.invoke.GCTest
  32  *                              java.lang.invoke.GCTest$T
  33  *                              java.lang.invoke.NonInlinedReinvoker
  34  *                              jdk.test.lib.Asserts
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions
  36  *                   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  37  *                   -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1
  38  *                      java.lang.invoke.GCTest
  39  */
  40 package java.lang.invoke;
  41 
  42 import sun.hotspot.WhiteBox;

  43 import jdk.internal.vm.annotation.DontInline;
  44 import jdk.internal.vm.annotation.Stable;

  45 import java.lang.ref.*;
  46 import static jdk.test.lib.Asserts.*;
  47 
  48 public class GCTest {
  49     static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP;
  50 
  51     static class T {
  52         static int f1() { return 0; }
  53         static int f2() { return 1; }
  54     }
  55 
  56     static @Stable MethodHandle mh;
  57     static PhantomReference<LambdaForm> lform;
  58 
  59     static final ReferenceQueue<LambdaForm> rq = new ReferenceQueue<>();
  60     static final WhiteBox WB = WhiteBox.getWhiteBox();
  61 
  62     @DontInline
  63     static int invokeBasic() {
  64         try {


test/compiler/jsr292/NonInlinedCall/GCTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File