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
Lazily allocate PCFilter

Summary: PCFilter basically holds a pointer to a trie, but it always allocated one
level. To avoid that, a couple of the PCFilters on ExecutionContext were
dynamically allocated. It seemed to make more sense to just lazily allocate
the root pointer, and avoid the double indirection.

While working on the diff I noticed that at each level, we were mallocing a
PtrMapNode, whose sole purpose was to hold a single, malloced pointer. So
I removed a level of indirection there too.

Reviewed By: @jdelong

Differential Revision: D1573909
Fixes <<__Memoize>> causing fatals when applied to static functions on traits

Summary: Normally the static $impl function is called by name on statics, but with traits that resolves to calling a private static method on another class. The fix is in this scenario to call self::foo$impl(); There's precident for this in EmitterVisitor::emitFuncCall().

Reviewed By: @jano

Differential Revision: D1576279
Prevents collisions between strings and objects as cache keys

Summary: With DY, if an object can have the same cache key as a string. This behavior was replicated in <<__Memoize>>. While that probably never happens in practice, this makes it correct by disambiguating strings and objects.

Reviewed By: @jano

Differential Revision: D1575956
typechecker: Error on trivial equality checks on primitives.

Summary: I deleted the typing_fail_int_float.php test because it was failing with the
new check, and it didn't actually seem to be testing for any fails...

Reviewed By: @elgenie

Differential Revision: D1540609
add OPT_VERIFY_KEY, OPT_SORT_HOSTS, resetServerList()

Summary: Fixes #3615, #3616, #3617. A superset of #3827.

Thanks to@​keyurdg and@​adsr for helping me out!
Closes https://github.com/facebook/hhvm/pull/3833

Reviewed By: @ptarjan

Differential Revision: D1576206
Implement getImageSizeFromString()

Summary: Open a data stream to get the string as a stream which can be passed to the logic in f_getimagesize(). This logic is moved into a new function

The implementation of getImageSize() and getImageSizeFromString() could be moved to PHP, but I am not sure how to expose the C++ function to PHP land.

Fixes #3801

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

Reviewed By: @ptarjan

Differential Revision: D1576163