Skip to content

Commit 09d4936

Browse files
committed
8252136: Several methods in hotspot are missing "static"
Reviewed-by: coleenp, stefank, kvn, kbarrett
1 parent f6e2851 commit 09d4936

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+227
-220
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,7 +2575,7 @@ Assembler::Condition to_assembler_cond(BoolTest::mask cond) {
25752575
}
25762576

25772577
// Binary src (Replicate con)
2578-
bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
2578+
static bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
25792579
if (n == nullptr || m == nullptr) {
25802580
return false;
25812581
}
@@ -2616,7 +2616,7 @@ bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
26162616

26172617
// (XorV src (Replicate m1))
26182618
// (XorVMask src (MaskAll m1))
2619-
bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
2619+
static bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
26202620
if (n != nullptr && m != nullptr) {
26212621
return (n->Opcode() == Op_XorV || n->Opcode() == Op_XorVMask) &&
26222622
VectorNode::is_all_ones_vector(m);

src/hotspot/cpu/aarch64/frame_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -678,7 +678,7 @@ static void printbc(Method *m, intptr_t bcx) {
678678
printf("%s : %s ==> %s\n", m->name_and_sig_as_C_string(), buf, name);
679679
}
680680

681-
void internal_pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, uintptr_t bcx) {
681+
static void internal_pf(uintptr_t sp, uintptr_t fp, uintptr_t pc, uintptr_t bcx) {
682682
if (! fp)
683683
return;
684684

src/hotspot/cpu/aarch64/immediate_aarch64.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -53,7 +53,7 @@ struct li_pair {
5353
static struct li_pair InverseLITable[LI_TABLE_SIZE];
5454

5555
// comparator to sort entries in the inverse table
56-
int compare_immediate_pair(const void *i1, const void *i2)
56+
static int compare_immediate_pair(const void *i1, const void *i2)
5757
{
5858
struct li_pair *li1 = (struct li_pair *)i1;
5959
struct li_pair *li2 = (struct li_pair *)i2;
@@ -142,7 +142,7 @@ static inline uint32_t uimm(uint32_t val, int hi, int lo)
142142
// result
143143
// a bit string containing count copies of input bit string
144144
//
145-
uint64_t replicate(uint64_t bits, int nbits, int count)
145+
static uint64_t replicate(uint64_t bits, int nbits, int count)
146146
{
147147
assert(count > 0, "must be");
148148
assert(nbits > 0, "must be");
@@ -231,8 +231,8 @@ uint64_t replicate(uint64_t bits, int nbits, int count)
231231
// For historical reasons the implementation of this function is much
232232
// more convoluted than is really necessary.
233233

234-
int expandLogicalImmediate(uint32_t immN, uint32_t immr,
235-
uint32_t imms, uint64_t &bimm)
234+
static int expandLogicalImmediate(uint32_t immN, uint32_t immr,
235+
uint32_t imms, uint64_t &bimm)
236236
{
237237
int len; // ought to be <= 6
238238
uint32_t levels; // 6 bits
@@ -446,4 +446,3 @@ uint32_t encoding_for_fp_immediate(float immediate)
446446
res = (s << 7) | (r << 4) | f;
447447
return res;
448448
}
449-

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 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
@@ -1207,9 +1207,10 @@ void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) {
12071207
__ move(result_reg, result);
12081208
}
12091209

1210+
#ifndef _LP64
12101211
// _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
12111212
// _i2b, _i2c, _i2s
1212-
LIR_Opr fixed_register_for(BasicType type) {
1213+
static LIR_Opr fixed_register_for(BasicType type) {
12131214
switch (type) {
12141215
case T_FLOAT: return FrameMap::fpu0_float_opr;
12151216
case T_DOUBLE: return FrameMap::fpu0_double_opr;
@@ -1218,6 +1219,7 @@ LIR_Opr fixed_register_for(BasicType type) {
12181219
default: ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
12191220
}
12201221
}
1222+
#endif
12211223

12221224
void LIRGenerator::do_Convert(Convert* x) {
12231225
#ifdef _LP64

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4120,8 +4120,9 @@ static void restore_xmm_register(MacroAssembler* masm, int offset, XMMRegister r
41204120
}
41214121
}
41224122

4123-
int register_section_sizes(RegSet gp_registers, XMMRegSet xmm_registers, bool save_fpu,
4124-
int& gp_area_size, int& fp_area_size, int& xmm_area_size) {
4123+
static int register_section_sizes(RegSet gp_registers, XMMRegSet xmm_registers,
4124+
bool save_fpu, int& gp_area_size,
4125+
int& fp_area_size, int& xmm_area_size) {
41254126

41264127
gp_area_size = align_up(gp_registers.size() * Register::max_slots_per_register * VMRegImpl::stack_slot_size,
41274128
StackAlignmentInBytes);

src/hotspot/cpu/x86/peephole_x86_64.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -33,8 +33,8 @@
3333
// lea d, [s1 + s2] and
3434
// mov d, s1; shl d, s2 into
3535
// lea d, [s1 << s2] with s2 = 1, 2, 3
36-
bool lea_coalesce_helper(Block* block, int block_index, PhaseCFG* cfg_, PhaseRegAlloc* ra_,
37-
MachNode* (*new_root)(), uint inst0_rule, bool imm) {
36+
static bool lea_coalesce_helper(Block* block, int block_index, PhaseCFG* cfg_, PhaseRegAlloc* ra_,
37+
MachNode* (*new_root)(), uint inst0_rule, bool imm) {
3838
MachNode* inst0 = block->get_node(block_index)->as_Mach();
3939
assert(inst0->rule() == inst0_rule, "sanity");
4040

@@ -136,7 +136,7 @@ bool lea_coalesce_helper(Block* block, int block_index, PhaseCFG* cfg_, PhaseReg
136136
// This helper func takes a condition and returns the flags that need to be set for the condition
137137
// It uses the same flags as the test instruction, so if the e.g. the overflow bit is required,
138138
// this func returns clears_overflow, as that is what the test instruction does and what the downstream path expects
139-
juint map_condition_to_required_test_flags(Assembler::Condition condition) {
139+
static juint map_condition_to_required_test_flags(Assembler::Condition condition) {
140140
switch (condition) {
141141
case Assembler::Condition::zero: // Same value as equal
142142
case Assembler::Condition::notZero: // Same value as notEqual

src/hotspot/cpu/x86/stubRoutines_x86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ uint32_t _crc32c_pow_2k_table[TILL_CYCLE]; // because _crc32c_pow_2k_table[TILL_
279279
// A. Kadatch and B. Jenkins / Everything we know about CRC but afraid to forget September 3, 2010 8
280280
// Listing 1: Multiplication of normalized polynomials
281281
// "a" and "b" occupy D least significant bits.
282-
uint32_t crc32c_multiply(uint32_t a, uint32_t b) {
282+
static uint32_t crc32c_multiply(uint32_t a, uint32_t b) {
283283
uint32_t product = 0;
284284
uint32_t b_pow_x_table[D + 1]; // b_pow_x_table[k] = (b * x**k) mod P
285285
b_pow_x_table[0] = b;
@@ -303,7 +303,7 @@ uint32_t crc32c_multiply(uint32_t a, uint32_t b) {
303303
#undef P
304304

305305
// A. Kadatch and B. Jenkins / Everything we know about CRC but afraid to forget September 3, 2010 9
306-
void crc32c_init_pow_2k(void) {
306+
static void crc32c_init_pow_2k(void) {
307307
// _crc32c_pow_2k_table(0) =
308308
// x^(2^k) mod P(x) = x mod P(x) = x
309309
// Since we are operating on a reflected values
@@ -318,7 +318,7 @@ void crc32c_init_pow_2k(void) {
318318
}
319319

320320
// x^N mod P(x)
321-
uint32_t crc32c_f_pow_n(uint32_t n) {
321+
static uint32_t crc32c_f_pow_n(uint32_t n) {
322322
// result = 1 (polynomial)
323323
uint32_t one, result = 0x80000000, i = 0;
324324

src/hotspot/cpu/x86/x86.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
13581358
return offset;
13591359
}
13601360

1361-
Assembler::Width widthForType(BasicType bt) {
1361+
static Assembler::Width widthForType(BasicType bt) {
13621362
if (bt == T_BYTE) {
13631363
return Assembler::B;
13641364
} else if (bt == T_SHORT) {

src/hotspot/cpu/x86/x86_32.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void emit_cmpfp_fixup(MacroAssembler& _masm) {
504504
__ bind(exit);
505505
}
506506

507-
void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
507+
static void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
508508
Label done;
509509
__ movl(dst, -1);
510510
__ jcc(Assembler::parity, done);

src/hotspot/cpu/x86/x86_64.ad

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
519519
}
520520

521521
// This could be in MacroAssembler but it's fairly C2 specific
522-
void emit_cmpfp_fixup(MacroAssembler& _masm) {
522+
static void emit_cmpfp_fixup(MacroAssembler& _masm) {
523523
Label exit;
524524
__ jccb(Assembler::noParity, exit);
525525
__ pushf();
@@ -539,7 +539,7 @@ void emit_cmpfp_fixup(MacroAssembler& _masm) {
539539
__ bind(exit);
540540
}
541541

542-
void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
542+
static void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
543543
Label done;
544544
__ movl(dst, -1);
545545
__ jcc(Assembler::parity, done);
@@ -558,10 +558,10 @@ void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
558558
// je #
559559
// |-jz -> a | b # a & b
560560
// | -> a #
561-
void emit_fp_min_max(MacroAssembler& _masm, XMMRegister dst,
562-
XMMRegister a, XMMRegister b,
563-
XMMRegister xmmt, Register rt,
564-
bool min, bool single) {
561+
static void emit_fp_min_max(MacroAssembler& _masm, XMMRegister dst,
562+
XMMRegister a, XMMRegister b,
563+
XMMRegister xmmt, Register rt,
564+
bool min, bool single) {
565565

566566
Label nan, zero, below, above, done;
567567

0 commit comments

Comments
 (0)