Skip to content

Instantly share code, notes, and snippets.

@garazdawi
Created February 21, 2012 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garazdawi/1875718 to your computer and use it in GitHub Desktop.
Save garazdawi/1875718 to your computer and use it in GitHub Desktop.
## Initial assembly
lbl_sum0: i_func_info_IaaI 0 sum sum 2
i_is_eq_exact_immed_frc f(lbl_sum1) x(0) 0
move_return_xr x(1) x(0)
lbl_sum1: is_tuple_of_arity_fxA f(lbl_sum0) x(1) 2
extract_next_element2_x x(2)
i_is_eq_exact_immed_fxc f(lbl_sum0) x(2) s
i_fetch_rc x(0) 1
i_minus_jId j(0000000000000000) 4 x(1)
i_fetch_xr x(3) x(0)
i_plus_jId j(0000000000000000) 4 x(0)
test_heap_It 3 4
i_put_tuple_xI x(2) 2 s x(0)
move_xr x(1) x(0)
move_xx x(2) x(1)
i_call_only_f lbl_sum0
## Traced
lbl_sum0: i_is_ne_exact_immed_frc f(ABORT_JIT) x(0) 0
is_tuple_of_arity_fxA f(ABORT_JIT) x(1) 2
extract_next_element2_x x(2)
i_is_eq_exact_immed_fxc f(ABORT_JIT) x(2) s
i_fetch_rc x(0) 1
i_minus_jId j(0000000000000000) 4 x(1)
i_fetch_xr x(3) x(0)
i_plus_jId j(0000000000000000) 4 x(0)
test_heap_It 3 4
i_put_tuple_xI x(2) 2 s x(0)
move_xr x(1) x(0)
move_xx x(2) x(1)
i_call_only_f lbl_sum0
## Escape analysis loop shifting
lbl_sum0: i_is_ne_exact_immed_frc f(ABORT_JIT) x(0) 0
is_tuple_of_arity_fxA f(ABORT_JIT) x(1) 2
extract_next_element2_x x(2)
i_is_eq_exact_immed_fxc f(ABORT_JIT) x(2) s
lbl_sum1 i_fetch_rc x(0) 1
i_minus_jId j(0000000000000000) 4 x(1)
i_fetch_xr x(3) x(0)
i_plus_jId j(0000000000000000) 4 x(0)
test_heap_It 3 4
i_put_tuple_xI x(2) 2 s x(0)
move_xr x(1) x(0)
move_xx x(2) x(1)
i_is_ne_exact_immed_frc f(ABORT_JIT) x(0) 0
is_tuple_of_arity_fxA f(ABORT_JIT) x(1) 2
extract_next_element2_x x(2)
i_is_eq_exact_immed_fxc f(ABORT_JIT) x(2) s
i_call_only_f lbl_sum1
## Optimizations after frame shift
lbl_sum0: i_is_ne_exact_immed_frc f(ABORT_JIT) x(0) 0
is_tuple_of_arity_fxA f(ABORT_JIT) x(1) 2
extract_next_element2_x x(2)
i_is_eq_exact_immed_fxc f(ABORT_JIT) x(2) s
lbl_sum1: i_fetch_rc x(0) 1
i_minus_jId j(0000000000000000) 4 x(1)
i_fetch_xr x(3) x(0)
i_plus_jId j(0000000000000000) 4 x(3)
move_xx x(1) x(0)
i_is_ne_exact_immed_frc f(lbl_restore) x(0) 0
i_call_only_f lbl_sum1
lbl_restore: test_heap_It 3 4
i_put_tuple_xI x(2) 2 s x(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment