mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Remove PARSER_ARGUMENTS_NOT_NEEDED parser flag. (#3308)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
parent
84f60c19ce
commit
55c7590767
@ -51,8 +51,7 @@ typedef enum
|
||||
PARSER_HAS_NON_STRICT_ARG = (1u << 6), /**< the function has arguments which
|
||||
* are not supported in strict mode */
|
||||
PARSER_ARGUMENTS_NEEDED = (1u << 7), /**< arguments object must be created */
|
||||
PARSER_ARGUMENTS_NOT_NEEDED = (1u << 8), /**< arguments object must NOT be created */
|
||||
PARSER_LEXICAL_ENV_NEEDED = (1u << 9), /**< lexical environment object must be created */
|
||||
PARSER_LEXICAL_ENV_NEEDED = (1u << 9), /**< lexical environment object must be created */
|
||||
PARSER_INSIDE_WITH = (1u << 10), /**< code block is inside a with statement */
|
||||
PARSER_RESOLVE_BASE_FOR_CALLS = (1u << 11), /**< the this object must be resolved when
|
||||
* a function without a base object is called */
|
||||
|
||||
@ -564,11 +564,6 @@ parser_parse_function_statement (parser_context_t *context_p) /**< context */
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
|
||||
if (context_p->lit_object.type == LEXER_LITERAL_OBJECT_ARGUMENTS)
|
||||
{
|
||||
context_p->status_flags |= PARSER_ARGUMENTS_NOT_NEEDED;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
if (context_p->status_flags & PARSER_MODULE_STORE_IDENT)
|
||||
{
|
||||
|
||||
@ -53,7 +53,6 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
|
||||
{
|
||||
parser_list_iterator_t literal_iterator;
|
||||
lexer_literal_t *literal_p;
|
||||
uint32_t status_flags = context_p->status_flags;
|
||||
|
||||
uint16_t ident_count = 0;
|
||||
uint16_t const_literal_count = 0;
|
||||
@ -62,12 +61,6 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
|
||||
uint16_t const_literal_index;
|
||||
uint16_t literal_index;
|
||||
|
||||
if (status_flags & PARSER_ARGUMENTS_NOT_NEEDED)
|
||||
{
|
||||
status_flags &= (uint32_t) ~PARSER_ARGUMENTS_NEEDED;
|
||||
context_p->status_flags = status_flags;
|
||||
}
|
||||
|
||||
/* First phase: count the number of items in each group. */
|
||||
parser_list_iterator_init (&context_p->literal_pool, &literal_iterator);
|
||||
while ((literal_p = (lexer_literal_t *) parser_list_iterator_next (&literal_iterator)))
|
||||
@ -115,6 +108,7 @@ parser_compute_indicies (parser_context_t *context_p, /**< context */
|
||||
|
||||
#if !ENABLED (JERRY_PARSER_DUMP_BYTE_CODE)
|
||||
const uint8_t *char_p = literal_p->u.char_p;
|
||||
uint32_t status_flags = context_p->status_flags;
|
||||
|
||||
if ((literal_p->status_flags & LEXER_FLAG_SOURCE_PTR)
|
||||
&& literal_p->prop.length < 0xfff)
|
||||
@ -1763,14 +1757,7 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
|
||||
error_location_p->error = PARSER_ERR_NO_ERROR;
|
||||
}
|
||||
|
||||
if (arg_list_p == NULL)
|
||||
{
|
||||
context.status_flags = PARSER_ARGUMENTS_NOT_NEEDED;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.status_flags = PARSER_IS_FUNCTION;
|
||||
}
|
||||
context.status_flags = (arg_list_p == NULL) ? 0 : PARSER_IS_FUNCTION;
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
context.status_flags |= PARSER_GET_CLASS_PARSER_OPTS (parse_opts);
|
||||
@ -1982,6 +1969,8 @@ parser_parse_source (const uint8_t *arg_list_p, /**< function argument list */
|
||||
JERRY_ASSERT (context.status_flags & PARSER_SCANNING_SUCCESSFUL);
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
JERRY_ASSERT (arg_list_p != NULL || !(context.status_flags & PARSER_ARGUMENTS_NEEDED));
|
||||
|
||||
#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE)
|
||||
if (context.is_show_opcodes)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user