Set directly into Sets instead of using lvals during Unserialization
commit3533080473e001800cc2b302998a7428ec28bb26
authorKaty Voor <voork@fb.com>
Thu, 13 May 2021 15:51:47 +0000 (13 08:51 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 13 May 2021 15:53:15 +0000 (13 08:53 -0700)
tree0114b2f21388f049bb40098982e0238e9bed43ab
parente85c519b49a31b202aad73800ea796005581307f
Set directly into Sets instead of using lvals during Unserialization

Summary:
Currently we get an lval into our MixedArray with `findForUnserialize()` and then we `tvSet` the typedvalue of that key into our set. Since the value is just the key, we can just directly set into it without needing an lval.

Note that for sets we do need to do anything on conflict because the element is the same as the key. Therefore, we can specialize this case to be an noop on conflict.

This eliminates another spot where we would need to record the datatype we are putting into our mixed array.

Follow-up to the comment on D28209743

Reviewed By: ricklavoie

Differential Revision: D28389776

fbshipit-source-id: 2e907c8cabb4cf9ac7d10377567c8de0908b4d64
hphp/runtime/base/mixed-array.cpp
hphp/runtime/base/mixed-array.h
hphp/runtime/base/variable-unserializer.cpp
hphp/runtime/ext/collections/ext_collections-set.cpp
hphp/runtime/ext/collections/ext_collections-set.h