Handle bespokes in collections
commite7ebf174ce5e6c9779be069a1b57ae7e44404c6b
authorShaunak Kishore <kshaunak@fb.com>
Tue, 2 Jun 2020 03:30:10 +0000 (1 20:30 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 2 Jun 2020 03:32:29 +0000 (1 20:32 -0700)
treebde44d7cba631fd7cad6aba78dc5085664665880
parentd9066a18bb0391c464f7222e73cfef6d72c4b395
Handle bespokes in collections

Summary:
We'll refuse to put bespoke Hack arrays into Vector, Map, and Set for now, escalating instead.

Note that the JIT already guards to vanilla in this case, so we don't have to slow it down. We only need to put the escalation into collections::alloc, used by the interpreter.

This change also reveals an incorrect assertion in LoggingArray: a claim that we've never shared the inner array with anyone else. The implementation of LoggingArray doesn't rely on this claim, so we just drop the assertion.

Reviewed By: ricklavoie

Differential Revision: D21829178

fbshipit-source-id: e7a2385808cb50ce58bc67a1acc5735e530bc130
hphp/runtime/base/bespoke/logging-array.cpp
hphp/runtime/base/collections.cpp
hphp/runtime/base/collections.h