Don't use pointer compression where the ecma_value can store pointer value directly

This changes affects those internal properties where the property value type is an ecma_object_t ptr.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
robertsipka
2016-04-22 14:30:53 +02:00
committed by László Langó
parent 3203613b07
commit a87aca4d84
5 changed files with 54 additions and 25 deletions
+1 -1
View File
@@ -316,7 +316,7 @@ ecma_gc_mark_property (ecma_property_t *property_p) /**< property */
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
case ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP: /* an object */
{
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, property_value);
ecma_object_t *obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t, property_value);
ecma_gc_set_object_visited (obj_p, true);
+31
View File
@@ -71,6 +71,37 @@
utf8_ptr ## must_be_freed = true; \
}
#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
/**
* Set an internal property value of pointer
*/
#define ECMA_SET_INTERNAL_VALUE_POINTER(field, pointer) \
(field) = ((ecma_value_t) pointer)
/**
* Get an internal property value of pointer
*/
#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \
((type *) field)
#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
/**
* Set an internal property value of non-null pointer so that it will correspond
* to specified non_compressed_pointer.
*/
#define ECMA_SET_INTERNAL_VALUE_POINTER(field, non_compressed_pointer) \
ECMA_SET_NON_NULL_POINTER (field, non_compressed_pointer)
/**
* Get an internal property value of pointer from specified non-null compressed pointer.
*/
#define ECMA_GET_INTERNAL_VALUE_POINTER(type, field) \
ECMA_GET_NON_NULL_POINTER (type, field)
#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
/**
* Free the cesu-8 string buffer allocated by 'ECMA_STRING_TO_UTF8_STRING'
*/