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
Expand assert in LightProcess::proc_open

Summary: This is occasionally firing in prod. There haven't been any useful
core files but this might give us a hint as to what's going wrong.

Reviewed By: @ptarjan

Differential Revision: D1577087
Tweak the test script.

Summary: Separate the diff-generation from the actual testing.

The review script makes iterating more convenient.

Reviewed By: @jwatzman

Differential Revision: D1568601
Check exprs with short-circuit operators correctly

Reviewed By: @jwatzman, @elgenie

Differential Revision: D1567624
Maybe a refcount leak

Summary: While testing objprof I noticed that interp mode gives me the right refcount while jit mode doesn't.
Specifically, for string keys of array-data, they have one too many refcounts.
I tried to triage this with debug prints and I reached addElemStringKeyHelper (an op references from hhbc).
It looks half "copied-pasted" from the addElemIntKeyHelper except it doesn't dec the key's ref count.

I added key->decRefCount() and tested that home.php still works on my sandbox and that it fixed the refcount issue for me.
Now I'm diffing this and also running a perflab.

Image- https://www.latest.facebook.com/pxlcld/lDgL

Reviewed By: @markw65

Differential Revision: D1573712