Move VanillaDictKeys to m_extra_lo8
commit48e608043a12d65b5390f1d3b2c612fc615ba727
authorShaunak Kishore <kshaunak@fb.com>
Wed, 15 Dec 2021 18:02:33 +0000 (15 10:02 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 15 Dec 2021 18:14:06 +0000 (15 10:14 -0800)
treeee8fe21f93f64b8cd2d6d3b8717b04ae1397efa0
parent51b0b6522ad5fc250201bcd6baf75ba33346eaa6
Move VanillaDictKeys to m_extra_lo8

Summary:
We'd like to place an array's size class in a consistent place: the upper byte of m_aux16. Doing so lets us de-virtualize the array's "heapSize" and "releaseShallow" operations.

Right now, VanillaDict uses this byte for the VanillaDictKeys bitset. We can move this bitset to the ArrayData header's unused m_extra_lo8 field instead. While we're at it, we can stop converting this bitset to and from an int and doing bitwise operations on its raw value, making operations on it more type-safe.

Reviewed By: ricklavoie

Differential Revision: D33098540

fbshipit-source-id: fd049fae7229044a34f0dc9bc593c768f74ac548
hphp/runtime/base/vanilla-dict-keys.h
hphp/runtime/base/vanilla-dict.cpp
hphp/runtime/base/vanilla-dict.h
hphp/runtime/base/vanilla-vec.cpp