Fix broken cycle detection in doRegMoves()

It failed to detect a cycle if the path to the cycle started
from a leaf node that wasn't in the cycle.  This diff goes
back to the old algorithm, adapted for PhysReg and PhysReg::Map,
and also goes back to fixed-length arrays to avoid allocations.

Reviewed By: @jdelong

Differential Revision: D1116541
collections: macrofy materialization and magic-method declarations ...

... as a direct counterpart to similar macros in the .cpp file

Reviewed By: @jdelong

Differential Revision: D1116696
collections: introduce BaseMap superclass for Map and StableMap

This diff ensures that Map and StableMap have the same
 storage implementation in preparation for:

  - StableMap going away (except, perhaps, for its equality semantics)
  - FrozenMap coming into existence

 Specifically, this diff:

  - introduces a BaseMap superclass
  - makes c_Map inherit from BaseMap
    - renames c_Map::t_xyz to BaseMap::php_xyz
    - make c_Map::t_xyz a thin wrapper over BaseMap::php_xyz
  - makes c_StableMap inherit from BaseMap
    - removes vast majority of old implementation
    - adds c_StableMap::t_xyz as a thin wrapper over BaseMap::php_xyz
    - keeps c_StableMap::equals behavior (order mattering)
    - keeps unserialization behavior (serialize to 'StableMap' class)
  - gets rid of StableMapIterator in favor of a transformed MapIterator that works with any BaseMap

 Apologies to reviewers: this started out as a diff series with
 StableMap extends Map to verify limited number of test failures, and
 git code move detecting wasn't quite good enough to make commit
 rewriting less painful.

Reviewed By: @jdelong

Differential Revision: D1113840
collections: centralize equality in BaseMap

We'll most likely stay with Map's equality semantics for ==,
 but StableMap's equality semantics will likely have a place as a
 user-PHP accessible method on collections.

Reviewed By: @jdelong

Differential Revision: D1116700
Move ext/sockets constants from constants.idl.json to ext_sockets.cpp

Organizationally makes more sense.

Also allows us to set the constant values based on the system defines
rather than hard-coded posix values, and make some conditionally
available constants conditional.

I went through php-src/ext/sockets/sockets.c to match PHP:

Newly added sockets constants:
MSG_CTRUNC
MSG_TRUNC
IP_MULTICAST_IF
IP_MULTICAST_TTL
IP_MULTICAST_LOOP
IPV6_MULTICAST_IF
IPV6_MULTICAST_HOPS
IPV6_MULTICAST_LOOP
IPPROTO_IP
IPPROTO_IPV6
IPV6_UNICAST_HOPS

Existing constants made conditional:
MSG_EOR
MSG_EOF

Newly added conditional constants:
MSG_CONFIRM
MSG_ERRQUEUE
MSG_NOSIGNAL
MSG_DONTWAIT
MSG_MORE
MSG_WAITFORONE
MSG_CMSG_CLOEXEC
SO_REUSEPORT
SO_FAMILY
SO_BINDTODEVICE
TCP_NODELAY

Note: I left out the MCAST_* constants in ext/sockets because
we don't actually have the code to do anything with them.
We can add those in a separate diff.

Reviewed By: @jdelong

Differential Revision: D1116722