Skip to content

Commit 3dd07b9

Browse files
MaxXSofte1iu
authored andcommittedAug 14, 2024
8336163: Remove declarations of some debug-only methods in release build
Reviewed-by: dholmes, eliu, kvn
1 parent 720b446 commit 3dd07b9

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed
 

‎src/hotspot/share/cds/heapShared.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ class HeapShared: AllStatic {
371371
KlassSubGraphInfo* subgraph_info,
372372
oop orig_obj);
373373

374+
#ifndef PRODUCT
374375
static ResourceBitMap calculate_oopmap(MemRegion region); // marks all the oop pointers
376+
#endif
375377
static void add_to_dumped_interned_strings(oop string);
376378

377379
// Scratch objects for archiving Klass::java_mirror()
@@ -426,7 +428,9 @@ class HeapShared: AllStatic {
426428
static void init_roots(oop roots_oop) NOT_CDS_JAVA_HEAP_RETURN;
427429
static void serialize_tables(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
428430

431+
#ifndef PRODUCT
429432
static bool is_a_test_class_in_unnamed_module(Klass* ik) NOT_CDS_JAVA_HEAP_RETURN_(false);
433+
#endif
430434
};
431435

432436
#if INCLUDE_CDS_JAVA_HEAP

‎src/hotspot/share/compiler/compilationPolicy.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ class CompilationPolicy : AllStatic {
179179

180180
// Set carry flags in the counters (in Method* and MDO).
181181
inline static void handle_counter_overflow(const methodHandle& method);
182+
#ifdef ASSERT
182183
// Verify that a level is consistent with the compilation mode
183184
static bool verify_level(CompLevel level);
185+
#endif
184186
// Clamp the request level according to various constraints.
185187
inline static CompLevel limit_level(CompLevel level);
186188
// Common transition function. Given a predicate determines if a method should transition to another level.

‎src/hotspot/share/opto/node.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,9 @@ class Node {
834834
juint _class_id;
835835
juint _flags;
836836

837+
#ifdef ASSERT
837838
static juint max_flags();
839+
#endif
838840

839841
protected:
840842
// These methods should be called from constructors only.

‎src/hotspot/share/runtime/frame.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ class frame {
387387
static int interpreter_frame_monitor_size();
388388
static int interpreter_frame_monitor_size_in_bytes();
389389

390+
#ifdef ASSERT
390391
void interpreter_frame_verify_monitor(BasicObjectLock* value) const;
392+
#endif
391393

392394
// Return/result value from this interpreter frame
393395
// If the method return type is T_OBJECT or T_ARRAY populates oop_result
@@ -438,8 +440,10 @@ class frame {
438440
void print_on_error(outputStream* st, char* buf, int buflen, bool verbose = false) const;
439441
static void print_C_frame(outputStream* st, char* buf, int buflen, address pc);
440442

443+
#ifndef PRODUCT
441444
// Add annotated descriptions of memory locations belonging to this frame to values
442445
void describe(FrameValues& values, int frame_no, const RegisterMap* reg_map=nullptr);
446+
#endif
443447

444448
// Conversion from a VMReg to physical stack location
445449
template <typename RegisterMapT>
@@ -492,9 +496,11 @@ class frame {
492496

493497
// Verification
494498
void verify(const RegisterMap* map) const;
499+
#ifdef ASSERT
495500
static bool verify_return_pc(address x);
496501
// Usage:
497502
// assert(frame::verify_return_pc(return_address), "must be a return pc");
503+
#endif
498504

499505
#include CPU_HEADER(frame)
500506

‎src/hotspot/share/runtime/registerMap.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, 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
@@ -153,19 +153,19 @@ class RegisterMap : public StackObj {
153153
const RegisterMap* as_RegisterMap() const { return this; }
154154
RegisterMap* as_RegisterMap() { return this; }
155155

156+
#ifndef PRODUCT
156157
void print_on(outputStream* st) const;
157158
void print() const;
158159

159-
void set_async(bool value) { NOT_PRODUCT(_async = value;) }
160-
void set_skip_missing(bool value) { NOT_PRODUCT(_skip_missing = value;) }
161-
162-
#ifndef PRODUCT
163160
bool is_async() const { return _async; }
164161
bool should_skip_missing() const { return _skip_missing; }
165162

166163
VMReg find_register_spilled_here(void* p, intptr_t* sp);
167164
#endif
168165

166+
void set_async(bool value) { NOT_PRODUCT(_async = value;) }
167+
void set_skip_missing(bool value) { NOT_PRODUCT(_skip_missing = value;) }
168+
169169
// the following contains the definition of pd_xxx methods
170170
#include CPU_HEADER(registerMap)
171171

0 commit comments

Comments
 (0)
Please sign in to comment.