Passing less number of arguments to a function is generally faster. So
the three boolean arguments of ecma_create_named_data_property and the two boolean arguments of ecma_create_named_accessor_property are combined into one uint8_t argument. On ARM-32 it is preferred to have less than four arguments, since these arguments can be passed in registers. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -300,11 +300,24 @@ TRY_TO_INSTANTIATE_PROPERTY_ROUTINE_NAME (ecma_object_t *obj_p, /**< object */
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t prop_attributes = 0;
|
||||
|
||||
if (configurable)
|
||||
{
|
||||
prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_CONFIGURABLE);
|
||||
}
|
||||
if (enumerable)
|
||||
{
|
||||
prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_ENUMERABLE);
|
||||
}
|
||||
if (writable)
|
||||
{
|
||||
prop_attributes = (uint8_t) (prop_attributes | ECMA_PROPERTY_FLAG_WRITABLE);
|
||||
}
|
||||
|
||||
ecma_property_t *prop_p = ecma_create_named_data_property (obj_p,
|
||||
prop_name_p,
|
||||
writable,
|
||||
enumerable,
|
||||
configurable);
|
||||
prop_attributes);
|
||||
|
||||
ecma_named_data_property_assign_value (obj_p, prop_p, value);
|
||||
|
||||
|
||||
@@ -737,11 +737,11 @@ ecma_builtin_json_parse (ecma_value_t this_arg __attr_unused___, /**< 'this' arg
|
||||
{
|
||||
ecma_object_t *object_p = ecma_op_create_object_object_noarg ();
|
||||
ecma_string_t *name_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);
|
||||
ecma_property_t *property_p = ecma_create_named_data_property (object_p,
|
||||
name_p,
|
||||
true,
|
||||
true,
|
||||
true);
|
||||
|
||||
ecma_property_t *property_p;
|
||||
property_p = ecma_create_named_data_property (object_p,
|
||||
name_p,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE);
|
||||
|
||||
ecma_named_data_property_assign_value (object_p, property_p, final_result);
|
||||
ecma_free_value (final_result);
|
||||
|
||||
@@ -1572,7 +1572,7 @@ ecma_builtin_helper_split_match (ecma_value_t input_string, /**< first argument
|
||||
ecma_string_t *magic_index_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_INDEX);
|
||||
ecma_property_t *index_prop_p = ecma_create_named_data_property (match_array_p,
|
||||
magic_index_str_p,
|
||||
true, false, false);
|
||||
ECMA_PROPERTY_FLAG_WRITABLE);
|
||||
ecma_deref_ecma_string (magic_index_str_p);
|
||||
|
||||
ecma_named_data_property_assign_value (match_array_p,
|
||||
|
||||
@@ -316,7 +316,7 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
|
||||
|
||||
ecma_property_t *len_prop_p = ecma_create_named_data_property (object_p,
|
||||
string_p,
|
||||
false, false, false);
|
||||
ECMA_PROPERTY_FIXED);
|
||||
|
||||
ecma_set_named_data_property_value (len_prop_p, ecma_make_uint32_value (length_prop_value));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user