[builtins] Pass correct number of arguments after adapting arguments.
authorbmeurer <bmeurer@chromium.org>
Mon, 31 Aug 2015 11:28:51 +0000 (04:28 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 31 Aug 2015 11:28:59 +0000 (11:28 +0000)
commitfbad63669e309e8c5c3f2ecf503df2fefaac79bb
tree7c0699ee941326841ac86a6b252899bf6e8809aa
parent44a93bcbea341736ba4df746346e51790bbe423f
[builtins] Pass correct number of arguments after adapting arguments.

The call protocol requires that the register dedicated to the number of
actual arguments (i.e. rax on x64) always contains the actual arguments.
That means after adapting arguments it should match the number of
expected arguments.  But currently we pass some semi-random value
(usually some stack address) after adapting arguments.

It looks like this is currently not observable anywhere, because our
builtins and functions either don't look at the number of arguments and
just make hard coded (unchecked) assumptions, or are marked as "don't
adapt arguments", which bypasses the broken code in the trampoline for
arguments adaption.  Nevertheless this should be fixed.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1306423003

Cr-Commit-Position: refs/heads/master@{#30467}
src/arm/builtins-arm.cc
src/arm64/builtins-arm64.cc
src/ia32/builtins-ia32.cc
src/x64/builtins-x64.cc