8350006: IGV: show memory slices as type information

Reviewed-by: dlunden, chagedorn, dfenacci
This commit is contained in:
Roberto Castañeda Lozano 2025-02-19 09:17:27 +00:00
parent 9042aa82a8
commit 0ef1c40991
3 changed files with 39 additions and 7 deletions

View File

@ -542,6 +542,31 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
assert(s2.size() < sizeof(buffer), "size in range");
print_prop("dump_spec", buffer);
const TypePtr* adr_type = node->adr_type();
if (adr_type != nullptr && C->have_alias_type(adr_type)) {
Compile::AliasType* at = C->alias_type(adr_type);
if (at != nullptr) {
print_prop("alias_index", at->index());
// The value of at->field(), if present, is already dumped in the
// "source"/"destination" properties.
const Type* element = at->element();
if (element != nullptr) {
stringStream element_stream;
element->dump_on(&element_stream);
print_prop("alias_element", element_stream.freeze());
}
if (at->is_rewritable()) {
print_prop("alias_is_rewritable", "true");
}
if (at->is_volatile()) {
print_prop("alias_is_volatile", "true");
}
if (at->general_index() != at->index()) {
print_prop("alias_general_index", at->general_index());
}
}
}
if (node->is_block_proj()) {
print_prop("is_block_proj", "true");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -98,7 +98,7 @@ class IdealGraphPrinter : public CHeapObj<mtCompiler> {
outputStream *_output;
ciMethod *_current_method;
int _depth;
char buffer[512];
char buffer[2048];
bool _should_send_method;
PhaseChaitin* _chaitin;
bool _traverse_outs;

View File

@ -44,8 +44,16 @@ function simplifyType(type) {
}
// Merge a possibly existing extra label, bottom type, and phase type into a
// new, single extra label.
function mergeAndAppendTypeInfo(extra_label, bottom_type, phase_type) {
// new, single extra label. For memory nodes, add an extra label with the memory
// slice, extracted from the dump_spec field.
function mergeAndAppendTypeInfo(extra_label, bottom_type, phase_type, category, dump_spec) {
new_extra_label = extra_label == null ? "" : (extra_label + " ");
if (category == "memory") {
m = /idx=([^\s]+);/.exec(dump_spec);
if (m != null) {
return new_extra_label + "mem: " + m[1];
}
}
if (phase_type == null && bottom_type == null) {
return extra_label;
}
@ -62,11 +70,10 @@ function mergeAndAppendTypeInfo(extra_label, bottom_type, phase_type) {
type += "B: ";
type += simplifyType(bottom_type);
}
new_extra_label = extra_label == null ? "" : (extra_label + " ");
return new_extra_label + type;
}
editProperty(not(or([matches("bottom_type", "bottom"),
matches("bottom_type", "abIO")])),
["extra_label", "bottom_type", "phase_type"], "extra_label",
function(propertyValues) {return mergeAndAppendTypeInfo(propertyValues[0], propertyValues[1], propertyValues[2]);});
["extra_label", "bottom_type", "phase_type", "category", "dump_spec"], "extra_label",
function(propertyValues) {return mergeAndAppendTypeInfo(propertyValues[0], propertyValues[1], propertyValues[2], propertyValues[3], propertyValues[4]);});