Use LowFuncPtr for Class method table

Summary: Probably uses less memory or something.

Reviewed By: @edwinsmith

Differential Revision: D1587099
Shave 32 bytes from Class using LowPtr

Summary: Bytes == bad.

Reviewed By: @jdelong

Differential Revision: D1587563
Offload rarely-used members of Class to Class::ExtraData

Summary: Data members for traits (which are flattened in repo mode), reflection
methods, and builtins don't need to be present for all Classes in the
common case.  Bytes == bad.

Also includes two auxiliary changes:
- Add a range() method to IndexedStringMap.
- Add a DefaultPtr type to shortcut `px ? px->m_f : my_default`.

Reviewed By: @jdelong, @elgenie

Differential Revision: D1591981
Remove duplicate tests.

Summary: Found all these by running a dedup script.

For every fileN.php deleted in this commit, the duplicate file is at file(N-1).php.

Reviewed By: @elgenie

Differential Revision: D1596717
Make solve_todos a utility function.

Summary: Makes it easier to add other types of 'todos'.

Reviewed By: @elgenie

Differential Revision: D1596894
Fix small memory leaks in ext_bcmath.cpp

Summary: Use SCOPE_EXIT to properly release resources, even when the function raises a warning or returns prematurely.

Reviewed By: @jdelong

Differential Revision: D1597156
Forgot to use emitLdLowPtr for Class::m_invoke

Reviewed By: @bertmaher, @markw65

Differential Revision: D1597419
Add 1s by default between starting $php_engine and running sanity check

Summary: php-ng starts up faster - and nginx hasn't finished starting up, so the sanity check fails.

Reviewed By: @oyamauchi

Differential Revision: D1597189
Make hhi for some builtin constants.

Reviewed By: @jwatzman

Differential Revision: D1596887
Fix hack javascript wanting tons of dependencies

Summary: For the test case described in D1567415, 3000 dependencies are pulled in before this change. 200 are pulled in after.

-When we implemented the js version of hack, we needed a way to figure out what dependencies we need.
-On the IDE client, the user would open a file, and we'd try to typecheck it.
-When we finished typechecking, we needed to know what dependencies were missing (so we could pull them in)
-This was accomplished by replacing the Typing_deps module. By replacing the model, we can find out the names of every dependency the client has seen.

Now, say I'm typechecking FileA and FileA has a dependency on FileB. FileB has a dependency on FileC.
When I typecheck FileA, I find out that I need FileB, so I hh_add_dep FileB. When FileB gets named and decled, it adds FileC to our dep set.

However, we don't actually need FileC, unless FileB is inheriting from FileC. This change makes it so that FileC would not be added in this case.

My fix is kind of hacky (using a reference), but seemed like the simplest way to keep the change isolated to the hh_ide javascript stuff.

Reviewed By: @jwatzman

Differential Revision: D1575078
Fix subtyping for enum types with constraints.

Summary: Move the code that handles that case to the end, so we can take
advantage of the other cases that handle the peeling off of Toption,
etc.

Reviewed By: @elgenie

Differential Revision: D1596826
Close a memory leak in hh_server and hh_ide.js

Summary: When we want to get the errors for something, we use Errors.try or Errors.do. However, not all callers of functions that add errors are guaranteed to be within Errors.try or Errors.do (specifically, dev tools stuff doesn't always do this).

This made a list of errors accumulate within the errors module forever, with no way to get to it.

This fix makes it so that if we're not within errors.try, errors.ignore or errors.do, we crash if we add an error instead of leaking them.

Reviewed By: @jwatzman

Differential Revision: D1571225
Align recoverable fatal error's message with PHP

Summary: Unhandled recoverable fatal error's message is not consist with PHP.
Closes https://github.com/facebook/hhvm/pull/3805

Reviewed By: @ptarjan

Differential Revision: D1579435
Restore some mixed typed arguments with ?string type

Summary: fixes #3832

Reviewed By: @ptarjan

Differential Revision: D1592864
Convert APC to HNI

Summary: fixes #3627

Reviewed By: @ptarjan

Differential Revision: D1531906
Minor code cleanup for anon function unification.

Summary: This matches the similar code in typing.ml for checking anon
function invocation. Also, we do one less map lookup for the anonymous
function now.

No change in runtime behavior.

Reviewed By: @jwatzman, @elgenie

Differential Revision: D1596893
Add tests for the calling nested shutdown fix

Summary: More tests for 6bba8967d32109310e58720e2f89cb13857a769f
Closes #3904

Reviewed By: @ptarjan

Differential Revision: D1598798

Pulled By: @JoelMarcey
fix jemalloc stats

Summary: remove bad error checking that was blocking ods stats. Error count will go up if one occurs, but
will not prevent reporting.

Reviewed By: @bertmaher

Differential Revision: D1597889
Fix build

Reviewed By: @ptarjan
Create hhi for ext_icu_num_fmt

Summary: Creating a hhi file for NumberFormatter.

Reviewed By: @ptarjan

Differential Revision: D1582010