Convert bindcall to vasm

Summary: Do bindcall using vasm, by converting emitBindCall to emit the
mainline vasm code to set up and call, and also generate the
REQ_BIND_CALL service request stub at codegen time. The stub
generation is done using a self-contained vasm unit, which we
lower to asm during codegen time.

Removed the Vout& vfrozen param from CodeGenerator, since it
was dead, but also pass in CodeBlock& frozen, since we need it
to generate the ephemeral service request stub. This would cause
an assert if vmain were actually pointing to frozen (marked Unused),
however we never do that.

Also, refactor x64::emitServiceReqImpl() to take a CodeBlock.
The tricky pointer manipulation is all for generating ephemeral
service request stubs, and it's simpler to just pass in a mutable
CodeBlock, which has meaningful base, frontier, and capacity members.

Reviewed By: @swtaarrs

Differential Revision: D1625531
CodeGenerators don't need to be virtual anymore.

Reviewed By: @jasone

Differential Revision: D1627033
Update third-party/ to bump folly version
Eliminate m_curInst

Summary: Why use a global when a local will work? This diff inches its
way towards breaking down the class-with-bytecode-methods organization
of CodeGenerator.

Reviewed By: @swtaarrs

Differential Revision: D1626666
Make sure we have non-zero exit status on hack build err

Reviewed By: @jwatzman

Differential Revision: D1617708
Convert IPC to HNI

Summary: fixes #3922

Reviewed By: @markw65

Differential Revision: D1602962
Make vasm-x64.cpp's lowerCalls a little more generic

Summary: It will soon be handling more than just vcall/vinvoke.

Reviewed By: @edwinsmith

Differential Revision: D1622969
Convert process to HNI

Summary: fixes #3934

Reviewed By: @markw65

Differential Revision: D1604838
Delete db code

Summary: Unused these days.

Reviewed By: @ptarjan

Differential Revision: D1628313
Make HTTP status phrases optional with a fallback for known codes

Summary: RFC 7231 defines status line as follows:
"The first line of a response message is the status-line, consisting
of the protocol version, a space, the status code, another
space, a possibly empty textual phrase describing the status code,
and ending with CRLF."

- This basically means response phrase is optional and may be omitted.
In that case, fall back for default response phrase for known codes or
empty string for others.

- Fix usage of explicit HTTP/* header to set response phrase properly,
if set.

- Also synchronize default phrases to match codes defined in RFC.

Closes #3907. Closes #3945. Partially reverts 93a6dc27c9.
Closes https://github.com/facebook/hhvm/pull/3976

Reviewed By: @paulbiss

Differential Revision: D1618243
Add script to add HH_FIXME

Summary: Simple script to take the output of `hh_client --json` and add
a FIXME for every single one.

Reviewed By: @dlreeves

Differential Revision: D1614381
Remove CodeGenerator::m_slocs & m_dlocs

Summary: They're just copied from m_state.locs, so plumb that through
to the handful of callsites that need it, and plumb inst through
to srcLoc() and dstLoc().

Reviewed By: @jdelong

Differential Revision: D1626986
Some cleanup of PCRE header

Summary: It seemed out of place for pcre_ functions to be declared in
program-functions.h.  Moved them to preg.h for documentation, and forward
declared them where necessary to keep dependencies minimal.

Reviewed By: @jdelong

Differential Revision: D1625249
Get tests passing with Simplifier turned off

Summary: Since we've lately discovered that Simplifier has some pretty
significant unsoundness, we wanted to see how much it costs us to turn
it off. First step is to pass tests with it turned off.

- The change to make bool-casting an array be accurate for
  NameValueTableWrapper wasn't applied to one callsite, which gets
  called by the translation of ConvCellToBool, which appears much more
  commonly when simplifier is off.

- The spec's description of CheckNullptr was wrong. This sent me on a
  wild goose chase for a bit.

- `AssertNonNull(nullptr)` appears in the IR with simplification off.
  This is OK because it's unreachable, but we need to give it a type
  that isn't Bottom and corresponds to a DataType, to avoid upsetting
  machinery downstream. (This definitely feels silly, but I tried a
  variety of other solutions and this is the simplest I found.)

- We start seeing `IsType<InitCell>`, which requires two comparisons to
  check. Just punt on it.

Reviewed By: @jdelong

Differential Revision: D1628088
Remove a couple of references to Eval.JitAStubsSize

Summary: This option was killed when we split astubs into cold and frozen.

Reviewed By: @bertmaher

Differential Revision: D1628118
Several changes to make simple tracelets pass with LLVM code gen.

Summary: Use HHVM_TC calling convention to gain access to %rbx, %r12, %rbp.

Workaround for non-SSA reserved registers.

Implementation for direct vcall/vinvoke instructions.

Substitution of pushm/ret combo with a tail call.

Fake personality function recognizable by LLVM runtime.

Emit set of instructions for minimal tracelets to pass.

Force no function alignment for emitted code.

Override stack alignment with 8 bytes.

Added a couple more optimization passes.

Create own MInstrState area and redirect %rsp-relative addresses to it.

Reviewed By: @swtaarrs

Differential Revision: D1616966
Emit uses of ZR intelligently on ARM

Summary: I added this to the immediate-folding pass. It seemed like most of the
unfortunate zero constants came from stores (e.g. in SpillFrame) so I've
added those for now.

In the process of doing this, I found a couple places where we were
emitting "add x0, x0, #0x0" which is totally useless, so I eliminated
those.

I eliminated all mention of zr from code-gen-arm.cpp, since we should
just make this pass handle all of it.

Reviewed By: @edwinsmith

Differential Revision: D1629590
Enable PGO for all functions

Summary: In server mode, only functions marked as hot were target of PGO.
This diff enables PGO for all functions.

Reviewed By: @jdelong

Differential Revision: D1623210
Convert most fssa() instructions to make call-target decisions at codegen time

Summary: We've had a long-standing issue since we do the indexing in the
optables at translation time, which means that changes (refinments) in the
instruction arg types in later optimization passes can break things.  This came
up again recently (and hopefully will come up more in the future), so let's fix
it.  For most cases this just moves the optable indexing to codegen time---but
there's were also a decent number of opcodes that used fssa() for no apparent
reason (or in some cases used optabs just to handle a bool, which seems a bit
excessive), so those were just converted into if statements or normal
native-calls on case-by-case basis.

Reviewed By: @swtaarrs

Differential Revision: D1625316
Remove fssa() support from native-calls.cpp

Reviewed By: @swtaarrs

Differential Revision: D1625331