Fix bug in IsTypeStructC in sandbox mode
commita4faaa60166ab739f00af5aec9c5095ae9ff18ff
authorShaunak Kishore <kshaunak@fb.com>
Fri, 12 Mar 2021 19:59:26 +0000 (12 11:59 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 12 Mar 2021 20:06:27 +0000 (12 12:06 -0800)
treea1411da414bce7e3498d754b40c25cad47604b4e
parentfdb845144b2f8cfb7a62cd10056ddca6107992a3
Fix bug in IsTypeStructC in sandbox mode

Summary:
We read the type structure resolution cache in both the IsTypeStructCache IR op and in the native helper. The native helper also writes to this cache.

This cache is stored in RDS::Local, which means that it's local to the thread but not to a request. That means any data cached there must not vary from request to request. We must check that a class is persistent before caching it.

Does this change completely disable the optimization in sandbox mode? I assume it does, in which case, we should probably just avoid JIT-ing this code in that case...

Reviewed By: oulgen

Differential Revision: D27000753

fbshipit-source-id: aa792c079bf19857088daffb972b96360cecba65
hphp/runtime/vm/jit/target-cache.cpp