Optimize newInstanceRaw by fully initializing ObjectData attributes
commite8520ed80ae30e1e62948746990f224200efa000
authorEdwin Smith <smith@fb.com>
Wed, 6 Sep 2017 15:17:06 +0000 (6 08:17 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 6 Sep 2017 15:29:44 +0000 (6 08:29 -0700)
treeef14c376c4b19c7b4bcf9af55759a95e6737aa7e
parentea2d7853082591526c1ded6fac4bdcc523072fe7
Optimize newInstanceRaw by fully initializing ObjectData attributes

Summary:
The ObjectData constructor used by newInstanceRaw always initalizes
flags to 0, and shortly after we explicitly store the compile-time
flags value to m_aux16, if it's not zero. This costs an extra store
in the nonzero flags case.

Optimize by adding newInstanceRawAttr, which passes a compile-time
immediate flags value to the ObjectData constructor, which combines
it with other header fields into a single store.

Eliminate the no-flags-init constructor; the newInstanceRaw
overloaded functions all call the full NoInit constructor now.
But, split the full NoInit{} constructor into two variations;
NoInit{} still asserts that there are zero properties, while
InitRaw{} doesn't; the latter is for the cases where the caller
takes care of property-initialization.

Reviewed By: alexeyt

Differential Revision: D5766580

fbshipit-source-id: e6da845fcffbd1babc9c2f1c80da38ed4f5ae9ea
hphp/runtime/base/object-data-inl.h
hphp/runtime/base/object-data.cpp
hphp/runtime/base/object-data.h
hphp/runtime/ext/asio/ext_wait-handle.h
hphp/runtime/ext/collections/ext_collections-pair.h
hphp/runtime/ext/collections/ext_collections-vector.h
hphp/runtime/ext/collections/hash-collection.cpp
hphp/runtime/ext/collections/hash-collection.h
hphp/runtime/vm/jit/irlower-object.cpp