Refactor property code to use MemberLookupContext
commitef4eb29f51f9027b52ae9df32bede94b347ac383
authorJames Wu <jjwu@fb.com>
Mon, 1 Aug 2022 04:28:53 +0000 (31 21:28 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 1 Aug 2022 04:28:53 +0000 (31 21:28 -0700)
tree7e5223b5b2011869eaf3fe4f9c8c5e374ecffd9f
parent1d0f7e880cdddbaae8570d24d62ece7c157f88d5
Refactor property code to use MemberLookupContext

Summary:
Rename MethodLookupCallContext to MemberLookupContext, so that we can use it for properties too. Then pass it into the class DeclProp functions.

We leave some TODOs where we need to pass in the full context instead of a class pointer, especially in object-data.h. We will address those callsites in the next diff.

In order to do this safely, I had to change the sentinel value used in the variable unserializer from (Class*)-1 to (Class*)-2, in order to reserve a bit for the Either tag bit. Not sure how to test this beyond what we already have.

Reviewed By: oulgen

Differential Revision: D38024010

fbshipit-source-id: 692199b818b20cb63c62ed22679f80d77079d8b2
19 files changed:
hphp/runtime/base/builtin-functions.cpp
hphp/runtime/base/object-data.cpp
hphp/runtime/base/variable-serializer.cpp
hphp/runtime/base/variable-unserializer.cpp
hphp/runtime/ext/reflection/ext_reflection.cpp
hphp/runtime/ext/std/ext_std_classobj.cpp
hphp/runtime/ext/std/ext_std_variable.cpp
hphp/runtime/vm/bytecode.cpp
hphp/runtime/vm/class.cpp
hphp/runtime/vm/class.h
hphp/runtime/vm/jit/irgen-call.cpp
hphp/runtime/vm/jit/irgen-minstr.cpp
hphp/runtime/vm/jit/irgen-sprop-global.cpp
hphp/runtime/vm/jit/target-cache.cpp
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/runtime/vm/method-lookup.cpp
hphp/runtime/vm/method-lookup.h
hphp/runtime/vm/module.cpp
hphp/runtime/vm/super-inlining-bros.cpp