Adding ecma-string's hash to ecma_string_t.

This commit is contained in:
Ruben Ayrapetyan
2014-11-28 18:00:24 +03:00
parent 6c65c48772
commit fe7e34d93e
6 changed files with 109 additions and 8 deletions
+12 -2
View File
@@ -740,6 +740,16 @@ typedef enum
ECMA_MAGIC_STRING__COUNT /**< number of magic strings */
} ecma_magic_string_id_t;
/**
* ECMA string hash
*/
typedef uint16_t ecma_string_hash_t;
/**
* Number of string's last characters to use for hash calculation
*/
#define ECMA_STRING_HASH_LAST_CHARS_COUNT (2)
/**
* ECMA string-value descriptor
*/
@@ -755,8 +765,8 @@ typedef struct
* in a stack variable (not in the heap) */
unsigned int is_stack_var : 1;
/** Padding */
ecma_length_t padding;
/** Hash of the string (calculated from two last characters of the string) */
ecma_string_hash_t hash;
/**
* Actual data or identifier of it's place in container (depending on 'container' field)