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
+3 -3
View File
@@ -42,7 +42,7 @@ lit_get_magic_string_ex_count (void)
const lit_utf8_byte_t *
lit_get_magic_string_utf8 (uint32_t id) /**< magic string id */
{
static const lit_utf8_byte_t * const lit_magic_strings[] JERRY_CONST_DATA =
static const lit_utf8_byte_t * const lit_magic_strings[] JERRY_ATTR_CONST_DATA =
{
/** @cond doxygen_suppress */
#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id)
@@ -67,7 +67,7 @@ lit_get_magic_string_utf8 (uint32_t id) /**< magic string id */
lit_utf8_size_t
lit_get_magic_string_size (uint32_t id) /**< magic string id */
{
static const lit_magic_size_t lit_magic_string_sizes[] JERRY_CONST_DATA =
static const lit_magic_size_t lit_magic_string_sizes[] JERRY_ATTR_CONST_DATA =
{
/** @cond doxygen_suppress */
#define LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE(size, id)
@@ -93,7 +93,7 @@ lit_get_magic_string_size (uint32_t id) /**< magic string id */
static lit_magic_string_id_t
lit_get_magic_string_size_block_start (lit_utf8_size_t size) /**< magic string size */
{
static const lit_magic_string_id_t lit_magic_string_size_block_starts[] JERRY_CONST_DATA =
static const lit_magic_string_id_t lit_magic_string_size_block_starts[] JERRY_ATTR_CONST_DATA =
{
/** @cond doxygen_suppress */
#define LIT_MAGIC_STRING_DEF(id, utf8_string)
+13 -13
View File
@@ -17,7 +17,7 @@
* from UnicodeData-9.0.0.txt and SpecialCasing-9.0.0.txt files. Do not edit! */
/* Contains start points of character case ranges (these are bidirectional conversions). */
static const uint16_t lit_character_case_ranges[] JERRY_CONST_DATA =
static const uint16_t lit_character_case_ranges[] JERRY_ATTR_CONST_DATA =
{
0x00c0, 0x00e0, 0x00d8, 0x00f8, 0x0189, 0x0256, 0x01b1, 0x028a, 0x0388, 0x03ad,
0x038e, 0x03cd, 0x0391, 0x03b1, 0x03a3, 0x03c3, 0x03fd, 0x037b, 0x0400, 0x0450,
@@ -29,7 +29,7 @@ static const uint16_t lit_character_case_ranges[] JERRY_CONST_DATA =
};
/* Interval lengths of start points in `character_case_ranges` table. */
static const uint8_t lit_character_case_range_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_character_case_range_lengths[] JERRY_ATTR_CONST_DATA =
{
0x0017, 0x0007, 0x0002, 0x0002, 0x0003, 0x0002, 0x0011, 0x0009, 0x0003, 0x0010,
0x0020, 0x0026, 0x0026, 0x0050, 0x0006, 0x0008, 0x0006, 0x0008, 0x0008, 0x0006,
@@ -38,7 +38,7 @@ static const uint8_t lit_character_case_range_lengths[] JERRY_CONST_DATA =
};
/* Contains the start points of bidirectional conversion ranges. */
static const uint16_t lit_character_pair_ranges[] JERRY_CONST_DATA =
static const uint16_t lit_character_pair_ranges[] JERRY_ATTR_CONST_DATA =
{
0x0100, 0x0132, 0x0139, 0x014a, 0x0179, 0x0182, 0x0187, 0x018b, 0x0191, 0x0198,
0x01a0, 0x01a7, 0x01ac, 0x01af, 0x01b3, 0x01b8, 0x01bc, 0x01cd, 0x01de, 0x01f4,
@@ -49,7 +49,7 @@ static const uint16_t lit_character_pair_ranges[] JERRY_CONST_DATA =
};
/* Interval lengths of start points in `character_pair_ranges` table. */
static const uint8_t lit_character_pair_range_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_character_pair_range_lengths[] JERRY_ATTR_CONST_DATA =
{
0x0030, 0x0006, 0x0010, 0x002e, 0x0006, 0x0004, 0x0002, 0x0002, 0x0002, 0x0002,
0x0006, 0x0002, 0x0002, 0x0002, 0x0004, 0x0002, 0x0002, 0x0010, 0x0012, 0x0002,
@@ -60,7 +60,7 @@ static const uint8_t lit_character_pair_range_lengths[] JERRY_CONST_DATA =
};
/* Contains lower/upper case bidirectional conversion pairs. */
static const uint16_t lit_character_pairs[] JERRY_CONST_DATA =
static const uint16_t lit_character_pairs[] JERRY_ATTR_CONST_DATA =
{
0x0178, 0x00ff, 0x0181, 0x0253, 0x0186, 0x0254, 0x018e, 0x01dd, 0x018f, 0x0259,
0x0190, 0x025b, 0x0193, 0x0260, 0x0194, 0x0263, 0x0196, 0x0269, 0x0197, 0x0268,
@@ -80,20 +80,20 @@ static const uint16_t lit_character_pairs[] JERRY_CONST_DATA =
/* Contains start points of one-to-two uppercase ranges where the second character
* is always the same.
*/
static const uint16_t lit_upper_case_special_ranges[] JERRY_CONST_DATA =
static const uint16_t lit_upper_case_special_ranges[] JERRY_ATTR_CONST_DATA =
{
0x1f80, 0x1f08, 0x0399, 0x1f88, 0x1f08, 0x0399, 0x1f90, 0x1f28, 0x0399, 0x1f98,
0x1f28, 0x0399, 0x1fa0, 0x1f68, 0x0399, 0x1fa8, 0x1f68, 0x0399
};
/* Interval lengths for start points in `upper_case_special_ranges` table. */
static const uint8_t lit_upper_case_special_range_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_upper_case_special_range_lengths[] JERRY_ATTR_CONST_DATA =
{
0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007
};
/* Contains start points of lowercase ranges. */
static const uint16_t lit_lower_case_ranges[] JERRY_CONST_DATA =
static const uint16_t lit_lower_case_ranges[] JERRY_ATTR_CONST_DATA =
{
0x1e96, 0x1e96, 0x1f80, 0x1f80, 0x1f88, 0x1f80, 0x1f90, 0x1f90, 0x1f98, 0x1f90,
0x1fa0, 0x1fa0, 0x1fa8, 0x1fa0, 0x1fb2, 0x1fb2, 0x1fb6, 0x1fb6, 0x1fc2, 0x1fc2,
@@ -102,14 +102,14 @@ static const uint16_t lit_lower_case_ranges[] JERRY_CONST_DATA =
};
/* Interval lengths for start points in `lower_case_ranges` table. */
static const uint8_t lit_lower_case_range_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_lower_case_range_lengths[] JERRY_ATTR_CONST_DATA =
{
0x0005, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0003, 0x0002, 0x0003,
0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0003, 0x0002, 0x0007, 0x0005
};
/* The remaining lowercase conversions. The lowercase variant can be one-to-three character long. */
static const uint16_t lit_lower_case_conversions[] JERRY_CONST_DATA =
static const uint16_t lit_lower_case_conversions[] JERRY_ATTR_CONST_DATA =
{
0x00df, 0x00df, 0x0149, 0x0149, 0x01c5, 0x01c6, 0x01c8, 0x01c9, 0x01cb, 0x01cc,
0x01f0, 0x01f0, 0x01f2, 0x01f3, 0x0390, 0x0390, 0x03b0, 0x03b0, 0x03f4, 0x03b8,
@@ -119,13 +119,13 @@ static const uint16_t lit_lower_case_conversions[] JERRY_CONST_DATA =
};
/* Number of one-to-one, one-to-two, and one-to-three lowercase conversions. */
static const uint8_t lit_lower_case_conversion_counters[] JERRY_CONST_DATA =
static const uint8_t lit_lower_case_conversion_counters[] JERRY_ATTR_CONST_DATA =
{
0x0016, 0x0001, 0x0000
};
/* The remaining uppercase conversions. The uppercase variant can be one-to-three character long. */
static const uint16_t lit_upper_case_conversions[] JERRY_CONST_DATA =
static const uint16_t lit_upper_case_conversions[] JERRY_ATTR_CONST_DATA =
{
0x00b5, 0x039c, 0x0130, 0x0130, 0x0131, 0x0049, 0x017f, 0x0053, 0x01c5, 0x01c4,
0x01c8, 0x01c7, 0x01cb, 0x01ca, 0x01f2, 0x01f1, 0x0345, 0x0399, 0x03c2, 0x03a3,
@@ -156,7 +156,7 @@ static const uint16_t lit_upper_case_conversions[] JERRY_CONST_DATA =
};
/* Number of one-to-one, one-to-two, and one-to-three uppercase conversions. */
static const uint8_t lit_upper_case_conversion_counters[] JERRY_CONST_DATA =
static const uint8_t lit_upper_case_conversion_counters[] JERRY_ATTR_CONST_DATA =
{
0x001c, 0x002c, 0x0010
};
+9 -9
View File
@@ -22,7 +22,7 @@
* The characters covered by these intervals are from
* the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl
*/
static const uint16_t lit_unicode_letter_interval_sps[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_letter_interval_sps[] JERRY_ATTR_CONST_DATA =
{
0x00c0, 0x00d8, 0x00f8, 0x01f8, 0x02c6, 0x02e0, 0x0370, 0x0376, 0x037a, 0x0388,
0x038e, 0x03a3, 0x03f7, 0x048a, 0x0531, 0x0561, 0x05d0, 0x05f0, 0x0620, 0x066e,
@@ -63,7 +63,7 @@ static const uint16_t lit_unicode_letter_interval_sps[] JERRY_CONST_DATA =
* The characters covered by these intervals are from
* the following Unicode categories: Lu, Ll, Lt, Lm, Lo, Nl
*/
static const uint8_t lit_unicode_letter_interval_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_unicode_letter_interval_lengths[] JERRY_ATTR_CONST_DATA =
{
0x0016, 0x001e, 0x00ff, 0x00c9, 0x000b, 0x0004, 0x0004, 0x0001, 0x0003, 0x0002,
0x0013, 0x0052, 0x008a, 0x00a5, 0x0025, 0x0026, 0x001a, 0x0002, 0x002a, 0x0001,
@@ -105,7 +105,7 @@ static const uint8_t lit_unicode_letter_interval_lengths[] JERRY_CONST_DATA =
* The characters are from the following Unicode categories:
* Lu, Ll, Lt, Lm, Lo, Nl
*/
static const uint16_t lit_unicode_letter_chars[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_letter_chars[] JERRY_ATTR_CONST_DATA =
{
0x00aa, 0x00b5, 0x00ba, 0x02ec, 0x02ee, 0x037f, 0x0386, 0x038c, 0x0559, 0x06d5,
0x06ff, 0x0710, 0x07b1, 0x07fa, 0x081a, 0x0824, 0x0828, 0x093d, 0x0950, 0x09b2,
@@ -125,7 +125,7 @@ static const uint16_t lit_unicode_letter_chars[] JERRY_CONST_DATA =
* The characters covered by these intervals are from
* the following Unicode categories: Nd, Mn, Mc, Pc
*/
static const uint16_t lit_unicode_non_letter_ident_part_interval_sps[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_non_letter_ident_part_interval_sps[] JERRY_ATTR_CONST_DATA =
{
0x0300, 0x0483, 0x0591, 0x05c1, 0x05c4, 0x0610, 0x064b, 0x06d6, 0x06df, 0x06e7,
0x06ea, 0x06f0, 0x0730, 0x07a6, 0x07c0, 0x07eb, 0x0816, 0x081b, 0x0825, 0x0829,
@@ -155,7 +155,7 @@ static const uint16_t lit_unicode_non_letter_ident_part_interval_sps[] JERRY_CON
* The characters covered by these intervals are from
* the following Unicode categories: Nd, Mn, Mc, Pc
*/
static const uint8_t lit_unicode_non_letter_ident_part_interval_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_unicode_non_letter_ident_part_interval_lengths[] JERRY_ATTR_CONST_DATA =
{
0x006f, 0x0004, 0x002c, 0x0001, 0x0001, 0x000a, 0x001e, 0x0006, 0x0005, 0x0001,
0x0003, 0x0009, 0x001a, 0x000a, 0x0009, 0x0008, 0x0003, 0x0008, 0x0002, 0x0004,
@@ -186,7 +186,7 @@ static const uint8_t lit_unicode_non_letter_ident_part_interval_lengths[] JERRY_
* The characters are from the following Unicode categories:
* Nd, Mn, Mc, Pc
*/
static const uint16_t lit_unicode_non_letter_ident_part_chars[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_non_letter_ident_part_chars[] JERRY_ATTR_CONST_DATA =
{
0x05bf, 0x05c7, 0x0670, 0x0711, 0x09bc, 0x09d7, 0x0a3c, 0x0a51, 0x0a75, 0x0abc,
0x0b3c, 0x0b82, 0x0bd7, 0x0cbc, 0x0d57, 0x0dca, 0x0dd6, 0x0e31, 0x0eb1, 0x0f35,
@@ -197,7 +197,7 @@ static const uint16_t lit_unicode_non_letter_ident_part_chars[] JERRY_CONST_DATA
/**
* Unicode separator character interval starting points from Unicode category: Zs
*/
static const uint16_t lit_unicode_separator_char_interval_sps[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_separator_char_interval_sps[] JERRY_ATTR_CONST_DATA =
{
0x2000
};
@@ -205,7 +205,7 @@ static const uint16_t lit_unicode_separator_char_interval_sps[] JERRY_CONST_DATA
/**
* Unicode separator character interval lengths from Unicode category: Zs
*/
static const uint8_t lit_unicode_separator_char_interval_lengths[] JERRY_CONST_DATA =
static const uint8_t lit_unicode_separator_char_interval_lengths[] JERRY_ATTR_CONST_DATA =
{
0x000b
};
@@ -216,7 +216,7 @@ static const uint8_t lit_unicode_separator_char_interval_lengths[] JERRY_CONST_D
*
* Unicode category: Zs
*/
static const uint16_t lit_unicode_separator_chars[] JERRY_CONST_DATA =
static const uint16_t lit_unicode_separator_chars[] JERRY_ATTR_CONST_DATA =
{
0x1680, 0x180e, 0x202f, 0x205f, 0x3000
};