Reduce memory consumption of property names.

Property names were always required a string reference which consumed
a large amount of memory for arrays. This patch reduces this consumption
by directly storing the value part of certain strings.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-11-25 05:44:57 -08:00
parent abaf4c8af8
commit 6d67b8dff9
18 changed files with 595 additions and 393 deletions
+4 -1
View File
@@ -1259,7 +1259,8 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|| ECMA_PROPERTY_GET_TYPE (*property_p) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
{
ecma_property_pair_t *prop_pair_p = (ecma_property_pair_t *) prop_iter_p;
ecma_string_t *name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t, prop_pair_p->names_cp[i]);
ecma_string_t *name_p = ecma_string_from_property_name (*property_p,
prop_pair_p->names_cp[i]);
if (!(is_enumerable_only && !ecma_is_property_enumerable (*property_p)))
{
@@ -1311,6 +1312,8 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
names_hashes_bitmap[bitmap_row] |= (1u << bitmap_column);
}
}
ecma_deref_ecma_string (name_p);
}
}