Skip to content

Commit b919240

Browse files
committed
8266967: debug.cpp utility find() should print Java Object fields.
Reviewed-by: mdoerr Backport-of: 5e557d8
1 parent b092d77 commit b919240

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

src/hotspot/share/oops/instanceKlass.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -3120,8 +3120,6 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
31203120
// -----------------------------------------------------------------------------------------------------
31213121
// Printing
31223122

3123-
#ifndef PRODUCT
3124-
31253123
#define BULLET " - "
31263124

31273125
static const char* state_names[] = {
@@ -3263,16 +3261,12 @@ void InstanceKlass::print_on(outputStream* st) const {
32633261
st->cr();
32643262
}
32653263

3266-
#endif //PRODUCT
3267-
32683264
void InstanceKlass::print_value_on(outputStream* st) const {
32693265
assert(is_klass(), "must be klass");
32703266
if (Verbose || WizardMode) access_flags().print_on(st);
32713267
name()->print_value_on(st);
32723268
}
32733269

3274-
#ifndef PRODUCT
3275-
32763270
void FieldPrinter::do_field(fieldDescriptor* fd) {
32773271
_st->print(BULLET);
32783272
if (_obj == NULL) {
@@ -3330,8 +3324,6 @@ void InstanceKlass::oop_print_on(oop obj, outputStream* st) {
33303324
}
33313325
}
33323326

3333-
#endif //PRODUCT
3334-
33353327
void InstanceKlass::oop_print_value_on(oop obj, outputStream* st) {
33363328
st->print("a ");
33373329
name()->print_value_on(st);

src/hotspot/share/oops/instanceKlass.hpp

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

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

9290
// Describes where oops are located in instances of this klass.
9391
class OopMapBlock {
@@ -1338,16 +1336,14 @@ class InstanceKlass: public Klass {
13381336

13391337
public:
13401338
// Printing
1341-
#ifndef PRODUCT
13421339
void print_on(outputStream* st) const;
1343-
#endif
13441340
void print_value_on(outputStream* st) const;
13451341

13461342
void oop_print_value_on(oop obj, outputStream* st);
13471343

1348-
#ifndef PRODUCT
13491344
void oop_print_on (oop obj, outputStream* st);
13501345

1346+
#ifndef PRODUCT
13511347
void print_dependent_nmethods(bool verbose = false);
13521348
bool is_dependent_nmethod(nmethod* nm);
13531349
#endif

src/hotspot/share/runtime/fieldDescriptor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ void fieldDescriptor::verify() const {
124124
}
125125
}
126126

127+
#endif /* PRODUCT */
128+
127129
void fieldDescriptor::print_on(outputStream* st) const {
128130
access_flags().print_on(st);
129131
name()->print_value_on(st);
@@ -214,4 +216,3 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
214216
}
215217
}
216218

217-
#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, 2018, 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
@@ -111,8 +111,8 @@ class fieldDescriptor {
111111

112112
// Print
113113
void print() { print_on(tty); }
114-
void print_on(outputStream* st) const PRODUCT_RETURN;
115-
void print_on_for(outputStream* st, oop obj) PRODUCT_RETURN;
114+
void print_on(outputStream* st) const;
115+
void print_on_for(outputStream* st, oop obj);
116116
void verify() const PRODUCT_RETURN;
117117
};
118118

0 commit comments

Comments
 (0)