]> Cypherpunks repositories - gostls13.git/commit
runtime: tail call into memeq/cmp body implementations
authorKeith Randall <khr@golang.org>
Tue, 21 Apr 2015 21:22:41 +0000 (14:22 -0700)
committerKeith Randall <khr@golang.org>
Wed, 29 Apr 2015 04:46:25 +0000 (04:46 +0000)
commitc526f3ac1099fef117a385d0336860cacde6b257
treead4fd02e6e3ef20e5231cea83b12c0f896a959ae
parent7e49c8193c27e59935aafea4ebee0c2416831e4a
runtime: tail call into memeq/cmp body implementations

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/9202
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_arm.s
src/runtime/asm_arm64.s