Update HHVM_API_VERSION

Summary: Since 3.0 `Extension` class has been updated, so we need
to update HHVM_API_VERSION, or HHVM could load extensions
compiled against HHVM2.2 and crash.

Closes #3032
Closes #3090

Reviewed By: @ptarjan

Differential Revision: D1422384

Pulled By: @fredemmott
Fix for bad_shell_exec failing depending on the user's shell

Summary: Different shells have different error messages, which trips up
this test case. Switches the test case to a regex covering the
two cases I've seen.

Eg:
```
~/hhvm(branch:master) » echo $SHELL
/usr/bin/zsh

~/hhvm(branch:master) » hphp/hhvm/hhvm hphp/test/run hphp/test/slow/ext_process/bad_shell_exec.php
Running 1 tests in 1 threads

FAILED
1 tests failed
(╯°□°）╯︵ ┻━┻
: hphp/test/slow/ext_process/bad_shell_exec.php
002+ sh: 1: /invalid_path/: not found
002- sh: /invalid_path/: No such file or directory
```
Closes #3103

Reviewed By: @ptarjan

Differential Revision: D1422459

Pulled By: @fredemmott
CMake: distribute hphp/system/ public headers too

Summary: Add auto_sources/HHVM_PUBLIC_HEADERS under hphp/system/ as well, which
was forgotten from the initial build system improvements. This
distributes systemlib.h, among others, which is necessary for building
extensions.
Closes #3085

Reviewed By: @ptarjan

Differential Revision: D1422661

Pulled By: @fredemmott
Revert "Fix for bad_shell_exec failing depending on the user's shell"

Summary: This reverts commit 62eb6be5d23126089f8c2619da976d7f23550a71.

Reviewed By: @ptarjan

Differential Revision: D1423366
Fix casting a DateTime to an array

Summary: Fixes facebook/hhvm#3083

Reviewed By: @ptarjan

Differential Revision: D1414803
Make SplHeap comparisons work on non-number objects

Summary: `compare()` only gets called with comparison to greater than zero. I could change it to return true if is greater than. Keeping the same behaviour matches the name

Fixes #3086
Closes #3091

Reviewed By: @ptarjan

Differential Revision: D1422402

Pulled By: @fredemmott
Fix EZC usage of ThreadLocal and clarify ThreadLocal comments

Summary: I inappropriately had EZC's TSRM layer create ThreadLocal objects as
true globals, instead of using DECLARE_THREAD_LOCAL and
IMPLEMENT_THREAD_LOCAL. This caused a crash since the variables were
meant to be thread-local but weren't. Fixed this, and clarified and
expanded the comments in thread-local.h to address the origin of the
error.

Also:

* Fixed some whitespace and namespacing issues in this code, along
  the lines of my previous EZC commits.
* Fixed a bounds check in ts_free_id().
Closes #3120

Reviewed By: @ptarjan

Differential Revision: D1422510

Pulled By: @fredemmott
Make Sets use arrays as buffers, share more code between Map and Set

Summary: This diff refactors Map and Set to share a lot of their implementation,
and in doing so makes Sets use arrays as buffers (like Maps).

Reviewed By: @elgenie

Differential Revision: D1421364
Add literal table to MCGenerator

Summary: Adds a value->address map to mcgenerator for generating
large constants that we can point to using rip-relative
addressing. Use this mode when loading doubles into SIMD
registers on x64, and when we can't get a trampoline.

Also add a literal table to struct CodeGenFixups so we can
keep track of pending literals and only commit them to the
global table when we know we won't roll back.

Reviewed By: @markw65

Differential Revision: D1413464
Disable flaky zend tests

Summary: spl directory iterator tests failing on D1421815 for no reason

Reviewed By: @swtaarrs

Differential Revision: D1423910
hh_single doesn't need hhi files

Summary: Set this for unit tests so we don't need the hhi archive lying
around, since we don't use it anyways -- but the `Naming` error case
might still try to read it.

Reviewed By: @elgenie

Differential Revision: D1422029
Add touching hhi files to the heater

Summary: Some systems are pretty aggro about cleaning up `/tmp`, so
let's keep poking the mtime of these files as long as we're using them.

Reviewed By: joelb, eletuchy

Differential Revision: D1423210
Clean up uses of Type::unbox() in MInstrTranslator

Summary: We were assuming that the result of a LdRef instruction would always
be typeParam.unbox(), but this isn't the case. I went through all the uses in
minstrtranslator and audited each one, either commenting on why it's ok or
fixing it to use ldRefReturn. The call to checkMIState() is now after
emitBaseOp() because none of the base ops actually needed it and this allows us
to use m_base in checkMIState() instead of duplicating some of its logic.

Reviewed By: @jdelong

Differential Revision: D1410177
Update flaky PHP5 tests

Summary: They couldn't be run in parallel. They've already been fixed in PHP5,
so it was just a matter of running import_zend.py

Reviewed By: @ptarjan

Differential Revision: D1423492
Don't follow region-breaking instructions in WholeCFG

Summary: Including control flow arcs created by bytecodes like Switch isn't
supported, so let's ban those in WholeCFG like we do in HotTrace.

Reviewed By: ottoni, alexanderm

Differential Revision: D1421832
Don't include the initial block twice

Summary: We weren't adding the initial block to the visited set during the CFG
traversal, so we could end up adding it to the region twice, which caused
various problems.

Reviewed By: @ottoni

Differential Revision: D1421815
Plumb a handle to the return value through the hotprofiler.

Summary: Plumb the symbol name through more of the hotprofiler.
Annotate hotprofiler virtual override methods with override keyword as needed.
Reformat as necessary to meet 80 char/line coding style.

Closes #3071

Reviewed By: @markw65

Differential Revision: D1412089

Pulled By: @LiraNuna
Initial blocks with backwards edge predecessors are merge points

Summary: The initial block of a region only needs one incoming arc to count as
a merge point. It already has an invisible "entry" arc coming into it.

Reviewed By: @ottoni

Differential Revision: D1412834
decouple server protocol

Summary: 1. Inline HandleMessage into HackProgram
2. Move HackProgram out of ServerFunctors into its own file
3. Unfunctorize ClientCheckStatus command

ServerMsg protocol is assumed throughout, which makes this
simplification no less general. HackProgram was already in
the wrong place, and this enlarges it, so moved it out now.

Reviewed By: @gabelevi

Differential Revision: D1421302
move declaration of cpu_set_t to ext_hotprofiler.h to fix OS X build

Summary: Fixes issue https://github.com/facebook/hhvm/issues/3079

cpu_set_t is used in ext_hotprofiler.h (line 18 of .cpp, line 129 of ext_hotprofiler.h) before it has been defined in ext_hotprofiler.cpp (at line 51).
Closes #3106

Reviewed By: @ptarjan

Differential Revision: D1422472

Pulled By: @fredemmott