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:
committed by
Zoltan Herczeg
parent
8410570dd9
commit
e11c499b4b
@@ -62,11 +62,7 @@ ecma_op_create_object_object_noarg (void)
|
||||
ecma_object_t *object_prototype_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
|
||||
/* 3., 4., 6., 7. */
|
||||
ecma_object_t *obj_p = ecma_op_create_object_object_noarg_and_set_prototype (object_prototype_p);
|
||||
|
||||
ecma_deref_object (object_prototype_p);
|
||||
|
||||
return obj_p;
|
||||
return ecma_op_create_object_object_noarg_and_set_prototype (object_prototype_p);
|
||||
} /* ecma_op_create_object_object_noarg */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user