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
AcceptorConfiguration is a struct

Summary: All these setters and getters -- just make it a struct!

Reviewed By: @praveenr

Differential Revision: D1526499
Makes <<__Memoize>> work for functions with args of certain types

Summary: Right now, this only works with arguments whose types can safely be used as array keys without conversion. Arbitrary params will come in the next diff.

Reviewed By: @jano

Differential Revision: D1515148
Fix inst_meth example in hhi comment

Summary: `inst_meth` doesn't work on `private` anything due to runtime
restrictions.

Reviewed By: @pikatchu, @elgenie

Differential Revision: D1531767
flakeylist copy_variation6

Summary: It failed on D1479623?id=4938785

Reviewed By: @paulbiss

Differential Revision: D1531609
Fix some crashes in hphpd

Summary: There are plenty of cores showing what is clearly the result of
popping an element from an empty stack, so guard popActiveLineBreak().

getActiveLineBreak() already checks for size() == 0, and is usually followed up
by a call to setActiveLineBreak(), which does not. So fix that too.

Reviewed By: @edwinsmith

Differential Revision: D1533549
Let's not rely on explicit HHVM version numbers in xdebug tests

Summary: We bump the version number quite a bit. Let's not hardcode them in the xdebug tests

Reviewed By: @ptarjan

Differential Revision: D1534339
Clean up printing functions & some const usage in vasm

Summary: Rename some printing functions to be more consistent with the rest of
the jit, make them work with const references, and move function declarations
to vasm-print.h to match the definitions in vasm-print.cpp.

Reviewed By: @edwinsmith

Differential Revision: D1532792
Version bump to 3.4.0-dev

Summary: We are cutting the 3.3.0 release. I am bumping the external version for the HHVM-3.3 branch to 3.3.0. Now, bump the internal version to 3.4.0-dev to get ready for the next one.

Reviewed By: @ptarjan

Differential Revision: D1532428
Document hh_client --auto-complete

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

Reviewed By: @JoelMarcey

Differential Revision: D1534255
Make RUSAGE_THREAD available to getrusage PHP function

Summary: The signature of the PHP function is getrusage( [ int $who = 0 ] ).
In both HHVM and PHP5, $who can be 1 to request RUSAGE_CHILDREN data. This
change allows $who to be 2 to request RUSAGE_THREAD data. RUSAGE_THREAD
measures resource usage for just the calling thread.

This allows HHVM PHP code to measure resource usage for the current request.
(In PHP5 this can be done with RUSAGE_SELF, by dint of the threading model.)
Closes https://github.com/facebook/hhvm/pull/3632

Reviewed By: @JoelMarcey

Differential Revision: D1530059
Fix fall-through jump for the last region block

Summary: If the last block falls-through to another region block,
translateRegion was not inserting a jump but doing a ReqBindJmp
instead.

Reviewed By: @alexmalyshev

Differential Revision: D1534942
clean up /tmp/test-run- files

Summary: While investigating t5037772 I noticed we don't clean these files up. Seems prudent to.

Reviewed By: @JoelMarcey

Differential Revision: D1535223