Log and account for ctor opsnightly-2020.08.31
commit003a006ba20edd8e7659927ddb1d48355260e24c
authorShaunak Kishore <kshaunak@fb.com>
Sun, 30 Aug 2020 19:03:19 +0000 (30 12:03 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sun, 30 Aug 2020 19:04:55 +0000 (30 12:04 -0700)
treeb225ad29750b4a69b610dd299cc0e6f4af2a3c46
parent4f1e2836bd2aad2e8429fd857324a40c39b18c0e
Log and account for ctor ops

Summary:
For a non-static array, a constructor op is logically a sequence of sets or appends. We log these individual operations at the point we create a LoggingArray, using a new pair of ConstructStr / ConstructInt "pseudo-ops" to be distinct from SetInt / SetStr / Append ops that happen post-construction.

The new logging handles constructors in most cases naturally. For struct-like arrays, we'll include the static string keys in the ConstructStr ops. For sufficiently-small tuple-like vecs, the ConstructInt will include some information about the int key plus the value type at that index. For larger, non-tuple vecs, ConstructInt will drop the constant int and only log the value type.

We also pull the arrayOpIsRead helper into the ARRAY_OPS macro. A few ops, like release and ToVArray, change from writes to reads; we're using "write" as a short-hand for "operation that may cause a layout change", and these ops don't do that.

Differential Revision: D23406011

fbshipit-source-id: 195082f685ba287b6897e0dd0efa452e539eb70f
hphp/runtime/base/bespoke/logging-array.cpp
hphp/runtime/base/bespoke/logging-profile.cpp
hphp/runtime/base/bespoke/logging-profile.h