Avoid unnecessary side exits in Await and WHResult
commit5f5228dfb61d21df6cf38e196613c2255eeefa18
authorJan Oravec <jan@fb.com>
Tue, 3 Aug 2021 22:59:54 +0000 (3 15:59 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 3 Aug 2021 23:02:12 +0000 (3 16:02 -0700)
treef09604554603ebeb92a04c91cb37c2a2a1a12caf
parent8afd769a32fb8c6f5102b7613bf1973ef03feba5
Avoid unnecessary side exits in Await and WHResult

Summary:
Merge the logic of emitAwait() and emitWHResult() into implAwait(), as these
opcodes differ only in handling of non-finished Awaitables. This gives WHResult
ability to handle exceptions without side-exiting if the stack is empty.

Try to perform the fast path of Await in async generators resumed from
a previous blocking Await and side-exit only if the async generator would
suspend at Await for the second time.

Reviewed By: oulgen

Differential Revision: D30026257

fbshipit-source-id: a5c61d6426b91f55ab033afe4a6819e552438a97
hphp/runtime/vm/jit/irgen-resumable.cpp