author | amurillo |
Fri, 06 May 2016 06:23:29 -0700 | |
changeset 38208 | ff63d43b0480 |
parent 36851 | 03e2f4d0a421 |
child 39414 | 4adf52148100 |
permissions | -rw-r--r-- |
32589
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
1 |
/* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
4 |
* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
8 |
* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
13 |
* accompanied this code). |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
14 |
* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
18 |
* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
21 |
* questions. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
22 |
*/ |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
23 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
24 |
/* |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
25 |
* @test SharedStringsAuto |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
26 |
* @summary Test -Xshare:auto with shared strings. |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
27 |
* Feature support: G1GC only, compressed oops/kptrs, 64-bit os, not on windows |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
28 |
* @requires (sun.arch.data.model != "32") & (os.family != "windows") |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
29 |
* @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true) |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
30 |
* @requires (vm.gc=="G1" | vm.gc=="null") |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
31 |
* @library /testlibrary |
36851 | 32 |
* @modules java.base/jdk.internal.misc |
32589
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
33 |
* java.management |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
34 |
* @run main SharedStringsRunAuto |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
35 |
*/ |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
36 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
37 |
import jdk.test.lib.*; |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
38 |
import java.io.File; |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
39 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
40 |
public class SharedStringsRunAuto { |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
41 |
public static void main(String[] args) throws Exception { |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
42 |
// Dump |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
43 |
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
44 |
"-XX:+UnlockDiagnosticVMOptions", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
45 |
"-XX:SharedArchiveFile=./SharedStringsRunAuto.jsa", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
46 |
"-XX:+UseCompressedOops", "-XX:+UseG1GC", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
47 |
"-XX:+PrintSharedSpaces", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
48 |
"-Xshare:dump"); |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
49 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
50 |
new OutputAnalyzer(pb.start()) |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
51 |
.shouldContain("Loading classes to share") |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
52 |
.shouldContain("Shared string table stats") |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
53 |
.shouldHaveExitValue(0); |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
54 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
55 |
// Run with -Xshare:auto |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
56 |
pb = ProcessTools.createJavaProcessBuilder( |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
57 |
"-XX:+UnlockDiagnosticVMOptions", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
58 |
"-XX:SharedArchiveFile=./SharedStringsRunAuto.jsa", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
59 |
"-XX:+UseCompressedOops", "-XX:+UseG1GC", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
60 |
"-Xshare:auto", |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
61 |
"-version"); |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
62 |
|
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
63 |
new OutputAnalyzer(pb.start()) |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
64 |
.shouldMatch("(java|openjdk) version") |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
65 |
.shouldHaveExitValue(0); |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
66 |
} |
f86fb16fcab0
8131734: assert(!is_null(v)) failed: narrow klass value can never be zero with -Xshared:auto
jiangli
parents:
diff
changeset
|
67 |
} |