Make DataWalker::LookupFeature reflect how we actually use it.
Summary:
DataWalker has exactly 3 callers; apc-array.cpp and apc-collection.cpp pass LookupFeature::DetectNonPersistable and apc-object.cpp passes LookupFeature::DetectSerializable. The callers that pass DetectNonPersistable care about isCircular, and if the data structure does not contain cycles they then care about hasNonPersistable. apc-object.cpp behaves the same whether we detected isCircular or hasSerializable.
In spite of this, DataWalker::LookupFeature is treated as a set of composable bits (with largely unused boolean operators and an unused DataWalker::LookupFeature::Default with no bits set). We don't use DataWalker like this, and we've encoded assumptions about which callers want us to stop early in DataWalker::canStopWalk. The way we've encoded them misbehaves if we e.g. try to set both DetectNonPersistable and DetectSerializable (we no longer stop as soon as we see hasSerializable).
Make DataWalker::LookupFeature a normal, non-bitset enum to reflect how we use it and add a doc comment about assumptions encoded in DataWalker::canStopWalk.
Reviewed By: ricklavoie
Differential Revision:
D26703551
fbshipit-source-id:
70d03debad2536b7c96436e39ec2d47a03b1002e