Using hash value stored in ecma-string for lcache search; comparing string faster but with possible false negatives while performing lcache lookup.

This commit is contained in:
Ruben Ayrapetyan
2014-11-28 20:27:27 +03:00
parent fe7e34d93e
commit 3b29280b79
4 changed files with 139 additions and 95 deletions
+7 -4
View File
@@ -743,7 +743,7 @@ typedef enum
/**
* ECMA string hash
*/
typedef uint16_t ecma_string_hash_t;
typedef uint8_t ecma_string_hash_t;
/**
* Number of string's last characters to use for hash calculation
@@ -758,13 +758,13 @@ typedef struct
/** Reference counter for the string */
unsigned int refs : CONFIG_ECMA_REFERENCE_COUNTER_WIDTH;
/** Where the string's data is placed (ecma_string_container_t) */
unsigned int container : 3;
/** Flag indicating whether the string descriptor is placed
* in a stack variable (not in the heap) */
unsigned int is_stack_var : 1;
/** Where the string's data is placed (ecma_string_container_t) */
uint8_t container;
/** Hash of the string (calculated from two last characters of the string) */
ecma_string_hash_t hash;
@@ -794,6 +794,9 @@ typedef struct
/** Identifier of magic string */
ecma_magic_string_id_t magic_string_id;
/** For zeroing and comparison in some cases */
uint32_t common_field;
} u;
} ecma_string_t;