mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
6824493: experimental support for additional info for instructions
Reviewed-by: mcimadamore
This commit is contained in:
parent
f05e74203e
commit
72b623769a
13 changed files with 1024 additions and 11 deletions
|
@ -44,6 +44,9 @@ public class BasicWriter {
|
|||
protected BasicWriter(Context context) {
|
||||
lineWriter = LineWriter.instance(context);
|
||||
out = context.get(PrintWriter.class);
|
||||
messages = context.get(Messages.class);
|
||||
if (messages == null)
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
protected void print(String s) {
|
||||
|
@ -88,8 +91,26 @@ public class BasicWriter {
|
|||
return "???";
|
||||
}
|
||||
|
||||
protected String space(int w) {
|
||||
if (w < spaces.length && spaces[w] != null)
|
||||
return spaces[w];
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < w; i++)
|
||||
sb.append(" ");
|
||||
|
||||
String s = sb.toString();
|
||||
if (w < spaces.length)
|
||||
spaces[w] = s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
private String[] spaces = new String[80];
|
||||
|
||||
private LineWriter lineWriter;
|
||||
private PrintWriter out;
|
||||
protected Messages messages;
|
||||
|
||||
private static class LineWriter {
|
||||
static LineWriter instance(Context context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue