Fixing retrieval of [[Class]] properties for built-in function objects, optimizing memory related to [[Class]] property.

- introduced ecma_object_get_class_name interface;
 - removed creation of [[Class]] internal property for types of objects that unambiguously determine the [[Class]] value.

Related issue: #112

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-05-28 20:49:55 +03:00
parent bc7c28ce12
commit da7e9d9871
18 changed files with 284 additions and 92 deletions
@@ -88,8 +88,11 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
ECMA_OBJECT_TYPE_STRING);
ecma_deref_object (prototype_obj_p);
ecma_property_t *class_prop_p = ecma_create_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_CLASS);
class_prop_p->u.internal_property.value = ECMA_MAGIC_STRING_STRING_UL;
/*
* [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_STRING type.
*
* See also: ecma_object_get_class_name
*/
ecma_property_t *prim_value_prop_p = ecma_create_internal_property (obj_p,
ECMA_INTERNAL_PROPERTY_PRIMITIVE_STRING_VALUE);