Rework usages/naming of configuration macros [part 2] (#2903)

There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.

Main changes:

* The following macros are now 0/1 switches:
** Renamed CONFIG_ECMA_LCACHE_DISABLE to JERRY_LCACHE.
** Renamed CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE to JERRY_PROPERTY_HASHMAP.
** Renamed CONFIG_DISABLE_UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
** Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
** Renamed JERRY_DISABLE_JS_PARSER to JERRY_PARSER.
** Renamed JERRY_ENABLE_ERROR_MESSAGES to JERRY_ERROR_MESSAGES.
** Renamed JERRY_ENABLE_EXTERNAL_CONTEXT to JERRY_EXTERNAL_CONTEXT.
** Renamed JERRY_ENABLE_LINE_INFO to JERRY_LINE_INFO.
** Renamed JERRY_ENABLE_LOGGING to JERRY_LOGGING.
** Renamed JERRY_ENABLE_SNAPSHOT_EXEC to JERRY_SNAPSHOT_EXEC.
** Renamed JERRY_ENABLE_SNAPSHOT_SAVE to JERRY_SNAPSHOT_SAVE.
** Renamed JERRY_SYSTEM_ALLOCATOR to JERRY_SYSTEM_ALLOCATOR.
** Renamed JERRY_VM_EXEC_STOP to JERRY_VM_EXEC_STOP.
** Renamed JMEM_GC_BEFORE_EACH_ALLOC to JERRY_MEM_GC_BEFORE_EACH_ALLOC.
** Renamed JMEM_STATS to JERRY_MEM_STATS.
** Renamed PARSER_DUMP_BYTE_CODE to JERRY_PARSER_DUMP_BYTE_CODE.
** Renamed REGEXP_DUMP_BYTE_CODE to JERRY_REGEXP_DUMP_BYTE_CODE.
* Recursion check changes:
** Renamed REGEXP_RECURSION_LIMIT to JERRY_REGEXP_RECURSION_LIMIT.
** Renamed VM_RECURSION_LIMIT to JERRY_VM_RECURSION_LIMIT.
* Attribute macro changes:
** Renamed JERRY_CONST_DATA to JERRY_ATTR_CONST_DATA.
** Renamed JERRY_HEAP_SECTION_ATTR to JERRY_ATTR_GLOBAL_HEAP.
  Now the macro can specify any attribute for the global heap object.
* Other macro changes:
** Renamed CONFIG_MEM_HEAP_AREA_SIZE to JERRY_GLOBAL_HEAP_SIZE.
   Then new macro now specify the global heap size in kilobytes.
* Updated documentations to reflect the new macro names.

For more deatils please see jerry-core/config.h.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Péter Gál
2019-06-19 12:28:21 +02:00
committed by Dániel Bátyai
parent 985de93d04
commit 01ecc7bb7b
77 changed files with 1154 additions and 795 deletions
+20 -20
View File
@@ -15,7 +15,7 @@
#include "js-parser-internal.h"
#ifndef JERRY_DISABLE_JS_PARSER
#if ENABLED (JERRY_PARSER)
#include "jcontext.h"
#include "ecma-helpers.h"
@@ -344,9 +344,9 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
#if defined (JERRY_DEBUGGER) || defined (JERRY_ENABLE_LINE_INFO)
#if defined (JERRY_DEBUGGER) || ENABLED (JERRY_LINE_INFO)
parser_line_counter_t ident_line_counter = context_p->token.line;
#endif /* JERRY_DEBUGGER || JERRY_ENABLE_LINE_INFO */
#endif /* JERRY_DEBUGGER || ENABLED (JERRY_LINE_INFO) */
context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_VAR;
@@ -375,12 +375,12 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
}
#endif /* JERRY_DEBUGGER */
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
if (ident_line_counter != context_p->last_line_info_line)
{
parser_emit_line_info (context_p, ident_line_counter, false);
}
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
parser_parse_expression (context_p,
@@ -1307,9 +1307,9 @@ parser_parse_switch_statement_start (parser_context_t *context_p) /**< context *
switch_case_was_found = false;
default_case_was_found = false;
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
uint32_t last_line_info_line = context_p->last_line_info_line;
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
while (true)
{
@@ -1365,12 +1365,12 @@ parser_parse_switch_statement_start (parser_context_t *context_p) /**< context *
lexer_next_token (context_p);
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (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);
}
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
parser_parse_expression (context_p, PARSE_EXPR);
@@ -1386,9 +1386,9 @@ parser_parse_switch_statement_start (parser_context_t *context_p) /**< context *
JERRY_ASSERT (switch_case_was_found || default_case_was_found);
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
context_p->last_line_info_line = last_line_info_line;
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
if (!switch_case_was_found)
{
@@ -2190,14 +2190,14 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
}
#endif /* JERRY_DEBUGGER */
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
if (JERRY_CONTEXT (resource_name) != ECMA_VALUE_UNDEFINED)
{
parser_emit_cbc_ext (context_p, CBC_EXT_RESOURCE_NAME);
parser_flush_cbc (context_p);
}
context_p->last_line_info_line = 0;
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
while (context_p->token.type == LEXER_LITERAL
&& context_p->token.lit_location.type == LEXER_STRING_LITERAL)
@@ -2242,9 +2242,9 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
context_p->last_breakpoint_line = context_p->token.line;
}
#endif /* JERRY_DEBUGGER */
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
parser_emit_line_info (context_p, context_p->token.line, false);
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
lexer_construct_literal_object (context_p, &lit_location, LEXER_STRING_LITERAL);
parser_emit_cbc_literal_from_token (context_p, CBC_PUSH_LITERAL);
@@ -2254,14 +2254,14 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
break;
}
#ifdef PARSER_DUMP_BYTE_CODE
#if ENABLED (JERRY_PARSER_DUMP_BYTE_CODE)
if (context_p->is_show_opcodes
&& !(status_flags & PARSER_IS_STRICT)
&& (context_p->status_flags & PARSER_IS_STRICT))
{
JERRY_DEBUG_MSG (" Note: switch to strict mode\n\n");
}
#endif /* PARSER_DUMP_BYTE_CODE */
#endif /* ENABLED (JERRY_PARSER_DUMP_BYTE_CODE) */
if (context_p->token.type == LEXER_SEMICOLON)
{
@@ -2313,7 +2313,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
}
#endif /* JERRY_DEBUGGER */
#ifdef JERRY_ENABLE_LINE_INFO
#if ENABLED (JERRY_LINE_INFO)
if (context_p->token.line != context_p->last_line_info_line
&& context_p->token.type != LEXER_SEMICOLON
&& context_p->token.type != LEXER_LEFT_BRACE
@@ -2325,7 +2325,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
{
parser_emit_line_info (context_p, context_p->token.line, true);
}
#endif /* JERRY_ENABLE_LINE_INFO */
#endif /* ENABLED (JERRY_LINE_INFO) */
switch (context_p->token.type)
{
@@ -2932,4 +2932,4 @@ parser_free_jumps (parser_stack_iterator_t iterator) /**< iterator position */
* @}
*/
#endif /* !JERRY_DISABLE_JS_PARSER */
#endif /* ENABLED (JERRY_PARSER) */