YJIT: Avoid a register spill on arm64 (#9014)

This commit is contained in:
Takashi Kokubun 2023-11-22 15:13:32 -08:00 коммит произвёл GitHub
Родитель 5672fb63d2
Коммит 926bfc3bc0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -4244,3 +4244,10 @@ assert_equal 'true', %q{
def entry = yield def entry = yield
entry { true } entry { true }
} }
assert_normal_exit %q{
ivars = 1024.times.map { |i| "@iv_#{i} = #{i}\n" }.join
Foo = Class.new
Foo.class_eval "def initialize() #{ivars} end"
Foo.new
}

Просмотреть файл

@ -564,6 +564,7 @@ impl Assembler
// If we're attempting to load into a memory operand, then // If we're attempting to load into a memory operand, then
// we'll switch over to the store instruction. // we'll switch over to the store instruction.
(Opnd::Mem(_), _) => { (Opnd::Mem(_), _) => {
let opnd0 = split_memory_address(asm, *dest);
let value = match *src { let value = match *src {
// If the first operand is zero, then we can just use // If the first operand is zero, then we can just use
// the zero register. // the zero register.
@ -579,7 +580,6 @@ impl Assembler
_ => split_bitmask_immediate(asm, *src, dest.rm_num_bits()) _ => split_bitmask_immediate(asm, *src, dest.rm_num_bits())
}; };
let opnd0 = split_memory_address(asm, *dest);
asm.store(opnd0, value); asm.store(opnd0, value);
}, },
// If we're loading a memory operand into a register, then // If we're loading a memory operand into a register, then