Refresh ringbuffer tracing

The binary ringbuffer tracing had bitrotted a little with the
transition to the IR. I also reorganized RingBufferEntry a little to hold more
information and cleaned up the printing code to print more information about
SrcKeys.

Reviewed By: @jdelong

Differential Revision: D985433
Make test/zend/good/Zend/tests/bug36759.php less flaky

This recently started failing on my devserver but not on contbuild. I
traced it down to a dependence on the iteration order of
ExecutionContext::m_liveBCObjs. Wrapping it in a function make the objects'
destruction order deterministic.

Reviewed By: @ptarjan

Differential Revision: D987785
Fix how 'pipes' argument is handled in proc_open

Zend PHP ignores whatever the 'pipes' reference is pointing to
in proc_open, and just fills it with an array of resources, but
only if they are not null.

Also rename the ChildProcess's classname to lowercase 'process'
to match Zend's output.

This fixes a fatal in Symfony unit tests.

Reviewed By: @ptarjan

Differential Revision: D984996
Fix bug with namespaces not being the first statement in a script

Parser::onNamespaceStart already ignores T_DECLARE, but it also
appears to need to ignore ';'. By default, we do not add a
T_CLOSE_TAG for '?>' but we do append on a ';', and this was
throwing off the parser.

Fixes the last fatal in the composer unittest suite.

Reviewed By: @ptarjan

Differential Revision: D984844
Filter out zend-compat extensions in hphp

Otherwise mysterious things happen.

Reviewed By: @ptarjan

Differential Revision: D985277
Make hhvm more numa aware

Makes a number of changes:
 - Binds each server thread to a numa node, and
   sets its default allocation mode to that node
 - Allocates a jemalloc arena for each node,
   and selects the right one at thread startup (
   to ensure that we don't get memory that was
   previously allocated on a different node)
 - Changes thread scheduling to alternate between
   nodes
 - Sets the default allocation strategy for the
   main thread (and non-server threads) to
   interleaved.

Reviewed By: @jdelong

Differential Revision: D974085
Fix profile counters for translations with guards on boxed values

Since normally the inner types of boxed values are checked lazily, the
profile counters were being inserted before the inner types were
checked. This was causing translations with guards on boxed values to
be overcounted -- their profile count was being incremented even when
the inner-type mismatched.

This diff fixes the problem by adding an option to
guardType{Local,Stack} to request the inner types to be checked too.
This option is used to eagerly check the inner types in TransProfile
mode.

Reviewed By: @swtaarrs

Differential Revision: D985443
Turn off JitEnableRenameFunction in vm-perf tests

We don't use it in prod so this makes the perf tests more
representative of reality

Reviewed By: @jdelong

Differential Revision: D989075
Remove a weird shell script from hphp/runtime

Reviewed By: @edwinsmith

Differential Revision: D989102
Plumb IRUnit through most of the JIT.

Use IRUnit as much as possible, starting at the Translator-x64
level, and plumbing it down through the call tree into individual
stages.

Reviewed By: @jdelong

Differential Revision: D987491
Clean up memory-manager.h

Reviewed By: @edwinsmith

Differential Revision: D989068
Remove uses of IRTrace from CodeGenerator

We didn't need CodegenState::catchTrace because we could look
it up using m_curInst.  isCatch() was easy to implement on
Block instead of trace, which enabled cleaning up IRTrace a bit
more.  IRTrace::bcOff was only ever referenced for the main
trace, so I moved that field to IRUnit.

Reviewed By: @jdelong

Differential Revision: D988099
Eliminate IRTrace::m_data

It's just a per-trace field needed in linear-scan.cpp

Reviewed By: @jdelong

Differential Revision: D989097
Move translator runtime functions out of code-gen-helpers

That's it

Reviewed By: @edwinsmith

Differential Revision: D989120
Don't allow mock classes to extend collection classes

The native collection classes aren't made to support derived classes, and it
would take some work to add such support. This diff adds a check to prevent
classes marked with <<__MockClass>> from deriving from a collection class.

Reviewed By: drussi

Differential Revision: D980050
Fix HHVM to correctly handle cases where __toString() returns a non-string

Reviewed By: @ptarjan

Differential Revision: D968210
Make exception tests less picky about how many frames it takes to cause a stack overlow

These exception tests use stack overflow, but they were brittle. 5 and 6 were checking the line the overflow occurs on, and I think that was unnecessary. The point of those two is that something doesn't happen on overflow, not the line the overflow occurs on. 3 and 4 want to see that objects left on the stack are destructed. For those I switched to using some counts, and check them in a shutdown function.

With this change all tests in test/quick pass with ASAN on.

Reviewed By: @scannell

Differential Revision: D987024
Do not emit a source context for the full function body when emitting an implicit function return.

When the compiler inserts an implicit function return statement, there is no source context for the return and the source context defaults to the context of the entire function. This causes execution to stop at implicit returns and the debugger to display a bizarre source context. It also causes every single line in a file to be considered a valid breakpoint location, even blank lines and lines with comments. The code for inserting implicit returns now overrides the source context with a dummy and the code for creating the source line map now ignores dummies.

Reviewed By: @mikemag

Differential Revision: D987159
Temporarily disable ext_zend tests that rely on arrays

Reviewed By: @ptarjan

Differential Revision: D988751
Substr_compare warning parity with Zend

Zend Compatibility: substr_compare should raise warnings when
offset and length parameters are invalid.

Reviewed By: @alexmalyshev

Differential Revision: D989609

Pulled By: @scannell