Eliminate ArrayData::LvalForceNew
Summary:
Now that false-y promote is dead, we don't support [] as an intermediate member op - only a final op. We can use this fact to eliminate LvalForceNew.
9 times out of 10, if you're calling "LvalForceNew", you really just want to append a value to the array. The 10th time, you're implementing register_variable, which has synthetic support for an implicit [] as an intermediate op. For this case, I did an awkward thing where I use iteration order to identify the key that was just added. We were already doing something similar in ext_xml and this function isn't hot.
We still have a few direct calls to PackedArray or MixedArray LvalForce methods in variable-serializer. Now that these methods aren't part of the general interface, we can simplify them, pushing assumptions onto the callers and optimizing them for this pre-sized use case.
Reviewed By: jjgriego
Differential Revision:
D20759054
fbshipit-source-id:
8475a91f845911bb07fed0b0a3aaefd9987b1e53