Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro - remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default) - move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names - add skiplist to some snapshot tests that were supported only in 5.1 - fix doxygen issues that were hidden before (bc. of es.next macro) Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -57,7 +57,6 @@ typedef enum
|
||||
* after the last byte code */
|
||||
PARSER_DEBUGGER_BREAKPOINT_APPENDED = (1u << 11), /**< pending (unsent) breakpoint
|
||||
* info is available */
|
||||
#if JERRY_ESNEXT
|
||||
PARSER_LEXICAL_BLOCK_NEEDED = (1u << 12), /**< global script: needs a lexical environment for let and const
|
||||
* function: needs a lexical environment for arguments */
|
||||
PARSER_IS_ARROW_FUNCTION = (1u << 13), /**< an arrow function is parsed */
|
||||
@@ -79,7 +78,6 @@ typedef enum
|
||||
PARSER_IS_CLASS_STATIC_BLOCK = (1u << 26), /**< a class static block is parsed */
|
||||
PARSER_PRIVATE_FUNCTION_NAME = PARSER_IS_FUNC_EXPRESSION, /**< represents private method for
|
||||
* parser_set_function_name*/
|
||||
#endif /* JERRY_ESNEXT */
|
||||
#if JERRY_MODULE_SYSTEM
|
||||
PARSER_MODULE_DEFAULT_CLASS_OR_FUNC = (1u << 27), /**< parsing a function or class default export */
|
||||
PARSER_MODULE_STORE_IDENT = (1u << 28), /**< store identifier of the current export statement */
|
||||
@@ -128,14 +126,10 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
PARSER_CHECK_BLOCK_CONTEXT, /**< check block context */
|
||||
#if JERRY_ESNEXT
|
||||
PARSER_CHECK_GLOBAL_CONTEXT, /**< check global context */
|
||||
PARSER_CHECK_FUNCTION_CONTEXT, /**< check function context */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
} parser_check_context_type_t;
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Class field bits.
|
||||
*/
|
||||
@@ -148,8 +142,6 @@ typedef enum
|
||||
PARSER_CLASS_FIELD_STATIC_BLOCK = (1u << 4), /**< static class field */
|
||||
} parser_class_field_type_t;
|
||||
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Mask for strict mode code
|
||||
*/
|
||||
@@ -172,7 +164,6 @@ typedef enum
|
||||
#define PARSER_MAX_BRANCH_LENGTH 3
|
||||
#endif /* PARSER_MAXIMUM_CODE_SIZE <= UINT16_MAX */
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
/**
|
||||
* Offset of PARSER_ALLOW_SUPER
|
||||
*/
|
||||
@@ -222,15 +213,6 @@ typedef enum
|
||||
#define PARSER_IS_NORMAL_ASYNC_FUNCTION(status_flags) \
|
||||
(((status_flags) & (PARSER_IS_GENERATOR_FUNCTION | PARSER_IS_ASYNC_FUNCTION)) == PARSER_IS_ASYNC_FUNCTION)
|
||||
|
||||
#else /* !JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* All flags that affect exotic arguments object creation.
|
||||
*/
|
||||
#define PARSER_ARGUMENTS_RELATED_FLAGS (PARSER_ARGUMENTS_NEEDED | PARSER_IS_STRICT)
|
||||
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/* Checks whether unmapped arguments are needed. */
|
||||
#define PARSER_NEEDS_MAPPED_ARGUMENTS(status_flags) \
|
||||
(((status_flags) &PARSER_ARGUMENTS_RELATED_FLAGS) == PARSER_ARGUMENTS_NEEDED)
|
||||
@@ -403,8 +385,6 @@ typedef struct
|
||||
*/
|
||||
#define PARSER_SCOPE_STACK_FUNC 0xffff
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Mask for decoding the register index of map_to
|
||||
*/
|
||||
@@ -426,8 +406,6 @@ typedef struct
|
||||
*/
|
||||
#define PARSER_SCOPE_STACK_IS_LOCAL_CREATED (PARSER_SCOPE_STACK_IS_CONST_REG)
|
||||
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Starting literal index for registers.
|
||||
*/
|
||||
@@ -485,7 +463,6 @@ typedef struct
|
||||
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
/**
|
||||
* List of private field contexts
|
||||
*/
|
||||
@@ -495,7 +472,6 @@ typedef struct parser_private_context_t
|
||||
struct parser_private_context_t *prev_p; /**< previous private field context */
|
||||
uint8_t opts; /**< options */
|
||||
} parser_private_context_t;
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Those members of a context which needs
|
||||
@@ -512,9 +488,7 @@ typedef struct parser_saved_context_t
|
||||
|
||||
/* Literal types */
|
||||
uint16_t argument_count; /**< number of function arguments */
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t argument_length; /**< length property of arguments */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
uint16_t register_count; /**< number of registers */
|
||||
uint16_t literal_count; /**< number of literals */
|
||||
|
||||
@@ -526,11 +500,8 @@ typedef struct parser_saved_context_t
|
||||
uint16_t scope_stack_size; /**< size of scope stack */
|
||||
uint16_t scope_stack_top; /**< preserved top of scope stack */
|
||||
uint16_t scope_stack_reg_top; /**< preserved top register of scope stack */
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t scope_stack_global_end; /**< end of global declarations of a function */
|
||||
ecma_value_t tagged_template_literal_cp; /**< compessed pointer to the tagged template literal collection */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
uint16_t context_stack_depth; /**< current context stack depth */
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
@@ -602,9 +573,7 @@ typedef struct
|
||||
|
||||
/* Literal types */
|
||||
uint16_t argument_count; /**< number of function arguments */
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t argument_length; /**< length property of arguments */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
uint16_t register_count; /**< number of registers */
|
||||
uint16_t literal_count; /**< number of literals */
|
||||
|
||||
@@ -618,11 +587,9 @@ typedef struct
|
||||
uint16_t scope_stack_size; /**< size of scope stack */
|
||||
uint16_t scope_stack_top; /**< current top of scope stack */
|
||||
uint16_t scope_stack_reg_top; /**< current top register of scope stack */
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t scope_stack_global_end; /**< end of global declarations of a function */
|
||||
ecma_value_t tagged_template_literal_cp; /**< compessed pointer to the tagged template literal collection */
|
||||
parser_private_context_t *private_context_p; /**< private context */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
uint8_t stack_top_uint8; /**< top byte stored on the stack */
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
@@ -738,6 +705,7 @@ ecma_string_t *parser_new_ecma_string_from_literal (lexer_literal_t *literal_p);
|
||||
void parser_set_branch_to_current_position (parser_context_t *context_p, parser_branch_t *branch_p);
|
||||
void parser_set_breaks_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
|
||||
void parser_set_continues_to_current_position (parser_context_t *context_p, parser_branch_node_t *current_p);
|
||||
void parser_reverse_class_fields (parser_context_t *context_p, size_t fields_size);
|
||||
|
||||
/* Convenience macros. */
|
||||
#define parser_emit_cbc_ext(context_p, opcode) parser_emit_cbc ((context_p), PARSER_TO_EXT_OPCODE (opcode))
|
||||
@@ -754,10 +722,6 @@ void parser_set_continues_to_current_position (parser_context_t *context_p, pars
|
||||
#define parser_emit_cbc_ext_backward_branch(context_p, opcode, offset) \
|
||||
parser_emit_cbc_backward_branch ((context_p), PARSER_TO_EXT_OPCODE (opcode), (offset))
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
void parser_reverse_class_fields (parser_context_t *context_p, size_t fields_size);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
@@ -772,7 +736,6 @@ bool lexer_check_next_character (parser_context_t *context_p, lit_utf8_byte_t ch
|
||||
bool lexer_check_next_characters (parser_context_t *context_p, lit_utf8_byte_t character1, lit_utf8_byte_t character2);
|
||||
uint8_t lexer_consume_next_character (parser_context_t *context_p);
|
||||
bool lexer_check_post_primary_exp (parser_context_t *context_p);
|
||||
#if JERRY_ESNEXT
|
||||
void lexer_skip_empty_statements (parser_context_t *context_p);
|
||||
bool lexer_check_arrow (parser_context_t *context_p);
|
||||
bool lexer_check_arrow_param (parser_context_t *context_p);
|
||||
@@ -781,7 +744,6 @@ bool lexer_consume_generator (parser_context_t *context_p);
|
||||
bool lexer_consume_assign (parser_context_t *context_p);
|
||||
void lexer_update_await_yield (parser_context_t *context_p, uint32_t status_flags);
|
||||
bool lexer_scan_private_identifier (parser_context_t *context_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
void lexer_parse_string (parser_context_t *context_p, lexer_string_options_t opts);
|
||||
void lexer_expect_identifier (parser_context_t *context_p, uint8_t literal_type);
|
||||
bool lexer_scan_identifier (parser_context_t *context_p, lexer_parse_options_t opts);
|
||||
@@ -800,9 +762,7 @@ void lexer_construct_literal_object (parser_context_t *context_p,
|
||||
bool lexer_construct_number_object (parser_context_t *context_p, bool is_expr, bool is_negative_number);
|
||||
void lexer_convert_push_number_to_push_literal (parser_context_t *context_p);
|
||||
uint16_t lexer_construct_function_object (parser_context_t *context_p, uint32_t extra_status_flags);
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t lexer_construct_class_static_block_function (parser_context_t *context_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
void lexer_construct_regexp_object (parser_context_t *context_p, bool parse_only);
|
||||
bool lexer_compare_identifier_to_string (const lexer_lit_location_t *left_p, const uint8_t *right_p, size_t size);
|
||||
bool lexer_compare_identifiers (parser_context_t *context_p,
|
||||
@@ -811,11 +771,9 @@ bool lexer_compare_identifiers (parser_context_t *context_p,
|
||||
bool lexer_current_is_literal (parser_context_t *context_p, const lexer_lit_location_t *right_ident_p);
|
||||
bool lexer_string_is_use_strict (parser_context_t *context_p);
|
||||
bool lexer_string_is_directive (parser_context_t *context_p);
|
||||
#if JERRY_ESNEXT
|
||||
bool lexer_token_is_identifier (parser_context_t *context_p, const char *identifier_p, size_t identifier_length);
|
||||
bool lexer_token_is_let (parser_context_t *context_p);
|
||||
bool lexer_token_is_async (parser_context_t *context_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
bool lexer_compare_literal_to_string (parser_context_t *context_p, const char *string_p, size_t string_length);
|
||||
void lexer_init_line_info (parser_context_t *context_p);
|
||||
uint8_t lexer_convert_binary_lvalue_token_to_binary (uint8_t token);
|
||||
@@ -832,7 +790,6 @@ uint8_t lexer_convert_binary_lvalue_token_to_binary (uint8_t token);
|
||||
void parser_parse_block_expression (parser_context_t *context_p, int options);
|
||||
void parser_parse_expression_statement (parser_context_t *context_p, int options);
|
||||
void parser_parse_expression (parser_context_t *context_p, int options);
|
||||
#if JERRY_ESNEXT
|
||||
void parser_resolve_private_identifier (parser_context_t *context_p);
|
||||
void parser_save_private_context (parser_context_t *context_p,
|
||||
parser_private_context_t *private_ctx_p,
|
||||
@@ -841,8 +798,6 @@ void parser_restore_private_context (parser_context_t *context_p, parser_private
|
||||
void parser_parse_class (parser_context_t *context_p, bool is_statement);
|
||||
void parser_parse_initializer (parser_context_t *context_p, parser_pattern_flags_t flags);
|
||||
void parser_parse_initializer_by_next_char (parser_context_t *context_p, parser_pattern_flags_t flags);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
@@ -861,21 +816,17 @@ void scanner_reverse_info_list (parser_context_t *context_p);
|
||||
void scanner_cleanup (parser_context_t *context_p);
|
||||
|
||||
bool scanner_is_context_needed (parser_context_t *context_p, parser_check_context_type_t check_type);
|
||||
#if JERRY_ESNEXT
|
||||
bool scanner_try_scan_new_target (parser_context_t *context_p);
|
||||
void scanner_check_variables (parser_context_t *context_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
void scanner_create_variables (parser_context_t *context_p, uint32_t option_flags);
|
||||
|
||||
void scanner_get_location (scanner_location_t *location_p, parser_context_t *context_p);
|
||||
void scanner_set_location (parser_context_t *context_p, scanner_location_t *location_p);
|
||||
uint16_t scanner_decode_map_to (parser_scope_stack_t *stack_item_p);
|
||||
#if JERRY_ESNEXT
|
||||
uint16_t scanner_save_literal (parser_context_t *context_p, uint16_t ident_index);
|
||||
bool scanner_literal_is_const_reg (parser_context_t *context_p, uint16_t literal_index);
|
||||
bool scanner_literal_is_created (parser_context_t *context_p, uint16_t literal_index);
|
||||
bool scanner_literal_exists (parser_context_t *context_p, uint16_t literal_index);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
void scanner_scan_all (parser_context_t *context_p);
|
||||
|
||||
@@ -935,7 +886,6 @@ uint8_t *parser_line_info_generate (parser_context_t *context_p);
|
||||
*/
|
||||
|
||||
ecma_compiled_code_t *parser_parse_function (parser_context_t *context_p, uint32_t status_flags);
|
||||
#if JERRY_ESNEXT
|
||||
ecma_compiled_code_t *parser_parse_class_static_block (parser_context_t *context_p);
|
||||
ecma_compiled_code_t *parser_parse_arrow_function (parser_context_t *context_p, uint32_t status_flags);
|
||||
ecma_compiled_code_t *parser_parse_class_fields (parser_context_t *context_p);
|
||||
@@ -948,7 +898,6 @@ void parser_compiled_code_set_function_name (parser_context_t *context_p,
|
||||
uint16_t name_index,
|
||||
uint32_t status_flags);
|
||||
uint16_t parser_check_anonymous_function_declaration (parser_context_t *context_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/* Error management. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user