8332724: x86 MacroAssembler may over-align code

Reviewed-by: dlong, kvn
This commit is contained in:
Daniel Jeliński 2024-05-27 05:23:26 +00:00
parent 97ee2ffb89
commit 08d51003d1
4 changed files with 9 additions and 9 deletions

View File

@ -3918,7 +3918,7 @@ void Assembler::negl(Address dst) {
emit_operand(as_Register(3), dst, 0);
}
void Assembler::nop(int i) {
void Assembler::nop(uint i) {
#ifdef ASSERT
assert(i > 0, " ");
// The fancy nops aren't currently recognized by debuggers making it a

View File

@ -1800,7 +1800,7 @@ private:
void negq(Address dst);
#endif
void nop(int i = 1);
void nop(uint i = 1);
void notl(Register dst);

View File

@ -1150,20 +1150,20 @@ void MacroAssembler::addpd(XMMRegister dst, AddressLiteral src, Register rscratc
// Stub code is generated once and never copied.
// NMethods can't use this because they get copied and we can't force alignment > 32 bytes.
void MacroAssembler::align64() {
align(64, (unsigned long long) pc());
align(64, (uint)(uintptr_t)pc());
}
void MacroAssembler::align32() {
align(32, (unsigned long long) pc());
align(32, (uint)(uintptr_t)pc());
}
void MacroAssembler::align(int modulus) {
void MacroAssembler::align(uint modulus) {
// 8273459: Ensure alignment is possible with current segment alignment
assert(modulus <= CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment");
assert(modulus <= (uintx)CodeEntryAlignment, "Alignment must be <= CodeEntryAlignment");
align(modulus, offset());
}
void MacroAssembler::align(int modulus, int target) {
void MacroAssembler::align(uint modulus, uint target) {
if (target % modulus != 0) {
nop(modulus - (target % modulus));
}

View File

@ -213,8 +213,8 @@ class MacroAssembler: public Assembler {
// Alignment
void align32();
void align64();
void align(int modulus);
void align(int modulus, int target);
void align(uint modulus);
void align(uint modulus, uint target);
void post_call_nop();
// A 5 byte nop that is safe for patching (see patch_verified_entry)