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
@@ -1275,17 +1275,9 @@ ecma_make_empty_property_descriptor (void)
|
||||
{
|
||||
ecma_property_descriptor_t prop_desc;
|
||||
|
||||
prop_desc.is_value_defined = false;
|
||||
prop_desc.flags = 0;
|
||||
prop_desc.value = ECMA_VALUE_UNDEFINED;
|
||||
prop_desc.is_writable_defined = false;
|
||||
prop_desc.is_writable = false;
|
||||
prop_desc.is_enumerable_defined = false;
|
||||
prop_desc.is_enumerable = false;
|
||||
prop_desc.is_configurable_defined = false;
|
||||
prop_desc.is_configurable = false;
|
||||
prop_desc.is_get_defined = false;
|
||||
prop_desc.get_p = NULL;
|
||||
prop_desc.is_set_defined = false;
|
||||
prop_desc.set_p = NULL;
|
||||
|
||||
return prop_desc;
|
||||
@@ -1298,18 +1290,18 @@ ecma_make_empty_property_descriptor (void)
|
||||
void
|
||||
ecma_free_property_descriptor (ecma_property_descriptor_t *prop_desc_p) /**< property descriptor */
|
||||
{
|
||||
if (prop_desc_p->is_value_defined)
|
||||
if (prop_desc_p->flags & ECMA_PROP_IS_VALUE_DEFINED)
|
||||
{
|
||||
ecma_free_value (prop_desc_p->value);
|
||||
}
|
||||
|
||||
if (prop_desc_p->is_get_defined
|
||||
if ((prop_desc_p->flags & ECMA_PROP_IS_GET_DEFINED)
|
||||
&& prop_desc_p->get_p != NULL)
|
||||
{
|
||||
ecma_deref_object (prop_desc_p->get_p);
|
||||
}
|
||||
|
||||
if (prop_desc_p->is_set_defined
|
||||
if ((prop_desc_p->flags & ECMA_PROP_IS_SET_DEFINED)
|
||||
&& prop_desc_p->set_p != NULL)
|
||||
{
|
||||
ecma_deref_object (prop_desc_p->set_p);
|
||||
|
||||
Reference in New Issue
Block a user