Refactor ecma_op_to_string (#3171)

Similar to the ecma_op_to_object rework, in this new method we
return directly with the pointer to the ecma string, and we don't
wrap the result into an ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2019-10-25 15:58:47 +02:00
committed by Robert Fancsik
parent b7aa21ebc7
commit 4b352758c1
25 changed files with 391 additions and 427 deletions
@@ -1185,15 +1185,13 @@ ecma_builtin_global_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
return ecma_builtin_global_object_is_finite (arg_num);
}
ecma_value_t string_value = ecma_op_to_string (routine_arg_1);
ecma_string_t *str_p = ecma_op_to_string (routine_arg_1);
if (ECMA_IS_VALUE_ERROR (string_value))
if (JERRY_UNLIKELY (str_p == NULL))
{
return string_value;
return ECMA_VALUE_ERROR;
}
ecma_string_t *str_p = ecma_get_string_from_value (string_value);
ecma_value_t ret_value;
if (builtin_routine_id <= ECMA_GLOBAL_PARSE_FLOAT)