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.
Move static strings out of debugBacktrace

We're paying for some null checks here each time we do a
backtrace.  Inspected all usage sites of the other StaticStrings to
ensure adding "consts" shouldn't change behavior (similar to that
ternary operator issue @smith ran into).  Also remove a bunch of
temporary smart pointers that we don't need anymore.
Use ArrayInit in debugBacktrace

Presize the arrays.