Add proper variadic parameter support to HHAS files
commitbf2f9d1a09330adea3ccd78e78a95182cb8d4955
authorRick Lavoie <rlavoie@fb.com>
Wed, 5 Oct 2016 03:09:22 +0000 (4 20:09 -0700)
committerHhvm Bot <hhvm-bot-bot@fb.com>
Wed, 5 Oct 2016 03:16:59 +0000 (4 20:16 -0700)
tree0705f5a69125da6ffff596af71972bf747dab814
parentd4cd93d5809d3339439729fe331edf3791c4752d
Add proper variadic parameter support to HHAS files

Summary:
The HHAS parser was treating any function with a parameter list ending
with ... as being MayUseVV. This was effectively a way to indicate you expected
the function to be called with extra parameters. Instead, modify the parser to
treat as ... in the last parameter the same as normal PHP functions. It
indicates a named variadic argument. The presence of such an argument no longer
implies MayUseVV. The function should have the [mayusevv] attribute if it needs
it.

Modify array_map to use a named variadic argument, and forward the arguments to
the builtin in a way that doesn't require MayUseVV. This allows us to inline
array_map in the normal cases.

Reviewed By: markw65

Differential Revision: D3854227

fbshipit-source-id: 1105bf405859ecc0aa8d24549e58d4d9e83ae7f1
hphp/runtime/vm/as.cpp
hphp/system/php/array_map.hhas