Remove comments about manually saving callee-saved registers.

Even though Cretonne doesn't implement callee-saved registers yet,
it will, so we shouldn't need manual save/restore code when calling it.
This commit is contained in:
Dan Gohman
2017-09-22 16:17:08 -07:00
parent 4c5f584d01
commit ecd746718b

View File

@@ -142,33 +142,8 @@ pub fn execute(exec: &ExecutableCode) -> Result<(), String> {
// the Rust ABI for calling a function with no arguments and no return matches the one of // the Rust ABI for calling a function with no arguments and no return matches the one of
// the generated code.Thanks to this, we can transmute the code region into a first-class // the generated code.Thanks to this, we can transmute the code region into a first-class
// Rust function and call it. // Rust function and call it.
// TODO: the Rust callee-saved registers will be overwritten by the executed code, inline
// assembly spilling these registers to the stack and restoring them after the call is
// needed.
let start_func = transmute::<_, fn()>(code_buf.as_ptr()); let start_func = transmute::<_, fn()>(code_buf.as_ptr());
// The code below saves the Intel callee-saved registers. It is not activate because
// inline ASM is not supported in the release version of the Rust compiler.
/*asm!("push rax
push rcx
push rdx
push rsi
push rdi
push r8
push r9
push r10
push r11
" :::: "intel", "volatile");*/
start_func(); start_func();
/*asm!("pop r11
pop r10
pop r9
pop r8
pop rdi
pop rsi
pop rdx
pop rcx
pop rax
" :::: "intel", "volatile");*/
Ok(()) Ok(())
} }
} }