General optimizations around compressed pointer management (#3019)
ECMA_GET_POINTER is removed from:
- property list iteration
- lexical environment chain iteration
- prototype chain iteration
For all these iteration the compressed pointer can be used to get the elements and only decompressed them if it is necessary.
- Properly guard ecma property hashmap routines
- Remove the redundant NULL pointer check from ecma_create_property
- Remove ecma_gc_get_object_next since it became unnecessary
- Substitute ECMA_{GET,SET}_POINTER with ECMA_{GET,SET}_NON_NULL pointer when we can assume the pointer is not NULL
- Remove ecma_get_object_prototype and ecma_get_lex_env_outer_reference helper function the reduce the number of NULL pointer checks during decompressing the pointers
- Remove ecma_get_named_accessor_property_{getter,setter} helper functions for also reduce the number of NULL pointer check/decompressions
- Remove ECMA_PROPERTY_SEARCH_DEPTH_LIMIT since in ES5 there is no way to create circular prototype chain, and the ES2015 setPrototypeOf method can resolve this error so this check during the property lookup can be eliminated.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Dániel Bátyai
parent
97e348528a
commit
47f2f0ea8b
@@ -494,8 +494,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jmem_cpointer_t getter_p; /**< pointer to getter object */
|
||||
jmem_cpointer_t setter_p; /**< pointer to setter object */
|
||||
jmem_cpointer_t getter_cp; /**< compressed pointer to getter object */
|
||||
jmem_cpointer_t setter_cp; /**< compressed pointer to setter object */
|
||||
} ecma_getter_setter_pointers_t;
|
||||
|
||||
/**
|
||||
@@ -564,11 +564,6 @@ typedef struct
|
||||
#define ECMA_PROPERTY_VALUE_PTR(property_p) \
|
||||
((ecma_property_value_t *) ECMA_PROPERTY_VALUE_DATA_PTR (property_p))
|
||||
|
||||
/**
|
||||
* Depth limit for property search (maximum prototype chain depth).
|
||||
*/
|
||||
#define ECMA_PROPERTY_SEARCH_DEPTH_LIMIT 128
|
||||
|
||||
/**
|
||||
* Property reference. It contains the value pointer
|
||||
* for real, and the value itself for virtual properties.
|
||||
@@ -744,10 +739,19 @@ typedef struct
|
||||
jmem_cpointer_t gc_next_cp;
|
||||
|
||||
/** compressed pointer to property list or bound object */
|
||||
jmem_cpointer_t property_list_or_bound_object_cp;
|
||||
union
|
||||
{
|
||||
jmem_cpointer_t property_list_cp; /**< compressed pointer to object's
|
||||
* or declerative lexical environments's property list */
|
||||
jmem_cpointer_t bound_object_cp; /**< compressed pointer to lexical environments's the bound object */
|
||||
} u1;
|
||||
|
||||
/** object prototype or outer reference */
|
||||
jmem_cpointer_t prototype_or_outer_reference_cp;
|
||||
union
|
||||
{
|
||||
jmem_cpointer_t prototype_cp; /**< compressed pointer to the object's prototype */
|
||||
jmem_cpointer_t outer_reference_cp; /**< compressed pointer to the lexical environments's outer reference */
|
||||
} u2;
|
||||
} ecma_object_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user