Reduce the memory consumption of function objects. (#1954)

Several properties of strict and bound functions are moved to
lazy property instantiation. The memory consumption of bound
functions are also reduced when only a this is present.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-08-30 14:17:35 +02:00
committed by Dániel Bátyai
parent 82a94d0f88
commit e897858c64
10 changed files with 275 additions and 232 deletions
+15 -3
View File
@@ -231,7 +231,11 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
}
/* Get prototype physical property. */
property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
else if (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION)
{
property_p = ecma_op_bound_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
if (property_p == NULL)
@@ -529,7 +533,11 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
}
/* Get prototype physical property. */
property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
else if (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION)
{
property_p = ecma_op_bound_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
if (property_p == NULL)
@@ -816,7 +824,11 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
}
/* Get prototype physical property. */
property_p = ecma_op_function_try_lazy_instantiate_property (object_p, property_name_p);
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
else if (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION)
{
property_p = ecma_op_bound_function_try_to_lazy_instantiate_property (object_p, property_name_p);
}
}