Fix autocomplete

Summary: We need to clear out these errors if `fail` is false. Make this
code more readable too while we're at it.

Reviewed By: joelb

Subscribers: hphp-diffslists, ps, jwatzman, ptc

Differential Revision: D1334810

Tasks: 4352006
Revert "Fix Xenon crash"

Reviewed By: mwilliams

Subscribers: hphp-diffslists
Add --light-processes to php_wrapper and a flag to xhprof.

Summary: * Making light processes slightly less verbose.
* Adding a php_wrapper flag to enable them.

Reviewed By: mwilliams

Subscribers: trunkagent, hphp-diffslists, ps, jwatzman, ptc

Differential Revision: D1333636
Fix crash on missing trait in RepoAuthoritative mode

Summary: At some point we stopped checking up front that
traits exist in RepoAuthoritative mode. But we still assume
that Unit::lookupClass will find them, and crash if not.

This checks every trait, and fatals if it doesn't exist.

Reviewed By: drussi

Subscribers: hphp-diffslists, ps

Differential Revision: D1348353

Tasks: 4397258
Fix Xenon crash

Summary: When WaitableWaitHandle::getdependencystack is called, there
could be async functions on the stack which are in the middle of returning.
In particular, their $this might have been destroyed, and then we have
started executing a local variable's __destruct, which then ends up
calling WaitableWaitHandle::getdependencystack (possibly through many
levels of calls).

This typically happens due to Xenon being called from onFunctionEnter,
or onFunctionExit. There was a previous attempt to fix these crashes
by nulling out $this in the ActRec passed to onFunctionExit; but as
described above (and as happens in the new test case), there's no
guarantee that the problem is happening in the top frame.

Reviewed By: drussi

Subscribers: hphp-diffslists, jan, ps, bill

Differential Revision: D1336321

Tasks: 4352949
Fix for Xenon crash, change order of decRef between locals and $this

Summary: Making lifetime of $this longer so that a stack walk from Xenon can still find the class and a somewhat usable $this

Reviewed By: jan, mwilliams

Subscribers: platform-diffslists, guilin, subbu, ekandrot, pierrer, trunkagent, hphp-diffslists, jan, ps, bill

Differential Revision: D1343247

Conflicts:
	hphp/runtime/vm/jit/hhbc-translator.cpp
	hphp/test/slow/collection_classes/materialize-methods-2.php.expect
unit tests expected output fix for change in object destruction order

Summary: Fi unit tests expected output

Reviewed By: mwilliams

Subscribers: hphp-diffslists, ps