Improve parse_identifier (#4691)

Ascii string length is no longer computed during string allocation.

JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz batizjob@gmail.com
This commit is contained in:
batizdaniel
2021-08-17 12:16:58 +02:00
committed by GitHub
parent e7ffb70ae0
commit 3bcd48f72d
19 changed files with 172 additions and 92 deletions
+11 -1
View File
@@ -305,6 +305,16 @@ typedef enum
#endif /* JERRY_BUILTIN_BIGINT */
} lexer_number_type_t;
/**
* Lexer literal flags.
**/
typedef enum
{
LEXER_LIT_LOCATION_NO_OPTS = 0, /**< no options */
LEXER_LIT_LOCATION_HAS_ESCAPE = (1 << 0), /**< binding has escape */
LEXER_LIT_LOCATION_IS_ASCII = (1 << 1), /**< all characters are ascii characters */
} lexer_lit_location_flags_t;
/**
* Lexer character (string / identifier) literal data.
*/
@@ -313,7 +323,7 @@ typedef struct
const uint8_t *char_p; /**< start of identifier or string token */
prop_length_t length; /**< length or index of a literal */
uint8_t type; /**< type of the current literal */
uint8_t has_escape; /**< has escape sequences */
uint8_t status_flags; /**< any combination of lexer_lit_location_flags_t status bits */
} lexer_lit_location_t;
/**