Skip to content

Commit 4fe99da

Browse files
afshin-zafariJesperIRL
authored andcommitted
8151413: os::allocation_granularity/page_size and friends return signed values
Reviewed-by: stefank, ccheung, ysr
1 parent 09b8a19 commit 4fe99da

File tree

66 files changed

+165
-163
lines changed

Some content is hidden

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

66 files changed

+165
-163
lines changed

src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
108108
// significant 2 bits cleared and page_size is a power of 2
109109
mov(rscratch1, sp);
110110
sub(hdr, hdr, rscratch1);
111-
ands(hdr, hdr, aligned_mask - os::vm_page_size());
111+
ands(hdr, hdr, aligned_mask - (int)os::vm_page_size());
112112
// for recursive locking, the result is zero => save it in the displaced header
113113
// location (NULL in the displaced hdr location indicates recursive locking)
114114
str(hdr, Address(disp_hdr, 0));

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2023, 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
*
@@ -802,7 +802,7 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg)
802802
// copy
803803
mov(rscratch1, sp);
804804
sub(swap_reg, swap_reg, rscratch1);
805-
ands(swap_reg, swap_reg, (uint64_t)(7 - os::vm_page_size()));
805+
ands(swap_reg, swap_reg, (uint64_t)(7 - (int)os::vm_page_size()));
806806

