Skip to content
Permalink
Browse files
8266967: debug.cpp utility find() should print Java Object fields.
Reviewed-by: sspitsyn, coleenp
  • Loading branch information
Kevin Walls committed Jun 7, 2021
1 parent c7c77fd commit 5e557d8650d81f9f81938892de28a6dd8fea98b0
Showing 4 changed files with 8 additions and 15 deletions.
@@ -3306,8 +3306,6 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
// -----------------------------------------------------------------------------------------------------
// Printing

#ifndef PRODUCT

#define BULLET " - "

static const char* state_names[] = {
@@ -3457,16 +3455,12 @@ void InstanceKlass::print_on(outputStream* st) const {
st->cr();
}

#endif //PRODUCT

void InstanceKlass::print_value_on(outputStream* st) const {
assert(is_klass(), "must be klass");
if (Verbose || WizardMode) access_flags().print_on(st);
name()->print_value_on(st);
}

#ifndef PRODUCT

void FieldPrinter::do_field(fieldDescriptor* fd) {
_st->print(BULLET);
if (_obj == NULL) {
@@ -3524,6 +3518,8 @@ void InstanceKlass::oop_print_on(oop obj, outputStream* st) {
}
}

#ifndef PRODUCT

bool InstanceKlass::verify_itable_index(int i) {
int method_count = klassItable::method_count_for_interface(this);
assert(i >= 0 && i < method_count, "index out of bounds");
@@ -76,7 +76,6 @@ class FieldClosure: public StackObj {
virtual void do_field(fieldDescriptor* fd) = 0;
};

#ifndef PRODUCT
// Print fields.
// If "obj" argument to constructor is NULL, prints static fields, otherwise prints non-static fields.
class FieldPrinter: public FieldClosure {
@@ -86,7 +85,6 @@ class FieldPrinter: public FieldClosure {
FieldPrinter(outputStream* st, oop obj = NULL) : _obj(obj), _st(st) {}
void do_field(fieldDescriptor* fd);
};
#endif // !PRODUCT

// Describes where oops are located in instances of this klass.
class OopMapBlock {
@@ -1240,16 +1238,14 @@ class InstanceKlass: public Klass {

public:
// Printing
#ifndef PRODUCT
void print_on(outputStream* st) const;
#endif
void print_value_on(outputStream* st) const;

void oop_print_value_on(oop obj, outputStream* st);

#ifndef PRODUCT
void oop_print_on (oop obj, outputStream* st);

#ifndef PRODUCT
void print_dependent_nmethods(bool verbose = false);
bool is_dependent_nmethod(nmethod* nm);
bool verify_itable_index(int index);
@@ -129,6 +129,8 @@ void fieldDescriptor::verify() const {
}
}

#endif /* PRODUCT */

void fieldDescriptor::print_on(outputStream* st) const {
access_flags().print_on(st);
name()->print_value_on(st);
@@ -229,4 +231,3 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
}
}

#endif /* PRODUCT */
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -113,8 +113,8 @@ class fieldDescriptor {

// Print
void print() const;
void print_on(outputStream* st) const PRODUCT_RETURN;
void print_on_for(outputStream* st, oop obj) PRODUCT_RETURN;
void print_on(outputStream* st) const;
void print_on_for(outputStream* st, oop obj);
void verify() const PRODUCT_RETURN;
};

0 comments on commit 5e557d8

Please sign in to comment.