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