Postpone mayalias effects of unbalanced decrefs
commit750e4d3c8e4552d4ba0deb203c28b5238312eb3c
authorMark Williams <mwilliams@fb.com>
Thu, 19 Jul 2018 14:46:06 +0000 (19 07:46 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 19 Jul 2018 14:56:59 +0000 (19 07:56 -0700)
tree2d9b3099490f45c6c0445c5972f615fe6a7fe048
parent5d547efb3245a762f82dcfa115c4c0281936dd77
Postpone mayalias effects of unbalanced decrefs

Summary:
After an unbalanced DecRef, we have to reduce the lower bounds of all
may_alias sets. This means that in a sequence like

  IncRef a
  DecRef b; // unbalanced
  DecRef a;

we typically can't eliminate the IncRef/DecRef of a.

However, if the DecRef of b actually affects a (eg b is an array
containing a, or b actually *is* a), then removing the IncRef/DecRef
pair at worst changes the exact timing of the destructor calls.

When destructors are disabled, the difference should not be observable.

This delays the lower bound reduction (and the observations of the
lower bounds) until the next non-trivial instruction.

Reviewed By: swtaarrs

Differential Revision: D8450371

fbshipit-source-id: 2c1600bdfc4372fc9167d6df7e21d6b69155b5bd
hphp/runtime/vm/jit/refcount-opts.cpp