Speed up lookup_param_prep
commit97d3e10e2edfd4965f3610188e3af9a61c872eac
authorMark Williams <mwilliams@fb.com>
Tue, 14 Feb 2017 15:57:16 +0000 (14 07:57 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 14 Feb 2017 16:10:52 +0000 (14 08:10 -0800)
treee595090db4dc680695d8a00e92fb2a9f329e06d0
parent05a8631c5df027a2ec29f21b1f2ccbcce0496d1b
Speed up lookup_param_prep

Summary:
I noticed that during the analyze steps, hhbbc was spending > 20% of
the time in lookup_param_prep. The reason is that there are often many
methods with the same name, and in that case we end up iterating all
the methods for every parameter, and then, in almost all cases, we
return PrepKind::Val.

This precomputes a map from method names to a bitmap indicating which
parameters might be by ref, and short circuits when that tells us that
it can't by by ref.

Reviewed By: alexeyt

Differential Revision: D4552100

fbshipit-source-id: 80c1aada895fe407d2a2f3495fce50cb1406b30e
hphp/hhbbc/index.cpp