LookupCnsE needs a catch block

Reviewed By: @alexmalyshev

Differential Revision: D1381275
Fix bug in preOptimizeAssertTypeOp, tighten up typeMightRelax logic

Summary: preOptimizeAssertTypeOp has some logic to avoiding inserting redundant
AssertTypeOps when the source value comes from an AssertTypeOp with an
appropriate typeParam. It was looking at the dest type instead of the typeParam
of the new Assert op and missing out on lots of cases.

typeMightRelax would previously only return false if guard relaxation was off
or if the value was a constant. I've extended it to do the right thing for each
dest type in the opcode table. This prevents us from doing silly things like
keeping around "AssertType<Cell> t4:Str" when t4 comes from a Concat operation.

Together, these two fixes drastically reduce the number of AsssertTypes we end
up emitting into the initial translation. This eliminates some O(n^2) guard
relaxation crap we were running into in the new test. It looks like there's
still something superlinear going on in a different part of the jit so I'll dig
into that next.

Reviewed By: @bertmaher

Differential Revision: D1380326
Add InterpOne support for multiple profile translations with same SrcKey in translateRegion

Summary: We want to support Optimize regions that contain arbitrary
shapes. These regions may be formed from multiple Profile translations
that contain the same bytecode instruction ranges.  The set of
instructions to be InterpOne'd was keyed by SrcKey, and this diff
generalizes it by keying it by ProfSrcKey, which is a pair of
profiling TransID and SrcKey.

Reviewed By: @bertmaher

Differential Revision: D1380158
Fix assert in cse

Summary: The simplifier removes Movs as instruction sources as
it goes along, and as it processes later instructions, it asserts
that this has been done to all previous instructions. But if the
result of simplification is a Mov, and the dst is different from
the input, it would generate a Mov, causing the assert to fire.

Reviewed By: @bertmaher

Differential Revision: D1380875
Fix link.

Summary: Closes #2928

Reviewed By: @ptarjan

Differential Revision: D1381819

Pulled By: @JoelMarcey
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