8387721: C2: Print Node barrier data

Reviewed-by: amitkumar, chagedorn
This commit is contained in:
Aleksey Shipilev 2026-07-06 15:44:00 +00:00
parent b9f36a121a
commit 01a9a40218
2 changed files with 30 additions and 4 deletions

View File

@ -86,12 +86,13 @@ bool MemNode::check_if_adr_maybe_raw(Node* adr) {
#ifndef PRODUCT
void MemNode::dump_spec(outputStream *st) const {
if (in(Address) == nullptr) return; // node is dead
if (in(Address) == nullptr) {
// node is dead
return;
}
#ifndef ASSERT
// fake the missing field
const TypePtr* _adr_type = nullptr;
if (in(Address) != nullptr)
_adr_type = in(Address)->bottom_type()->isa_ptr();
const TypePtr* _adr_type = in(Address)->bottom_type()->isa_ptr();
#endif
dump_adr_type(_adr_type, st);
@ -108,6 +109,7 @@ void MemNode::dump_spec(outputStream *st) const {
if (_unsafe_access) {
st->print(" unsafe");
}
st->print(" barrier(0x%x)", _barrier_data);
}
void MemNode::dump_adr_type(const TypePtr* adr_type, outputStream* st) {
@ -4145,6 +4147,26 @@ MemBarNode* LoadStoreNode::trailing_membar() const {
uint LoadStoreNode::size_of() const { return sizeof(*this); }
#ifndef PRODUCT
void LoadStoreNode::dump_spec(outputStream* st) const {
if (in(MemNode::Address) == nullptr) {
// node is dead
return;
}
#ifndef ASSERT
// fake the missing field
const TypePtr* _adr_type = in(MemNode::Address)->bottom_type()->isa_ptr();
#endif
MemNode::dump_adr_type(_adr_type, st);
Compile* C = Compile::current();
if (C->alias_type(_adr_type)->is_volatile()) {
st->print(" Volatile!");
}
st->print(" barrier(0x%x)", _barrier_data);
}
#endif
//=============================================================================
//----------------------------------LoadStoreConditionalNode--------------------
LoadStoreConditionalNode::LoadStoreConditionalNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex ) : LoadStoreNode(c, mem, adr, val, nullptr, TypeInt::BOOL, 5) {

View File

@ -880,6 +880,10 @@ public:
uint8_t barrier_data() { return _barrier_data; }
void set_barrier_data(uint8_t barrier_data) { _barrier_data = barrier_data; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
private:
virtual bool depends_only_on_test_impl() const { return false; }
};