@@ -194,7 +194,7 @@ typedef enum
194
194
* Get class option bits from ecma_parse_opts_t
195
195
*/
196
196
#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)
198
198
199
199
/**
200
200
* All flags that affect exotic arguments object creation.
@@ -215,7 +215,7 @@ typedef enum
215
215
216
216
/* Checks whether unmapped arguments are needed. */
217
217
#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)
219
219
220
220
/* The maximum of PARSER_CBC_STREAM_PAGE_SIZE is 127. */
221
221
#define PARSER_CBC_STREAM_PAGE_SIZE ((uint32_t) (64 - sizeof (void *)))
@@ -245,7 +245,7 @@ typedef struct
245
245
#define PARSER_CBC_UNAVAILABLE CBC_EXT_OPCODE
246
246
247
247
#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)
249
249
#define PARSER_IS_BASIC_OPCODE (opcode ) ((opcode) < 256)
250
250
#define PARSER_IS_PUSH_LITERAL (opcode ) \
251
251
((opcode) == CBC_PUSH_LITERAL || (opcode) == CBC_PUSH_TWO_LITERALS || (opcode) == CBC_PUSH_THREE_LITERALS)
@@ -366,6 +366,16 @@ typedef struct parser_branch_node_t
366
366
parser_branch_t branch ; /**< branch */
367
367
} parser_branch_node_t ;
368
368
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
+
369
379
/**
370
380
* Items of scope stack.
371
381
*/
@@ -591,6 +601,7 @@ typedef struct
591
601
ecma_value_t tagged_template_literal_cp ; /**< compessed pointer to the tagged template literal collection */
592
602
parser_private_context_t * private_context_p ; /**< private context */
593
603
uint8_t stack_top_uint8 ; /**< top byte stored on the stack */
604
+ parser_branch_list_t * branch_list ; /**< list of branches */
594
605
595
606
#ifndef JERRY_NDEBUG
596
607
/* Variables for debugging / logging. */
@@ -654,6 +665,11 @@ void *parser_list_get (parser_list_t *list_p, size_t index);
654
665
void parser_list_iterator_init (parser_list_t * list_p , parser_list_iterator_t * iterator_p );
655
666
void * parser_list_iterator_next (parser_list_iterator_t * iterator_p );
656
667
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
+
657
673
/* Parser stack. Optimized for pushing bytes.
658
674
* Pop functions never throws error. */
659
675
0 commit comments