mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
Define constants for magic registers
This commit is contained in:
parent
783f730773
commit
5db2ef5e14
2 changed files with 16 additions and 11 deletions
|
@ -7,7 +7,7 @@ module RubyVM::MJIT
|
|||
# @param ctx [RubyVM::MJIT::Context]
|
||||
# @param asm [RubyVM::MJIT::X86Assembler]
|
||||
def putnil(ctx, asm)
|
||||
asm.mov([:rbx], Qnil)
|
||||
asm.mov([SP], Qnil)
|
||||
ctx.stack_size += 1
|
||||
KeepCompiling
|
||||
end
|
||||
|
@ -19,14 +19,14 @@ module RubyVM::MJIT
|
|||
# TODO: Check interrupts
|
||||
|
||||
# Pop the current frame (ec->cfp++)
|
||||
asm.add(:rsi, C.rb_control_frame_t.size) # rsi = cfp + 1
|
||||
asm.mov([:rdi, C.rb_execution_context_t.offsetof(:cfp)], :rsi) # ec->cfp = rsi
|
||||
asm.add(CFP, C.rb_control_frame_t.size) # cfp = cfp + 1
|
||||
asm.mov([EC, C.rb_execution_context_t.offsetof(:cfp)], CFP) # ec->cfp = cfp
|
||||
|
||||
# Return a value
|
||||
asm.mov(:rax, [:rbx])
|
||||
asm.mov(:rax, [SP])
|
||||
|
||||
# Restore callee-saved registers
|
||||
asm.pop(:rbx)
|
||||
asm.pop(SP)
|
||||
|
||||
asm.ret
|
||||
EndBlock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue