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
@@ -1141,27 +1141,24 @@ re_set_result_array_properties (ecma_object_t *array_obj_p, /**< result array */
|
||||
ecma_builtin_helper_def_prop (array_obj_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_INDEX),
|
||||
ecma_make_int32_value (index),
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
|
||||
true); /* Failure handling */
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | ECMA_IS_THROW);
|
||||
|
||||
/* Set input property of the result array */
|
||||
ecma_builtin_helper_def_prop (array_obj_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_INPUT),
|
||||
ecma_make_string_value (input_str_p),
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
|
||||
true); /* Failure handling */
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE | ECMA_IS_THROW);
|
||||
|
||||
/* Set length property of the result array */
|
||||
{
|
||||
ecma_property_descriptor_t array_item_prop_desc = ecma_make_empty_property_descriptor ();
|
||||
array_item_prop_desc.is_value_defined = true;
|
||||
array_item_prop_desc.flags |= (ECMA_PROP_IS_VALUE_DEFINED | ECMA_PROP_IS_THROW);
|
||||
|
||||
array_item_prop_desc.value = ecma_make_uint32_value (num_of_elements);
|
||||
|
||||
ecma_op_object_define_own_property (array_obj_p,
|
||||
ecma_get_magic_string (LIT_MAGIC_STRING_LENGTH),
|
||||
&array_item_prop_desc,
|
||||
true);
|
||||
&array_item_prop_desc);
|
||||
}
|
||||
} /* re_set_result_array_properties */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user