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 package sun.hotspot.cpuinfo;
25
26 import java.util.List;
27 import java.util.Arrays;
28 import java.util.Collections;
29 import java.util.regex.Pattern;
30 import java.util.regex.Matcher;
31
32 import sun.hotspot.WhiteBox;
33
34 /**
35 * Information about CPU on test box.
36 *
37 * CPUInfo uses WhiteBox to gather information,
38 * so WhiteBox class should be added to bootclasspath
39 * and option -XX:+WhiteBoxAPI should expclicetly
40 * specified on command line.
41 */
42 public class CPUInfo {
43
44 private static final List<String> features;
45 private static final String additionalCPUInfo;
46
47 static {
48 WhiteBox wb = WhiteBox.getWhiteBox();
49
50 Pattern additionalCPUInfoRE =
51 Pattern.compile("([^(]*\\([^)]*\\)[^,]*),\\s*");
52
53 String cpuFeaturesString = wb.getCPUFeatures();
54 Matcher matcher = additionalCPUInfoRE.matcher(cpuFeaturesString);
55 if (matcher.find()) {
56 additionalCPUInfo = matcher.group(1);
57 } else {
58 additionalCPUInfo = "";
59 }
|
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 package sun.hotspot.cpuinfo;
25
26 import java.util.List;
27 import java.util.Arrays;
28 import java.util.Collections;
29 import java.util.regex.Pattern;
30 import java.util.regex.Matcher;
31
32 import sun.hotspot.WhiteBox;
33
34 /**
35 * Information about CPU on test box.
36 *
37 * CPUInfo uses WhiteBox to gather information,
38 * so WhiteBox class should be added to bootclasspath
39 * and option -XX:+WhiteBoxAPI should be explicitly
40 * specified on command line.
41 */
42 public class CPUInfo {
43
44 private static final List<String> features;
45 private static final String additionalCPUInfo;
46
47 static {
48 WhiteBox wb = WhiteBox.getWhiteBox();
49
50 Pattern additionalCPUInfoRE =
51 Pattern.compile("([^(]*\\([^)]*\\)[^,]*),\\s*");
52
53 String cpuFeaturesString = wb.getCPUFeatures();
54 Matcher matcher = additionalCPUInfoRE.matcher(cpuFeaturesString);
55 if (matcher.find()) {
56 additionalCPUInfo = matcher.group(1);
57 } else {
58 additionalCPUInfo = "";
59 }
|