Move refcount methods to HeaderWord
commitd0d8fd9b13b567da734e0cdc53662e9fd8e5bb37
authorEdwin Smith <smith@fb.com>
Mon, 26 Oct 2015 23:44:43 +0000 (26 16:44 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 26 Oct 2015 23:54:41 +0000 (26 16:54 -0700)
tree94f07df6c40735b0c96323417b3d3d284fb16dec
parent3ab4236eb6a98f3cfa3886f6dee46f6334cceaf7
Move refcount methods to HeaderWord

Summary: Upcoming diffs may add more fields to HeaderWord, so its cleaner
to have methods that can access fields other than count, instead
of CountableManip[NS] functions that take count as a ref param.
This is also a step towards having a true header class.
Having a template param for static/uncounted support in HeaderWord
also simplifies things by letting us collapse IMPLEMENT_COUNTABLE_METHODS
into a single macro.

This diff includes a few small changes in behavior:
- most methods call checkCount(), which is stricter than before.
- removed a few assertions on release paths that blow up when count == 0.
- the non-static version of decRefAndRelease() is now avoids
  doing --count when count==1, similar to the static version,
  instead of doing: if (--count) release();

Reviewed By: markw65

Differential Revision: D2570230

fb-gh-sync-id: cdc6171574cc53aea988a1eb8a49f99fab348d8d
hphp/runtime/base/array-data.h
hphp/runtime/base/countable.h
hphp/runtime/base/header-kind.h
hphp/runtime/base/object-data.cpp
hphp/runtime/base/object-data.h
hphp/runtime/base/ref-data.h
hphp/runtime/base/resource-data.h
hphp/runtime/base/string-data.h
hphp/runtime/base/tv-helpers.h