Lower some CufIter operations to more specific instructions
Summary:
Introduce pure-load and pure-store IR instructions which read and write to the
fields of cuf-iter slots. These instructions have the proper memory effects so
that load/store-elim can remove loads and stores to these fields. The
CufIterSpillFrame instruction is now no longer needed. It can be replaced by
loads of the respective fields which can then be passed into the normal
SpillFrame instruction.
As a result, the SpillFrame instruction needs to be enhanced. Since the "invoke
name" now may not be statically known (because its coming from a
LdCufIterInvName instruction), instead pass it as a parameter instead of in
extra-data. Modify the lowering of SpillFrame to not generate extra code in the
(common) case where we know that the invoke name is null.
Unfortunately we cannot get rid of the DecodeCufIter instruction. For object
callables, its easy to lower the decoding into the equivalent set of store
instructions to the cuf-iterator slot. However, its not done right now for other
types, so we need to continue to emit DecodeCufIter for those.
Finally, the CIterFree instruction can be removed. It can instead by implemented
by loads of the fields, dec-reffing them, and then killing the slot so that
store-elim knows the values in the slot are no longer important. This is done by
a new KillCufIter instruction.
Reviewed By: markw65
Differential Revision:
D5069510
fbshipit-source-id:
2827acc3d1ba7f6ae17b7844a2f2cd54f1eb5dc1