Fix typechecking the hhi files

Summary: Fixes facebook/hhvm#3036

Sed.

Reviewed By: @JoelMarcey

Differential Revision: D1403524
Refactor cell and type arith for shift operators

Summary: They were just handwritten in several areas, this finally adds
{cell,type}Sh{l,r} to match the other functions.

Also changes the returns on some of the type-arith functions from
TInitCell in the worst case to TInitPrim.

Reviewed By: @jdelong

Differential Revision: D1380563
Fixed error output for json_encode

Summary: `json_encode` threw a notice instead of setting a json error, this caused several discrepencies including forgotten implementaion of `JSON_PARTIAL_OUTPUT_ON_ERROR`.

Reviewed By: fredemmott, ptarjan

Differential Revision: D1393135
Handle DefLabel in constrainValue

Reviewed By: @swtaarrs

Differential Revision: D1399894
Casting Resource to Array should give array($resource)

Summary: @kmiller68 fixed this for Object cast, this diff fixes the similar array cast.

Reviewed By: @fredemmott

Differential Revision: D1399347
Fix await/yield operator precedence

Summary: Do not rely on magic, declare operator precedence correctly.

Reviewed By: @elgenie

Differential Revision: D1403498
Handle mismatching fromLoad state in refcount opts

Summary: It can actually be legit to have mismatching fromLoad states, as long as the
realCounts are suitable.  Includes a minimized test case for the case that's
been occasionally killing our flib runs.

Reviewed By: @swtaarrs

Differential Revision: D1404995
Fix running multiple tests at the same time

Summary: Broke runnign quick tests as part of the framework runner. Broken when adding suppport for spaces.

Reviewed By: @JoelMarcey

Differential Revision: D1405906
Adapt Xenon to use asio changes

Summary: Remove unused m_asyncInvalidCount from Xenon.  Went away with new asio changes.
Added wait sample to Xenon.
Modified Xenon::log to handle wait samples.

Reviewed By: @jano

Differential Revision: D1403928
Band aid for C++ exceptions while unwinding PHP exception.

Reviewed By: @markw65

Differential Revision: D1406669
Fix subtyping "newtype X as Y" with nullables

Summary: The order matters here.

Reviewed By: @elgenie

Differential Revision: D1406629
functorize client stop command

Summary: Functorize Hack client stop command.

Reviewed By: @jwatzman

Differential Revision: D1398492
Add checks that Enum subclasses are being used properly

Summary: Do a bunch of checks on classes extending Enums to make sure they are being used at least somewhat reasonably. This means checking that all constants are actually compatible with the declared type, enforcing that only int, string, and mixed can be used, and only allowing int and string constants when the type is mixed.

We also make the declared Enum type the type for each of the constants.

We also want to allow abstract types to be used if the actual underlying type is int or string, which requires some pretty tasteless abstraction breaking.

Reviewed By: @elgenie

Differential Revision: D1388879
Revert "Fixed error output for json_encode"

Summary: This reverts commit 0c1c211537bc49e50bd16676c5ec74a0df426b4d.

Reviewed By: @jdelong

Differential Revision: D1406161
AsyncIterator vs. AsyncKeyedIterator

Summary: Move AsyncIterator to AsyncKeyedIterator and introduce AsyncIterator
that is typed only over yielded value.

Makes it possible to type most of the async generators in lightweight
way without having to specify key type:

  async function foo(): AsyncIterator<int> {
    yield 42;
  }

Reviewed By: @billf

Differential Revision: D1405410
Clean up list assignment

Summary: Deduplicate two instances of list assignment implementation.

Reviewed By: @billf

Differential Revision: D1406278
Fix some Type::Null stuff, LbGbl guard relaxation

Summary: - We were being sloppy with Type::Null in isKnownDataType and toDataType,
  mostly for historical reasons. I cleaned that up and nothing seemed to break.
- IsType<Null> was just checking for KindOfNull. I fixed it to check for <=
  KindOfNull to also get KindOfUninit.
- LdGbl is roughly the same as LdLoc but we weren't tracing through it in guard
  relaxation.

The new test is fixed by having either the second or the third item, since it
was a combination of both causing issues.

Reviewed By: @ottoni

Differential Revision: D1401528
Disable flaky zend test

Reviewed By: @bertmaher
Fix bug in cgStoreTypedValue

Summary: This was introduced by D1401528 but missed because of a sandcastle
bug.

Reviewed By: @dariorussi

Differential Revision: D1407977
Expand documentation on Value::merge in refcount-opts

Summary: Explain why it's ok for the pendingIncs vectors to differ.

Reviewed By: @bertmaher

Differential Revision: D1408000