48 new String[] { "ShenandoahCASBarrier" },
49 new String[] { "ShenandoahCloneBarrier" },
50 };
51
52 int size = 1;
53 for (String[] l : opts) {
54 size *= (l.length + 1);
55 }
56
57 ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
58
59 for (int c = 0; c < size; c++) {
60 int t = c;
61
62 List<String> conf = new ArrayList<>();
63 conf.addAll(Arrays.asList(args));
64 conf.add("-Xmx128m");
65 conf.add("-XX:+UnlockDiagnosticVMOptions");
66 conf.add("-XX:+UnlockExperimentalVMOptions");
67 conf.add("-XX:+UseShenandoahGC");
68 conf.add("-XX:ShenandoahGCHeuristics=passive");
69
70 StringBuilder sb = new StringBuilder();
71 for (String[] l : opts) {
72 // Make a choice which flag to select from the group.
73 // Zero means no flag is selected from the group.
74 int choice = t % (l.length + 1);
75 for (int e = 0; e < l.length; e++) {
76 conf.add("-XX:" + ((choice == (e + 1)) ? "+" : "-") + l[e]);
77 }
78 t = t / (l.length + 1);
79 }
80
81 conf.add("TestSelectiveBarrierFlags$Test");
82
83 pool.submit(() -> {
84 try {
85 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(conf.toArray(new String[0]));
86 OutputAnalyzer output = new OutputAnalyzer(pb.start());
87 output.shouldHaveExitValue(0);
88 } catch (Exception e) {
|
48 new String[] { "ShenandoahCASBarrier" },
49 new String[] { "ShenandoahCloneBarrier" },
50 };
51
52 int size = 1;
53 for (String[] l : opts) {
54 size *= (l.length + 1);
55 }
56
57 ExecutorService pool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
58
59 for (int c = 0; c < size; c++) {
60 int t = c;
61
62 List<String> conf = new ArrayList<>();
63 conf.addAll(Arrays.asList(args));
64 conf.add("-Xmx128m");
65 conf.add("-XX:+UnlockDiagnosticVMOptions");
66 conf.add("-XX:+UnlockExperimentalVMOptions");
67 conf.add("-XX:+UseShenandoahGC");
68 conf.add("-XX:ShenandoahGCMode=passive");
69
70 StringBuilder sb = new StringBuilder();
71 for (String[] l : opts) {
72 // Make a choice which flag to select from the group.
73 // Zero means no flag is selected from the group.
74 int choice = t % (l.length + 1);
75 for (int e = 0; e < l.length; e++) {
76 conf.add("-XX:" + ((choice == (e + 1)) ? "+" : "-") + l[e]);
77 }
78 t = t / (l.length + 1);
79 }
80
81 conf.add("TestSelectiveBarrierFlags$Test");
82
83 pool.submit(() -> {
84 try {
85 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(conf.toArray(new String[0]));
86 OutputAnalyzer output = new OutputAnalyzer(pb.start());
87 output.shouldHaveExitValue(0);
88 } catch (Exception e) {
|