Let vasm use all the registers

Summary: Expand the unreserved registers for vasm (when compiling a whole
IRUnit, but not when compiling snippets of code via Vauto) to include
all usable registers (everything except rbx,r12,rsp,rbp).

Add an "args" mask to all the call opcodes to indicate which registers
are used (as register arguments) to the call. vasm-xls marks these used
by the call; prior to the call, there are copies into these registers,
so they are live from the copy to the call.

Reviewed By: @swtaarrs

Differential Revision: D1527672
Fix bogus type assertions from nested arrays

Summary: In the new test case hhbbc correctly figured out that after
the first [], we had an array all of whose keys were intergers,
and all of whose values were array(55). For the second [] it knew
that the base was either null, or array(55). As a result, it gave up
on trying to update the known value of the array - but didn't discard
what it already knew.

When we iterated the array, it then thought the value had to be null, or
array(55). We eliminate the null by the if/continue, and so it asserted
that it was an array of one element (it doesn't bother to assert the types).

There are two fixes. The first was to improve the type of the base. If the
base of an array is known to be null or array(55), and we push somthing onto
it, we should promote it to empty|array(55), and then do the push (the existing
code converted it to null|empty|array(55)). The second was to drop any
specialized information from the base type when we don't know how to update it.

Reviewed By: @edwinsmith

Differential Revision: D1529980
Fix APC test giving more time between add and fetch to make sure expiration takes place

Summary: Make sure there is enough time for expiration to take place

Reviewed By: @bertmaher

Differential Revision: D1508686
Update NEWS for "Snoop Dogg"

Reviewed By: @markw65

Differential Revision: D1530250
Rename namespace ARM and X64 to arm and x64

Summary: This is purely for aesthetics and seemed good in the wake
of s/JIT/jit/. Not planning any more churn after this.

Reviewed By: @markw65

Differential Revision: D1519347
CMake: use bundled PCRE if system PCRE doesn't jit

Summary: PCRE comes with its own CMakeLists.txt, fortunately, so all we have to
do is run it.

Caution: I have very little idea what I'm doing when it comes to CMake
-- there's a lot of hidden magic going on -- but I think this is some
approximation of correct.

Reviewed By: @ptarjan

Differential Revision: D1523103
Implemented important remote debugging commands and other fixes necessary for phpstorm

Summary: @jlreyes: This diff gets phpstorm working with xdebug. Everything should work but I haven't had time to cleanup
or write tests.
@paulbiss: added test coverage, fixed broken tests, implemented symbol parsing

Reviewed By: @ptarjan

Differential Revision: D1515484
Fix crash due to hash collisions in POST data

Summary: Too many hash collisions in the POST data resulted in
a warnUnbalanced fatal, which was only caught by the "last resort"
catch in HttpRequestHandler::handleRequest.

This revealed a few bugs: sourceRootInfo and reqURI both contain
smart allocated Strings, but their destructors run after
hphp_session_exit() has destroyed the memory manager. Its not
clear to me why this isn't a problem when we don't fatal, but
I fixed it by splitting handleRequest to ensure the
destructors are called earlier.

This still left us with a problem where we didn't correctly
close the connection, so I fixed that too.

Reviewed By: @dariorussi

Differential Revision: D1496904
XDEBUG_PROFILE should enable profiling

Summary: Closes https://github.com/facebook/hhvm/pull/3641

Reviewed By: @JoelMarcey

Differential Revision: D1530783
Fix assert crash when autocompleting with the same thing defined twice in a file

Summary: We were hitting an assert when the same class/func name was defined twice in the same file.

This was because we were oldifying the same name twice, so the second time, it fail with:
hh_server: hphp/hack/src/heap/hh_shared.c:682: hh_move: Assertion `hashtbl[slot2].addr == ((void *)0)' failed.
@emiraga found a bunch of logs of the same error message. This should fix anything to do with the ide utils stuff. If we still see it in the logs after, it might be a bug in Typing_redecl_service.

Reviewed By: @jwatzman

Differential Revision: D1528258
Add OSS benchmarking suite

Summary: Facebook: moving out from facebook/

Reviewed By: @ptarjan

Differential Revision: D1531518
Fix PDO::bindColumn

Summary: when we call Variant.unset() all refs get lost, use Variant.setNull() instead

Fixes #2914
Closes https://github.com/facebook/hhvm/pull/3638

Reviewed By: @JoelMarcey

Differential Revision: D1530475
Set resumed flag before suspending VarEnv

Summary: Recent cleanup changed the order of operations, causing assertion checks
to fail. Make sure the resumed flag is set before attempting to suspend
VarEnv.

Reviewed By: @​aravind

Differential Revision: D1531325
typechecker: allow static:: for private members of final classes

Summary: Might have been forgotten when adding the check. On the one
 hand, this makes more `<?php` code hackify directly. On the other hand,
 `self::` is safer long-term practice.

Reviewed By: @jwatzman

Differential Revision: D1529377
typechecker: annotate time as returning an int

Summary: Facebook: www cleanup diff is {D1532268}

Reviewed By: @int3

Differential Revision: D1532227
Objprof for HHVM (Approx. instance counter)

Summary: A lot of times something happens and suddenly PHP land OOMs with bad requests spiking.
Today we record allocations stats and post them with every requests for triaging.
Once we know an endpoint has gone bad, there's still a lot of unknown as to what have happened (Every endpoint has a very large code base).

Objprof for HHVM is an extension that attempts to get approximation of instance count per class.
The extension will be triggered periodically and also upon memory outliers.
Using a comparison view of baseline vs. bad behavior should expose interesting aspects as to what takes the memory.

It isn't a lot of code. There are 3 phases to do it-
1. Map all the Class* known to HHVM
2. Traverse the slabs and increment for every valid Class*
3. Dump all mapped Class* with at least 1 instance back to PHP

Reviewed By: @markw65

Differential Revision: D1528183