Remove ecma_simple_value_t and refactor ecma_make_simple_value (#2135)

This patch removes all ecma_make_simple_value calls to make the code more easy to understand.
Also removes the type ecma_simple_value_t which improves the performance in related code paths by calculating the value of new ecma_value_t is no longer needed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2017-12-06 18:06:07 +01:00
committed by Dániel Bátyai
parent 1007b63024
commit e83de3accd
60 changed files with 470 additions and 482 deletions
@@ -61,7 +61,7 @@ ecma_builtin_global_object_eval (ecma_value_t this_arg, /**< this argument */
ecma_value_t x) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
bool is_direct_eval = vm_is_direct_eval_form_call ();
@@ -107,7 +107,7 @@ ecma_builtin_global_object_parse_int (ecma_value_t this_arg, /**< this argument
ecma_value_t radix) /**< routine's second argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (string_var, ecma_op_to_string (string), ret_value);
@@ -318,7 +318,7 @@ ecma_builtin_global_object_parse_float (ecma_value_t this_arg, /**< this argumen
ecma_value_t string) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (string_var, ecma_op_to_string (string), ret_value);
@@ -537,14 +537,13 @@ ecma_builtin_global_object_is_nan (ecma_value_t this_arg, /**< this argument */
ecma_value_t arg) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
bool is_nan = ecma_number_is_nan (arg_num);
ret_value = ecma_make_simple_value (is_nan ? ECMA_SIMPLE_VALUE_TRUE
: ECMA_SIMPLE_VALUE_FALSE);
ret_value = is_nan ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
@@ -565,15 +564,14 @@ ecma_builtin_global_object_is_finite (ecma_value_t this_arg, /**< this argument
ecma_value_t arg) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ECMA_OP_TO_NUMBER_TRY_CATCH (arg_num, arg, ret_value);
bool is_finite = !(ecma_number_is_nan (arg_num)
|| ecma_number_is_infinity (arg_num));
ret_value = ecma_make_simple_value (is_finite ? ECMA_SIMPLE_VALUE_TRUE
: ECMA_SIMPLE_VALUE_FALSE);
ret_value = is_finite ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
@@ -638,7 +636,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
const uint8_t *reserved_uri_bitset) /**< reserved characters bitset */
{
JERRY_UNUSED (uri);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ECMA_TRY_CATCH (string,
ecma_op_to_string (uri),
@@ -915,7 +913,7 @@ static ecma_value_t
ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argument */
const uint8_t *unescaped_uri_bitset_p) /**< unescaped bitset */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ECMA_TRY_CATCH (string,
ecma_op_to_string (uri),
@@ -1138,7 +1136,7 @@ ecma_builtin_global_object_escape (ecma_value_t this_arg, /**< this argument */
ecma_value_t arg) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ECMA_TRY_CATCH (string,
ecma_op_to_string (arg),
@@ -1259,7 +1257,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg, /**< this argument *
ecma_value_t arg) /**< routine's first argument */
{
JERRY_UNUSED (this_arg);
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (string, ecma_op_to_string (arg), ret_value);