Enable access to $this from fb_setprofile handler
commitfac487e60987a34de6c5ce61aa48cd2ec824b395
authorMichael Colavita <mcolavita@fb.com>
Sat, 6 Jul 2019 03:04:30 +0000 (5 20:04 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 6 Jul 2019 03:08:09 +0000 (5 20:08 -0700)
tree212f036e3a3b91cf29fa1ec80ca8ea49fb0d6883
parentce82d93aecc75cd1425a64a5c5f46fe9363b95b3
Enable access to $this from fb_setprofile handler

Summary: The current implementation of `fb_setprofile` passes `this_ptr`, the numeric pointer value of `$this`, to the registered handler. It does not appear this can be used to access properties of the object. I have introduced an additional array key in the handler's data parameter, `this_obj`, which provides access to the object on which the method is invoked, in a similar fashion to `fb_intercept`.

Reviewed By: paulbiss

Differential Revision: D16059618

fbshipit-source-id: b7bb3e6c3b9c57de8667d421879f2088d9989bfa
hphp/runtime/base/runtime-option.cpp
hphp/runtime/base/runtime-option.h
hphp/runtime/ext/xhprof/ext_xhprof.cpp
hphp/runtime/vm/event-hook.cpp
hphp/runtime/vm/event-hook.h
hphp/test/slow/profile/setprofile-flags.php
hphp/test/slow/profile/setprofile-flags.php.expectf
hphp/test/slow/profile/setprofile-flags.php.opts
hphp/test/slow/profile/setprofile_native.php
hphp/test/slow/profile/setprofile_native.php.expectf
hphp/test/slow/profile/setprofile_native.php.opts