Reduce memory consumption of property names.
Property names were always required a string reference which consumed a large amount of memory for arrays. This patch reduces this consumption by directly storing the value part of certain strings. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
+7
-1
@@ -62,7 +62,13 @@ vm_op_get_value (ecma_value_t object, /**< base object */
|
||||
{
|
||||
ecma_integer_value_t int_value = ecma_get_integer_from_value (property);
|
||||
|
||||
if (int_value >= 0)
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
bool limit_check = (int_value >= 0);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
bool limit_check = (int_value >= 0 && int_value < (UINT16_MAX + 1));
|
||||
#endif
|
||||
|
||||
if (limit_check)
|
||||
{
|
||||
/* Statically allocated string for searching. */
|
||||
ecma_init_ecma_string_from_uint32 (&uint32_string, (uint32_t) int_value);
|
||||
|
||||
Reference in New Issue
Block a user