test/hotspot/jtreg/runtime/SharedArchiveFile/TestInterpreterMethodEntries.java
changeset 55350 1224b16c8ff4
parent 51990 6003e034cdd8
equal deleted inserted replaced
55349:139f21bad9fd 55350:1224b16c8ff4
     1 /*
     1 /*
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    23 
    23 
    24 /**
    24 /**
    25  * @test InterpreterMethodEntries
    25  * @test InterpreterMethodEntries
    26  * @bug 8169711
    26  * @bug 8169711
    27  * @summary Test interpreter method entries for intrinsics with CDS (class data sharing)
    27  * @summary Test interpreter method entries for intrinsics with CDS (class data sharing)
    28  *          and different settings of the intrinsic flag during dump/use of the archive.
    28  *          and the intrinsic flag enabled during dump and disabled during use of the archive.
       
    29  * @requires vm.cds
       
    30  * @comment the test disables intrinsics, so it can't be run w/ AOT'ed java module
       
    31  * @requires !vm.aot.enabled
       
    32  * @library /test/lib
       
    33  * @modules java.base/jdk.internal.misc
       
    34  *          java.management
       
    35  * @run driver TestInterpreterMethodEntries true false
       
    36  */
       
    37 
       
    38 /**
       
    39  * @test InterpreterMethodEntries
       
    40  * @bug 8169711
       
    41  * @summary Test interpreter method entries for intrinsics with CDS (class data sharing)
       
    42  *          and the intrinsic flag disabled during dump and enabled during use of the archive.
    29  * @requires vm.cds
    43  * @requires vm.cds
    30  * @library /test/lib
    44  * @library /test/lib
    31  * @modules java.base/jdk.internal.misc
    45  * @modules java.base/jdk.internal.misc
    32  *          java.management
    46  *          java.management
    33  * @run driver TestInterpreterMethodEntries
    47  * @run driver TestInterpreterMethodEntries false true
    34  */
    48  */
    35 
    49 
    36 import java.lang.Math;
    50 import java.lang.Math;
    37 import java.util.zip.CRC32;
    51 import java.util.zip.CRC32;
    38 import java.util.zip.CRC32C;
    52 import java.util.zip.CRC32C;
    41 import jdk.test.lib.process.OutputAnalyzer;
    55 import jdk.test.lib.process.OutputAnalyzer;
    42 
    56 
    43 public class TestInterpreterMethodEntries {
    57 public class TestInterpreterMethodEntries {
    44 
    58 
    45     public static void main(String[] args) throws Exception {
    59     public static void main(String[] args) throws Exception {
    46         if (args.length == 0) {
    60         if (args.length > 1) {
       
    61           boolean dump = Boolean.parseBoolean(args[0]);
       
    62           boolean use  = Boolean.parseBoolean(args[1]);
       
    63 
    47           // Dump and use shared archive with different flag combinations
    64           // Dump and use shared archive with different flag combinations
    48           dumpAndUseSharedArchive("+", "-");
    65           dumpAndUseSharedArchive(dump ? "+" : "-", use ? "+" : "-");
    49           dumpAndUseSharedArchive("-", "+");
       
    50         } else {
    66         } else {
    51           // Call intrinsified java.lang.Math::fma()
    67           // Call intrinsified java.lang.Math::fma()
    52           Math.fma(1.0, 2.0, 3.0);
    68           Math.fma(1.0, 2.0, 3.0);
    53 
    69 
    54           byte[] buffer = new byte[256];
    70           byte[] buffer = new byte[256];