Move MemoryManager::refreshStatsImpl out of the header

Summary: Since MM is included by the world it's hard to iterate on this code
rapidly.  This function doesn't appear to be perf critical (and is too big for
inlining to make a huge difference anyways), so move it to the cpp file and
declare the boolean template specializations explicitly.

Reviewed By: @edwinsmith

Differential Revision: D1552525
Bind the resource limits to a local static for ini_xxx capabilities

Summary: Developing the "bad ini setting diff" led me to this. Let's bind these to actual ini settings.

Reviewed By: @ptarjan

Differential Revision: D1550734
Add minimal hdf support to test runner

Summary: I want to be able to specify a `testname.php.hdf` file along with a `testname.php.ini` file. The `.hdf` does not have as much "clout" as the .ini ... it is either there or it isn't. It does not search directories for one.

Reviewed By: @ptarjan

Differential Revision: D1554401
Allocate uncounted strings with malloc.

Summary: APC strings are uncounted but not static, and consume a lot of
low-memory. This pressure can be bad in general, but especially
when the treadmill stalls.

Reviewed By: @markw65

Differential Revision: D1554596
Remove "after vasm-auto" trace

Summary: Seems too noisy.

Reviewed By: @edwinsmith

Differential Revision: D1554221
Introduce several vasm trace levels

Summary: Level 1 prints only initial vasm.  Level 2 will print initial only
vasm and vasm + x64 interleaved after we have that.  Other stuff is higher
levels.

Reviewed By: @edwinsmith

Differential Revision: D1554256
Analyze/optimize pseudomains in hhbbc

Summary: We need to have a pass that determines which static properties can be
modified by the program (including public ones), which means we need to see
possible changes to static properties in pseudomains.  The easiest way to do
this is to analyze psuedomains like anything else.  (This also should help with
more clearly seeing the differences in the repo stats when hphpc's inferTypes
and postOptimize are off, since most of the bytecode changes are currently in
pseudomains.)

Reviewed By: @alexmalyshev

Differential Revision: D1545270
Don't allow setting static properties via reflection in RepoAuthoritative mode.

Reviewed By: @markw65

Differential Revision: D1550898
Don't warn if HDF files don't end in .hdf

Summary: `raise_warning()` was causing issues with current HDF files that don't have a `.hdf` suffix.
So, let's just allow any non-`.ini` file be assumed a `.hdf` file for now.

Reviewed By: @alexmalyshev

Differential Revision: D1554485
Fixed an assertion in the emitter for IncDec of $this

Summary: While processing $this++, the emitter would first push $this onto the
eval stack as a cell, then it would try to emit an IncDec bytecode instruction.
However, there exists no variant of IncDec which operates on the top value in
the eval stack. As it is always a syntax error to try to IncDec all other
cells, we kept the invariant that IncDec will assert if it encounters a cell on
the eval stack. We now check explicity for the $this++ case in visit().

Reviewed By: @jdelong

Differential Revision: D1545839
Fixes segfault on certain memoized functions

Summary: Functions that use $this as a local get an extra initialization step. The easiest way to trigger this is to pass $this as an argument in a function call.
When a function with a local $this is memoized, we were trying to init the $this local in the wrapper and segfaulted because the wrapper doesn't have any named locals.

Reviewed By: @jano

Differential Revision: D1554192
"arraykey" type

Summary: The union type of int and string is useful because it is currently the
type of keys for collections and arrays. To allow users to express this
type I am adding an arraykey type to represent this concept.

Reviewed By: @elgenie

Differential Revision: D1544844
Revert "Refactor the parsing and processing of configuration options ... just a bit ..."

Summary: sadpanda

In order to get some more local production testing with this refactor, this reverts commit:

//Remove ini refactoring parameter artificat//

... and subsequent commits directly based on this one

//Don't warn if HDF files don't end in .hdf//
//Remove ini refactoring parameter artificat//
//migrate many callsites from Config::GetFoo to Config::Bind//

**Light at end of tunnel**

These diffs will probably come back as one big diff that has been more thoroughly tested (along with another diff for tier overwrites that hasn't landed yet).

Reviewed By: @markw65

Differential Revision: D1554807
Spew nginx stats too

Summary: We're sending *much* fewer bytes than php-ng. Turns out this is because we gzip-compress everything by default.

Confirmed with:

  curl http://devbig076.prn2.facebook.com:8090/ | wc -c # gets me the same number of bytes as php-ng
  curl -H 'Accept-Encoding: gzip' http://devbig076.prn2.facebook.com:8090/ | wc -c # gets me the lower number

Reviewed By: @ptarjan

Differential Revision: D1552801
Typo fix

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

Reviewed By: @fredemmott

Differential Revision: D1555480
Update documentation about __toString inconsistency, add test

Summary: Seems that we match php5 and only allow strings now. Found while investigating LeviM's questions for the return type RFC.

Reviewed By: @jdelong

Differential Revision: D1555431
Support mappy ini configuration

Summary: Along with `std::vector<std::string>`, `std::map<std::string, std::string>` is the
other most common collection-style ini configuration.

Support this construct.

Once these two basics are supported, then we tackle the non-stringy vectors and maps. That will be a little harder.

Reviewed By: @ptarjan

Differential Revision: D1516955
Make vasm cloadq be 3-address form.

Summary: cloadq{} as currently defined, is unsound; it conditionally loads
a value, which means it conditionally sets its dst register.
However, all instructions with a dest are assumed to always
set their dest. This broke two separate ways as I was doing other
things on top of master.

Reviewed By: @swtaarrs

Differential Revision: D1555363
Xdebug cleanup and trivial features

Summary: This PR performs cleanup and finishes all the the trivial features (the ones not discussed in #3704).

Additions:
* Implemented `xdebug_break()` function
  * This is similar to `hphpd_break()`, except for xdebug. Call this to cause a breakpoint
* Implemented `xdebug_disable()`, `xdebug_enable()`, and `xdebug_is_enabled()`.
  * These just manipulate the `DefaultEnable` ini setting underneath
* Implemented `xdebug_get_stack_depth()`
* Implemented `force_error_reporting` ini setting
  * This is a bitmask that will be ORed with the error reporting level to produce the final error reporting level
  * Implemented by creating corresponding hhvm runtime option `Log.ForceErrorReportingLevel`
* Implemented `halt_level` ini setting
  * This is a bitmask of error constants. The corresponding errors will be upgraded to `E_USER_ERROR` when encountered
  * Implemented by creating corresponding hhvm runtime option `ErrorHandling.UpgradeLevel`
* Implemented `scream` ini setting
  * This turns off the silencer
Closes https://github.com/facebook/hhvm/pull/3706

Reviewed By: @paulbiss

Differential Revision: D1544220

Pulled By: @sgolemon
Better error on "public void function"

Reviewed By: @jwatzman

Differential Revision: D1556218