Fix in headers defines for cygwin

Summary: An update to libcurl exposed this issue
the curl header uses win32 detection instead of proper compiler detection
make sure on cygwin this is undefined before using the curl header

Reviewed By: @JoelMarcey

Differential Revision: D1502088
VASM part 2: call, shuffleArgs, shuffle2, syncpoint, vregs

Summary: Converts more emitter-helper code to use VASM, notably shuffleArgs,
prepXMM, and PhysRegSaver. Start using makeReg() to generate temporary
virtual registers instead of named reserved tmps like rAsm/rCgGP/rCgXMM*.

Reviewed By: @alexmalyshev

Differential Revision: D1460362
VASM part 3: calls and other trickyness

Summary: Convert cgCallHelper to vasm. The two interesting parts of this are
catch edges and LdObjMethod. LdObjMethod requires two special vasm
opcodes that support the alignment and patching that goes on.

Catch blocks are supported by an "unwind" instruction that behaves like
a conditional branch; the taken edge represents a transfer of control
from the callee to the unwinder block. The normal edge represents a
normal return.

This diff starts using vasm for service requests. the service request
opcodes encapsulate more or less all of the corresponding emitReqXXX
helper functions, so they generate more asm after register allocation
and sometimes re-enter Vauto recursively. See t4785959.

Reviewed By: @alexmalyshev

Differential Revision: D1460363
VASM part 4: hoist vasm up to cgInst

Summary: Hoist the creation of the main assembler to cgInst; at this point,
each CodeGenerator cg* function must be fully converted to vasm or
left alone (fully x64-asm).

Reviewed By: @alexmalyshev

Differential Revision: D1460398
VASM part 5: decrefs, cgBinaryIntOp, cgBinaryDblOp, less m_rScratch

Summary: Converted the decref family of functions. Instead of emitting code
with an unpatched forward jump, and patching it later, the vasm version
creates the "done" block early, and passes it down to the various decref
helpers as the target to use if there's no decrement needed. (cleaner).

Converted cgCallNative so all CALL_OPCODE opcodes are converted.
vasm-ified cgBinaryIntOp and cgBinaryDblOp, and simplified them somewhat
by de-inlining special cases (noncommutative or overflow-detecting).
(these look more complicated now, but get simpler again in patches
higher in the stack).

Reviewed By: @alexmalyshev

Differential Revision: D1460408
Move mailparse to HNI

Summary: This pull request moves the functions in mailparse.idl.json to HNI.

Also, `ezmlm_hash` now calculates the hash it should calculate.

Part of #1480
Closes https://github.com/facebook/hhvm/pull/3505

Reviewed By: @ptarjan

Differential Revision: D1502587
Update and lock framework test dependencies

Summary: This updates the framework testing dependencies, and this locking of dependencies should be better than the previous way of specifying less than half of the exact versions in the composer.json.
Closes https://github.com/facebook/hhvm/pull/3411

Reviewed By: @ptarjan

Differential Revision: D1489052

Pulled By: @fredemmott
Adds a couple tests requested in my previous diff

Summary: Followup to D1496765, adds test cases related to overriding methods with different memoization attributes. These cases were requested by@fredemmott

Reviewed By: @jano

Differential Revision: D1502087
Introduce kVPackedKind for vector-like arrays

Summary: This diff introduces a new ArrayKind kVPackedKind which is vector-like
(with integer keys 0 thru n-1) and is able to gracefully downgrade into a
PackedArray.

Reviewed By: @elgenie

Differential Revision: D1483853
Parser support for "varray(..)"

Summary: This diff adds HHVM support for "varray(..)" literals in "<?hh" files, and
it removes hphp_varray().

Depends on D1483853

Reviewed By: @elgenie

Differential Revision: D1502673
Force hhi root to be set in master before workers fork

Summary: Make sure that the workers all get the same, preset hhi path,
computed by the master before they fork. This could manifest as a worker
trying to re-extract the hhi files to a preexisting location (since the
random seed is shared across all of them) and hitting an exception when
the directory already exists.

It's pretty weird that we didn't run into this immediately when I did
the hhi embedding -- AFAICT this has been wrong since day one. I think
what saved us is the logic that says "if the number of changes is lower
than N, do it all in the master", where N is about 10 -- so most of the
time this didn't matter. (And it looks like during init we do some other
stuff in the master too or something? In any event, this was hard to
trigger.)

Reviewed By: @elgenie

Differential Revision: D1501184
Print backtrace when worker dies

Summary: On an unhandled exception, we were printing the exception name
but not the backtrace. Do that too, so we have some hope of knowing what
went wrong.

Reviewed By: @elgenie

Differential Revision: D1501129
Makes <<__Memoize>> work with static methods

Summary: Next will be top level methods. The tests feel a little thin here, but I think the main memoization tests cover most of what needs to be tested so I just added tests to show that it works with a static method. Let me know what you think I'm missing

Reviewed By: @jano

Differential Revision: D1502068
Fix a crash when using sqliteCreateFunction

Summary: The segfault is reproduced by the test.
Without this fix, drupal 7 when configured to use sqlite is unusable.
The crash occurs for instance when clearing the cache.
Closes https://github.com/facebook/hhvm/pull/3512

Reviewed By: @ptarjan

Differential Revision: D1503431
check EAGAIN & EINTR in read

Summary: Closes https://github.com/facebook/hhvm/pull/3509

Reviewed By: @ptarjan

Differential Revision: D1503423
Don't apc_inc/dec on non-numerics

Summary: Closes https://github.com/facebook/hhvm/pull/3419

Reviewed By: @ptarjan

Differential Revision: D1488804
Fix json_encode UTF8 error

Summary: Removed the hack to not return false on utf8 errors
That hack was introduced due to getting utf8 errors on unexpected situations

Seems to be working now, so remove the hack.

Changed one test in slow to properly match php
Closes #3457

Reviewed By: @ptarjan

Differential Revision: D1497833

Pulled By: @fredemmott
Vasm review comments

Summary: A few cleanups, and remove the now unused align{} instruction.

Reviewed By: @alexmalyshev

Differential Revision: D1503963
Rework hphp/test/zend/.gitattributes

Summary: - if any of these are touched, you need to edit both good/ and bad/ (-bad +good hopefully)
- might as well sort them

Reviewed By: @ptarjan

Differential Revision: D1497848
Revert "Update and lock framework test dependencies"

Reviewed By: @JoelMarcey