Remove BiasedCoin

Summary: It's dead, we have a thread-local one getting constructed for Translator
but it never actually gets used.

Reviewed By: @swtaarrs

Differential Revision: D1357676
Remove VariantStrongBind and CVarStrongBind

Summary: All they do is box an existing Variant and make a copy of it. This makes
more sense as a constructor on Variant (because we're trying to avoid
the Variant(const Variant&) constructor).

Reviewed By: @jdelong

Differential Revision: D1354380
Move vmfp, vmsp, and vmpc into RDS

Summary: The three registers now live in the RDS header struct instead of the
execution context. This makes accessing them from translated code more
efficient, though we do that rarely enough that it doesn't matter much in
practice. The speed of the accessor functions should be unchanged: they're
still loading a pointer from TLS then reading at a fixed offset from that
pointer. This will slow down parts of the interpreter a little, since they now
access TLS instead of a member on this.

Most of the diff is just changing uses of the old accessors to use the "new"
ones and is pretty uninteresting. The biggest change is that the
vmfp()/vmsp()/vmpc() accessors have moved out of translator-inline.h into their
own header, runtime/vm/vm-regs.h, and are now the canonical way to access these
registers. VMRegAnchor and CallerFrame have also moved out of the JIT namespace
since they're such an integral part of the VM now.

Reviewed By: @jdelong

Differential Revision: D1357112
Fix various problems with the nullability of mixed.

Summary: Fix mixed so that mixed member variables are considered initialized by default. Made mixed able to unify with T and ?T at the same time.

Reviewed By: @pikatchu

Differential Revision: D1358032
Straighten out typedef checking

Summary: Right now we keep this `seen` map of typedefs we've expanded to check
for circularity. This doesn't work when expanding something like
`TD<TD<int>>` -- that's not necessarily circular, just involves the same
typedef more than once. Instead, track what the toplevel typedef name
is, and carry just that through when checking for circularity.

Fixes #2556 (https://github.com/facebook/hhvm/issues/2556)

Reviewed By: @pikatchu

Differential Revision: D1335495
Use encoding scheme with m_packedCap to support larger PackedArrays

Summary: Though m_packedCap is declared as uint32_t, PackedArrays must ensure that
the upper byte of m_packedCap is 0 because it overlaps with m_kind field.
To make this work, PackedArray was only supporting capacities up to 2^24-1
and for larger capacities it would escalate to MixedArray.

The Vector collection implementation is being changed to use an array as
the Vector's buffer, and it would be nice if Vector could assume it's
always dealing with a PackedArray. However, imposing a maximum capacity
of 2^24-1 on Vectors feels unreasonably low.

This diff introduces an encoding scheme for PackedArray's capacity field.
This encoding scheme provides a mapping from 3-byte "capacity codes" to
4-byte capacities. The encoding scheme allows us to avoid doing any extra
work in the common case when growing a PackedArray, and it only introduces
one additional (predictable) branch in the common case when allocating,
copying, or freeing a PackedArray.

Reviewed By: @jdelong

Differential Revision: D1337469
Move m_index from {ExternalThreadEvent,Sleep}WaitHandle to the union in WaitHandle

Summary: This reduces sizeof(c_{ExternalThreadEvent,Sleep}WaitHandle) by 16
bytes (not used heavily so no impact) and makes it easier to use
the same pattern for queue registration by c_AsyncFunctionWaitHandle.

Reviewed By: @jdelong

Differential Revision: D1358778
add space to error message

Reviewed By: @JoelMarcey

Differential Revision: D1360279
Create staticEmptyString to speed up empty string

Summary: Create a parallel to staticEmptyArray() to speed up uses of the
empty string.

Reviewed By: @markw65

Differential Revision: D1356274
libmysql cmake fixes for compilation errors in Gentoo and other distros

Summary: Closes #2815
Fixes #1531

Reviewed By: @ptarjan

Differential Revision: D1359452

Pulled By: @JoelMarcey
fix soap calls for objects with __call

Summary: Once again not quite sure how to work this into a HHVM test (like my previous PR #2505).

When the soap object has a __call method we should consider it as a valid function and let the VM deal with it.
Closes #2820

Reviewed By: @ptarjan

Differential Revision: D1359394

Pulled By: @JoelMarcey
fix SimpleXML::addChild with empty namespace

Summary: In this case an empty string and null result in different behaviors.
See https://github.com/php/php-src/blob/PHP-5.6/ext/simplexml/simplexml.c#L1674
Closes #2818

Reviewed By: @ptarjan

Differential Revision: D1359308

Pulled By: @JoelMarcey
Revert "Implement type hierarchy for interfaces"

Summary: This reverts commit fa23cfbca5ba3ecb3eb60ef56029c379c2722927.
The Class::subtypeOf function isn't correct, and the logic is a bit
complicated so I'd rather revert for now than try to figure out how to
do it better.  (aravind: if you want to look, I think the issue is
that it's not clear what a non-empty interface list in a res::Class is
supposed to mean.)

Reviewed By: @dariorussi

Differential Revision: D1359861
Add a regression case for a bug we had in res::Class::subtypeOf

Summary: Adding in its own diff so the revert diff can be re-reverted
if we want to fix it.

Reviewed By: @dariorussi

Differential Revision: D1359897
cmake profiles for building

Summary: Different modes CMake build, examples of usage [profiles](https://github.com/denji/hhvm/commit/d971239f31#diff-3e1d1439ed0b241d4bcf9f0f5cb35da4R14):
```
-DCMAKE_BUILD_TYPE=[None|Debug|Release|RelWithDebInfo|MinSizeRel]
```

More information: http://bit.ly/1hpbbyk
Closes #2819

Reviewed By: @ptarjan

Differential Revision: D1359856

Pulled By: @JoelMarcey
unset() on ArrayObject is supposed to raise a notice if undefined key is passed

Summary: PHP throws a notice when trying to unset() or offsetUnset() key which aren't defined

I'm not sure if this is the right approach to get the appropriate error
Closes #2821

Reviewed By: @ptarjan

Differential Revision: D1359933

Pulled By: @JoelMarcey
Functorize type-at-pos

Summary: This is something else that would be nice to share

Reviewed By: bhosmer

Differential Revision: D1354822
Suggest command

Summary: Add a unimplemented suggest server command

Reviewed By: bhosmer

Differential Revision: D1355457
Fix deduplication, take 3

Summary: The previous approach failed to maintain insertion order. This
will maintain sort order for the cookies we actually send down to the
client regardless of whether deduplication is enabled

This fixes Github Issue #2758.

Reviewed By: joelm, fredemmott

Differential Revision: D1358654
Move loadClassCtor to translator-runtime where it belongs

Reviewed By: @jdelong

Differential Revision: D1360740