RFR: 8293618: x86: Wrong code generation in class Assembler
Quan Anh Mai
duke at openjdk.org
Thu Sep 22 07:28:16 UTC 2022
On Thu, 22 Sep 2022 07:05:09 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Hi,
>>
>> This patch fixes some issues in the code generation of x86 assembler:
>>
>> - `Assembler::testl` misses `prefix(dst)`
>> - `Assembler::addw` misses the 0x66 prefix
>> - `Assembler::emit_operand` needs the length of the instruction from the address operand, this is often forgotten, making this parameter explicit to prevent potential issues
>> - The assembler should not do optimisations that change the actual emitted instructions, these should be moved to `MacroAssembler` instead
>>
>> AFAICT there is no failure due to these mistakes. Please take a look and give reviews.
>> Thanks you very much.
>
> src/hotspot/cpu/x86/assembler_x86.cpp line 351:
>
>> 349: }
>> 350:
>> 351: void Assembler::emit_arith_operand_imm32(int op1, Register rm, Address adr, int32_t imm32) {
>
> Why is this needed?
@TobiHartmann Thanks for taking a look, method entry barrier needs a 4-byte immediate so it can be patched. This method is used in `Assembler::cmpl_imm32`
-------------
PR: https://git.openjdk.org/jdk/pull/10240
More information about the hotspot-dev
mailing list