Optimize ecma_builtin_helper_def_prop. (#3007)
This patch removes the ecma_property_descriptor_t structure bitfields and substitutes it with an uint16_t flag field to reduce the cost of the transformation from/into the ecma_property_flags_t. Also the is_throw last arguments is embedded to the property descriptor structure during the property defining process to reduce the number of arguments of the function. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Dániel Bátyai
parent
d0435e1db0
commit
ee1da14577
@@ -143,18 +143,18 @@ ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
|
||||
ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
|
||||
|
||||
ecma_value_t completion;
|
||||
if (!ecma_get_object_extensible (binding_obj_p))
|
||||
{
|
||||
return ECMA_VALUE_EMPTY;
|
||||
}
|
||||
|
||||
completion = ecma_builtin_helper_def_prop (binding_obj_p,
|
||||
name_p,
|
||||
ECMA_VALUE_UNDEFINED,
|
||||
is_deletable ? ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE
|
||||
: ECMA_PROPERTY_ENUMERABLE_WRITABLE,
|
||||
true); /* Failure handling */
|
||||
const uint32_t flags = ECMA_PROPERTY_ENUMERABLE_WRITABLE | ECMA_IS_THROW;
|
||||
|
||||
ecma_value_t completion = ecma_builtin_helper_def_prop (binding_obj_p,
|
||||
name_p,
|
||||
ECMA_VALUE_UNDEFINED,
|
||||
is_deletable ? flags | ECMA_PROPERTY_FLAG_CONFIGURABLE
|
||||
: flags);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (completion))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user