Add missing macros to timelib_config.h

The absence of HAVE_LIMITS_H caused timelib_structs.h to define LONG_MIN
and LONG_MAX to be 32-bit values, which caused timelib_date_to_int() to
give an error for a date after 2038, which caused the current time to be
returned for e.g. date_create('28 July 2038')->format('r').

The issue was detected by MediaWiki unit tests, and this fix was tested
by the same method.

While I was at it, I also added HAVE_LOCALE_H, which was checked for in
CMakeLists.txt but not used, and I fixed the definition of SIZEOF_INT
(#cmakedefine doesn't work that way). I arranged the macros in
timelib_config.h.cmake in the same order as they are in CMakeLists.txt.
Merge pull request #758 from tstarling/master

Add missing macros to timelib_config.h
proc_open should inherit g_context->m_envs

Some head scratching until I realized that my `putenv()` calls
in my PHP script weren't actually changing the environment for subsequent
`proc_open()` calls.

What I'd like this diff to do (and I fully expect that I'm violating some
referencing rules in hhvm) is to fall back to using our current view of
the environment as maintained in the execution context in the case that
proc_open is not explicitly passed an environment array.

I think I've even added a test to prove that this works, but I haven't
read the manual and fbmake runtests takes too long, so I'm just going
ahead to submit this diff.
Move pretty-printing code into its own file

Pretty-printing the IR is a kind of pass, and definitely a separate
concern, just like rendering IR as machine code.  Put it in its own file.
add hooks to ASIO to allow building of dependency graphs in PHP

In order to build a dependency graph of continuation execution and data-fetching in PHP-land, we need a few instrumentation points in the asio_ext HHVM extension. There are 4 additions required:
   1. Callback when a continuation finishes successfully.
   2. Callback when a continuation blocks on a wait_handle.
   3. Get array of WaitHandles a GenArrayWaitHandle is waiting on.
   4. Get WaitHandle that the SetResultToRefWaitHandle is waiting on.
I don't think this should really affect performance, as in the normal case, nothing has changed, but you never know... I'm also not sure who should be reviewing this, so I've just added @jan for now. If you could pile other people on, that would be cool.

sandcastle appears to be broken.
Eliminate circular dependency in SmartAllocator

SmartAllocator defined and used an enum for each type using smart allocation, thus closing a circular dependency loop. In fact the enum is not necessary and can be replaced with typeid with relative ease. While at it I've also simplified GarbageList a bit.

Also fixed a couple of lint errors.

Perflab completed, looks neutral to good: https://our.intern.facebook.com/intern/perflab/details.php?eq_id=399305
re-enable tests

These were reported (correctly) as crappy and disabled in D801504. I fixed them.
Move m_liveRegs out of IRInstruction

The live regs field in IRInstruction is the result of an analysis
pass which can be better encapsulated by moving the field into
its own StateVector.
Disable some flaky zend tests @override-unit-failures
Provide safe storage for private PHP data in external thread events

Sometimes, a PHP object (usually defined by extension) is needed to
unserialize the data.

Provide a safe mechanism to store such object with external thread
events.
Move spillslot field from SSATmp to linearscan pass

Spillslot is an internal field for the linear scan pass,
we don't want it in SSATmp.
Add missing #include

Add missing #include.
Inline object constructors

This should automatically handle the case when we had
a generated 86pinit constructor.
Allow type aliases to take (ignored) type arguments

type Foo<T> = Bar<T,T> is treated as Foo = Bar; Foo<T> = @?T isn't supported.
make test/run work on stock PHP

I want people to start contributing to us from the community. I think them running the tests would be a good idea on any patch. I don't really want to assume they replaced their php binary with hhvm just yet, so I think the test runner should work on whatever php is in the path
Don't template on op for SetOpProp and IncDecProp

The only difference between each template specialization was
the op they were passing into a rather deep chain of helpers. None of
them are very common either, so it's not worth the code bloat.

Unfortunately the setOpProp helpers now need 7 qwords of arguments so
one of them has to be passed on the stack. I added support for that to
codegen.
Clear local related helpers out of TraceBuilder

Optimizations went to Simplifier or preOptimize (or were
removed in some cases where they duplicated things already done in
simplifier), php-semantics went to hhbctranslator.
Clean up and document SRFlags

Make it part of abi-x64.h and explain what the flags mean.
line up stuff

These are the only braces not lined up on that column in this file.
Make it unnecessary to null out locals during RetC

We already look up the PC for every frame as we're taking the
backtrace, so we can just skip them when going through a backtrace
frame.  Also, there is currently a guarantee that if an exception
propagates through a frame where pc was pointing at RetC, all the
locals and the $this pointer have already been decref'd, so we don't
need to use a null check to determine this.