Add definitions for AsyncIterator and AsyncGenerator

Summary: Add hack definitions for AsyncIterator and AsyncGenerator.

Reviewed By: bill

Differential Revision: D1389287
namespace-qualify argument to --show

Summary: Requiring ## \Foo ## is a huge pain, because it must be
 single-quoted in bash. Also changes the help copy for ## --show ##
 to be slightly more accurate: there are no issues with people using it,
 just no scripts.

Reviewed By: julienv

Differential Revision: D1389637
Get rid of headers for region-hot-trace and region-whole-method

Summary: They define one method each, so just fold them into
region-selection.h, which is where the other region selectors are defined.

Reviewed By: smith

Differential Revision: D1390022
Awful bytecode pattern-matcher thing

Summary: I needed something to pattern-match on bytecodes in order to detect and
inline singleton patterns, so here it is.

Reviewed By: jdelong

Differential Revision: D1344595
Try to inline singleton pattern functions

Summary: We see a lot of code roughly of the form

  function getSingletonFoo() {
    static $instance = null;
    if ($instance === null) {
      // Do some stuff and set $instance.
    }
    return $instance;
  }

Let's optimistically assume that such patterns are in fact singleton
patterns (as opposed to, say, some means of inter-method communication
to avoid threading arguments) and try to inline these checks.  The first
time we hit each callsite, we'll side-exit to do the call, and
subsequent calls will simply return the value at $instance, assuming the
checks still pass.

We also introduce a TransFlags struct which we thread through BindJmp
requests and into the translation routines so that we turn the inlining
off in the stub.

Presently, this inlining strategy is restricted to non-resumable
functions with no arguments passed and which don't return refs.

Reviewed By: bertrand

Differential Revision: D1344602
Do not check surprise flags on async function suspend.

Summary: Once AwaitE suspends execution, locals of the current frame are
considered dead. If the surprise flag triggers C++ exception that
unwinds the frame, we incorrectly try to free them.

Let's not check surprise flag until this gets fixed.

Reviewed By: jdelong

Differential Revision: D1391872
Fix relaxation of specialized boxed types

Summary: The main problem exposed by the new test was that the assert in
TypeConstraint::setDesiredClass was too restrictive. While I was fixing that I
noticed that relaxType was losing specialized inner types so I fixed that too
and added a gtest case to catch it.

Reviewed By: ottoni

Differential Revision: D1389525
Fix a bug in evalPHPDebugger

Summary: evalPHPDebugger can be asked to print the results of evaluating php
before the initial frame has ever been entered.  In this case, fp is
null---most of the function was checking this, but a new part forgot to.

Reviewed By: aravind

Differential Revision: D1390724
Add interface to set hhi dir for unit tests

Summary: Nothing terrifically complicated. Just allow setting the ref cell.

Reviewed By: pad

Differential Revision: D1389742
Set environment variables needed for PHP5 mysqli tests on travis

Reviewed By: @ptarjan

Differential Revision: D1388391
Timeouts and retries for OSS installation commands

Reviewed By: @JoelMarcey

Differential Revision: D1392350
Clownlist more flakey joomla tests

Reviewed By: @JoelMarcey

Differential Revision: D1392685
Clownlist another phpbb3 test

Summary: thisisclowntown

Reviewed By: @JoelMarcey

Differential Revision: D1392742
update third-party submodule commit
add rules to tag exit() as terminal (non-returning)

Summary: Added typechecker rules to tag exit() as non-returning and added a new exit_terminal_check.php test case.

Fixes #2916 (https://github.com/facebook/hhvm/issues/2916)

Reviewed By: @jwatzman

Differential Revision: D1381953
EZC: fix ref counts in _object_and_properties_init()

Summary: In _object_and_properties_init() a.k.a. object_init_ex(), the ObjectData was created and returned to userspace with a refcount of zero, despite being referred to by the RefData. Also, the RefData was inappropriately incref'd, making it unconditionally leak.

The two bugs cancelled out in a common case -- calling tvUnbox() on the RefData caused the ObjectData to be incref'd, leaving it with the correct refcount if you discount the leaked, unreachable RefData. Added a test case showing a less common case which previously failed.

Should fix https://bugzilla.wikimedia.org/show_bug.cgi?id=65796
Closes #2959

Reviewed By: @ptarjan

Differential Revision: D1387967

Pulled By: @sgolemon
Increase timeout for fetching OSS stuff in tests

Summary: Mediawiki is big, flakey at 2 minutes.

Reviewed By: @JoelMarcey

Differential Revision: D1393049
Implemented xdebug_memory_usage and xdebug_peak_memory_usage

Summary: This diff implements the xdebug functions xdebug_memory_usage and
xdebug_peak_memory_usage.

xdebug_memory_usage is to return the total amount of memory used
by the script. xdebug_peak_memory_usage is supposed to return
the maximum amount of memory used by the script since it was
started.

Note that the added test was taken directly from the xdebug source,
which is why there are lint errors. Should I fix them anyways?

Reviewed By: @sgolemon

Differential Revision: D1389052
Add class_elt field and fix require extends bug

Summary: Previously, the methods actually implemented by a trait were not distinguished
from the methods that a trait would necessarily have by virtue of a require
extends declaration. This caused a required method that lived in a superclass
to sometimes override an implementation in a subclass (!).

This diff puts an extra breadcrumb in class_elt so we can tell them apart,
and makes nonrequired (i.e. really, really implemented by the trait) methods
take precedence over merely required.

ran unit tests locally and they passed, and on contbuild are taking a long time, so

Reviewed By: @jwatzman

Differential Revision: D1371534
Update async functions doc in bytecode.specification

Summary: AsyncSuspend does not exist anymore. Describe behavior of the new
opcodes instead.

Reviewed By: @billf

Differential Revision: D1391937