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