Remove runtime option and check for number of allocated cloned closures

Summary: This hasn't caught any real issues, and in sandbox mode we can legitimately create a lot more functions than in prod.

Reviewed By: @mclarkelauer

Differential Revision: D1598989
array_filter improvement

Summary: Sorry for going back and forth with that, but after working with this new typing in www I revised my views and would like to propose a slight improvement to typing (which I think we discussed and there wasn't any strong voices against, except it being "technically" incorrect).

So:

  function test(array<int, ?string> $a) {
    $a = array_filter($a);
    $a[] = 'test';
  }

should remain an error - that's the important distinction between hashtable arrays and vector arrays. BUT, there is no good (beyond "vectors are intended to have contiguous keys", which nobody adheres to) for this to be an error:

  function test(array<?string> $a): array<string> {
    $a = array_filter($a);
    return $a;
  }

which is currently the case.

Reviewed By: @elgenie

Differential Revision: D1584945
Fix symbolizing of OOM stack when text is mapped huge

Summary: When we map out part of .text and re-map it with huge pages, we lose
the address range -> filename mapping in /proc/self/maps, which
folly::symbolizer uses to figure out which file to search for symbols.  This
adds a pass to symbolize using /proc/self/exe, assuming no relocation.

Reviewed By: @markw65

Differential Revision: D1580689
import_zend_test.py now executes CLEAN sections properly

Summary: php-src is inconsistent with test's CLEAN section. Sometimes it starts with php open tags sometimes it doesn't.
e.g. https://github.com/facebook/hhvm/blob/master/hphp/test/zend/bad/ext/gd/tests/imagegd_nullbyte_injection.php

Also, php-src doesn't execute the CLEAN section when the test is executed. So all errors will be ignored. set error_reporting to 0 when the CLEAN section begins to ignore all errors as well.

Talked to ptarjan on IRC because my reimport will do stupid things and maybe a really nice oncall will do me the favor and reimport the whole thing? :)

Also PHP 5.6.1 is out, I don't know if it makes sense to start the import of the new version without importing 5.6.0 again.

From what I see from my import this should fix a bunch of bad tests :)
Closes https://github.com/facebook/hhvm/pull/3910

Reviewed By: @ptarjan, @JoelMarcey

Differential Revision: D1597942
hh_ide - output js objects instead of json

Summary: Instead of using out custom json pretty printing library, we'll now turn those same objects into javascript objects using js_of_ocaml's library functions.

Then, if we want json, we can use the native javascript's JSON.stringify to turn it into perfect json, instead of our hacky thing. (This'll be faster too.)

Also, this will let callers simply look inside the object instead of having it serialized and then deserialized for no reason (faster).

Reviewed By: @jwatzman

Differential Revision: D1598170
Update news for Ultramagnetic

Reviewed By: @bertmaher

Differential Revision: D1600431
Optimize in_array at IR gen time

Summary: Wordpress often uses in_array in this pattern:

  if (in_array($field, array('ID', 'post_parent'))) {

Transform this into:

  if (array_key_exists($field, array('ID' => null, 'post_parent' => null))) {

I'm restricting this to haystack arrays with only non-numeric string
keys. Allowing numeric keys gets complicated because the semantics of
array-indexing key comparisons are different from those of in_array's
comparisons.

Reviewed By: @markw65

Differential Revision: D1597251
Expand typedefs in trivial eq check.

Reviewed By: @jwatzman

Differential Revision: D1596509
Trivial equality check should recurse into nullable types.

Reviewed By: @jwatzman, @elgenie

Differential Revision: D1596548
Fix a couple more issues exposed by wholecfg region selector

Summary: - traceEnd() should only be called in Trace mode, since the last region block may not be a region exit

- allow tracked local types to become Bottom in FrameState

- don't try to pre-optimize LdLocs with incompatible types

Reviewed By: @swtaarrs

Differential Revision: D1601028
fix jemalloc stats xml

Summary: forgot to put a "/" to close the low_allocated tag. Causeing xml to not
parse properly.

Reviewed By: @bertmaher

Differential Revision: D1599874
Revert various HNI conversions

Summary: We can't handle a throw through a CoerceStk, so need to revert these for now

Revert "Convert APC to HNI"                                   : de2fb9ff58389c
Revert "Restore some mixed typed arguments with ?string type" : 042433fb53e92b
Revert "Convert string to HNI"                                : f0f3f6d7a938d3
Revert "Get rid of mangle map stuff"                          : 5ea8a1d993fd1f

The mangle map diff is a victim; things wouldn't build unless I reverted that too.

Reviewed By: @bertmaher, @jdelong

Differential Revision: D1601800
Add an ini_get_all test which gets everything

Summary: In order to ensure we are not landing breaking changes to config options, particularly
to names of those options, let's have a test that simply outputs all of the options
and their values when the test runner runs.

This test will only work with a vanilla, non-repo mode test run, so we have a `.norepo` file for this test.

Broke this up into three test parts to avoid pcre limitations when regex-ing over one big file.

Reviewed By: @ptarjan

Differential Revision: D1591831
Remove hphp/test/frameworks/perf

Summary: Moved to https://github.com/hhvm/oss-performance

Reviewed By: @oyamauchi

Differential Revision: D1599732
Hardcode array_map typing into typechecker - argument typing

Summary: As in title, see comment in .hhi file and unit tests for explanation.

Reviewed By: @elgenie

Differential Revision: D1566676
Fix in_array->array_key_exists conversion

Summary: It needs a static array, not a smart-allocated array with
the static bit set.

This also ensures that we only get one copy of each distinct array.

Reviewed By: @swtaarrs

Differential Revision: D1602742
Remove some helpers in datatype.h

Summary: One isn't used and one had a single caller.

Reviewed By: @mxw

Differential Revision: D1597974
Remove some MIN/MAX macro uses in the emitter

Summary: <algorithm> has preferable type-safe versions that don't double-eval
their args.

Reviewed By: @paulbiss

Differential Revision: D1599803
Remove now-unneeded MAP_ANON defines in read-only-arena.cpp

Summary: This should've gone away when it was switch to use malloc instead of
mmap.

Reviewed By: @bertmaher

Differential Revision: D1601873
Use smaller HHBC arena chunks by default

Summary: Why so big

Reviewed By: @bertmaher

Differential Revision: D1601886