Skip to content

Commit 458e563

Browse files
committed
8310711: [IR Framework] Remove safepoint while printing handling
Reviewed-by: thartmann, epeter
1 parent 71aac7a commit 458e563

File tree

6 files changed

+4
-461
lines changed

6 files changed

+4
-461
lines changed

test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/hotspot/CompilePhaseBlock.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
2929
* This class represents a single compile phase block of a {@link LoggedMethod}.
3030
*/
3131
class CompilePhaseBlock {
32-
public static final String SAFEPOINT_WHILE_PRINTING_MESSAGE = "<!-- safepoint while printing -->";
3332

3433
/**
3534
* Dummy object for a block that we do not need to parse.
@@ -38,11 +37,6 @@ class CompilePhaseBlock {
3837

3938
private final CompilePhase compilePhase;
4039
private final StringBuilder builder;
41-
/**
42-
* Stores an incomplete line that was interrupted by a safepoint.
43-
* Needs to be merged with the immediately following line.
44-
*/
45-
private String incompleteLine = "";
4640

4741
public CompilePhaseBlock(CompilePhase compilePhase) {
4842
this.compilePhase = compilePhase;
@@ -92,35 +86,14 @@ public static boolean isBlockEndLine(String line) {
9286
}
9387

9488
public void addLine(String line) {
95-
line = mergeWithIncompleteLine(line);
96-
if (line.endsWith(SAFEPOINT_WHILE_PRINTING_MESSAGE)) {
97-
line = removeSafepointMessage(line);
98-
incompleteLine = line;
99-
} else {
100-
appendLine(line);
101-
}
102-
}
103-
104-
private String mergeWithIncompleteLine(String line) {
105-
if (!incompleteLine.isEmpty()) {
106-
line = incompleteLine + line;
107-
incompleteLine = "";
108-
}
109-
return line;
110-
}
89+
builder.append(escapeXML(line)).append(System.lineSeparator());
11190

112-
private static String removeSafepointMessage(String line) {
113-
return line.substring(0, line.lastIndexOf(SAFEPOINT_WHILE_PRINTING_MESSAGE));
11491
}
11592

11693
public String content() {
11794
return builder.toString();
11895
}
11996

120-
private void appendLine(String line) {
121-
builder.append(escapeXML(line)).append(System.lineSeparator());
122-
}
123-
12497
private static String escapeXML(String line) {
12598
if (line.contains("&")) {
12699
line = line.replace("&lt;", "<");

test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/hotspot/State.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,26 +29,21 @@
2929
* This class holds the current state of the parsing of the hotspot_pid* file.
3030
*/
3131
class State {
32-
private final WriterThreads writerThreads;
33-
private WriterThread writerThread;
3432
private final CompileQueueMessages compileQueueMessages;
3533
private final LoggedMethods loggedMethods;
3634
private LoggedMethod loggedMethod = LoggedMethod.DONT_CARE;
3735

3836
public State(String testClassName, TestMethods testMethods) {
3937
this.compileQueueMessages = new CompileQueueMessages(testClassName, testMethods);
4038
this.loggedMethods = new LoggedMethods();
41-
this.writerThreads = new WriterThreads();
4239
}
4340

4441
public LoggedMethods loggedMethods() {
4542
return loggedMethods;
4643
}
4744

4845
public void update(String line) {
49-
if (WriterThread.isWriterThreadLine(line)) {
50-
processWriterThreadLine(line);
51-
} else if (compileQueueMessages.isTestMethodQueuedLine(line)) {
46+
if (compileQueueMessages.isTestMethodQueuedLine(line)) {
5247
processCompileQueueLine(line);
5348
} else if (CompilePhaseBlock.isBlockStartLine(line)) {
5449
processBlockStartLine(line);
@@ -59,15 +54,6 @@ public void update(String line) {
5954
}
6055
}
6156

62-
private void processWriterThreadLine(String line) {
63-
if (loggedMethod.hasActiveBlock()) {
64-
// The current compile phase block was interrupted due to a safepoint. Save and restore later.
65-
writerThread.saveLoggedMethod(loggedMethod);
66-
}
67-
writerThread = writerThreads.parse(line);
68-
loggedMethod = writerThread.restoreLoggedMethod();
69-
}
70-
7157
private void processCompileQueueLine(String line) {
7258
String methodName = compileQueueMessages.parse(line);
7359
loggedMethods.registerMethod(methodName);

test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/hotspot/WriterThread.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

test/hotspot/jtreg/compiler/lib/ir_framework/driver/irmatching/parser/hotspot/WriterThreads.java

Lines changed: 0 additions & 50 deletions
This file was deleted.

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSafepointWhilePrinting.java

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)