Replace Type::from(RuntimeType|DataType|DynLocation) with constructors

These have always bothered me. They only exist as historical
baggage from back before Type was a real class. I also took this
opportunity to convert everything in the jit to use KindOfAny instead
of KindOfInvalid/KindOfUnknown, mostly to clean up conversions from
DataType -> JIT::Type.

Reviewed By: @jdelong

Differential Revision: D960018
Differential Revision: D963452
Fix collection cloning refcount

When using collection literals in property initializer the ref count is 2 instead of 1 and the collection leaks

Reviewed By: @jdelong

Differential Revision: D959451
Fix test/slow/ext_iterator/1800.php.expectf

Directory sizes vary between machines.

Reviewed By: drussi

Differential Revision: D961338
Move some working Zend tests

move some working Zend tests

Reviewed By: @ptarjan

Differential Revision: D960549
Rename the HA ArgType in hhbc.h to LA

Removes an old TODO here from when we removed homes from
HHBC.

Reviewed By: @edwinsmith

Differential Revision: D960900
Change StringData::set{Char,} API to return new StringData

I want it to be able to reallocate.  (This diff shouldn't
change any behavior, except adding a test on the return value that
can't ever succeed for now.)

Reviewed By: @edwinsmith

Differential Revision: D960724
Differential Revision: D963394
Remove StringData::negate, and just do it at the single caller

Reviewed By: @edwinsmith

Differential Revision: D960782
Remove string modes except Flat and Shared

Modify the remaining mutation functions so they can
optionally return a new StringData*, and make a new rule that strings
created with MakeMalloc cannot have the mutation functions called.
Then reserve/escalate can both always create flat strings, and
MakeMalloc can create flat strings.

Reviewed By: @edwinsmith

Differential Revision: D960849
Improve StringData::Make(SharedVariant*)

The StringData inside a SharedVariant caches the hash for the
shared string, but we wait until the first time it is accessed to load
it into the request-local string.  Since we're already loading things
out of the shared memory at creation time, just eagerly load it there.
(It might be zero if no one has hashed it yet: we update it racily
from whichever request hashes it first.)  This diff also shuffles some
code around to avoid extra checks for MaxSize, and removes a few
redundant loads that gcc couldn't remove in some Make functions.  Also
move the code to shared-variant.o, and inline the fast path into its
only caller.

Reviewed By: @edwinsmith

Differential Revision: D960931
Remove StringData::copy, clean up ImmutableObj

Replaces use of copy with appropriate calls to Make (or
nothing in the case of class names, which are always static).  Fix
copy construct bug in ImmutableObj, make its header not included in
shared-variant.h, some const correctness and other tweaks.

Reviewed By: @edwinsmith

Differential Revision: D960942
Reorder HphpArray members some; make ctor/dtor private

Get the data representation all at the end, and keep all
privates non-data members at the end too.  Private ctors (eventually
should be removed and replaced by the Make functions) so we can change
its allocation behavior.  The public members are still in a mostly
random order for now, and I left the bulk of the non-static private
member functions alone.

Reviewed By: @edwinsmith

Differential Revision: D960965
Fix stack trace generation with compressed debug info

There were two issues:
 - you have to set BFD_DECOMPRESS on the bfd*, or it won't
   decompress compressed sections,
 - if the debug info is in a separate file, linked by
   .gnu_debuglink, libbfd will follow the link, but won't
   propagate the BFD_DECOMPRESS flag.

I changed the code to add the flag, and manually follow the
.gnu_debuglink sections, adding the flag as it goes.

Reviewed By: @jdelong

Differential Revision: D961365
delegate opendir to stream library

Directories should be just like Files. I repurposed the `Directory` resource so it didn't just hold a `DIR`. I tried to copy `File` as much as I could.

I implemented the Phar `opendir` as a re-usable `ArrayDirectory`. It felt a bit weird passing an `Array` to the constructor and then not doing anything during open, but it seemed to match `MemFile`.

Reviewed By: @markw65

Differential Revision: D903572
Convert asm test to use util/disasm.h

Make it so the the output doesn't depend on the version of
objdump that's available, so the test is more stable.

Reviewed By: @andralex

Differential Revision: D960736
enable Zend tests to be run in repo mode

Most of the Zend tests that work will work in repo mode, so
enable that. Create .norepo files for the rest.

Reviewed By: @sgolemon

Differential Revision: D961424
fix flakey socket tests

I saw these fail once

Reviewed By: @markw65

Differential Revision: D960622
Prevent race with bug39538.php

We'll use our own file instead...

Reviewed By: @jdelong

Differential Revision: D961808
Fix memory leak + incorrect behavior in fgetcsv()

Mostly making File::readCSV look like the code from Zend PHP,
also required changes to how SplFileObject::fgetcsv() handled its
arguments

Reviewed By: @ptarjan

Differential Revision: D961647
Fix behavior of stream_get_contents when default args are used

stream_get_contents was assuming a default 0 for maxlen and offset.
Vanilla php uses -1 as the default for both.

Reviewed By: @ptarjan

Differential Revision: D954736
Remove some flaky bits from test/slow/ext_socket/ext_socket.php

These two tests have flaked out on a couple diffs recently.

Reviewed By: @ptarjan

Differential Revision: D961944