hotspot/test/gc/TestCardTablePageCommits.java
author hseigel
Thu, 02 Apr 2015 08:50:10 -0400
changeset 30136 1c5202fa105b
parent 28026 3694b71eef6c
child 29678 dd2f3932c21e
permissions -rw-r--r--
8076236: VM permits illegal flags for class init method Summary: Move check for multiple access flags so that it also covers instance initialization methods Reviewed-by: ctornqvi, lfoltan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28026
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     1
/*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     2
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     4
*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     5
* This code is free software; you can redistribute it and/or modify it
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     6
* under the terms of the GNU General Public License version 2 only, as
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     7
* published by the Free Software Foundation.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     8
*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
     9
* This code is distributed in the hope that it will be useful, but WITHOUT
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    11
* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    12
* version 2 for more details (a copy is included in the LICENSE file that
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    13
* accompanied this code).
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    14
*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    15
* You should have received a copy of the GNU General Public License version
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    16
* 2 along with this work; if not, write to the Free Software Foundation,
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    18
*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    20
* or visit www.oracle.com if you need additional information or have any
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    21
* questions.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    22
*/
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    23
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    24
import com.oracle.java.testlibrary.JDKToolFinder;
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    25
import com.oracle.java.testlibrary.OutputAnalyzer;
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    26
import com.oracle.java.testlibrary.ProcessTools;
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    27
import com.oracle.java.testlibrary.Platform;
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    28
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    29
/*
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    30
 * @test TestCardTablePageCommits
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    31
 * @key gc
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    32
 * @bug 8059066
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    33
 * @summary Tests that the card table does not commit the same page twice
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    34
 * @library /testlibrary
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    35
 * @run driver TestCardTablePageCommits
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    36
 */
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    37
public class TestCardTablePageCommits {
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    38
    public static void main(String args[]) throws Exception {
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    39
        // The test is run with a small heap to make sure all pages in the card
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    40
        // table gets committed. Need 8 MB heap to trigger the bug on SPARC
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    41
        // because of 8kB pages, assume 4 KB pages for all other CPUs.
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    42
        String Xmx = Platform.isSparc() ? "-Xmx8m" : "-Xmx4m";
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    43
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    44
        String[] opts = {Xmx, "-XX:NativeMemoryTracking=detail", "-XX:+UseParallelGC", "-version"};
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    45
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(opts);
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    46
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    47
        output.shouldHaveExitValue(0);
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    48
    }
3694b71eef6c 8059066: CardTableModRefBS might commit the same page twice
ehelin
parents:
diff changeset
    49
}