Skip to content

Commit 08d5100

Browse files
committed
8332724: x86 MacroAssembler may over-align code
Reviewed-by: dlong, kvn
1 parent 97ee2ff commit 08d5100

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/hotspot/cpu/x86/assembler_x86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3918,7 +3918,7 @@ void Assembler::negl(Address dst) {
39183918
emit_operand(as_Register(3), dst, 0);
39193919
}
39203920

3921-
void Assembler::nop(int i) {
3921+
void Assembler::nop(uint i) {
39223922
#ifdef ASSERT
39233923
assert(i > 0, " ");
39243924
// The fancy nops aren't currently recognized by debuggers making it a

src/hotspot/cpu/x86/assembler_x86.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ class Assembler : public AbstractAssembler {
18001800
void negq(Address dst);
18011801
#endif
18021802

1803-
void nop(int i = 1);
1803+
void nop(uint i = 1);
18041804

18051805
void notl(Register dst);
18061806

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,20 +1150,20 @@ void MacroAssembler::addpd(XMMRegister dst, AddressLiteral src, Register rscratc
11501150
// Stub code is generated once and never copied.
11511151
// NMethods can't use this because they get copied and we can't force alignment > 32 bytes.
11521152
void MacroAssembler::align64() {
1153-
align(64, (unsigned long long) pc());
1153+
align(64, (uint)(uintptr_t)pc());
11541154
}
11551155

11561156
void MacroAssembler::align32() {
1157-
align(32, (unsigned long long) pc());
1157+
align(32, (uint)(uintptr_t)pc());
11581158
}
11591159

1160-
void MacroAssembler::align(int modulus) {
1160+
void MacroAssembler::align(uint modulus) {
11611161
// 8273459: Ensure alignment is possible with current segment alignment
1162-
assert(modulus <= CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment");
1162+
assert(modulus <= (uintx)CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment");
11631163
align(modulus, offset());
11641164
}
11651165

1166-
void MacroAssembler::align(int modulus, int target) {
1166+
void MacroAssembler::align(uint modulus, uint target) {
11671167
if (target % modulus != 0) {
11681168
nop(modulus - (target % modulus));
11691169
}

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ class MacroAssembler: public Assembler {
213213
// Alignment
214214
void align32();
215215
void align64();
216-
void align(int modulus);
217-
void align(int modulus, int target);
216+
void align(uint modulus);
217+
void align(uint modulus, uint target);
218218

219219
void post_call_nop();
220220
// A 5 byte nop that is safe for patching (see patch_verified_entry)

0 commit comments

Comments
 (0)