diff options
author | Robert Fancsik <frobert@inf.u-szeged.hu> | 2017-12-06 18:06:07 +0100 |
---|---|---|
committer | Dániel Bátyai <dbatyai@inf.u-szeged.hu> | 2017-12-06 18:06:07 +0100 |
commit | e83de3accdfb16a6d2de0b2df649b184d49bda3d (patch) | |
tree | 695acc6cd9be210591c90991b70637492feb20eb /jerry-core/ecma/builtin-objects/ecma-builtin-global.c | |
parent | 1007b6302405ad2d7881fdfd130b01268808d3ee (diff) |
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
Diffstat (limited to 'jerry-core/ecma/builtin-objects/ecma-builtin-global.c')
-rw-r--r-- | jerry-core/ecma/builtin-objects/ecma-builtin-global.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c index d9d7676f..d36cd035 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.c @@ -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); |