Convert server to HNI

Summary: fixes #3948

Reviewed By: @ptarjan

Differential Revision: D1615453
Convert LDAP to HNI

Summary: fixes #3931

Reviewed By: @ptarjan

Differential Revision: D1615345
Eliminate Vmeta

Summary: It was useful during transition to vasm, when we needed to
track program points across multiple Vunits. No longer useful.

Reviewed By: @swtaarrs

Differential Revision: D1631688
Don't pass userdata to callback in array_walk unless it was specified

Summary: Fixes #3022

Reviewed By: @ptarjan

Differential Revision: D1634275
Move CodeGenerator::m_unit and m_frozen to CodegenState

Reviewed By: @jdelong

Differential Revision: D1631629
Standardize on lea for address computations (including sp adjustments)

Summary: It's the same size in every situation we use it in, it doesn't modify
eflags, and Intel explicitly recommends using it for values that will be used
as pointers in loads or stores later on down the line.

Reviewed By: @edwinsmith

Differential Revision: D1631697
Tweak to enable more refcount optimizations

Summary: When a value is known to exist in many places, observeValue() will not
insert any IncRef before a DecRef. That's bad because it ends up
preventing some IncRef/DecRef pairs from being eliminated because the
IncRef is pushed down past the DecRef.  This diff makes sure that we
always drop an IncRef before a DecRef, which then enables more
IncRef/DecRef pairs to be eliminated.

Reviewed By: @swtaarrs

Differential Revision: D1631498
Add native data serialization support

Summary: If a native data class contains the following function, it is considered serializable.

Variant sleep()
void wakeup(const Variant& content)

All serialized native content will be stored along with other user-defined serializable properties.
Native content is stored using a reserved key "[underscore][underscore]native".
The key value pair [underscore][underscore]native will not appear in the serialized map if sleep() returns null.

Reviewed By: @elgenie

Differential Revision: D1582161
Add a thread filter to the ring buffer

Summary: Typically you just want to know what was happening recently on
the thread that crashed, so add a thread parameter. 0 means all threads.

Reviewed By: @swtaarrs

Differential Revision: D1634720
emitFuncGuard should use prepareForSmash

Summary: We don't want to recreate the alignment logic
in lots of places, and we need to tag the guard so that
future relocations know its alignment requirements

Reviewed By: @swtaarrs

Differential Revision: D1634806
Add ReflectionClass::getAttribute to HHI

Summary: Already there for functions and parameters, was missing for classes. Fixes facebook/hhvm#4049

Reviewed By: @jano

Differential Revision: D1634952
Micro-optimize InitPackedArrayLoop

Summary: Its okay to use SIMD registers to move values from the stack to
the array, because PackedArray doesn't use TypedValueAux's m_aux
field. Use the flags from subqi instead of cmp(0,j).

Once those changes were done I noticed an xchg crept into the
code (due to lack of phi-hinting), so fiddled the initialization
order to suppress the xchg.

Reviewed By: @mhahnenberg

Differential Revision: D1632139
LZ4_uncompress is obsolete, breaks build with out-of-tree LZ4.

Summary: LZ4_uncompress() has been replaced 1:1 with LZ4_decompress_fast().  When
you use an out-of-tree liblz4 r122 or beyond, LZ4_uncompress doesn't exist
anymore.  From bottom of lz4.h:

 [...]
 /*
 Obsolete decompression functions
 These function names are deprecated and should no longer be used.
 They are only provided here for compatibility with older user programs.
 - LZ4_uncompress is the same as LZ4_decompress_fast
 - LZ4_uncompress_unknownOutputSize is the same as LZ4_decompress_safe
 */
 int LZ4_uncompress (const char* source, char* dest, int outputSize);
 [...]

LZ4_decompress_fast() is already present in third-party's copy, so even if this
is not breaking a build with an internal lz4, it is for Debian and any other that
may have the library outside of the HHVM tree detected by CMake.

Closes: https://github.com/facebook/hhvm/issues/3610

Reviewed By: @ptarjan

Differential Revision: D1628566
Add operator|(PhysReg) and a few other overloads, and use them.

Summary: Makes RegSet manipulation a bit clearer.

Reviewed By: @swtaarrs

Differential Revision: D1636964
Fix findPrecedingFPI

Summary: Its possible that the first fpi region contains the
region we're after. Initialize fe to nullptr, and start from 0.

Reviewed By: @jdelong

Differential Revision: D1636070
Make uniqueStubs for bindCall

Summary: Most of the information compiled into the bindCall stubs can be computed from the callee ActRec. Once thats done, we only have two stubs; one for immutable calls, and one for non-immutable calls. So make a uniqueStub for each.

Reviewed By: @edwinsmith

Differential Revision: D1633348
Allow unlimited memory for the warmup requests

Summary: I guess it wasn't as bad as I thought.

Reviewed By: @bertmaher

Differential Revision: D1636748
Initial foundation for merging CodeGenerator classes

Summary: This is a real idea, but if people hate it I can pursue something else.

The plan is to gradually convert as many opcodes as possible in the ARM
class to DELEGATE_OPCODE first, before eventually merging the classes.
This will make the eventual merge go as smoothly as possible. Here's how
I envision it:

- Turn as many opcodes as possible into DELEGATE_OPCODE on the ARM side,
  both ones that are currently punting and ones that have real
  implementations. This will probably entail adding an x64->arm lowering
  pass to allow to use more of the x64 implementations unmodified.

- When that's done, merge the classes. Everything will go through
  x64::CodeGenerator. For the opcodes that still have divergent ARM
  implementations, we'll create things like cgBlahX64 and cgBlahARM,
  mechanically

- For those divergent opcodes, we can gradually replace them with mostly
  merged versions, with a little bit of branching in the middle.

Reviewed By: @edwinsmith, @swtaarrs

Differential Revision: D1635576
Make sure type is right when emitting testbi.

Summary: If the argument to testbi is larger than 1 byte we need to truncate it.

Reviewed By: @markw65

Differential Revision: D1636186
Fix logging

Summary: We were clearing some of the stats before logging them

Reviewed By: @jano

Differential Revision: D1637551