aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
diff options
context:
space:
mode:
authorRobert Fancsik <frobert@inf.u-szeged.hu>2017-12-06 18:06:07 +0100
committerDániel Bátyai <dbatyai@inf.u-szeged.hu>2017-12-06 18:06:07 +0100
commite83de3accdfb16a6d2de0b2df649b184d49bda3d (patch)
tree695acc6cd9be210591c90991b70637492feb20eb /jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
parent1007b6302405ad2d7881fdfd130b01268808d3ee (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-object-prototype.c')
-rw-r--r--jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
index 47062bed..0143c43f 100644
--- a/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
+++ b/jerry-core/ecma/builtin-objects/ecma-builtin-object-prototype.c
@@ -86,7 +86,7 @@ ecma_builtin_object_prototype_object_value_of (ecma_value_t this_arg) /**< this
static ecma_value_t
ecma_builtin_object_prototype_object_to_locale_string (ecma_value_t this_arg) /**< this argument */
{
- ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+ ecma_value_t return_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (obj_val,
ecma_op_to_object (this_arg),
@@ -130,7 +130,7 @@ static ecma_value_t
ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /**< this argument */
ecma_value_t arg) /**< first argument */
{
- ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+ ecma_value_t return_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (to_string_val,
@@ -172,10 +172,10 @@ ecma_builtin_object_prototype_object_is_prototype_of (ecma_value_t this_arg, /**
/* 1. Is the argument an object? */
if (!ecma_is_value_object (arg))
{
- return ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+ return ECMA_VALUE_FALSE;
}
- ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+ ecma_value_t return_value = ECMA_VALUE_EMPTY;
/* 2. ToObject(this) */
ECMA_TRY_CATCH (obj_value,
@@ -192,8 +192,7 @@ ecma_builtin_object_prototype_object_is_prototype_of (ecma_value_t this_arg, /**
ecma_object_t *v_obj_p = ecma_get_object_from_value (v_obj_value);
bool is_prototype_of = ecma_op_object_is_prototype_of (obj_p, v_obj_p);
- return_value = ecma_make_simple_value (is_prototype_of ? ECMA_SIMPLE_VALUE_TRUE
- : ECMA_SIMPLE_VALUE_FALSE);
+ return_value = is_prototype_of ? ECMA_VALUE_TRUE : ECMA_VALUE_FALSE;
ECMA_FINALIZE (v_obj_value);
ECMA_FINALIZE (obj_value);
@@ -214,7 +213,7 @@ static ecma_value_t
ecma_builtin_object_prototype_object_property_is_enumerable (ecma_value_t this_arg, /**< this argument */
ecma_value_t arg) /**< routine's first argument */
{
- ecma_value_t return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
+ ecma_value_t return_value = ECMA_VALUE_EMPTY;
/* 1. */
ECMA_TRY_CATCH (to_string_val,
@@ -245,7 +244,7 @@ ecma_builtin_object_prototype_object_property_is_enumerable (ecma_value_t this_a
}
else
{
- return_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
+ return_value = ECMA_VALUE_FALSE;
}
ECMA_FINALIZE (obj_val);