Reduce the argument count of ecma_op_object_get_property_names (#2598)

Introduce ECMA_LIST_ARRAY_INDICES[_ENUMBERABLE[_PROTOTYPE]] flags instead of passing 3 boolean arguments.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2018-11-15 13:40:44 +01:00
committed by László Langó
parent ba8e144f7b
commit 9535a230ba
9 changed files with 36 additions and 20 deletions
+4 -5
View File
@@ -1337,11 +1337,7 @@ ecma_op_object_is_prototype_of (ecma_object_t *base_p, /**< base object */
*/
ecma_collection_header_t *
ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
bool is_array_indices_only, /**< true - exclude properties with names
* that are not indices */
bool is_enumerable_only, /**< true - exclude non-enumerable properties */
bool is_with_prototype_chain) /**< true - list properties from prototype chain,
* false - list only own properties */
uint32_t opts) /**< any combination of ecma_list_properties_options_t values */
{
JERRY_ASSERT (obj_p != NULL
&& !ecma_is_lexical_environment (obj_p));
@@ -1351,6 +1347,9 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
const ecma_object_type_t type = ecma_get_object_type (obj_p);
const bool obj_is_builtin = ecma_get_object_is_builtin (obj_p);
const bool is_enumerable_only = (const bool) (opts & ECMA_LIST_ENUMERABLE);
const bool is_array_indices_only = (const bool) (opts & ECMA_LIST_ARRAY_INDICES);
const bool is_with_prototype_chain = (const bool) (opts & ECMA_LIST_PROTOTYPE);
const size_t bitmap_row_size = sizeof (uint32_t) * JERRY_BITSINBYTE;
const size_t names_hashes_bitmap_size = ECMA_OBJECT_HASH_BITMAP_SIZE / bitmap_row_size;