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
Added HTML5-PHP test suite

Summary: Closes #3042

Reviewed By: @fredemmott

Differential Revision: D1407665

Pulled By: @JoelMarcey
cellToBool, simplifyConvArrToBool, tvCastToBooleanInPlace don't match on NVTW

Summary: simplifyConvArrToBool and cellToBool call ArrayData::empty(), but
tvCastToBooleanInPlace has a comment saying it is intentionally
calling ArrayData::getSize() and having PHP5-incompatible behavior for
NVTW. This diff changes the first two to match the third.

Reviewed By: @oyamauchi

Differential Revision: D1406933
Fix cgIsScalarType assuming its argument is not const

Summary: Causes a test to fail with the simplifier disabled.

Reviewed By: @bertmaher

Differential Revision: D1406946
Add support for class constant shapes to hhvm.

Summary: Add support for using class constants as field names in shapes to HHVM.

Test failures already present.

Reviewed By: @jdelong

Differential Revision: D1381174
Reduce from four ways to look up Unit*'s to one

Summary: The 'eval' vs. 'lookup' distinction doesn't make
sense---neither of them did any evaluation.  I also didn't know what
an "include root" was or why you'd want to look one up.  Refactor
things so there's just lookupUnit (still on ExecutionContext for now).

Reviewed By: @bertmaher

Differential Revision: D1384187
Don't use FileRepository to find systemlib md5s

Summary: There's no need to do this---we can just ask the repo.

Reviewed By: @swtaarrs

Differential Revision: D1386880
Move lookupUnit out of ExecutionContext

Summary: Intermediate refactoring step.

Reviewed By: @alexmalyshev

Differential Revision: D1386881
Break more dependencies on PhpFile* outside of file-repository.cpp

Summary: EvaledFilesMap and debugger stuff still used these, but only
to call getFileName().  After some investigation, it looks like
phpFile->getFileName() is always equivalent to
phpFile->unit()->filepath() (we set the unit's filepath to the same
string we're going to pass the PhpFile constructor), even with
Eval.CheckSymLink on, so we can skip it.  While looking through this I
noticed m_evaledFilesOrder was being added to even if we're doing a
non-initial include of a file we've already included via a different
path, which makes the results of get_included_files not match php5, so
this diff also fixes that.

Reviewed By: @alexmalyshev

Differential Revision: D1386883
Hide the rest of FileRepository guts into its implementation

Summary: A few utility functions are still exported, but the main API
to this module is now just "lookupUnit", which is hopefully
understandable enough that it should be easy to replace the internals
with something more sane now.  (Later diff renames the file, it's a
"FileRepository" isn't a thing anymore.)

Reviewed By: @swtaarrs

Differential Revision: D1386886
Reflow various documentation to 79 columns

Summary: mwang and bsimmers like it better.

Reviewed By: @swtaarrs

Differential Revision: D1386888
Separate RepoAuthoritative Unit caching from the rest of the code

Summary: It's different enough that this seems less complex.  (And it already
made use of an entirely separate ConcurrentHashMap, anyway.)

Reviewed By: @mxw

Differential Revision: D1386891
Rewrite non-repo version of the thing formerly known as FileRepository

Summary: It was buggy, and had evolved poorly.

The main bug related to the ~PhpFile codepaths and the md5 map.  A treadmilled
PhpFile could be reused even though its unit was scheduled to be deleted.  This
diff fixes the race by having clearer ownership, and eliminating the md5 map.

Rationale on not reimplementing the md5-based cache for now: we are including
the file's path into the md5 to avoid sharing the "same" unit for files with
different paths (it would break the "Dir" and "File" opcodes as currently
implemented).  We also already have a cache to avoid starting from scratch if
the contents are the same (the Repo), so this only only can save on duplicating
JIT time/space, and Unit load time.  It also shouldn't be hitting very often: I
think the main case is if you manage to have the mtime change on a file without
the file contents actually changing.  Multiple copies of the "same" file for
different www checkouts on a shared server won't be getting shared Units right
now, and switching branches and then switching back can only reuse the Unit if
it either goes through the buggy code path and reused it even though it was
treadmilled or if the unit wasn't loaded since the time you were on the
previous branch.  So, I'm thinking let's make it simpler now and optimize it
again if we need to later.

Reviewed By: @swtaarrs

Differential Revision: D1386893
Rename file-repository to unit-cache

Summary: This is just a rename diff.  It's on top of everything else so we can
choose different names without me needing to rebase, if anyone has a better
naming idea.  This seems like a reasonable name, although both resolveVmInclude
and mangleUnitMd5 feel slightly out of place now (but resolveVmInclude (and
resolve_include) are pretty convoluted for historical reasons and deserving of
their own cleanup pass anyway, which I'm going to consider out of scope for now
since it's not causing bugs as far as we know ...).

Reviewed By: @mxw

Differential Revision: D1386894