Add enum-ish thing for test runner output format

Summary: prep work for fbmake

Reviewed By: @ptarjan

Differential Revision: D1380996
Fix minstrs on KindOfResource bases

Summary: Our switches didn't even have cases for them, so add them in the
appropriate place. Also fail with a better error if something like this happens
again.

Reviewed By: @jdelong

Differential Revision: D1381277
Relocate to arbitrary alignment

Summary: Add more meta data, to allow nops to be stripped, and
padding to be added as originally specified, if we change the
alignment of the code when relocating.

Reviewed By: @jdelong

Differential Revision: D1355815
Eagerly shrink branches

Summary: Eagerly shrink branches as we relocate, as long as we can
prove that the target will be in range.

I decided against trying the optimal solution for now, since its
complicated by the instruction alignment rules. All the necessary
information is available, but I think this will get nearly all the
benefits. Im open to persuasion if anyone thinks differently.

Reviewed By: @swtaarrs

Differential Revision: D1357920
Supports setting compressed value with ext_memcache

Summary: Closes #2929

Reviewed By: @ptarjan

Differential Revision: D1381832

Pulled By: @JoelMarcey
hhi sync for D1365081 and D1362152

Summary: I asked the authors for both of these diffs to sync to fbcode, but
neither did, and the type errors created are blocking D1361818, so I
guess I'll do it.

Reviewed By: campbellmadam

Differential Revision: D1380949
DOMException bug

Summary: DOMException() in zend php doesn't have a separate constructor

Reviewed By: @ptarjan

Differential Revision: D1380837
removing silent_mode

Summary: Silent mode was mostly used by auto-completion to ignore errors.
We are going to change the way the type-checker works and not stop at the first error any more.
In preparation of that diff, I prefer to first remove silent_mode, it makes the rest easier to follow.

Reviewed By: @elgenie

Differential Revision: D1365369
New error system

Summary: This diff introduces a new error system that doesn't throw.
I will adapt the rest of the code in subsequent diffs.

Reviewed By: @jwatzman

Differential Revision: D1372714
Adapt hh_single_type_check to new error system

Summary: cf title

Reviewed By: @jwatzman

Differential Revision: D1372740
Adapting the JS code to new error system

Summary: The new error system for Hack doesn't stop at the first error anymore.
~fail:true/false is gone for the parser because it doesn't make sense anymore.
What we do now is just ignore the errors that came from the parser.

Reviewed By: @joelbeales

Differential Revision: D1372747
Adapt naming to new error system

Summary: The new error system doesn't stop at the first error.
As a consequence, when an error occurs, an tree must be produced.
This diff introduces a new expression 'Any' that is produced when an error is encountered during the naming phase.
Any translates to the type Tany during type-checking, which should not introduce cascading errors.

Reviewed By: jwatzman, eletuchy

Differential Revision: D1372757
Remove strict mode in Ast

Summary: The global is not used anymore

Reviewed By: @jwatzman

Differential Revision: D1372764
Adapt parser to new error system

Summary: The new error system in Hack doesn't throw anymore.
This diff adapts the parser to the new system.
The parser use to have a ~fail option that would throw when true and recover otherwise.
The recovering mode was mostly used for auto-completion.
This option doesn't make sense anymore (since errors don't throw and from now on, should never throw).
Instead, the parser returns the list of errors. The caller gets to decide what to do with that list of errors (it could ignore it).
I removed hh_read_file because Utils.cat is as efficient (probably because it uses a buffer).

Reviewed By: @joelbeales

Differential Revision: D1372768
Adapting the server to the new error system

Summary: cf title

Reviewed By: @jwatzman

Differential Revision: D1372775
Adapting typing to new error system

Summary: The new error system doesn't throw anymore.
The tree can now have nodes called Any, produced when the naming phase encountered an error.
The type of an Any is always Tany to make sure that we don't introduce cascading errors

Reviewed By: @jwatzman

Differential Revision: D1372780
Adapting typing_decl to new error system

Summary: cf title

Reviewed By: @jwatzman

Differential Revision: D1372784
Adapt typing_suggest to new error system

Summary: The new error system doesn't throw when an error is encountered.
This breaks the suggestion mode logic.
All I did is make the code throw when an error is found, instead of
raising Error, we raise Exit (a predefined OCaml exception).
The output is slightly different (No errors! is printed in a different place),
so I fixed the .exp in the unit tests

Reviewed By: @jwatzman

Differential Revision: D1377683
Refactor JS utils

Summary: The JS version of Hack cannot make system calls (understandably).
The way we dealt with this so far was by having 2 versions of utils.ml.
The JS version was stripping out the primitives making system calls.

There was 2 problems:
1) js/utils.ml was not only stripping out the primitives making system calls,
it was stubbing modules that behave differently in JS (Path, Hhi).
2) We constantly have to modify both version of utils

This diff introduces a new module sys_utils.ml that is included by utils.ml
and regroups all the primitives making system calls.

To make this work, I had to rename all the uses of Json to Hh_json.
We had this weird situation where Json meant one thing in native world and
another in the JS world (because Json is a builtin module in the JS world).
So Hh_json was our version of Json for JS and non-existant for the native code.

I changed all of that so everybody uses Hh_json.

Reviewed By: @jwatzman

Differential Revision: D1377582
Don't call begin/endIteration on every call

Summary: PHP doesn't call beginIteration when you call rewind() twice.
It only calls it if it really is the begin of an Iteration.
Same for endIteration in valid().
If you already reached the end and call it again, it doesn't call endIteration

Fixed at least zend/bad/iterator_025.php

Note: this will probably conflict with #2930. So maybe it needs a rebase then.
Closes #2931

Reviewed By: @ptarjan

Differential Revision: D1382189

Pulled By: @JoelMarcey