Rework storing the line/column/bytecode info (#4707)
This information is stored in a separate memory block instead of being part of the byte code. Snapshot does not supported. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -485,6 +485,9 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
|
||||
#if JERRY_DEBUGGER || JERRY_LINE_INFO
|
||||
parser_line_counter_t ident_line_counter = context_p->token.line;
|
||||
#endif /* JERRY_DEBUGGER || JERRY_LINE_INFO */
|
||||
#if JERRY_LINE_INFO
|
||||
parser_line_counter_t ident_column_counter = context_p->token.column;
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
#if JERRY_MODULE_SYSTEM
|
||||
parser_module_append_export_name (context_p);
|
||||
@@ -522,10 +525,7 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
|
||||
#if JERRY_LINE_INFO
|
||||
if (ident_line_counter != context_p->last_line_info_line)
|
||||
{
|
||||
parser_emit_line_info (context_p, ident_line_counter, false);
|
||||
}
|
||||
parser_line_info_append (context_p, ident_line_counter, ident_column_counter);
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
uint16_t index = context_p->lit_object.index;
|
||||
@@ -1866,10 +1866,7 @@ parser_parse_switch_statement_start (parser_context_t *context_p) /**< context *
|
||||
switch_case_was_found = true;
|
||||
|
||||
#if JERRY_LINE_INFO
|
||||
if (context_p->token.line != context_p->last_line_info_line)
|
||||
{
|
||||
parser_emit_line_info (context_p, context_p->token.line, true);
|
||||
}
|
||||
parser_line_info_append (context_p, context_p->token.line, context_p->token.column);
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
parser_parse_expression (context_p, PARSE_EXPR);
|
||||
@@ -2834,7 +2831,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
|
||||
}
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
#if JERRY_LINE_INFO
|
||||
parser_emit_line_info (context_p, context_p->token.line, false);
|
||||
parser_line_info_append (context_p, context_p->token.line, context_p->token.column);
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
lexer_construct_literal_object (context_p, &lit_location, LEXER_STRING_LITERAL);
|
||||
@@ -2919,8 +2916,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
|
||||
#if JERRY_LINE_INFO
|
||||
if (context_p->token.line != context_p->last_line_info_line
|
||||
&& context_p->token.type != LEXER_SEMICOLON
|
||||
if (context_p->token.type != LEXER_SEMICOLON
|
||||
&& context_p->token.type != LEXER_LEFT_BRACE
|
||||
&& context_p->token.type != LEXER_RIGHT_BRACE
|
||||
&& context_p->token.type != LEXER_KEYW_VAR
|
||||
@@ -2930,7 +2926,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
|
||||
&& context_p->token.type != LEXER_KEYW_CASE
|
||||
&& context_p->token.type != LEXER_KEYW_DEFAULT)
|
||||
{
|
||||
parser_emit_line_info (context_p, context_p->token.line, true);
|
||||
parser_line_info_append (context_p, context_p->token.line, context_p->token.column);
|
||||
}
|
||||
#endif /* JERRY_LINE_INFO */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user