255 }
256 return null;
257 }
258
259 private String[] cmd(long classStart, long classStop) {
260 String phase = phaseName(classStart);
261 return new String[] {
262 "-Xbatch",
263 "-XX:-UseCounterDecay",
264 "-XX:-ShowMessageBoxOnError",
265 "-XX:+UnlockDiagnosticVMOptions",
266 // define phase start
267 "-DCompileTheWorldStartAt=" + classStart,
268 "-DCompileTheWorldStopAt=" + classStop,
269 // CTW library uses WhiteBox API
270 "-XX:+WhiteBoxAPI", "-Xbootclasspath/a:.",
271 // export jdk.internal packages used by CTW library
272 "--add-exports", "java.base/jdk.internal.jimage=ALL-UNNAMED",
273 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
274 "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
275 // enable diagnostic logging
276 "-XX:+LogCompilation",
277 // use phase specific log, hs_err and ciReplay files
278 String.format("-XX:LogFile=hotspot_%s_%%p.log", phase),
279 String.format("-XX:ErrorFile=hs_err_%s_%%p.log", phase),
280 String.format("-XX:ReplayDataFile=replay_%s_%%p.log", phase),
281 // MethodHandle MUST NOT be compiled
282 "-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*",
283 // CTW entry point
284 CompileTheWorld.class.getName(),
285 target,
286 };
287 }
288
289 private String phaseName(long classStart) {
290 return String.format("%s_%d", targetName, classStart);
291 }
292
293 }
|
255 }
256 return null;
257 }
258
259 private String[] cmd(long classStart, long classStop) {
260 String phase = phaseName(classStart);
261 return new String[] {
262 "-Xbatch",
263 "-XX:-UseCounterDecay",
264 "-XX:-ShowMessageBoxOnError",
265 "-XX:+UnlockDiagnosticVMOptions",
266 // define phase start
267 "-DCompileTheWorldStartAt=" + classStart,
268 "-DCompileTheWorldStopAt=" + classStop,
269 // CTW library uses WhiteBox API
270 "-XX:+WhiteBoxAPI", "-Xbootclasspath/a:.",
271 // export jdk.internal packages used by CTW library
272 "--add-exports", "java.base/jdk.internal.jimage=ALL-UNNAMED",
273 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
274 "--add-exports", "java.base/jdk.internal.reflect=ALL-UNNAMED",
275 "--add-exports", "java.base/jdk.internal.access=ALL-UNNAMED",
276 // enable diagnostic logging
277 "-XX:+LogCompilation",
278 // use phase specific log, hs_err and ciReplay files
279 String.format("-XX:LogFile=hotspot_%s_%%p.log", phase),
280 String.format("-XX:ErrorFile=hs_err_%s_%%p.log", phase),
281 String.format("-XX:ReplayDataFile=replay_%s_%%p.log", phase),
282 // MethodHandle MUST NOT be compiled
283 "-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*",
284 // CTW entry point
285 CompileTheWorld.class.getName(),
286 target,
287 };
288 }
289
290 private String phaseName(long classStart) {
291 return String.format("%s_%d", targetName, classStart);
292 }
293
294 }
|