Skip to content

Commit 5e557d8

Browse files
committed
8266967: debug.cpp utility find() should print Java Object fields.
Reviewed-by: sspitsyn, coleenp
1 parent c7c77fd commit 5e557d8

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

src/hotspot/share/oops/instanceKlass.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -3306,8 +3306,6 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
33063306
// -----------------------------------------------------------------------------------------------------
33073307
// Printing
33083308

3309-
#ifndef PRODUCT
3310-
33113309
#define BULLET " - "
33123310

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

3460-
#endif //PRODUCT
3461-
34623458
void InstanceKlass::print_value_on(outputStream* st) const {
34633459
assert(is_klass(), "must be klass");
34643460
if (Verbose || WizardMode) access_flags().print_on(st);
34653461
name()->print_value_on(st);
34663462
}
34673463

3468-
#ifndef PRODUCT
3469-
34703464
void FieldPrinter::do_field(fieldDescriptor* fd) {
34713465
_st->print(BULLET);
34723466
if (_obj == NULL) {
@@ -3524,6 +3518,8 @@ void InstanceKlass::oop_print_on(oop obj, outputStream* st) {
35243518
}
35253519
}
35263520

3521+
#ifndef PRODUCT
3522+
35273523
bool InstanceKlass::verify_itable_index(int i) {
35283524
int method_count = klassItable::method_count_for_interface(this);
35293525
assert(i >= 0 && i < method_count, "index out of bounds");

src/hotspot/share/oops/instanceKlass.hpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class FieldClosure: public StackObj {
7676
virtual void do_field(fieldDescriptor* fd) = 0;
7777
};
7878

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

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

12411239
public:
12421240
// Printing
1243-
#ifndef PRODUCT
12441241
void print_on(outputStream* st) const;
1245-
#endif
12461242
void print_value_on(outputStream* st) const;
12471243

12481244
void oop_print_value_on(oop obj, outputStream* st);
12491245

1250-
#ifndef PRODUCT
12511246
void oop_print_on (oop obj, outputStream* st);
12521247

1248+
#ifndef PRODUCT
12531249
void print_dependent_nmethods(bool verbose = false);
12541250
bool is_dependent_nmethod(nmethod* nm);
12551251
bool verify_itable_index(int index);

src/hotspot/share/runtime/fieldDescriptor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ void fieldDescriptor::verify() const {
129129
}
130130
}
131131

132+
#endif /* PRODUCT */
133+
132134
void fieldDescriptor::print_on(outputStream* st) const {
133135
access_flags().print_on(st);
134136
name()->print_value_on(st);
@@ -229,4 +231,3 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
229231
}
230232
}
231233

232-
#endif /* PRODUCT */

src/hotspot/share/runtime/fieldDescriptor.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -113,8 +113,8 @@ class fieldDescriptor {
113113

114114
// Print
115115
void print() const;
116-
void print_on(outputStream* st) const PRODUCT_RETURN;
117-
void print_on_for(outputStream* st, oop obj) PRODUCT_RETURN;
116+
void print_on(outputStream* st) const;
117+
void print_on_for(outputStream* st, oop obj);
118118
void verify() const PRODUCT_RETURN;
119119
};
120120

0 commit comments

Comments
 (0)