Commit 13e0f399 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Move get_thread_local into exception restores' body

parent 188e7acc
Pipeline #1285 failed with stages
in 3 minutes and 19 seconds
......@@ -133,7 +133,7 @@ pub extern "C" fn throw_exception_internal(exception_obj: Address, frame_cursor:
}
// The above loop will only exit when a catch block is found, so restore to it
unsafe {
thread::exception_restore(catch_address, frame_cursor.to_ptr(), sp, thread::muentry_get_thread_local());
thread::exception_restore(catch_address, frame_cursor.to_ptr(), spl)
}
}
......
......@@ -34,13 +34,23 @@ begin_func muentry_throw_exception
# won't return
end_func muentry_throw_exception
# exception_restore(dest: Address, frame_cursor: *const Word, sp: Address, mu_tls: Address) -> !
# X0 X1 X2 X3
# exception_restore(dest: Address, frame_cursor: *const Word, sp: Address) -> !
# X0 X1 X2
begin_func exception_restore
// Load mu tls value
MOV X28, X3
// Move argument regs to callee saved
MOV X25, X0
MOV X26, X1
MOV X27, X2
// Load mu_tls value
BL muentry_get_thread_local
MOV X28, X0
MOV SP, X27 // SP = sp
MOV X0, X25 // X0 = dest
SUB X1, X26, #144 // Skip to the bottom of the frame cursor
SUB X1, X1, #144 // Skip to the bottom of the frame cursor
// load each callee saved register relative to the stack pointer
pop_pair D15, D14, 0, X1
pop_pair D13, D12, 1, X1
......@@ -55,7 +65,6 @@ begin_func exception_restore
ADD X1, X1, #144 // Skip to the top of the frame cursor
LDP FP, LR, [X1], #16
MOV SP, X2
BR X0
end_func exception_restore
......
......@@ -398,7 +398,7 @@ extern "C" {
/// dest: code address to execute (catch block)
/// callee_saved: a sequence of value that will be restored in order
/// sp: stack pointer for the new execution
pub fn exception_restore(dest: Address, callee_saved: *const Word, sp: Address, mu_tls: Address) -> !;
pub fn exception_restore(dest: Address, callee_saved: *const Word, sp: Address) -> !;
}
#[cfg(not(feature = "sel4-rumprun-target-side"))]
......@@ -429,7 +429,7 @@ extern "C" {
#[allow(dead_code)]
fn muentry_swap_back_to_native_stack(sp_loc: Address);
pub fn get_current_frame_bp() -> Address;
pub fn exception_restore(dest: Address, callee_saved: *const Word, sp: Address, mu_tls: Address) -> !;
pub fn exception_restore(dest: Address, callee_saved: *const Word, sp: Address) -> !;
}
#[cfg(feature = "sel4-rumprun-target-side")]
......
......@@ -30,7 +30,7 @@ def test_PyPy():
flags = ['-O3', '--no-shared', '--backend=mu', '--mu-impl=zebu',
'--mu-vmargs', '--gc-immixspace-size=10737418240', '--mu-suplibdir=%(bin_dir)s' % globals()]
# flags = ['-O3', '--no-shared', '--backend=c', '--no-profopt']
args = ['--no-allworkingmodules']
args = ['--pybenchmodules']
cmd.extend(flags)
cmd.extend(['--output=%s' % target])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment