All strings whose are valid array indicies always use the UINT32_IN_DESC format. (#1422)
This patch reduces memory consumption for strings such as "0" or "123" by 8 bytes and "4294967295" by 16 bytes. The hash computation is changed for using the lower 16 bits for these strings which is much faster than converting the value to string first and compute the hash. The trade-of is a small overhead when strings are created or concatenated. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -844,6 +844,11 @@ typedef double ecma_number_t;
|
||||
*/
|
||||
#define ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32 10
|
||||
|
||||
/**
|
||||
* String is not a valid array index.
|
||||
*/
|
||||
#define ECMA_STRING_NOT_ARRAY_INDEX UINT32_MAX
|
||||
|
||||
/**
|
||||
* Description of a collection's header.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user