Add Closure::bind() to news

Summary: .

Reviewed By: @ptarjan

Differential Revision: D1567365
Implemented constant HHVM_VERSION_ID

Summary: Closes #3758
Closes https://github.com/facebook/hhvm/pull/3806

Reviewed By: @ptarjan

Differential Revision: D1568916
cotire 1.6.6

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

Reviewed By: @ptarjan

Differential Revision: D1569826
Fix SplFileInfo::setFile/InfoClass

Summary: Use infoClass and not fileClass everywhere
Also throw proper exceptions

This fixes an issue in zf2 (most likely)
Closes https://github.com/facebook/hhvm/pull/3814

Reviewed By: @ptarjan

Differential Revision: D1569299
SSA for GetCtxFwdCall and GetCtxFwdCallDyn

Reviewed By: @alexmalyshev

Differential Revision: D1568547
Provide an option to not have the default runtime options specified by the wrapper

Summary: Right now we always set these options:

```
    $flags .=
      '-v Eval.EnableHipHopSyntax=true '.
      '-v Eval.EnableHipHopExperimentalSyntax=true '.
      '-v Eval.JitEnableRenameFunction=0 '.
      '-v Eval.GdbSyncChunks=1 '.
      '-v Eval.AllowHhas=true '.
      '';
```

Let's provide an escape hatch just in case we want something just a bit more vanilla

Reviewed By: @jdelong

Differential Revision: D1570066
libxml error handler

Summary: after looking at the memory profiling, i found a lot of allocations coming out of the vector used for collecting libxml errors for later use.

- add new libxml_suppress_errors(bool $enabled) to control discarding errors recieved from libxml/domdocument

one oft-used idiom is:

  libxml_use_internal_errors(true);
  // do something that could possibly generate a lot of libxml errors
  libxml_use_internal_errors(false);

the libxml_use_internal_errors(false) call discards all the errors that were collected.
there's no reason to allocate storage to copy them into the request just to throw them away.

- change storage of xmlError structs to folly::fbvector. the pattern used is:

  v->resize(v->size() + 1)
  auto& e_copy = v->back();
  // manipulate e_copy

perhaps fbvector's reduced growth factor will help a little here. not benchmarked.

- pre-allocate storage for libxml_get_errors()

Reviewed By: @jano

Differential Revision: D1539513
grep for error: and warning: before checking for binary

Summary: I also changed from looking for `Error` on a `make` line to looking for the cmake error which will be ` error: `. Hopefuly this will surface the real reason for failure.

Reviewed By: @edwinsmith

Differential Revision: D1568139
Fix some tests in asan builds

Summary: zend-url.cpp was reading past the end of a string without verifying
its length. The other two tests were overflowing the VM stack, since it's
smaller for valgrind and asan. The new, smaller versions of the tests should be
just as useful. There are still a few more issues relating to C++ stack size
but I don't have time to get those right now.

Reviewed By: @edwinsmith

Differential Revision: D1566405
Fix Memcache return values/types

Summary: Part 1: Memcache was previously returning all values as a string, no matter what they were input as.  Now their original value is saved into the flags and restored when pulled back out from cache.
However,@fredemmott suspects this might break some internal Facebook PHP code, so someone from Facebook probably should try this out and make sure it doesn't.

This change also disables compression for integer/float values (emulating the pecl extension functionality).

Part 2: Memcache was previously always returning integers for the increment and decrement functions.  Now they return mixed/variants of int or bool (for failures).

Fixes #3789.
Fixes #3790.

Closes https://github.com/facebook/hhvm/pull/3802

Reviewed By: @ptarjan

Differential Revision: D1568454
Handle multiple pass-through instructions when merging local values

Summary: FrameState::merge had logic to keep the local value if one of the
branches had a value that was the dest of a pass-through instruction
whose source came from another branch.  This diff generalizes that to
handle cases where there are multiple pass-through instructions in one
of the branches.

Reviewed By: @swtaarrs

Differential Revision: D1569596
Fix a bug in the HealthMonitor, and try turning it on

Summary: While digging into the idle-flush issues the other day,
I noticed what I think is a bug in the health monitor code;
once a thread thinks its in an unhealthy state, it will stick
in that state until it gets a hi-pri request.

I don't think the reverse is an issue; if its initially healthy,
there's no need to check again. If there was a job available,
it will grab it immediately and go; and if there wasn't we're
unlikely to be in an overload situation.

Reviewed By: @​dmitrip

Differential Revision: D1554101
partial ext_asio

Reviewed By: @jano

Differential Revision: D1570375
move HNI'd functions into HH namespace

Reviewed By: @jano

Differential Revision: D1571329
EZC: Fix count() and conversion to boolean of ProxyArray

Summary: Fix JIT versions of count() and conversion of array to boolean, so that they work with ProxyArray. In both cases, duplicate the logic in ArrayData::size() -- if the sign bit of the size field is unset, use that field, otherwise call vsize().

The resulting generated machine code for conversion to boolean is along the lines of:

  mov    0x4(%rdi),%eax
  test   %eax,%eax
  js     0xf80049b
  setne  %al

where 0xf80049b is the slow path. This is similar to the machine code I previously reported for ArrayData::size() in code review of 1717e028f18 (see #3065).

Added test case which previously failed.
Closes https://github.com/facebook/hhvm/pull/3811

Reviewed By: @ptarjan

Differential Revision: D1568919
Fix nl2br support for carriage returns.

Summary: nl2br() now matches PHP to support prepending of html new lines on carriage returns in addition to newlines.  We also handle special cases when there is a carriage return beside a newline; each pair only get one html new line instead of two.

Fixes #3815

Closes https://github.com/facebook/hhvm/pull/3821

Reviewed By: @ptarjan

Differential Revision: D1571327
Move register hints to the vasm instruction macros.

Summary: @jasone and I both have run into bugs with the way the register hinting
code is organized. This adds DH and UH macros (def hint, use hint)
that avoid needing the nasty switch, and don't require all those
instructions to have identical operand names.

Reviewed By: @swtaarrs

Differential Revision: D1570915
Don't allow split before phidef in the same block.

Summary: If a phidef caused another interval to be split and spilled,
the split position could be just before the phidef in the same
block, which is illegal. Fix the nearestSplitPosition to
be the start of the block, which forces copies to the edge.

Added an assert that checks we don't try to copy two different
intervals to the same physical register along the same edge.
(which fires before this fix).

Reviewed By: @alexmalyshev

Differential Revision: D1568347
Better errors on runtime generics.

Summary: Closes https://github.com/facebook/hhvm/issues/3711

Reviewed By: @jwatzman

Differential Revision: D1565849
SSA for ExtendsClass and LdFuncCachedU, enable asserts in vasm-check.cpp

Summary: This is the last of the conversions; vasm is required to be SSA now.

Reviewed By: @alexmalyshev

Differential Revision: D1502355