Normalize routine's arguments before dispatch (#2687)

Binary size gain:
 - Intel: ~860B (gcc-7.3)
 - Arm: ~660B (arm-linux-gnueabi-gcc-7.3)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-01-15 16:45:16 +01:00
committed by Akos Kiss
parent a9c3ddff1f
commit b4df594d3e
3 changed files with 28 additions and 6 deletions
@@ -172,8 +172,7 @@ DISPATCH_ROUTINE_ROUTINE_NAME (uint16_t builtin_routine_id, /**< built-in wide r
switch (builtin_routine_id)
{
#define ROUTINE_ARG(n) (arguments_number >= n ? arguments_list[n - 1] \
: ECMA_VALUE_UNDEFINED)
#define ROUTINE_ARG(n) (arguments_list[n - 1])
#define ROUTINE_ARG_LIST_0
#define ROUTINE_ARG_LIST_1 , ROUTINE_ARG(1)
#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1, ROUTINE_ARG(2)