EZC: document persistent array limitation
Fix CMake whitespace

Applied a two-space indent. It was a mixture of 2, 3, 4 and 8 space
indents and tabs; I don't know how you could look at it without going
crazy. I mostly used Vim's "=" command, even in cases where its output
is potentially controversial, because at least it's consistent.

Also modified vertical whitespace in a couple of places. A
whitespace-insensitive diff will show you where.

Fixed DOS line endings in FindBISON.cmake, which were reported by git as
whitespace errors.
Always turn off FrameState::m_building in reoptimize

Summary: It seems like this is probably subtly incorrect: we're not propagating
end-of-block state forward in some cases. It may not be visibly
incorrect now, but it is with my upcoming diff.

Reviewed By: @bertmaher

Differential Revision: D1316533
Dispatch whole BB to the interpreter after reaching JitMaxTranslations

Summary: When we hit JitMaxTranslations for a SrcKey, it's because the code is
very polymorphic.  Dispatching just one instruction to the interpreter
in this case is likely to cause the SrcKey for the very next bytecode
instruction to also hit JitMaxTranslations, since only one instruction
is advanced and some of the polymorphic inputs may not have been
consumed yet.  And this can repeat for a sequence of bytecode
instructions, blowing the TC with translations that are likely to fail
the guards.  This diff alleviates the problem by dispatching a whole
basic block to the interpreter in the REQ_INTERPRET service request.

Reviewed By: @swtaarrs

Differential Revision: D1316215
Remove some dead Stats code

Summary: These counters haven't been useful since the death of tx64.

Reviewed By: @edwinsmith

Differential Revision: D1316236
Add server_is_warmed_up function

Reviewed By: @ottoni

Differential Revision: D1316333
Fix file_exists() and related functions for file:// URIs

Summary: Regression in mustache. Also re-recorded mustache, as it wasnt when it hit 100%

fixes facebook/hhvm#2623

Reviewed By: @ptarjan

Differential Revision: D1314609
Rename `caml_realpath` to `hh_realpath`

Summary: Rename this to avoid potential naming conflicts, as well as get
rid of another `liblib.a` which is likely to conflict as well.

Reviewed By: @aryx

Differential Revision: D1316569
Add function names to TransRecs

Summary: The full function name is determined at runtime since Funcs can be
cloned.  So store them in the TransRecs to enable tc-print to properly
report them.

Reviewed By: @bertmaher

Differential Revision: D1317639
Null out $this in EventHook::onFunctionExit

Summary: We weren't nulling out $this on a function's exit, causing Xenon to
hit weird errors because it seemed that there was a non-null $this in
the ActRec for an async function.

Reviewed By: @jano

Differential Revision: D1315551
Revert "fix get_object_vars for simplexml objects"

Summary: This reverts commit 0252032f7c8023cf2532839397490604fa66acda.

Reviewed By: @alexmalyshev

Differential Revision: D1319886
stop using utf16_to_utf8 while decoding

Summary: We were converting to utf16 then back to utf8, lets just stay in utf8.

Reviewed By: @fredemmott

Differential Revision: D1316394
Fix issues in the array set operations for possibly-empty arrays

Summary: It wasn't properly handling possibly-empty arrays.  Structure
it a little better: the effect of doing one of these operations is the
union of what you'd get if it were empty and if it weren't.

Reviewed By: @swtaarrs

Differential Revision: D1318055
Refactor reflection extension code

Summary: Refactor reflection extension code to allow for use outside of
ext_reflection.

Reviewed By: @elgenie

Differential Revision: D1312697
Allow parser to be generated with bison 3

Summary: We use lots of hacks on the parser output sadly, and removing them is pretty hard (the worst being the definiation of the `k_T_WHATEVER` constants by including the `.hpp` file many times).

After putting a few hour into removing those hacks, I just made the regexes stronger and removed many of the bison3 changes.

This is needed for debian packaging.
Closes #2573

Reviewed By: @jdelong

Differential Revision: D1313556
introduce container (something that matches arrays and collections only)

Summary: A container is something that can be foreached over, has a known size
 (can be passed to ##count##), and is "specially known" to the
 runtime: an array *or* collection.

 Traversable and KeyedTraversable serve a purpose, but they have the
 problem of not correctly describing how the array builtins now work.
 The runtime supports:

   if (is_array($x) || $x instanceof Collection) { ... }
   function container_builtin(???? $x) { ... } // what is ????

 ... which the typechecker doesn't know how to handle. Or one could write:

   if ($x instanceof KeyedTraversable) { ... }
   function container_builtin(KeyedTraversable $x) { ... }

 ... but that would be unsound, because KeyedIterator and KeyedIterable
 are KeyedTraversable, but not containers.

 Having Container and KeyedContainer allows for container built-ins of
 the array_* familly (and PHP-defined helper functions) to be
 appropriately type-hinted and the runtime and the typechecker to
 agree:

   if ($x instanceof Container) { ... }
   function container_builtin(Container $x) {}

Reviewed By: @paroski

Differential Revision: D1310546
teach typechecker about Container/KeyedContainer

Summary: the typechecker counterpart to {D1310546}.

Reviewed By: @jwatzman

Differential Revision: D1310557
typechecker: improve handling of builtins in hh_single_typecheck

Summary: Instead of pretending that they're present in the file being
 tested (but with incorrect line numbers), use a virtual "builtins.hhi"

Reviewed By: @jwatzman

Differential Revision: D1310565
hack: hack/src/{more_tests=>typecheck}

Summary: ## more_tests ## is not an informative directory name. As
 part of this change, rejiggered the ## .gitignore ## files for tests
 to be more direct, and the ## verify ## script to not require
 symlinking.

Reviewed By: @jwatzman

Differential Revision: D1311162
Support far calls to native builtins

Summary: If a builtin is loaded from a DSO with HNI, it may not be
in the low 2GB, so we need to generate an indirect call
to it.  This diff also fixes trampolines so they correctly
can call faraway code, and removes the too-many-trampoline
assert.  (emitCall can recover from running out of tramps).

Fixes #2637

Reviewed By: @markw65

Differential Revision: D1318778