hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
changeset 30123 7a8b6bd85e24
parent 19979 ebe1dbb6e1aa
child 30146 a5809dde4617
equal deleted inserted replaced
30121:cc43664a0ad7 30123:7a8b6bd85e24
     1 /*
     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2015, 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.
    35   public static void main(String[] args) throws Exception {
    35   public static void main(String[] args) throws Exception {
    36     ProcessBuilder pb;
    36     ProcessBuilder pb;
    37     if (Platform.is64bit()) {
    37     if (Platform.is64bit()) {
    38       pb = ProcessTools.createJavaProcessBuilder(
    38       pb = ProcessTools.createJavaProcessBuilder(
    39         "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
    39         "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
    40         "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
    40         "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:dump");
    41       OutputAnalyzer output = new OutputAnalyzer(pb.start());
    41       OutputAnalyzer output = new OutputAnalyzer(pb.start());
    42       try {
    42       try {
    43         output.shouldContain("Loading classes to share");
    43         output.shouldContain("Loading classes to share");
    44         output.shouldHaveExitValue(0);
    44         output.shouldHaveExitValue(0);
    45 
    45 
    46         pb = ProcessTools.createJavaProcessBuilder(
    46         pb = ProcessTools.createJavaProcessBuilder(
    47           "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
    47           "-XX:+UseCompressedClassPointers", "-XX:+UseCompressedOops",
    48           "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
    48           "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./CDSCompressedKPtrs.jsa", "-Xshare:on", "-version");
    49         output = new OutputAnalyzer(pb.start());
    49         output = new OutputAnalyzer(pb.start());
    50         output.shouldContain("sharing");
    50         output.shouldContain("sharing");
    51         output.shouldHaveExitValue(0);
    51         output.shouldHaveExitValue(0);
    52 
    52 
    53       } catch (RuntimeException e) {
    53       } catch (RuntimeException e) {