• Keith Randall's avatar
    runtime: tail call into memeq/cmp body implementations · c526f3ac
    Keith Randall authored
    There's no need to call/ret to the body implementation.
    It can write the result to the right place.  Just jump to
    it and have it return to our caller.
    
    Old:
      call body implementation
      compute result
      put result in a register
      return
      write register to result location
      return
    
    New:
      load address of result location into a register
      jump to body implementation
      compute result
      write result to passed-in address
      return
    
    It's a bit tricky on 386 because there is no free register
    with which to pass the result location.  Free up a register
    by keeping around blen-alen instead of both alen and blen.
    
    Change-Id: If2cf0682a5bf1cc592bdda7c126ed4eee8944fba
    Reviewed-on: https://go-review.googlesource.com/9202Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
    c526f3ac
asm_amd64.s 38.1 KB