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
@@ -110,8 +110,11 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
ecma_object_t *obj_p = ecma_create_object (array_prototype_obj_p, true, ECMA_OBJECT_TYPE_ARRAY);
ecma_deref_object (array_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_ARRAY_UL;
/*
* [[Class]] property is not stored explicitly for objects of ECMA_OBJECT_TYPE_ARRAY type.
*
* See also: ecma_object_get_class_name
*/
ecma_string_t *length_magic_string_p = ecma_get_magic_string (ECMA_MAGIC_STRING_LENGTH);
ecma_number_t *length_num_p = ecma_alloc_number ();