From 3de4170c152de7bf44b2856285d6c719cf8af9dd Mon Sep 17 00:00:00 2001 From: Robert Sipka Date: Wed, 4 May 2016 16:04:47 +0200 Subject: [PATCH] Unified the commenting form of the internal properties and removed the unused types. JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com --- jerry-core/ecma/base/ecma-gc.c | 23 ++++--------- jerry-core/ecma/base/ecma-globals.h | 52 +++++++++-------------------- jerry-core/ecma/base/ecma-helpers.c | 16 --------- 3 files changed, 22 insertions(+), 69 deletions(-) diff --git a/jerry-core/ecma/base/ecma-gc.c b/jerry-core/ecma/base/ecma-gc.c index 4ebeeabbe1..35648fecad 100644 --- a/jerry-core/ecma/base/ecma-gc.c +++ b/jerry-core/ecma/base/ecma-gc.c @@ -242,22 +242,6 @@ ecma_gc_mark_property (ecma_property_t *property_p) /**< property */ switch (ECMA_PROPERTY_GET_INTERNAL_PROPERTY_TYPE (property_p)) { - case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection of ecma values */ - case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection of ecma values */ - { - JERRY_UNIMPLEMENTED ("Indexed array storage is not implemented yet."); - } - - case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t - * (see above in the routine) */ - case ECMA_INTERNAL_PROPERTY_EXTENSIBLE: /* the property's value is located in ecma_object_t - * (see above in the routine) */ - case ECMA_INTERNAL_PROPERTY__COUNT: /* not a real internal property type, - * but number of the real internal property types */ - { - JERRY_UNREACHABLE (); - } - case ECMA_INTERNAL_PROPERTY_PRIMITIVE_STRING_VALUE: /* compressed pointer to a ecma_string_t */ case ECMA_INTERNAL_PROPERTY_PRIMITIVE_NUMBER_VALUE: /* compressed pointer to a ecma_number_t */ case ECMA_INTERNAL_PROPERTY_PRIMITIVE_BOOLEAN_VALUE: /* a simple boolean value */ @@ -268,7 +252,6 @@ ecma_gc_mark_property (ecma_property_t *property_p) /**< property */ case ECMA_INTERNAL_PROPERTY_FREE_CALLBACK: /* an object's native free callback */ case ECMA_INTERNAL_PROPERTY_BUILT_IN_ID: /* an integer */ case ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC: /* an integer */ - case ECMA_INTERNAL_PROPERTY_EXTENSION_ID: /* an integer */ case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_0_31: /* an integer (bit-mask) */ case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_32_63: /* an integer (bit-mask) */ case ECMA_INTERNAL_PROPERTY_REGEXP_BYTECODE: @@ -322,6 +305,12 @@ ecma_gc_mark_property (ecma_property_t *property_p) /**< property */ break; } + case ECMA_INTERNAL_PROPERTY__COUNT: /* not a real internal property type, + * but number of the real internal property types */ + { + JERRY_UNREACHABLE (); + break; + } } break; } diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index 3cce0c1bd4..5f484892f3 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -120,11 +120,11 @@ typedef uint32_t ecma_value_t; typedef enum { ECMA_INTERNAL_PROPERTY_CLASS, /**< [[Class]] */ - ECMA_INTERNAL_PROPERTY_PROTOTYPE, /**< [[Prototype]] */ - ECMA_INTERNAL_PROPERTY_EXTENSIBLE, /**< [[Extensible]] */ ECMA_INTERNAL_PROPERTY_SCOPE, /**< [[Scope]] */ ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP, /**< [[ParametersMap]] */ - ECMA_INTERNAL_PROPERTY_CODE_BYTECODE, /**< first part of [[Code]] - compressed pointer to bytecode array */ + ECMA_INTERNAL_PROPERTY_CODE_BYTECODE, /**< pointer to compact bytecode array */ + ECMA_INTERNAL_PROPERTY_REGEXP_BYTECODE, /**< pointer to RegExp bytecode array */ + ECMA_INTERNAL_PROPERTY_NATIVE_CODE, /**< native handler location descriptor */ ECMA_INTERNAL_PROPERTY_NATIVE_HANDLE, /**< native handle associated with an object */ ECMA_INTERNAL_PROPERTY_FREE_CALLBACK, /**< object's native free callback */ @@ -132,47 +132,27 @@ typedef enum ECMA_INTERNAL_PROPERTY_PRIMITIVE_NUMBER_VALUE, /**< [[Primitive value]] for Number objects */ ECMA_INTERNAL_PROPERTY_PRIMITIVE_BOOLEAN_VALUE, /**< [[Primitive value]] for Boolean objects */ - /** Part of an array, that is indexed by numbers */ - ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES, - - /** Part of an array, that is indexed by strings */ - ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES, - - /** Implementation-defined identifier of built-in object */ - ECMA_INTERNAL_PROPERTY_BUILT_IN_ID, - - /** Implementation-defined identifier of built-in routine - that corresponds to a built-in function object - ([[Built-in routine's description]]) */ - ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC, - - /** Identifier of implementation-defined extension object */ - ECMA_INTERNAL_PROPERTY_EXTENSION_ID, - /** Bound function internal properties **/ ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_TARGET_FUNCTION, ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_THIS, ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_BOUND_ARGS, - /** - * Bit-mask of non-instantiated built-in's properties (bits 0-31) - */ - ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_0_31, + ECMA_INTERNAL_PROPERTY_BUILT_IN_ID, /**< Implementation-defined identifier of built-in object */ - /** - * Bit-mask of non-instantiated built-in's properties (bits 32-63) - */ - ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_32_63, + ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC, /**< Implementation-defined identifier of built-in routine + * that corresponds to a built-in function object + * ([[Built-in routine's description]]) + */ - /** - * RegExp bytecode array - */ - ECMA_INTERNAL_PROPERTY_REGEXP_BYTECODE, + ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_0_31, /**< Bit-mask of non-instantiated + * built-in's properties (bits 0-31) + */ - /** - * Number of internal properties' types - */ - ECMA_INTERNAL_PROPERTY__COUNT + ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_32_63, /**< Bit-mask of non-instantiated + * built-in's properties (bits 32-63) + */ + + ECMA_INTERNAL_PROPERTY__COUNT /**< Number of internal properties' types */ } ecma_internal_property_id_t; /** diff --git a/jerry-core/ecma/base/ecma-helpers.c b/jerry-core/ecma/base/ecma-helpers.c index 1734e61f18..3aea724172 100644 --- a/jerry-core/ecma/base/ecma-helpers.c +++ b/jerry-core/ecma/base/ecma-helpers.c @@ -516,9 +516,6 @@ ecma_find_internal_property (ecma_object_t *object_p, /**< object descriptor */ { JERRY_ASSERT (object_p != NULL); - JERRY_ASSERT (property_id != ECMA_INTERNAL_PROPERTY_PROTOTYPE - && property_id != ECMA_INTERNAL_PROPERTY_EXTENSIBLE); - ecma_property_header_t *prop_iter_p = ecma_get_property_list (object_p); if (prop_iter_p != NULL @@ -804,16 +801,6 @@ ecma_free_internal_property (ecma_property_t *property_p) /**< the property */ switch (ECMA_PROPERTY_GET_INTERNAL_PROPERTY_TYPE (property_p)) { - case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection */ - case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection */ - { - ecma_free_values_collection (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_header_t, - property_value), - true); - - break; - } - case ECMA_INTERNAL_PROPERTY_PRIMITIVE_STRING_VALUE: /* compressed pointer to a ecma_string_t */ { ecma_string_t *str_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_string_t, property_value); @@ -842,12 +829,9 @@ ecma_free_internal_property (ecma_property_t *property_p) /**< the property */ case ECMA_INTERNAL_PROPERTY_PRIMITIVE_BOOLEAN_VALUE: /* a simple boolean value */ case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */ case ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP: /* an object */ - case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t */ - case ECMA_INTERNAL_PROPERTY_EXTENSIBLE: /* the property's value is located in ecma_object_t */ case ECMA_INTERNAL_PROPERTY_CLASS: /* an enum */ case ECMA_INTERNAL_PROPERTY_BUILT_IN_ID: /* an integer */ case ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC: /* an integer */ - case ECMA_INTERNAL_PROPERTY_EXTENSION_ID: /* an integer */ case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_0_31: /* an integer (bit-mask) */ case ECMA_INTERNAL_PROPERTY_NON_INSTANTIATED_BUILT_IN_MASK_32_63: /* an integer (bit-mask) */ case ECMA_INTERNAL_PROPERTY_BOUND_FUNCTION_TARGET_FUNCTION: