Cleanup context handling of fcallImpl()
Summary:
Instead of passing a callback to fcallImpl() that initialized the context of
ActRec, pass the context directly to fcallImpl().
This is needed for the next diff that will spill ActRec from doFCall(), which
can't take the lambda as it may be called directly from the TC.
There was one minor complication -- we were previously deferring extraction of
context until after various fcallImpl() checks ran. This meant that we had to
keep structures (array in case of fcallFuncArr) supporting refcount of the
future `$this` alive until the lambda was called. This logic is now performed
before fcallImpl() and fcallImpl() is responsible for freeing `$this` if any of
these checks fail. That means if `$this` came from the stack, it needs to be
overwritten by null so that we don't free it twice.
Reviewed By: oulgen
Differential Revision:
D18695010
fbshipit-source-id:
9b5270edd56132190d17cea410f5fd3cb97de030