Reduce ecma_{ref, deref}_object calls while using ecma_builtin_get (#2616)

The following stucture was highly frequented in the code base:

 - Get a builtin object // This operation increases the reference count of the object
 - Use it for create a new object
 - Deref the builtin object

After a builtin has been instantiated there is always at least one reference to "keep it alive",
so increase/decrease the reference count for getting the value only is unnecessary.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2018-11-28 20:23:21 +01:00
committed by Zoltan Herczeg
parent 8410570dd9
commit e11c499b4b
24 changed files with 28 additions and 97 deletions
@@ -109,8 +109,6 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
ext_object_p->u.class_prop.class_id = LIT_MAGIC_STRING_ARGUMENTS_UL;
}
ecma_deref_object (prototype_p);
ecma_property_value_t *prop_value_p;
/* 11.a, 11.b */
@@ -182,8 +180,6 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
&prop_desc,
false);
JERRY_ASSERT (ecma_is_value_true (completion));
ecma_deref_object (thrower_p);
}
ecma_string_t *arguments_string_p = ecma_get_magic_string (LIT_MAGIC_STRING_ARGUMENTS);