Merge newInstance{,Reified} from runtime.h into ObjectData.
Summary:
We had most of the functionality for ObjectData::newInstance in the object-data{.h,-inl.h,.cpp} code, BUT the logic for handling reified generics was living separately in vm/runtime.h. This is unintuitive and dangerous - calling ObjectData::newInstance directly bypassed the sanity checks that were in the runtime.h wrappers. Merge the runtime.h functionality into the object data code proper.
Most places were already calling the wrappers, but 2 were calling ObjectData::newInstance directly: in member-operations.h when we promote falsy to stdClass, and in type-object.h when constructing an Object from a Class*. The former was fine (stdClass will never have reified generics), but the latter was a bug: C++ code could construct instances of classes with reified generics without setting the reified generics on them. This bug was actually being (mis)used in APC, and is the only reason that the new hphp/test/slow/reified_generics/apc-*.php tests oulgen added were able to pass. I'm temporarily disabling these tests until we can fix APC to construct objects with reified generics safely.
While making these changes, I noticed that the trivial functions Class::hasReifiedGenerics and Class::hasReifiedParent were not inline (like their func and actrec counterparts are). Make them inline.
Reviewed By: oulgen
Differential Revision:
D15079486
fbshipit-source-id:
c7db49ac29f29b4976bf34f79f20b650bb4e8bbe