co-allocate APCTypedValue with uncounted MixedArray
commit7e72d2e94172f5f5657e605a3a154b17bd142545
authorDaniel Andersson <koda@fb.com>
Thu, 19 May 2016 18:20:29 +0000 (19 11:20 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Thu, 19 May 2016 18:34:18 +0000 (19 11:34 -0700)
tree217a3fe03f89054b50720f821a5a846bdad2e4a4
parentc9259dc7bc0c7ce6fa4f21ab08c6004319bf069a
co-allocate APCTypedValue with uncounted MixedArray

Summary:
Co-allocate APCTypedValue with uncounted MixedArray to improve data locality and enable further optimizations that avoid dereferencing the handle.

Currently, the APCTypedValue/Handle is often allocated far away from the uncounted array it references. Co-allocating them by itself improves locality.

Furthermore, having the APCHandle at a known offset from the ArrayData will enable type-aware code to store just an ArrayData* and avoid dereferencing the handle altogether, e.g. when initializing a Variant for the result of an apc_fetch.

Reviewed By: edwinsmith

Differential Revision: D3183709

fbshipit-source-id: d942b9f820ea45a45d52f6d35fd0c2535e8a7a3c
hphp/runtime/base/apc-array.cpp
hphp/runtime/base/apc-typed-value.cpp
hphp/runtime/base/mixed-array.cpp
hphp/runtime/base/mixed-array.h
hphp/runtime/base/packed-array.cpp
hphp/runtime/base/packed-array.h