Remove APC stats

We are moving away from unused stats and start moving the stats to a more sensible infrastructure

Reviewed By: @jdelong

Differential Revision: D1110559
Call iterNext indirectly via table with heavily specialized helpers

Make iterNext and iterNextK super specialized helpers and invoke via indirect call instead of call to single helper

Reviewed By: @paroski

Differential Revision: D1084030
Support mod_fastcgi

when using mod_fastcgi SCRIPT_NAME is the Action instead of the actual document you want
this commit uses PATH_TRANSLATED - DOCUMENT_ROOT

tested with:
apache+mod_fastcgi
apache+mod_proxy_fcgi
nginx with no PATH_TRANSLATED header
nginx with this as PATH_TRANSLATED: fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;

Reviewed By: @scannell

Differential Revision: D1114124
remove StaticContentCache scan at startup

This was added many moons ago for static content perf. Basically we scanned whatever was on disk and made a map of all the file extensions we wanted to serve. We also allow files to be loaded from disk if `EnableStaticContentFromDisk` is set (which is default on).

Having this was bad for fastcgi since `SourceRoot` doesn't even make sense there.

Reviewed By: @jdelong

Differential Revision: D1124447
return false for bad preg_match

Closes #1347

Reviewed By: @JoelMarcey

Differential Revision: D1125164
disabled tests

Including the disabled tests for mongo so I can slowly enable them

Reviewed By: @paroski

Differential Revision: D979400
Implement the equivalent of CALL_OPCODE for ARM

This gets the native-call machinery working on ARM. I tried hard to
avoid copypasta, but unfortunately I think some amount of it is
inevitable.

I've only converted one of the simplest possible opcodes (ConvIntToStr)
for now, because I've knowingly punted on some stuff for now, most
notably arguments passed on the stack. This diff gets the basics in
place; in future diffs I'll convert more opcodes and iron out the issues
that arise.

- shuffleArgs(), like SpillStack, is another one of those annoying cases
  where most of the logic is platform-independent but there are several
  instruction-emitting calls buried deep down.

- I moved ArgDesc and ArgGroup into their own file, which was fairly
  smooth, especially now that PhysReg isn't x64-specific.

- I split out Immed from asm-x64.h because it's not x64-specific and
  ArgDesc depends on it.

Reviewed By: @edwinsmith

Differential Revision: D1121726
Fix valgrind issue in Github build

This fixes a JIT crash with VALGRIND=1.

Closes #1483

Reviewed By: @ptarjan

Differential Revision: D1117038

Pulled By: @scannell
Implement codegen for LdLoc, IncRef, AssertType

LdLoc was the goal here (it was by far the most frequent punt). It's
really simple to implement, but it turned out that doing codegen for it
had a few cascading effects.

- We're now carrying registers across InterpOne calls, so switch to
  using cgCallHelper there.

- Using cgCallHelper for interp-one now requires cgCallHelper to support
  immediate arguments to helpers.

- IncRef and AssertType are now generated in such a way that we can't
  punt on them (even if you punt on them, they show up in
  hhbc-translator output).

Reviewed By: @edwinsmith

Differential Revision: D1120272
Don't preemptively optimize away conditional jumps

There may be a stack adjustment needed.

Reviewed By: @ottoni

Differential Revision: D1124766
Print test commands when --verbose is present in test/run

Sometimes I want to see the command to run a test even if it's not
failing.

Reviewed By: @ptarjan

Differential Revision: D1114189
Document TakeStack better, emit it in fewer situations

There was no obvious context for why it was being emitted in
simplifyLdStack, and we don't need to emit it if the new value is already from
a raw load.

Reviewed By: @edwinsmith

Differential Revision: D1114188
HHVM MySQL corrections for bogus connections

Followup to https://github.com/facebook/hhvm/commit/76cab4dd67c3b20ad64927ada9bd71d0c4

Reviewed By: @ptarjan

Differential Revision: D1124285
Remove s_file_mutex from util.cpp

Apparently dead.

Reviewed By: @bertmaher

Differential Revision: D1124735
Move LogFileFlusher to its own header

Out of util.h.  For now, put drop_caches into
compatability.h, but that could easily turn into a blob-header also if
we're not careful.  Also made some style changes: make the virtual
private (virtual functions should rarely be protected), override
keyword, non-static member initializer, s/class/struct/.

Reviewed By: @edwinsmith

Differential Revision: D1124736
Remove includes of util.h from util/ headers

Few of them were using functions exported by util.h, they
were just using it to grab things like std::map.  Fixed some
downstream direct-includes.  Where trivial, used folly or boost
instead of Util::.

Reviewed By: @ptarjan

Differential Revision: D1124738
Remove includes of util.h from .cpp files in hphp/util

Replace some uses with folly functions or boost.  I kept
string_vsnprintf in its own header for now.  We could probably move it
to folly/String.h (folly has stringPrintf and such, just no vararg
version), but on the other hand using va_list is not very encouraged
so maybe we should just leave it here for these legacy uses.

Reviewed By: @ptarjan

Differential Revision: D1124742
Let systemlib units go through hhbbc

After the change to include systemlib in hphpc's static
analysis, I temporarily cut them out of whole_program in HHBBC.  The
problem was just that systemlib needs to end up merge only, but none
of hhbbc's output units are merge only.  Solve this with a special
case in emit.cpp for now.

This seems to make a ~2x slow down in how long the first analyze pass
takes hhbbc.  I think the reason is that now *tons* of things are
registering dependencies to common builtins that didn't use to
(e.g. idx)---it seems to be spending a lot of time on the single lock
there now.  (Will probably change it to tbb ...)

Reviewed By: @dariorussi

Differential Revision: D1125024
Add support for "bumping" trace levels, use it to not trace systemlib in hhbbc

Use this so systemlib units will only be traced if the level
is higher than normal.

Reviewed By: @edwinsmith

Differential Revision: D1125039
Use tbb::concurrent_hash_map for the Index dependency map

It was previously just a std::mutex around a
std::unordered_map, which seems to be a big source of contention after
putting systemlib is in the mix.

Reviewed By: @edwinsmith

Differential Revision: D1125048