807807
// Save the test result, for recursive case, the result is zero
808808
str(swap_reg, Address(lock_reg, mark_offset));

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -4577,9 +4577,9 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
45774577
// Bang one page at a time because large size can bang beyond yellow and
45784578
// red zones.
45794579
Label loop;
4580-
mov(rscratch1, os::vm_page_size());
4580+
mov(rscratch1, (int)os::vm_page_size());
45814581
bind(loop);
4582-
lea(tmp, Address(tmp, -os::vm_page_size()));
4582+
lea(tmp, Address(tmp, -(int)os::vm_page_size()));
45834583
subsw(size, size, rscratch1);
45844584
str(size, Address(tmp));
45854585
br(Assembler::GT, loop);
@@ -4590,10 +4590,10 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
45904590
// was post-decremented.) Skip this address by starting at i=1, and
45914591
// touch a few more pages below. N.B. It is important to touch all
45924592
// the way down to and including i=StackShadowPages.
4593-
for (int i = 0; i < (int)(StackOverflow::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) {
4593+
for (int i = 0; i < (int)(StackOverflow::stack_shadow_zone_size() / (int)os::vm_page_size()) - 1; i++) {
45944594
// this could be any sized move but this is can be a debugging crumb
45954595
// so the bigger the better.
4596-
lea(tmp, Address(tmp, -os::vm_page_size()));
4596+
lea(tmp, Address(tmp, -(int)os::vm_page_size()));
45974597
str(size, Address(tmp));
45984598
}
45994599
}

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
17981798

17991799
__ sub(swap_reg, sp, swap_reg);
18001800
__ neg(swap_reg, swap_reg);
1801-
__ ands(swap_reg, swap_reg, 3 - os::vm_page_size());
1801+
__ ands(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
18021802

18031803
// Save the test result, for recursive case, the result is zero
18041804
__ str(swap_reg, Address(lock_reg, mark_word_offset));

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
655655
const int overhead_size =
656656
-(frame::interpreter_frame_initial_sp_offset * wordSize) + entry_size;
657657

658-
const int page_size = os::vm_page_size();
658+
const size_t page_size = os::vm_page_size();
659659

660660
Label after_frame_check;
661661

@@ -1063,7 +1063,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
10631063
// See more discussion in stackOverflow.hpp.
10641064

10651065
const int shadow_zone_size = checked_cast<int>(StackOverflow::stack_shadow_zone_size());
1066-
const int page_size = os::vm_page_size();
1066+
const int page_size = (int)os::vm_page_size();
10671067
const int n_shadow_pages = shadow_zone_size / page_size;
10681068

10691069
#ifdef ASSERT

src/hotspot/cpu/arm/macroAssembler_arm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ void MacroAssembler::zero_memory(Register start, Register end, Register tmp) {
970970

971971
void MacroAssembler::arm_stack_overflow_check(int frame_size_in_bytes, Register tmp) {
972972
// Version of AbstractAssembler::generate_stack_overflow_check optimized for ARM
973-
const int page_size = os::vm_page_size();
973+
const int page_size = (int)os::vm_page_size();
974974

975975
sub_slow(tmp, SP, StackOverflow::stack_shadow_zone_size());
976976
strb(R0, Address(tmp));

src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2018 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*

src/hotspot/cpu/ppc/gc/z/zGlobals_ppc.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -107,7 +107,7 @@ static unsigned int probe_valid_max_address_bit(size_t init_bit, size_t min_bit)
107107
unsigned int max_valid_address_bit = 0;
108108
void* last_allocatable_address = nullptr;
109109

110-
const unsigned int page_size = os::vm_page_size();
110+
const size_t page_size = os::vm_page_size();
111111

112112
for (size_t i = init_bit; i >= min_bit; --i) {
113113
void* base_addr = (void*) (((unsigned long) 1U) << i);

src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,8 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
11621162
// Bang each page in the shadow zone. We can't assume it's been done for
11631163
// an interpreter frame with greater than a page of locals, so each page
11641164
// needs to be checked. Only true for non-native.
1165-
const int page_size = os::vm_page_size();
1166-
const int n_shadow_pages = ((int)StackOverflow::stack_shadow_zone_size()) / page_size;
1165+
const size_t page_size = os::vm_page_size();
1166+
const int n_shadow_pages = StackOverflow::stack_shadow_zone_size() / page_size;
11671167
const int start_page = native_call ? n_shadow_pages : 1;
11681168
BLOCK_COMMENT("bang_stack_shadow_pages:");
11691169
for (int pages = start_page; pages <= n_shadow_pages; pages++) {

src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,7 +96,7 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
9696
// assuming both the stack pointer and page_size have their least
9797
// significant 2 bits cleared and page_size is a power of 2
9898
sub(hdr, hdr, sp);
99-
mv(t0, aligned_mask - os::vm_page_size());
99+
mv(t0, aligned_mask - (int)os::vm_page_size());
100100
andr(hdr, hdr, t0);
101101
// for recursive locking, the result is zero => save it in the displaced header
102102
// location (NULL in the displaced hdr location indicates recursive locking)

src/hotspot/cpu/riscv/interp_masm_riscv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
44
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -831,7 +831,7 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg)
831831
// least significant 3 bits clear.
832832
// NOTE: the oopMark is in swap_reg x10 as the result of cmpxchg
833833
sub(swap_reg, swap_reg, sp);
834-
mv(t0, (int64_t)(7 - os::vm_page_size()));
834+
mv(t0, (int64_t)(7 - (int)os::vm_page_size()));
835835
andr(swap_reg, swap_reg, t0);
836836

837837
// Save the test result, for recursive case, the result is zero

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
19331933
// Bang stack for total size given plus shadow page size.
19341934
// Bang one page at a time because large size can bang beyond yellow and
19351935
// red zones.
1936-
mv(t0, os::vm_page_size());
1936+
mv(t0, (int)os::vm_page_size());
19371937
Label loop;
19381938
bind(loop);
19391939
sub(tmp, sp, t0);
@@ -1947,10 +1947,10 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
19471947
// was post-decremented.) Skip this address by starting at i=1, and
19481948
// touch a few more pages below. N.B. It is important to touch all
19491949
// the way down to and including i=StackShadowPages.
1950-
for (int i = 0; i < (int)(StackOverflow::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) {
1950+
for (int i = 0; i < (int)(StackOverflow::stack_shadow_zone_size() / (int)os::vm_page_size()) - 1; i++) {
19511951
// this could be any sized move but this is can be a debugging crumb
19521952
// so the bigger the better.
1953-
sub(tmp, tmp, os::vm_page_size());
1953+
sub(tmp, tmp, (int)os::vm_page_size());
19541954
sd(size, Address(tmp, 0));
19551955
}
19561956
}

src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
16921692
// NOTE: the oopMark is in swap_reg % 10 as the result of cmpxchg
16931693

16941694
__ sub(swap_reg, swap_reg, sp);
1695-
__ andi(swap_reg, swap_reg, 3 - os::vm_page_size());
1695+
__ andi(swap_reg, swap_reg, 3 - (int)os::vm_page_size());
16961696

16971697
// Save the test result, for recursive case, the result is zero
16981698
__ sd(swap_reg, Address(lock_reg, mark_word_offset));

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
602602
const int overhead_size =
603603
-(frame::interpreter_frame_initial_sp_offset * wordSize) + entry_size;
604604

605-
const int page_size = os::vm_page_size();
605+
const int page_size = (int)os::vm_page_size();
606606

607607
Label after_frame_check;
608608

@@ -889,7 +889,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
889889
// See more discussion in stackOverflow.hpp.
890890

891891
const int shadow_zone_size = checked_cast<int>(StackOverflow::stack_shadow_zone_size());
892-
const int page_size = os::vm_page_size();
892+
const int page_size = (int)os::vm_page_size();
893893
const int n_shadow_pages = shadow_zone_size / page_size;
894894

895895
#ifdef ASSERT

src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016, 2020 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -787,7 +787,7 @@ void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue)
787787

788788
void TemplateInterpreterGenerator::generate_stack_overflow_check(Register frame_size, Register tmp1) {
789789
Register tmp2 = Z_R1_scratch;
790-
const int page_size = os::vm_page_size();
790+
const int page_size = (int)os::vm_page_size();
791791
NearLabel after_frame_check;
792792

793793
BLOCK_COMMENT("stack_overflow_check {");
@@ -2020,7 +2020,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
20202020
// Bang each page in the shadow zone. We can't assume it's been done for
20212021
// an interpreter frame with greater than a page of locals, so each page
20222022
// needs to be checked. Only true for non-native. For native, we only bang the last page.
2023-
const int page_size = os::vm_page_size();
2023+
const size_t page_size = os::vm_page_size();
20242024
const int n_shadow_pages = (int)(StackOverflow::stack_shadow_zone_size()/page_size);
20252025
const int start_page_num = native_call ? n_shadow_pages : 1;
20262026
for (int pages = start_page_num; pages <= n_shadow_pages; pages++) {

src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2023, 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
@@ -87,7 +87,7 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
8787
// assuming both the stack pointer and page_size have their least
8888
// significant 2 bits cleared and page_size is a power of 2
8989
subptr(hdr, rsp);
90-
andptr(hdr, aligned_mask - os::vm_page_size());
90+
andptr(hdr, aligned_mask - (int)os::vm_page_size());
9191
// for recursive locking, the result is zero => save it in the displaced header
9292
// location (NULL in the displaced hdr location indicates recursive locking)
9393
movptr(Address(disp_hdr, 0), hdr);

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp
613613
// Locked by current thread if difference with current SP is less than one page.
614614
subptr(tmpReg, rsp);
615615
// Next instruction set ZFlag == 1 (Success) if difference is less then one page.
616-
andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) );
616+
andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - (int)os::vm_page_size())) );
617617
movptr(Address(boxReg, 0), tmpReg);
618618
} else {
619619
// Clear ZF so that we take the slow path at the DONE label. objReg is known to be not 0.
@@ -2784,8 +2784,8 @@ void C2_MacroAssembler::string_indexof(Register str1, Register str2,
27842784
// since heaps are aligned and mapped by pages.
27852785
assert(os::vm_page_size() < (int)G, "default page should be small");
27862786
movl(result, str2); // We need only low 32 bits
2787-
andl(result, (os::vm_page_size()-1));
2788-
cmpl(result, (os::vm_page_size()-16));
2787+
andl(result, ((int)os::vm_page_size()-1));
2788+
cmpl(result, ((int)os::vm_page_size()-16));
27892789
jccb(Assembler::belowEqual, CHECK_STR);
27902790

27912791
// Move small strings to stack to allow load 16 bytes into vec.
@@ -2814,8 +2814,8 @@ void C2_MacroAssembler::string_indexof(Register str1, Register str2,
28142814

28152815
// Check cross page boundary.
28162816
movl(result, str1); // We need only low 32 bits
2817-
andl(result, (os::vm_page_size()-1));
2818-
cmpl(result, (os::vm_page_size()-16));
2817+
andl(result, ((int)os::vm_page_size()-1));
2818+
cmpl(result, ((int)os::vm_page_size()-16));
28192819
jccb(Assembler::belowEqual, BIG_STRINGS);
28202820

28212821
subptr(rsp, 16);

src/hotspot/cpu/x86/interp_masm_x86.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2023, 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
@@ -1269,7 +1269,7 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg) {
12691269
// least significant bits clear.
12701270
// NOTE: the mark is in swap_reg %rax as the result of cmpxchg
12711271
subptr(swap_reg, rsp);
1272-
andptr(swap_reg, zero_bits - os::vm_page_size());
1272+
andptr(swap_reg, zero_bits - (int)os::vm_page_size());
12731273

12741274
// Save the test result, for recursive case, the result is zero
12751275
movptr(Address(lock_reg, mark_offset), swap_reg);

src/hotspot/cpu/x86/macroAssembler_x86.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1273,9 +1273,9 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
12731273
// red zones.
12741274
Label loop;
12751275
bind(loop);
1276-
movl(Address(tmp, (-os::vm_page_size())), size );
1277-
subptr(tmp, os::vm_page_size());
1278-
subl(size, os::vm_page_size());
1276+
movl(Address(tmp, (-(int)os::vm_page_size())), size );
1277+
subptr(tmp, (int)os::vm_page_size());
1278+
subl(size, (int)os::vm_page_size());
12791279
jcc(Assembler::greater, loop);
12801280

12811281
// Bang down shadow pages too.
@@ -1284,10 +1284,10 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
12841284
// was post-decremented.) Skip this address by starting at i=1, and
12851285
// touch a few more pages below. N.B. It is important to touch all
12861286
// the way down including all pages in the shadow zone.
1287-
for (int i = 1; i < ((int)StackOverflow::stack_shadow_zone_size() / os::vm_page_size()); i++) {
1287+
for (int i = 1; i < ((int)StackOverflow::stack_shadow_zone_size() / (int)os::vm_page_size()); i++) {
12881288
// this could be any sized move but this is can be a debugging crumb
12891289
// so the bigger the better.
1290-
movptr(Address(tmp, (-i*os::vm_page_size())), size );
1290+
movptr(Address(tmp, (-i*(int)os::vm_page_size())), size );
12911291
}
12921292
}
12931293

src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2023, 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
@@ -1702,7 +1702,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
17021702
// NOTE: the oopMark is in swap_reg %rax, as the result of cmpxchg
17031703

17041704
__ subptr(swap_reg, rsp);
1705-
__ andptr(swap_reg, 3 - os::vm_page_size());
1705+
__ andptr(swap_reg, 3 - (int)os::vm_page_size());
17061706

17071707
// Save the test result, for recursive case, the result is zero
17081708
__ movptr(Address(lock_reg, mark_word_offset), swap_reg);

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2023, 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
@@ -2172,7 +2172,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
21722172
// NOTE: the oopMark is in swap_reg %rax as the result of cmpxchg
21732173

21742174
__ subptr(swap_reg, rsp);
2175-
__ andptr(swap_reg, 3 - os::vm_page_size());
2175+
__ andptr(swap_reg, 3 - (int)os::vm_page_size());
21762176

21772177
// Save the test result, for recursive case, the result is zero
21782178
__ movptr(Address(lock_reg, mark_word_offset), swap_reg);

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
480480
const int overhead_size =
481481
-(frame::interpreter_frame_initial_sp_offset * wordSize) + entry_size;
482482

483-
const int page_size = os::vm_page_size();
483+
const int page_size = (int)os::vm_page_size();
484484

485485
Label after_frame_check;
486486

@@ -732,7 +732,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
732732
// method receiver, so do the banging after locking the receiver.)
733733

734734
const int shadow_zone_size = checked_cast<int>(StackOverflow::stack_shadow_zone_size());
735-
const int page_size = os::vm_page_size();
735+
const int page_size = (int)os::vm_page_size();
736736
const int n_shadow_pages = shadow_zone_size / page_size;
737737

738738
const Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread);

src/hotspot/os/aix/os_aix.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1772,10 +1772,10 @@ void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
17721772
bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
17731773

17741774
assert(is_aligned_to(addr, os::vm_page_size()),
1775-
"addr " PTR_FORMAT " not aligned to vm_page_size (" PTR_FORMAT ")",
1775+
"addr " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
17761776
p2i(addr), os::vm_page_size());
17771777
assert(is_aligned_to(size, os::vm_page_size()),
1778-
"size " PTR_FORMAT " not aligned to vm_page_size (" PTR_FORMAT ")",
1778+
"size " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
17791779
size, os::vm_page_size());
17801780

17811781
vmembk_t* const vmi = vmembk_find(addr);
@@ -1807,10 +1807,10 @@ void os::pd_commit_memory_or_exit(char* addr, size_t size,
18071807

18081808
bool os::pd_uncommit_memory(char* addr, size_t size, bool exec) {
18091809
assert(is_aligned_to(addr, os::vm_page_size()),
1810-
"addr " PTR_FORMAT " not aligned to vm_page_size (" PTR_FORMAT ")",
1810+
"addr " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
18111811
p2i(addr), os::vm_page_size());
18121812
assert(is_aligned_to(size, os::vm_page_size()),
1813-
"size " PTR_FORMAT " not aligned to vm_page_size (" PTR_FORMAT ")",
1813+
"size " PTR_FORMAT " not aligned to vm_page_size (" SIZE_FORMAT ")",
18141814
size, os::vm_page_size());
18151815

18161816
// Dynamically do different things for mmap/shmat.
@@ -2215,7 +2215,7 @@ extern "C" {
22152215
}
22162216
}
22172217

2218-
static void set_page_size(int page_size) {
2218+
static void set_page_size(size_t page_size) {
22192219
OSInfo::set_vm_page_size(page_size);
22202220
OSInfo::set_vm_allocation_granularity(page_size);
22212221
}

0 commit comments

Comments
 (0)