Tweak to enable more refcount optimizations
commitacb3a99a65a0fbfd1bb157f6ec98f7f39020718b
authorGuilherme Ottoni <ottoni@fb.com>
Thu, 23 Oct 2014 20:13:16 +0000 (23 13:13 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Thu, 23 Oct 2014 20:30:28 +0000 (23 13:30 -0700)
treedc566e343ae751fde94eb3aa79ff0664f5d38fe7
parent40f45ac88954d83a0d8711ff8a0130262e4efdea
Tweak to enable more refcount optimizations

Summary: When a value is known to exist in many places, observeValue() will not
insert any IncRef before a DecRef. That's bad because it ends up
preventing some IncRef/DecRef pairs from being eliminated because the
IncRef is pushed down past the DecRef.  This diff makes sure that we
always drop an IncRef before a DecRef, which then enables more
IncRef/DecRef pairs to be eliminated.

Reviewed By: @swtaarrs

Differential Revision: D1631498
hphp/runtime/vm/jit/refcount-opts.cpp