@@ -194,7 +194,7 @@ typedef enum
194194 * Get class option bits from ecma_parse_opts_t
195195 */
196196#define PARSER_RESTORE_STATUS_FLAGS (opts ) \
197- (((opts) &PARSER_RESTORE_STATUS_FLAGS_MASK) << PARSER_RESTORE_STATUS_FLAGS_SHIFT)
197+ (((opts) & PARSER_RESTORE_STATUS_FLAGS_MASK) << PARSER_RESTORE_STATUS_FLAGS_SHIFT)
198198
199199/**
200200 * All flags that affect exotic arguments object creation.
@@ -215,7 +215,7 @@ typedef enum
215215
216216/* Checks whether unmapped arguments are needed. */
217217#define PARSER_NEEDS_MAPPED_ARGUMENTS (status_flags ) \
218- (((status_flags) &PARSER_ARGUMENTS_RELATED_FLAGS) == PARSER_ARGUMENTS_NEEDED)
218+ (((status_flags) & PARSER_ARGUMENTS_RELATED_FLAGS) == PARSER_ARGUMENTS_NEEDED)
219219
220220/* The maximum of PARSER_CBC_STREAM_PAGE_SIZE is 127. */
221221#define PARSER_CBC_STREAM_PAGE_SIZE ((uint32_t) (64 - sizeof (void *)))
@@ -245,7 +245,7 @@ typedef struct
245245#define PARSER_CBC_UNAVAILABLE CBC_EXT_OPCODE
246246
247247#define PARSER_TO_EXT_OPCODE (opcode ) ((uint16_t) ((opcode) + 256))
248- #define PARSER_GET_EXT_OPCODE (opcode ) ((opcode) -256)
248+ #define PARSER_GET_EXT_OPCODE (opcode ) ((opcode) - 256)
249249#define PARSER_IS_BASIC_OPCODE (opcode ) ((opcode) < 256)
250250#define PARSER_IS_PUSH_LITERAL (opcode ) \
251251 ((opcode) == CBC_PUSH_LITERAL || (opcode) == CBC_PUSH_TWO_LITERALS || (opcode) == CBC_PUSH_THREE_LITERALS)
@@ -366,6 +366,16 @@ typedef struct parser_branch_node_t
366366 parser_branch_t branch ; /**< branch */
367367} parser_branch_node_t ;
368368
369+ /**
370+ * All data allocated by the parser is
371+ * stored in parser_data_pages in the memory.
372+ */
373+ typedef struct parser_branch_list_t
374+ {
375+ struct parser_branch_list_t * next_p ; /**< next page */
376+ parser_branch_node_t * branch_node_p ;
377+ } parser_branch_list_t ;
378+
369379/**
370380 * Items of scope stack.
371381 */
@@ -591,6 +601,7 @@ typedef struct
591601 ecma_value_t tagged_template_literal_cp ; /**< compessed pointer to the tagged template literal collection */
592602 parser_private_context_t * private_context_p ; /**< private context */
593603 uint8_t stack_top_uint8 ; /**< top byte stored on the stack */
604+ parser_branch_list_t * branch_list ; /**< list of branches */
594605
595606#ifndef JERRY_NDEBUG
596607 /* Variables for debugging / logging. */
@@ -654,6 +665,11 @@ void *parser_list_get (parser_list_t *list_p, size_t index);
654665void parser_list_iterator_init (parser_list_t * list_p , parser_list_iterator_t * iterator_p );
655666void * parser_list_iterator_next (parser_list_iterator_t * iterator_p );
656667
668+ void parser_branch_list_init (parser_context_t * context_p );
669+ void * parser_branch_list_append (parser_context_t * context_p );
670+ void parser_branch_list_remove (const parser_context_t * context_p , const parser_branch_node_t * node_p );
671+ void parser_branch_list_free (const parser_context_t * context_p );
672+
657673/* Parser stack. Optimized for pushing bytes.
658674 * Pop functions never throws error. */
659675
0 commit comments