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
@@ -122,7 +122,7 @@ ecma_value_t
ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, /**< this object */
uint32_t index) /**< array index */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
ecma_string_t *index_string_p = ecma_new_ecma_string_from_uint32 (index);
ECMA_TRY_CATCH (index_value,
@@ -322,7 +322,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *obj_p, /**< array */
uint32_t *length_p, /**< [in,out] array's length */
ecma_value_t value) /**< value to concat */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
/* 5.b */
if (ecma_is_value_object (value)
@@ -400,7 +400,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *obj_p, /**< array */
if (ecma_is_value_empty (ret_value))
{
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
ret_value = ECMA_VALUE_TRUE;
}
return ret_value;
@@ -478,7 +478,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_value_t this_arg, /**
ecma_value_t arg2, /**< routine's second argument */
bool first_index) /**< routine's third argument */
{
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 (check_coercible_val,