Exposed ProfilerFactory for use in external profilers

Summary: This diff moves `ProfilerFactory` in ext_hotprofiler.cpp into the header
ext_hotprofiler.h with the `Profiler` definition.

Right now it is possible for an extension to define a profiler by just
including ext_hotprofiler.h, but there is no exposed unified way to attach it
to a thread. If one wanted to attach a profiler to a thread they would
essentially be duplicating the code currently in `ProfilerFactory`-- but
also they would have to synchronize the state of the request's `ProfilerFactory`
with their own.

Now an external profiler would just have to call `s_profiler_factory->start(...)`
and `s_profiler_factory->stop(...)` to start/stop profiling.

I've also removed the requirement that `ProfilerFactory::start` be called with
`RuntimeOptions::EnableHotProfiler` as it may not be necessary for external
profilers. Finally `ProfilerFactory::start` now returns a boolean indicating
whether or not it succeeded.

Reviewed By: @ptarjan

Differential Revision: D1434395
Changed xdebug config setting from size_t to uint64_t

Summary: In issue #3227 compiling failed due to XDebugExtension::FramebufSize having type
size_t because Config::Bind does not have a definition for size_t. We didn't run
into this issue when testing or compiling internally. But the user
compiled on mac osx, where `size_t` expanded to `long unsigned int` and
`uint64_t` expanded to `long long unsigned int`.

This diff changes the configuration option to have type uint64_t, which should
fix the error.

Reviewed By: @ptarjan

Differential Revision: D1452470
update lz4
Improve positions on enum error messages

Summary: Fix the error messages when an enum constant isn't an int or a string to actually point to the offending constant and not just where the type came from (which could be far away).

Reviewed By: jwatzman, eletuchy

Differential Revision: D1451013
folly::Singleton, a class for managing singletons

Summary: Singletons are surprisingly tricky in a codebase where
libraries depend on one another.  folly::Singleton hopes to make this
process more reliable by ensuring object creation happens in a safe
order, that destruction is possible, and that singletons are created
on-demand.

The basic fbcode use intention is to invoke registration completion in
initFacebook, so users need only declare singletons via
Singleton<ClassName> in their .cpp files.

This diff converts a couple of singletons to this model.

Reviewed By: @fugalh

Differential Revision: D1404231
Revert D1404231, folly::Singleton, a class for managing singletons

Summary: Broke hhvm open source builds.  Reverting.

Reviewed By: @JoelMarcey

Differential Revision: D1453096
Hide benign git error when running fbmake

Summary: hphp has a prerun command that runs before *every* fbmake. It runs git
to try to compute a hash for the hphp directory. Since their hash computation is
somewhat git specific, and would be difficult to port to Mercurial, let's just
hide the error that it produces for now.

Reviewed By: @sid0

Differential Revision: D1450699
Retry tracelet selection if inlining fails

Summary: Apparently, if we have a nested callstack a() -> b() -> c(), our
decision of whether or not we can possibly inline c()---depth and cost
limits notwithstanding---varies depending on whether we consider the
toplevel caller to be b() or c().

Since inlining decision-making no longer has access to the whole
callstack context, and instead just looks at a single caller-callee
pair, we need to detect these failures explicitly in RegionFormer::go()
and trigger retry.

Reviewed By: @ottoni

Differential Revision: D1452237
Remove numLocals argument from FrameState constructor

Summary: Just get it from the func argument.

Reviewed By: @alexmalyshev

Differential Revision: D1452686
Use RC files for embedded data on windows

Summary: Use windows apis on cygwin mingw and msvc builds to embed php in rc files as rcdata
That's the best way to do blobs in windows C/C++
This code is entirely contained in ifdefs for windows os's

Reviewed By: @sgolemon

Differential Revision: D1420865
Cygwin/Windows cmake build fixes

Summary: Alterations to cmake files to make building with cmake successful with cygwin, contains both generic "windows' fixes and cygwin specific ones

Reviewed By: @sgolemon

Differential Revision: D1420857
Refactor ArgumentInfo and expose on the command line

Summary: Moved Argument info to use TypingHooks and made a command line API for it.

No promises on a stable API here yet, so I left the description empty so that lots of people don't start using it.

This is purely cleanup with regard to the logic. I haven't made any real changes.

Reviewed By: @jwatzman

Differential Revision: D1450096
Drop some unused fields from typing_env

Summary: Drop pclasses and pfuns from Typing_env.env, since they are never read from.

Reviewed By: @elgenie

Differential Revision: D1453086