Cleanup thisReturn()

Summary: GuardLoc and friends don't define a new FP anymore.

Reviewed By: @alexmalyshev

Differential Revision: D1572128
FrameState::startBlock should take a LocalStateHook

Summary: It'll null out local values if it enters a loop header, so we want to
pass in a LocalStateHook so that it can clear its locals too.

Fix refcount-opts so that it correctly consumes all locals when
startBlock nulls them out.

Reviewed By: @swtaarrs

Differential Revision: D1550496
Typing of single-argument array_filter

Summary: Here is a pretty common patten: you use an API to load a bunch of stuff, some of it may come back as null due to circumstances beyond your control, so you stick it into array_filter... and we're blind, going from array of strongly typed things to an unknown type.

Here is a proposal to improve the situation by hardcoding (some part) of the array_filter behavior into the type-checker. See the unit tests for example of how I imagine it working. It changes type of array_filter, depending on the type of arguments, to one of the following:

function(array): array
function(Container<?Tv>): array<mixed, Tv>
function(KeyedContainer<Tk, ?Tv>): array<Tk, Tv>

Reviewed By: @elgenie

Differential Revision: D1447846
Update .hhi files for array_filter

Summary: Sane typing.

Reviewed By: @elgenie

Differential Revision: D1567517
array_filter: make the .hhi files work with custom return type.

Summary: This is merging work from D1447846 and D1567517. It was originally set up in a way that ignored .hhi definitions, but I do want to use them for argument typechecking, I just want to overwrite the return type with something custom.

Reviewed By: @dlreeves

Differential Revision: D1567598
Fixed the logic of touch() function

Summary: The logic as it used to be was different from the one in PHP5 and what's required by the standard.

This non-compliance was breaking Symfony's SortableIteratorTest.

Reviewed By: @ptarjan

Differential Revision: D1568332
Expose numRows in the QueryResult

Summary: Currently we have 3 ways to count the number of rows!
diffusion/E/browse/tfb/trunk/www/flib/core/db/api/DBResult.php;1425779$286-293

Reviewed By: @​campbellmadam

Differential Revision: D1571307
Use a larger C++ stack in asan builds

Summary: asan builds use a lot more C++ stack in certain functions than normal
builds (40-50x more in some cases). This is a problem for some of our recursive
cfg traversal functions in the jit. A better fix would be to not recurse over
data structures that are sized by user code, but making the C++ stack bigger
will allow us to reenable the automated asan builds without rewriting a bunch
of things.

Reviewed By: @jdelong

Differential Revision: D1573383
Fix remaining asan test failures

Summary: - The JEWISH_MONTH_NAME macro was accessing an array out of bounds when given a
  year < 1. According to a few sources on the internet, years < 1 don't exist
  in the Jewish calendar, so the result is undefined.
- A copy of ext/gmp/tests/002.php already exists in test/slow, so instead of
  applying the same fix I moved it to flaky.

Reviewed By: @alexmalyshev, @bertmaher

Differential Revision: D1573700
Add class name to error message of static method lookup failure.

Summary: This will be useful when we add support for typechecking static method
lookups on objects, since the type of the object may not be immediately
obvious.

Reviewed By: @elgenie

Differential Revision: D1568867
Replace boost::{next,prior} with std::{next,prev}

Summary: They're the same thing, but one is in the standard lib.

Reviewed By: @jdelong

Differential Revision: D1573137
Smaller handful of JIT-speed optimizations.

Summary: Optimize allocation in dce using a vector instead of linked list

inline some hot ir functions

Eval.JitRelocationSize defaults to 0 in opt builds, and 2^20 in debug builds.

optimize outputType()

partially inline subtypeOf

Reviewed By: @jdelong

Differential Revision: D1572492
remove extra newline

Reviewed By: @JoelMarcey, @fredemmott

Differential Revision: D1575599
Always emit a jump in HhbcTranslator::endBlock

Summary: Otherwise, we can end up with mal-formed IR due to a block lacking a
fall-through.  If the fall-through offset doesn't belong to the
region, the fall-through jump will go to an exit block.

Reviewed By: @jdelong

Differential Revision: D1572617
Remove some random includes of ext_apc.h

Summary: Noticed these in some extension code that don't actually appear to use
APC.

Reviewed By: @jdelong

Differential Revision: D1574376
Disable CSE while building IR with bytecode control flow

Summary: When dominators aren't available, CSE assumes it's safe.  This is fine
for traces, but it's incorrect with control flow.

Reviewed By: @bertmaher

Differential Revision: D1573970
cmake style fixes

Summary: I was trying to fix our out-of-tree builds, but gave up and was left with these good fixes

Reviewed By: @JoelMarcey

Differential Revision: D1572883
only run quick tests on travis

Summary: while I was in there I deleted a bunch of commented out lines that didn't seem to add anything of value to the config

```
# Sadly, travis only gives up 50 minutes to compile and run our tests. The
# compilation machines usually have a bunch of CPUs but very little RAM so gcc
# dies trying to compile some of our files if we do more than -j 6. So, with -j
# 6 that takes ~40 minutes, leaving only 10 minutes to test. The only thing we
# can fit in that time is the quick tests in no-repo mode. So basically this is
# a smoke test (did it compile and not segfault immediately) instead of a real
# test run. Please check out the attached phabricator to your PR for full unit
# test coverage.
```

Reviewed By: @fredemmott

Differential Revision: D1575816
Implement Memcached::resetServerList()

Summary: Fixes #3615
Closes https://github.com/facebook/hhvm/pull/3827

Reviewed By: @ptarjan

Differential Revision: D1572738
Fix incorrect index in arm cgShuffle

Reviewed By: @swtaarrs

Differential Revision: D1575213