Offload rarely-used members of Class to Class::ExtraData
commitb2a3143a149f1e1db45e38bc9928cd5c171c714e
authorMax Wang <mwang@fb.com>
Wed, 1 Oct 2014 22:46:43 +0000 (1 15:46 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 6 Oct 2014 17:30:25 +0000 (6 10:30 -0700)
tree66ad2ef266d7f1956f0e5b296ceb9a140a0f2124
parent2031b4ef09068eb2e6fdd409373135c2e88b908e
Offload rarely-used members of Class to Class::ExtraData

Summary: Data members for traits (which are flattened in repo mode), reflection
methods, and builtins don't need to be present for all Classes in the
common case.  Bytes == bad.

Also includes two auxiliary changes:
- Add a range() method to IndexedStringMap.
- Add a DefaultPtr type to shortcut `px ? px->m_f : my_default`.

Reviewed By: @jdelong, @elgenie

Differential Revision: D1591981
hphp/runtime/base/object-data.cpp
hphp/runtime/ext/reflection/ext_reflection.cpp
hphp/runtime/test/blob-helper-test.cpp [moved from hphp/runtime/vm/test/blob-helper-test.cpp with 100% similarity]
hphp/runtime/vm/class-inl.h
hphp/runtime/vm/class.cpp
hphp/runtime/vm/class.h
hphp/runtime/vm/indexed-string-map.h
hphp/runtime/vm/preclass.cpp
hphp/runtime/vm/preclass.h
hphp/util/default-ptr.h [new file with mode: 0644]