Optimize CountDict for struct arrays
commit45b119f13831b2bc36d5da6a0fae7a88dceab805
authorRick Lavoie <rlavoie@fb.com>
Wed, 1 Dec 2021 05:17:28 +0000 (30 21:17 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Dec 2021 05:19:52 +0000 (30 21:19 -0800)
treefe4b556fd870c25f00aa295dad3c3d6cb9f8c5a2
parent5b50e3607a71657f1eb671a7706abd4d2d09b626
Optimize CountDict for struct arrays

Summary:
If a dict is a struct array, and we can infer the number of elements
from the layout, lower CountDict to a constant. We know the number of
elements definitely if we know the layout, and the layout has no
optional keys.

Reviewed By: oulgen

Differential Revision: D32692311

fbshipit-source-id: 47b058e1ba05507708e2a364efbc80bae3253663
hphp/runtime/base/bespoke/layout.cpp
hphp/runtime/base/bespoke/layout.h
hphp/runtime/base/bespoke/struct-dict.cpp
hphp/runtime/base/bespoke/struct-dict.h
hphp/runtime/vm/jit/array-layout.cpp
hphp/runtime/vm/jit/array-layout.h
hphp/runtime/vm/jit/simplify.cpp