Avoid DV initializer loop in prologues for small number of DVs
commitb978890b9bd9b8ca196a964956ed2da7c44357ce
authorGuilherme Ottoni <ottoni@fb.com>
Mon, 4 Nov 2013 21:26:28 +0000 (4 13:26 -0800)
committerSara Golemon <sgolemon@fb.com>
Tue, 5 Nov 2013 17:20:46 +0000 (5 09:20 -0800)
tree71953ee47d2609a46b5989c68da720ddda2551e0
parent71201e29337ade6d5f88da62a09c2ac9b2a9dd7e
Avoid DV initializer loop in prologues for small number of DVs

We were always generating a loop like:
     0xd800252: mov eax, 0x1
     0xd800257: sub rbx, 0x10
     0xd80025b: inc eax
     0xd80025d: mov byte ptr [rbx+0x8], 0x0
     0xd800261: cmp eax, 0x2
     0xd800264: jl 0xd800257
to set the DVs that didn't get a value passed in to Uninit.

This diff unrolls the loop for small number of values to be
initialized.

Reviewed By: @jdelong

Differential Revision: D1041394
hphp/runtime/vm/jit/func-prologues-x64.cpp