Fix an assertion when iterating collections

Summary: iterInit for collections assumed (and asserted) that valOut was
not KindOfRef, but nothing was enforcing that.

Reviewed By: @dariorussi

Differential Revision: D1431817
Plumb Asm& through to ifThen()'s lambda function

Summary: All the other if-then-else assembler functions pass the Assembler
down to the lambda functions passed in, except this one.  Clean
it up and remove duplicated code.

Reviewed By: @bertmaher

Differential Revision: D1428732
Add ezpublish-kernel to framework tests

Summary: Closes #3119

Reviewed By: @ptarjan

Differential Revision: D1431397

Pulled By: @fredemmott
Optimize APC objects and collections by defining an APCCollection class and increasing the number of APCObject vs serialized objects

Summary: Allow collections in APC to be stored holding an uncounted or APC array. Also extend conditions under which an APCObject is created.

Reviewed By: @elgenie

Differential Revision: D1417525
Add memory protector to hhvm thread scheduler.

Summary: Introduced an outstanding memory checker thread on each proxygen server
instance. This memory protector periodically check the current actual
free memory, once it is lower than some configured threshold, a flag will
be marked so that new coming requests will be quened until that flag is
reset.

Once the free memory amount become back above the threshold, the
protector flag is reset. Meanwhile, the memory protector will
perform some extra "notify"s to the job queue, so that previous
queued jobs can be sweep up shortly.

The following parameters are configurable by hdf:

MemoryThreshold: the threshold of free memory, default as 512MB.

MemoryCheckFreq: the frequency of memory checking, default as 3s

QueuedJobsReleaseRate: the rate of extra "notify"s to release
previous queued jobs, default as 3, which means giving the job queue
3 notifies every secs, here P = QueuedJobsReleaseRate.

Reviewed By: @markw65

Differential Revision: D1396273
packed arrays in asio

Reviewed By: @elgenie

Differential Revision: D1413413
updating hack files

Summary: Adding the `AsyncConnectionPool` class and some functions.

Reviewed By: @jwatzman

Differential Revision: D1429917
Fix crashes related to "new Pair($x, $y)"

Summary: "new Pair" is supposed to throw an exception with any number of arguments,
However, there was a crash when running under hphpd that could happen if
one or more arguments were passed. The problem was that HHVM was raising a
warning and then returning a partially constructed Pair with uninitialized
fields.

This diff fixes the crash by making "new" use a more defensive C++
constructor that initializes all the field, and by making Pair's
__construct() method take any number of args (which ensures that "new Pair"
will always throw an exception no matter how many args are passed).

Reviewed By: @jdelong

Differential Revision: D1432922
Add warnings for numeric string keys when reading from intmap

Reviewed By: @paroski

Differential Revision: D1430008
Add warnings for calls to sort on intmaps

Summary: Change dispatch in g_array_funcs of Sort and Usort to WarnAndSort and
WarnAndUsort respectively. This way we don't incur any overhead for regular
kMixedKind arrays.

Reviewed By: @paroski

Differential Revision: D1429736
don't fail test if intl is too old

Summary: This is failing on cmake builds and anoying me in the oncall email

Reviewed By: @JoelMarcey

Differential Revision: D1432980
Fix build broken on OS X

Summary: Typo fix, rename `dest` to `reg` to match GCC_FAST_TLS version

This closes issue #3145
Closes #3159
Created from: https://github.com/facebook/hhvm/pull/3159

Reviewed By: @markw65

Differential Revision: D1428182
Correct a config key name in debugger.devdocs

Summary: It's "Eval.Debugger.Port", not "Eval.Debugger.DebugggerServerPort".
Closes #3186
Created from: https://github.com/facebook/hhvm/pull/3186

Reviewed By: @ptarjan

Differential Revision: D1435399
Enable sorting for Sets

Summary: Now that Sets retain insertion order it would be handy if Sets could be
sorted using PHP's sort builtin functions. This diff leverages to shared
implementation between Map and Set to enable sorting for Sets.

Reviewed By: ptc, eletuchy

Differential Revision: D1435214
Merge branch 'master' into php-compatible-lz4