Update C1Visualizer for JDK8+ (post-NPG)?
Krystal Mok
rednaxelafx at gmail.com
Tue Jun 7 01:43:39 UTC 2016
Hi guys,
This probably isn't the best mailing list for the topic, but the audience
should cover a lot of the developers/users of C1Visualizer, so here I go:
It looks like even the latest C1Visualizer doesn't handle CFG files
produced by a JDK8+ HotSpot C1 well, due to the NoPermGen/Metadata changes.
For instance, the following is an excerpt from a CFG file produced by a
JDK8u76 build:
begin_intervals
name "Before Register Allocation"
0 fixed "[rsi|I]" 0 -1 [0, 4[ [48, 50[ [60, 61[ "no spill store"
1 fixed "[rdi|I]" 1 187 [0, 1[ [58, 61[ "no spill store"
2 fixed "[rbx|I]" 2 -1 [0, 1[ [60, 61[ "no definition"
3 fixed "[rax|I]" 3 185 [0, 1[ [10, 11[ [60, 61[ [152, 153[ [154, 155[
[156, 158[ "no optimization"
4 fixed "[rdx|I]" 4 -1 [0, 6[ [60, 61[ "no definition"
5 fixed "[rcx|I]" 5 -1 [0, 1[ [60, 61[ "no definition"
6 fixed "[r8|I]" 6 -1 [0, 1[ [60, 61[ "no definition"
7 fixed "[r9|I]" 7 -1 [0, 1[ [60, 61[ "no definition"
8 fixed "[r11|I]" 8 -1 [0, 1[ [60, 61[ "no definition"
9 fixed "[r13|I]" 9 -1 [0, 1[ [60, 61[ "no definition"
10 fixed "[r14|I]" 10 -1 [0, 1[ [60, 61[ "no definition"
177 object 177 0 [4, 27[ 4 M 10 M "no spill store"
178 object 178 4 [6, 38[ 6 M 38 S "no spill store"
179 int 179 -1 [8, 11[ 8 M 10 M "no spill store"
180 object 180 -1 [10, 11[ 10 M "no definition"
181 *metadata* 181 -1 [12, 18[ 12 M 14 M 18 M "no spill store"
182 int 182 -1 [14, 24[ 14 M 16 M 18 M 22 M 24 M "no optimization"
183 *metadata* 183 -1 [20, 26[ 20 M 26 M "no spill store"
The "*metadata*" type is new from the NPG change, and apparently
C1Visualizer doesn't recognize that. If I open this file with the latest
C1Visualizer, I get a couple of errors saying:
Error while parsing input:
-- line 936 col 5: ident expected
...
In C1Visualizer/Compilation
Model/src/at/ssw/visualizer/parser/CompilationOutput.atg,
CHARACTERS
identCh =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-|:".
cr = '\r'.
lf = '\n'.
TOKENS
ident = identCh { identCh }.
The identCh rule should be updated to include '*', so that it'll be able to
parse "*metadata*", "*narrowoop*", etc. (as in HotSpot's
globalDefinitions.cpp type2name_tab).
In C1Visualizer/Interval
Editor/src/at/ssw/visualizer/interval/ViewSettings.java,
typeIntervalColors = new HashMap<String, Color>();
typeIntervalColors.put("fixed", new Color(128, 128, 128));
typeIntervalColors.put("object", new Color(192, 64, 255));
typeIntervalColors.put("int", new Color(64, 192, 255));
typeIntervalColors.put("long", new Color(0, 128, 255));
typeIntervalColors.put("float", new Color(192, 255, 64));
typeIntervalColors.put("double", new Color(128, 255, 0));
The constructor of ViewSettings should include colors for the *...* types
such as *metadata* and *narrowoop*.
Is there anybody on the list that would be able to put the fix into
C1Visualizer? Any help would be appreciated.
Best regards,
Kris (OpenJDK username: kmo)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160606/f0fcba83/attachment.html>
More information about the hotspot-compiler-dev
mailing list