Initialize start bits during allocation instead of Collector::init()
commitcc8e5dcd3d8db854d625acc9fbb306dcc1fd7dc9
authorEdwin Smith <smith@fb.com>
Sat, 3 Feb 2018 20:36:47 +0000 (3 12:36 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 3 Feb 2018 20:44:02 +0000 (3 12:44 -0800)
tree5d00d0a0e3d3872bb74e9f2c22b4771ea5f7eed7
parent090d143895db7a77b4cd3dd010ac3cc16207484c
Initialize start bits during allocation instead of Collector::init()

Summary:
Instead of walking all slabs to initialize start bits during
the "init" phase of GC, set start bits during allocation, when
allocating fresh objects from slabs.

This removes the last remaining reason we need to scan slabs
at gc-init time; init is much faster.

Setting & clearing start bits in FreeList::likelyPop()/push()
would be too expensive, so this diff leaves start-bits set
permanently; we ignore free objects as needed, by inspecting
HeaderKind.

Reviewed By: swtaarrs, alexeyt

Differential Revision: D6603142

fbshipit-source-id: f746690c03fbafdfd125175b86ded4a0e1c15c5e
hphp/runtime/base/heap-collect.cpp
hphp/runtime/base/heap-scan.h
hphp/runtime/base/memory-manager-defs.h
hphp/runtime/base/memory-manager.cpp
hphp/runtime/test/slab-test.cpp
hphp/util/bitops.h