Unifiy the comments of preprocessor conditionals

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss 2016-04-18 17:09:15 +02:00
parent df1e428c71
commit 3a8d3b3bcc
56 changed files with 165 additions and 165 deletions

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
* Copyright 2016 University of Szeged.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -98,13 +98,13 @@
#ifndef CONFIG_ECMA_NUMBER_TYPE
# define CONFIG_ECMA_NUMBER_TYPE CONFIG_ECMA_NUMBER_FLOAT32
#else /* !CONFIG_ECMA_NUMBER_TYPE */
#else /* CONFIG_ECMA_NUMBER_TYPE */
# if (CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32 \
&& CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64)
# error "ECMA-number storage is configured incorrectly"
# endif /* CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT32
&& CONFIG_ECMA_NUMBER_TYPE != CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE */
#endif /* !CONFIG_ECMA_NUMBER_TYPE */
/**
* Representation for ecma-characters
@ -114,13 +114,13 @@
#ifndef CONFIG_ECMA_CHAR_ENCODING
# define CONFIG_ECMA_CHAR_ENCODING CONFIG_ECMA_CHAR_ASCII
#else /* !CONFIG_ECMA_CHAR_ENCODING */
#else /* CONFIG_ECMA_CHAR_ENCODING */
# if (CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_ASCII \
&& CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_UTF16)
# error "ECMA-char encoding is configured incorrectly"
# endif /* CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_ASCII
&& CONFIG_ECMA_CHAR_ENCODING != CONFIG_ECMA_CHAR_UTF16 */
#endif /* CONFIG_ECMA_CHAR_ENCODING */
#endif /* !CONFIG_ECMA_CHAR_ENCODING */
/**
* Disable ECMA lookup cache

View File

@ -575,7 +575,7 @@ typedef double ecma_number_t;
* IEEE-754 2008, 3.6, Table 3.5
*/
#define ECMA_NUMBER_FRACTION_WIDTH (52)
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
/**
* Value '0' of ecma_number_t
@ -621,7 +621,7 @@ typedef double ecma_number_t;
* See also: ECMA_262 v5, 15.7.3.3
*/
# define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324)
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
/**
* Euler number

View File

@ -765,7 +765,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
}
return num;
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
} /* ecma_utf8_string_to_number */
/**
@ -1258,7 +1258,7 @@ ecma_number_to_decimal (ecma_number_t num, /**< ecma-number */
*out_digits_p = s;
*out_digits_num_p = k;
*out_decimal_exp_p = n;
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
} /* ecma_number_to_decimal */
/**

View File

@ -176,7 +176,7 @@ ecma_number_unpack (ecma_number_t num, /**< ecma-number */
*/
const int32_t ecma_number_exponent_bias = 1023;
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
/**
* Get fraction of number

View File

@ -1467,7 +1467,7 @@ ecma_string_substr (const ecma_string_t *string_p, /**< pointer to an ecma strin
const ecma_length_t string_length = ecma_string_get_length (string_p);
JERRY_ASSERT (start_pos <= string_length);
JERRY_ASSERT (end_pos <= string_length);
#endif
#endif /* !JERRY_NDEBUG */
if (start_pos < end_pos)
{

View File

@ -52,7 +52,7 @@ JERRY_STATIC_ASSERT ((sizeof (ecma_value_t) * JERRY_BITSINBYTE)
JERRY_STATIC_ASSERT (sizeof (uintptr_t) <= sizeof (ecma_value_t),
uintptr_t_must_fit_in_ecma_value_t);
#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
JERRY_STATIC_ASSERT (sizeof (uintptr_t) > sizeof (ecma_value_t),
uintptr_t_must_not_fit_in_ecma_value_t);
@ -84,7 +84,7 @@ ecma_pointer_to_ecma_value (const void *ptr) /**< pointer */
JERRY_ASSERT ((uint_ptr & ECMA_VALUE_FULL_MASK) == 0);
return (ecma_value_t) uint_ptr;
#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
mem_cpointer_t ptr_cp;
ECMA_SET_NON_NULL_POINTER (ptr_cp, ptr);
@ -103,7 +103,7 @@ ecma_get_pointer_from_ecma_value (ecma_value_t value) /**< value */
{
#ifdef ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY
return (void *) (uintptr_t) ((value) & ~ECMA_VALUE_FULL_MASK);
#else /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
#else /* !ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */
return ECMA_GET_NON_NULL_POINTER (ecma_number_t,
value >> ECMA_VALUE_SHIFT);
#endif /* ECMA_VALUE_CAN_STORE_UINTPTR_VALUE_DIRECTLY */

View File

@ -970,7 +970,7 @@ ecma_assert_object_contains_the_property (const ecma_object_t *object_p, /**< ec
#else /* JERRY_NDEBUG */
(void) object_p;
(void) prop_p;
#endif /* JERRY_NDEBUG */
#endif /* !JERRY_NDEBUG */
} /* ecma_assert_object_contains_the_property */
/**

View File

@ -213,7 +213,7 @@ ecma_lcache_insert (ecma_object_t *object_p, /**< object */
ecma_lcache_hash_table[ hash_key ][ entry_index ].prop_p = prop_p;
#else /* CONFIG_ECMA_LCACHE_DISABLE */
(void) prop_p;
#endif /* CONFIG_ECMA_LCACHE_DISABLE */
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
} /* ecma_lcache_insert */
/**
@ -267,7 +267,7 @@ ecma_lcache_lookup (ecma_object_t *object_p, /**< object */
(void) object_p;
(void) prop_name_p;
(void) prop_p_p;
#endif /* CONFIG_ECMA_LCACHE_DISABLE */
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
return false;
} /* ecma_lcache_lookup */

View File

@ -1325,7 +1325,7 @@ ecma_builtin_date_prototype_set_year (ecma_value_t this_arg, /**< this argument
return ret_value;
} /* ecma_builtin_date_prototype_set_year */
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
/**
* @}

View File

@ -1,5 +1,5 @@
/* Copyright 2015 Samsung Electronics Co., Ltd.
* Copyright 2015 University of Szeged.
/* Copyright 2015-2016 Samsung Electronics Co., Ltd.
* Copyright 2015-2016 University of Szeged.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -89,7 +89,7 @@ ROUTINE (LIT_MAGIC_STRING_GET_YEAR_UL, ecma_builtin_date_prototype_get_year, 0,
ROUTINE (LIT_MAGIC_STRING_SET_YEAR_UL, ecma_builtin_date_prototype_set_year, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TO_GMT_STRING_UL, ecma_builtin_date_prototype_to_utc_string, 0, 0)
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#undef OBJECT_ID
#undef SIMPLE_VALUE

View File

@ -1448,7 +1448,7 @@ ecma_builtin_global_object_unescape (ecma_value_t this_arg __attr_unused___, /**
return ret_value;
} /* ecma_builtin_global_object_unescape */
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
/**
* @}

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -131,7 +131,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_DATE_UL,
ECMA_PROPERTY_WRITABLE,
ECMA_PROPERTY_NOT_ENUMERABLE,
ECMA_PROPERTY_CONFIGURABLE)
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
// ECMA-262 v5, 15.1.4.8
@ -238,7 +238,7 @@ ROUTINE (LIT_MAGIC_STRING_PARSE_INT, ecma_builtin_global_object_parse_int, 2, 2)
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN
ROUTINE (LIT_MAGIC_STRING_ESCAPE, ecma_builtin_global_object_escape, 1, 1)
ROUTINE (LIT_MAGIC_STRING_UNESCAPE, ecma_builtin_global_object_unescape, 1, 1)
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#undef OBJECT_ID
#undef SIMPLE_VALUE

View File

@ -289,7 +289,7 @@ TRY_TO_INSTANTIATE_PROPERTY_ROUTINE_NAME (ecma_object_t *obj_p, /**< object */
\
return compact_profile_thrower_property_p; \
}
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
#define CP_UNIMPLEMENTED_VALUE(name, value, prop_writable, prop_enumerable, prop_configurable) case name: \
{ \
JERRY_UNIMPLEMENTED ("The built-in is not implemented."); \

View File

@ -526,9 +526,9 @@ ecma_builtin_math_object_random (ecma_value_t this_arg __attr_unused___) /**< 't
reps_count = 4;
#elif RAND_MAX < 0x10000
reps_count = 2;
#else /* RAND_MAX < 0x10000 */
#else /* RAND_MAX >= 0x10000 */
reps_count = 1;
#endif /* RAND_MAX >= 0x10000 */
#endif /* RAND_MAX < 0x100 */
for (uint32_t i = 0; i < reps_count; i++)
{

View File

@ -1,5 +1,5 @@
/* Copyright 2015 Samsung Electronics Co., Ltd.
* Copyright 2015 University of Szeged.
/* Copyright 2015-2016 Samsung Electronics Co., Ltd.
* Copyright 2015-2016 University of Szeged.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -88,7 +88,7 @@ NUMBER_VALUE (LIT_MAGIC_STRING_LASTINDEX_UL,
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN
ROUTINE (LIT_MAGIC_STRING_COMPILE, ecma_builtin_regexp_prototype_compile, 2, 1)
#endif
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
ROUTINE (LIT_MAGIC_STRING_EXEC, ecma_builtin_regexp_prototype_exec, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TEST, ecma_builtin_regexp_prototype_test, 1, 1)
ROUTINE (LIT_MAGIC_STRING_TO_STRING_UL, ecma_builtin_regexp_prototype_to_string, 0, 0)

View File

@ -2322,7 +2322,7 @@ ecma_builtin_string_prototype_object_substr (ecma_value_t this_arg, /**< this ar
return ret_value;
} /* ecma_builtin_string_prototype_object_substr */
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ANNEXB_BUILTIN */
/**
* @}

View File

@ -365,9 +365,9 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
JERRY_UNREACHABLE ();
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ("The built-in is not implemented.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
}
}
@ -442,9 +442,9 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
JERRY_UNREACHABLE ();
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ("The built-in is not implemented.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
}
}
@ -576,9 +576,9 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
JERRY_UNREACHABLE ();
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ("The built-in is not implemented.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
}
}
}
@ -638,7 +638,7 @@ ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
JERRY_UNREACHABLE ();
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ("The built-in is not implemented.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
}
@ -690,9 +690,9 @@ ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-i
{
#ifdef CONFIG_ECMA_COMPACT_PROFILE
JERRY_UNREACHABLE ();
#else /* CONFIG_ECMA_COMPACT_PROFILE */
#else /* !CONFIG_ECMA_COMPACT_PROFILE */
JERRY_UNIMPLEMENTED ("The built-in is not implemented.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE */
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
}
}

View File

@ -156,7 +156,7 @@ BUILTIN (ECMA_BUILTIN_ID_DATE,
true,
true,
date)
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN*/
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_DATE_BUILTIN */
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
/* The RegExp.prototype object (15.10.6) */

View File

@ -86,9 +86,9 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN
ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
ecma_object_t *array_prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ARRAY_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (array_prototype_obj_p, true, ECMA_OBJECT_TYPE_ARRAY);
ecma_deref_object (array_prototype_obj_p);

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -53,9 +53,9 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_BOOLEAN_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,

View File

@ -98,11 +98,11 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
ECMA_PROPERTY_VALUE_PTR (class_prop_p)->value = LIT_MAGIC_STRING_ERROR_UL;
return new_error_obj_p;
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
(void) error_type;
return ecma_builtin_get (ECMA_BUILTIN_ID_COMPACT_PROFILE_ERROR);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_ERROR_BUILTINS */
} /* ecma_new_standard_error */
/**

View File

@ -55,7 +55,7 @@ ecma_init_environment (void)
ecma_global_lex_env_p = ecma_create_object_lex_env (NULL, glob_obj_p, false);
ecma_deref_object (glob_obj_p);
#endif /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
#endif /* CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */
} /* ecma_init_environment */
/**

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -52,9 +52,9 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,

View File

@ -78,9 +78,9 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE);
#else /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
#endif /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_STRING_BUILTIN */
ecma_object_t *obj_p = ecma_create_object (prototype_obj_p,
true,

View File

@ -25,7 +25,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/** \addtogroup jerry Jerry engine interface
* @{
@ -331,5 +331,5 @@ jerry_api_string_t *jerry_api_value_to_string (const jerry_api_value_t *);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_API_H */

View File

@ -15,7 +15,7 @@
#ifndef JERRY_INTERNAL
# error "The header is for Jerry's internal interfaces"
#endif
#endif /* !JERRY_INTERNAL */
#ifndef JERRY_INTERNAL_H
#define JERRY_INTERNAL_H

View File

@ -22,7 +22,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/** \addtogroup jerry_port Jerry engine port
* @{
@ -41,5 +41,5 @@ int jerry_port_putchar (int c);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_PORT_H */

View File

@ -405,7 +405,7 @@ jerry_api_convert_ecma_value_to_api_value (jerry_api_value_t *out_value_p, /**<
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
out_value_p->type = JERRY_API_DATA_TYPE_FLOAT64;
out_value_p->u.v_float64 = *num;
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
}
else if (ecma_is_value_string (value))
{
@ -1644,12 +1644,12 @@ jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */
flags &= (jerry_flag_t) ~(JERRY_FLAG_MEM_STATS | JERRY_FLAG_MEM_STATS_SEPARATE);
JERRY_WARNING_MSG ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n");
#else /* !MEM_STATS */
#else /* MEM_STATS */
if (flags & JERRY_FLAG_MEM_STATS_SEPARATE)
{
flags |= JERRY_FLAG_MEM_STATS;
}
#endif /* MEM_STATS */
#endif /* !MEM_STATS */
}
jerry_flags = flags;
@ -1898,7 +1898,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p) /**< compiled
copied_compiled_code_p->status_flags = compiled_code_p->status_flags;
#else
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
JERRY_UNIMPLEMENTED ("RegExp is not supported in compact profile.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
return start_offset;
@ -2151,7 +2151,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou
ecma_bytecode_deref (bytecode_data_p);
return snapshot_buffer_write_offset;
#else /* JERRY_ENABLE_SNAPSHOT_SAVE */
#else /* !JERRY_ENABLE_SNAPSHOT_SAVE */
(void) source_p;
(void) source_size;
(void) is_for_global;
@ -2159,7 +2159,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou
(void) buffer_size;
return 0;
#endif /* !JERRY_ENABLE_SNAPSHOT_SAVE */
#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
} /* jerry_parse_and_save_snapshot */
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
@ -2203,7 +2203,7 @@ snapshot_load_compiled_code (const uint8_t *snapshot_data_p, /**< snapshot data
ecma_deref_ecma_string (pattern_str_p);
return (ecma_compiled_code_t *) re_bytecode_p;
#else
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
JERRY_UNIMPLEMENTED ("RegExp is not supported in compact profile.");
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
}
@ -2407,14 +2407,14 @@ jerry_exec_snapshot (const void *snapshot_p, /**< snapshot */
}
return ret_code;
#else /* JERRY_ENABLE_SNAPSHOT_EXEC */
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
(void) snapshot_p;
(void) snapshot_size;
(void) copy_bytecode;
(void) retval_p;
return JERRY_COMPLETION_CODE_INVALID_SNAPSHOT_VERSION;
#endif /* !JERRY_ENABLE_SNAPSHOT_EXEC */
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
} /* jerry_exec_snapshot */
/**

View File

@ -26,7 +26,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/** \addtogroup jerry Jerry engine interface
* @{
@ -94,5 +94,5 @@ jerry_completion_code_t jerry_run_simple (const jerry_api_char_t *, size_t, jerr
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_H */

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -94,12 +94,12 @@ jerry_assert_fail (const char *assertion, /**< assertion condition string */
#if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG)
printf ("ICE: Assertion '%s' failed at %s(%s):%lu.\n",
assertion, file, function, (unsigned long) line);
#else /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */
#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */
(void) assertion;
(void) file;
(void) function;
(void) line;
#endif /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */
#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */
jerry_fatal (ERR_FAILED_INTERNAL_ASSERTION);
} /* jerry_assert_fail */
@ -116,11 +116,11 @@ jerry_unreachable (const char *comment, /**< comment to unreachable mark if exis
{
#ifndef JERRY_NDEBUG
printf ("ICE: Unreachable control path at %s(%s):%lu was executed", file, function, (unsigned long) line);
#else /* !JERRY_NDEBUG */
#else /* JERRY_NDEBUG */
(void) file;
(void) function;
(void) line;
#endif /* JERRY_NDEBUG */
#endif /* !JERRY_NDEBUG */
if (comment != NULL)
{
@ -143,11 +143,11 @@ jerry_unimplemented (const char *comment, /**< comment to unimplemented mark if
{
#ifndef JERRY_NDEBUG
printf ("SORRY: Unimplemented case at %s(%s):%lu was executed", file, function, (unsigned long) line);
#else /* !JERRY_NDEBUG */
#else /* JERRY_NDEBUG */
(void) file;
(void) function;
(void) line;
#endif /* JERRY_NDEBUG */
#endif /* !JERRY_NDEBUG */
if (comment != NULL)
{

View File

@ -80,9 +80,9 @@ extern void __noreturn jerry_unimplemented (const char *, const char *, const ch
#if !defined (JERRY_NDEBUG) || !defined (JERRY_DISABLE_HEAVY_DEBUG)
#define JERRY_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \
jerry_assert_fail (#x, __FILE__, __func__, __LINE__); } } while (0)
#else /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG*/
#else /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_DEBUG */
#define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0)
#endif /* JERRY_NDEBUG && JERRY_DISABLE_HEAVY_NEBUG */
#endif /* !JERRY_NDEBUG || !JERRY_DISABLE_HEAVY_DEBUG */
#ifdef JERRY_ENABLE_LOG
#define JERRY_LOG(lvl, ...) \
@ -109,7 +109,7 @@ extern void __noreturn jerry_unimplemented (const char *, const char *, const ch
} while (0)
#define JERRY_DDLOG(...) JERRY_DLOG (__VA_ARGS__)
#define JERRY_DDDLOG(...) JERRY_DLOG (__VA_ARGS__)
#endif /* !JERRY_ENABLE_LOG */
#endif /* JERRY_ENABLE_LOG */
#define JERRY_ERROR_MSG(...) jerry_port_errormsg (__VA_ARGS__)
#define JERRY_WARNING_MSG(...) JERRY_ERROR_MSG (__VA_ARGS__)
@ -141,7 +141,7 @@ extern void jerry_ref_unused_variables (void *, ...);
} \
jerry_unimplemented (comment, __FILE__, __func__, __LINE__); \
} while (0)
#else /* !JERRY_NDEBUG */
#else /* JERRY_NDEBUG */
#define JERRY_UNREACHABLE() \
do \
{ \
@ -163,7 +163,7 @@ extern void jerry_ref_unused_variables (void *, ...);
} \
jerry_unimplemented (comment, NULL, NULL, 0); \
} while (0)
#endif /* JERRY_NDEBUG */
#endif /* !JERRY_NDEBUG */
/**
* Conditions' likeliness, unlikeliness.

View File

@ -56,9 +56,9 @@ mem_finalize (bool is_show_mem_stats) /**< show heap memory stats
{
mem_stats_print ();
}
#else /* MEM_STATS */
#else /* !MEM_STATS */
(void) is_show_mem_stats;
#endif /* !MEM_STATS */
#endif /* MEM_STATS */
mem_heap_finalize ();
} /* mem_finalize */

View File

@ -45,7 +45,7 @@
# define VALGRIND_UNDEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_UNDEFINED((p), (s))
# define VALGRIND_DEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_DEFINED((p), (s))
#else /* JERRY_VALGRIND */
#else /* !JERRY_VALGRIND */
# define VALGRIND_NOACCESS_SPACE(p, s)
# define VALGRIND_UNDEFINED_SPACE(p, s)
# define VALGRIND_DEFINED_SPACE(p, s)
@ -83,7 +83,7 @@ void mem_heap_valgrind_freya_mempool_request (void)
VALGRIND_FREELIKE_BLOCK((p), 0); \
}
#else /* JERRY_VALGRIND_FREYA */
#else /* !JERRY_VALGRIND_FREYA */
# define VALGRIND_FREYA_CHECK_MEMPOOL_REQUEST
# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s)
# define VALGRIND_FREYA_FREELIKE_SPACE(p)
@ -105,11 +105,11 @@ typedef struct
#if UINTPTR_MAX > UINT32_MAX
#define MEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) ((uint8_t *) (p) - (uint8_t *) mem_heap.area))
#define MEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((mem_heap_free_t *) &mem_heap.area[u])
#else
#else /* UINTPTR_MAX <= UINT32_MAX */
/* In this case we simply store the pointer, since it fits anyway. */
#define MEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) (p))
#define MEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((mem_heap_free_t *)(u))
#endif
#endif /* UINTPTR_MAX > UINT32_MAX */
/**
* Get end of region
@ -139,9 +139,9 @@ typedef struct
*/
#ifndef JERRY_HEAP_SECTION_ATTR
mem_heap_t mem_heap;
#else
#else /* JERRY_HEAP_SECTION_ATTR */
mem_heap_t mem_heap __attribute__ ((section (JERRY_HEAP_SECTION_ATTR)));
#endif
#endif /* !JERRY_HEAP_SECTION_ATTR */
/**
* Check size of heap is corresponding to configuration
@ -191,7 +191,7 @@ static void mem_heap_stat_free_iter ();
# define MEM_HEAP_STAT_NONSKIP()
# define MEM_HEAP_STAT_ALLOC_ITER()
# define MEM_HEAP_STAT_FREE_ITER()
#endif /* !MEM_STATS */
#endif /* MEM_STATS */
/**
* Startup initialization of heap

View File

@ -75,13 +75,13 @@ extern void mem_heap_stats_print (void);
#ifdef JERRY_VALGRIND
#error Valgrind and valgrind-freya modes are not compatible.
#endif
#endif /* JERRY_VALGRIND */
extern void mem_heap_valgrind_freya_mempool_request (void);
#define MEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST() mem_heap_valgrind_freya_mempool_request ()
#else /* JERRY_VALGRIND_FREYA */
#else /* !JERRY_VALGRIND_FREYA */
#define MEM_HEAP_VALGRIND_FREYA_MEMPOOL_REQUEST()

View File

@ -71,7 +71,7 @@ static void mem_pools_stat_dealloc (void);
# define MEM_POOLS_STAT_NEW_ALLOC()
# define MEM_POOLS_STAT_REUSE()
# define MEM_POOLS_STAT_DEALLOC()
#endif /* !MEM_STATS */
#endif /* MEM_STATS */
/*
* Valgrind-related options and headers
@ -82,7 +82,7 @@ static void mem_pools_stat_dealloc (void);
# define VALGRIND_NOACCESS_SPACE(p, s) VALGRIND_MAKE_MEM_NOACCESS((p), (s))
# define VALGRIND_UNDEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_UNDEFINED((p), (s))
# define VALGRIND_DEFINED_SPACE(p, s) VALGRIND_MAKE_MEM_DEFINED((p), (s))
#else /* JERRY_VALGRIND */
#else /* !JERRY_VALGRIND */
# define VALGRIND_NOACCESS_SPACE(p, s)
# define VALGRIND_UNDEFINED_SPACE(p, s)
# define VALGRIND_DEFINED_SPACE(p, s)
@ -93,7 +93,7 @@ static void mem_pools_stat_dealloc (void);
# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s) VALGRIND_MALLOCLIKE_BLOCK((p), (s), 0, 0)
# define VALGRIND_FREYA_FREELIKE_SPACE(p) VALGRIND_FREELIKE_BLOCK((p), 0)
#else /* JERRY_VALGRIND_FREYA */
#else /* !JERRY_VALGRIND_FREYA */
# define VALGRIND_FREYA_MALLOCLIKE_SPACE(p, s)
# define VALGRIND_FREYA_FREELIKE_SPACE(p)
#endif /* JERRY_VALGRIND_FREYA */

View File

@ -35,12 +35,12 @@
#ifndef JERRY_NDEBUG
#define PARSER_DEBUG
#endif
#endif /* !JERRY_NDEBUG */
#ifndef JERRY_NDEBUG
/* Note: This flag is independent from debug mode. */
#define PARSER_DUMP_BYTE_CODE
#endif
#endif /* !JERRY_NDEBUG */
#include "ecma-globals.h"
#include "ecma-regexp-object.h"
@ -98,9 +98,9 @@ typedef struct
#ifdef PARSER_DUMP_BYTE_CODE
struct
#else
#else /* !PARSER_DUMP_BYTE_CODE */
union
#endif
#endif /* PARSER_DUMP_BYTE_CODE */
{
uint16_t length; /**< length of ident / string literal */
uint16_t index; /**< real index during post processing */

View File

@ -1836,7 +1836,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */
context_p->lit_object.literal_p = literal_p;
context_p->lit_object.index = (uint16_t) (context_p->literal_count - 1);
context_p->lit_object.type = LEXER_LITERAL_OBJECT_ANY;
#else
#else /* CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */
(void) parse_only;
parser_raise_error (context_p, PARSER_ERR_UNSUPPORTED_REGEXP);
#endif /* !CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN */

View File

@ -224,7 +224,7 @@ typedef struct parser_saved_context_t
#ifdef PARSER_DEBUG
uint16_t context_stack_depth; /**< current context stack depth */
#endif
#endif /* PARSER_DEBUG */
} parser_saved_context_t;
/**

View File

@ -31,31 +31,31 @@
* Limit: LEXER_MAX_STRING_LENGTH. */
#ifndef PARSER_MAXIMUM_IDENT_LENGTH
#define PARSER_MAXIMUM_IDENT_LENGTH 255
#endif /* PARSER_MAXIMUM_IDENT_LENGTH */
#endif /* !PARSER_MAXIMUM_IDENT_LENGTH */
/* Maximum string length.
* Limit: 65535. */
#ifndef PARSER_MAXIMUM_STRING_LENGTH
#define PARSER_MAXIMUM_STRING_LENGTH 65535
#endif /* PARSER_MAXIMUM_STRING_LENGTH */
#endif /* !PARSER_MAXIMUM_STRING_LENGTH */
/* Maximum number of literals.
* Limit: 32767. Recommended: 510, 32767 */
#ifndef PARSER_MAXIMUM_NUMBER_OF_LITERALS
#define PARSER_MAXIMUM_NUMBER_OF_LITERALS 32767
#endif /* PARSER_MAXIMUM_NUMBER_OF_LITERALS */
#endif /* !PARSER_MAXIMUM_NUMBER_OF_LITERALS */
/* Maximum number of registers.
* Limit: PARSER_MAXIMUM_NUMBER_OF_LITERALS */
#ifndef PARSER_MAXIMUM_NUMBER_OF_REGISTERS
#define PARSER_MAXIMUM_NUMBER_OF_REGISTERS 256
#endif
#endif /* !PARSER_MAXIMUM_NUMBER_OF_REGISTERS */
/* Maximum code size.
* Limit: 16777215. Recommended: 65535, 16777215. */
#ifndef PARSER_MAXIMUM_CODE_SIZE
#define PARSER_MAXIMUM_CODE_SIZE (65535 << (MEM_ALIGNMENT_LOG))
#endif
#endif /* !PARSER_MAXIMUM_CODE_SIZE */
/* Maximum number of values pushed onto the stack by a function.
* Limit: 65500. Recommended: 1024. */

View File

@ -496,7 +496,7 @@ parser_parse_with_statement_start (parser_context_t *context_p) /**< context */
#ifdef PARSER_DEBUG
PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
context_p->status_flags |= PARSER_INSIDE_WITH | PARSER_LEXICAL_ENV_NEEDED;
parser_emit_cbc_ext_forward_branch (context_p,
@ -527,7 +527,7 @@ parser_parse_with_statement_end (parser_context_t *context_p) /**< context */
PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
#ifdef PARSER_DEBUG
PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_WITH_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
parser_emit_cbc (context_p, CBC_CONTEXT_END);
parser_set_branch_to_current_position (context_p, &with_statement.branch);
@ -722,7 +722,7 @@ parser_parse_for_statement_start (parser_context_t *context_p) /**< context */
#ifdef PARSER_DEBUG
PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
parser_emit_cbc_ext_forward_branch (context_p,
CBC_EXT_FOR_IN_CREATE_CONTEXT,
@ -1122,7 +1122,7 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
#ifdef PARSER_DEBUG
PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
parser_emit_cbc (context_p, CBC_CONTEXT_END);
parser_set_branch_to_current_position (context_p, &try_statement.branch);
@ -1139,7 +1139,7 @@ parser_parse_try_statement_end (parser_context_t *context_p) /**< context */
PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
#ifdef PARSER_DEBUG
PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
parser_emit_cbc (context_p, CBC_CONTEXT_END);
parser_flush_cbc (context_p);
@ -1565,7 +1565,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
uint32_t status_flags = context_p->status_flags;
#ifdef PARSER_DUMP_BYTE_CODE
int switch_to_strict_mode = PARSER_FALSE;
#endif
#endif /* PARSER_DUMP_BYTE_CODE */
JERRY_ASSERT (context_p->stack_depth == 0);
@ -1579,7 +1579,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
#ifdef PARSER_DUMP_BYTE_CODE
switch_to_strict_mode = PARSER_TRUE;
#endif
#endif /* PARSER_DUMP_BYTE_CODE */
}
lexer_next_token (context_p);
@ -1643,7 +1643,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
{
#ifdef PARSER_DEBUG
JERRY_ASSERT (context_p->stack_depth == context_p->context_stack_depth);
#endif
#endif /* PARSER_DEBUG */
switch (context_p->token.type)
{
@ -1749,7 +1749,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
#ifdef PARSER_DEBUG
PARSER_PLUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_TRY_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
try_statement.type = parser_try_block;
parser_emit_cbc_ext_forward_branch (context_p,
@ -1924,7 +1924,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->stack_depth == 0);
#ifdef PARSER_DEBUG
JERRY_ASSERT (context_p->context_stack_depth == 0);
#endif
#endif /* PARSER_DEBUG */
/* There is no lexer_next_token here, since the
* next token belongs to the parent context. */
return;
@ -2017,7 +2017,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
PARSER_MINUS_EQUAL_U16 (context_p->stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
#ifdef PARSER_DEBUG
PARSER_MINUS_EQUAL_U16 (context_p->context_stack_depth, PARSER_FOR_IN_CONTEXT_STACK_ALLOCATION);
#endif
#endif /* PARSER_DEBUG */
parser_emit_cbc_ext_backward_branch (context_p,
CBC_EXT_BRANCH_IF_FOR_IN_HAS_NEXT,
@ -2046,7 +2046,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
JERRY_ASSERT (context_p->stack_depth == 0);
#ifdef PARSER_DEBUG
JERRY_ASSERT (context_p->context_stack_depth == 0);
#endif
#endif /* PARSER_DEBUG */
parser_stack_pop_uint8 (context_p);
context_p->last_statement.current_p = NULL;

View File

@ -407,7 +407,7 @@ parser_emit_cbc_forward_branch (parser_context_t *context_p, /**< context */
#if PARSER_MAXIMUM_CODE_SIZE <= 65535
opcode++;
#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
PARSER_PLUS_EQUAL_U16 (opcode, 2);
#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
@ -420,7 +420,7 @@ parser_emit_cbc_forward_branch (parser_context_t *context_p, /**< context */
#if PARSER_MAXIMUM_CODE_SIZE <= 65535
PARSER_APPEND_TO_BYTE_CODE (context_p, 0);
context_p->byte_code_size += 3;
#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
parser_emit_two_bytes (context_p, 0, 0);
context_p->byte_code_size += 4;
#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
@ -522,7 +522,7 @@ parser_emit_cbc_backward_branch (parser_context_t *context_p, /**< context */
opcode++;
context_p->byte_code_size++;
}
#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
if (offset > 65535)
{
PARSER_PLUS_EQUAL_U16 (opcode, 2);
@ -587,7 +587,7 @@ parser_set_branch_to_current_position (parser_context_t *context_p, /**< context
page_p = page_p->next_p;
offset = 0;
}
#else
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
page_p->bytes[offset++] = (uint8_t) (delta >> 16);
if (offset >= PARSER_CBC_STREAM_PAGE_SIZE)
{
@ -600,7 +600,7 @@ parser_set_branch_to_current_position (parser_context_t *context_p, /**< context
page_p = page_p->next_p;
offset = 0;
}
#endif
#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
page_p->bytes[offset++] = delta & 0xff;
} /* parser_set_branch_to_current_position */

View File

@ -529,7 +529,7 @@ parser_generate_initializers (parser_context_t *context_p, /**< context */
{
mem_heap_free_block_size_stored ((void *) literal_p->u.char_p);
}
#else /* PARSER_DUMP_BYTE_CODE */
#else /* !PARSER_DUMP_BYTE_CODE */
literal_pool_p[literal_p->prop.index] = literal_p->u.value;
#endif /* PARSER_DUMP_BYTE_CODE */
}
@ -1395,7 +1395,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */
int prefix_zero = PARSER_TRUE;
#if PARSER_MAXIMUM_CODE_SIZE <= 65535
cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_2;
#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
cbc_opcode_t jump_forward = CBC_JUMP_FORWARD_3;
#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
@ -1554,7 +1554,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */
/* These opcodes are deleted from the stream. */
#if PARSER_MAXIMUM_CODE_SIZE <= 65535
size_t length = 3;
#else /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
#else /* PARSER_MAXIMUM_CODE_SIZE > 65535 */
size_t length = 4;
#endif /* PARSER_MAXIMUM_CODE_SIZE <= 65535 */
@ -1699,7 +1699,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */
}
}
}
#else
#else /* !PARSER_DUMP_BYTE_CODE */
if (context_p->status_flags & PARSER_HAS_LATE_LIT_INIT)
{
parser_list_iterator_t literal_iterator;
@ -1966,7 +1966,7 @@ parser_parse_function (parser_context_t *context_p, /**< context */
#ifdef PARSER_DEBUG
saved_context.context_stack_depth = context_p->context_stack_depth;
#endif
#endif /* PARSER_DEBUG */
/* Reset private part of the context. */
@ -2183,7 +2183,7 @@ parser_parse_function (parser_context_t *context_p, /**< context */
#ifdef PARSER_DEBUG
context_p->context_stack_depth = saved_context.context_stack_depth;
#endif
#endif /* PARSER_DEBUG */
return compiled_code_p;
} /* parser_parse_function */
@ -2231,7 +2231,7 @@ parser_set_show_instrs (int show_instrs) /**< flag indicating whether to dump by
{
#ifdef PARSER_DUMP_BYTE_CODE
parser_show_instrs = show_instrs;
#else
#else /* !PARSER_DUMP_BYTE_CODE */
(void) show_instrs;
#endif /* PARSER_DUMP_BYTE_CODE */
} /* parser_set_show_instrs */

View File

@ -117,7 +117,7 @@ void re_bytecode_list_insert (re_bytecode_ctx_t *, size_t, uint8_t *, size_t);
#ifdef JERRY_ENABLE_LOG
void re_dump_bytecode (re_bytecode_ctx_t *bc_ctx);
#endif
#endif /* JERRY_ENABLE_LOG */
/**
* @}

View File

@ -604,7 +604,7 @@ re_compile_bytecode (const re_compiled_code_t **out_bytecode_p, /**< [out] point
{
#ifdef JERRY_ENABLE_LOG
re_dump_bytecode (&bc_ctx);
#endif
#endif /* JERRY_ENABLE_LOG */
/* The RegExp bytecode contains at least a RE_OP_SAVE_AT_START opdoce, so it cannot be NULL. */
JERRY_ASSERT (bc_ctx.block_start_p != NULL);

View File

@ -1,4 +1,4 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -112,7 +112,7 @@
#else /* !__TARGET_HOST_ARMv7_HARD_FLOAT */
# define _STORE_VFP_S16_S31_IF_HARD_FLOAT
# define _LOAD_VFP_S16_S31_IF_HARD_FLOAT
#endif /* !__TARGET_HOST_ARMv7_HARD_FLOAT */
#endif /* __TARGET_HOST_ARMv7_HARD_FLOAT */
/*
* setjmp

View File

@ -23,7 +23,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
#ifndef NDEBUG
#define assert(x) \
@ -35,11 +35,11 @@ extern "C"
abort (); \
} \
} while (0)
#else
#else /* NDEBUG */
#define assert(x) ((void) 0)
#endif /* !NDEBUG */
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_ASSERT_H */

View File

@ -22,7 +22,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/**
* Storage for context, used for nonlocal goto
@ -61,5 +61,5 @@ void longjmp (jmp_buf env, int val);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_SETJMP_H */

View File

@ -23,7 +23,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/**
* File descriptor type
@ -62,5 +62,5 @@ int putchar (int c);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_STDIO_H */

View File

@ -20,7 +20,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/**
* Maximum integer that could be returned by random number generator
@ -37,5 +37,5 @@ void srand (unsigned int);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_STDLIB_H */

View File

@ -22,7 +22,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
void *memcpy (void *dest, const void *src, size_t n);
void *memset (void *s, int c, size_t n);
@ -35,5 +35,5 @@ size_t strlen (const char *s);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_STRING_H */

View File

@ -20,7 +20,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
/**
* Time value structure
@ -44,5 +44,5 @@ int gettimeofday (void *tp, void *tzp);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBC_TIME_H */

View File

@ -20,9 +20,9 @@
#include "arch/x86-32.h"
#elif defined (__TARGET_HOST_ARMv7)
#include "arch/arm-v7.h"
#else
#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
#error "Unsupported architecture"
#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_x86 && !__TARGET_HOST_ARMv7 */
#endif /* __TARGET_HOST_x64 */
#if defined (__linux__)
.macro func _name
@ -40,9 +40,9 @@
.endm
.macro endfunc _name
.endm
#else
#else /* !__linux && !(__APPLE__ && __MACH__) */
#error "Unsupported OS"
#endif /* !__linux && !(__APPLE__ && __MACH__) */
#endif /* __linux__ */
func _start
_START

View File

@ -35,9 +35,9 @@
#elif defined (__APPLE__) && defined (__MACH__)
#define SYS_exit_group SYS_exit
#define SYSCALL_NO(NAME) SYS_ ## NAME
#else
#else /* !__linux && !(__APPLE__ && __MACH__) */
#error "Unsupported OS"
#endif /* !__linux && !(__APPLE__ && __MACH__) */
#endif /* __linux__ */
#include "jerry-libc-defs.h"
@ -355,7 +355,7 @@ jrt_set_mem_limits (size_t data_size, /**< limit for data + bss + brk heap */
long int ret;
#ifdef __TARGET_HOST_x64
#if defined (__TARGET_HOST_x64)
ret = syscall_2 (SYSCALL_NO (setrlimit), RLIMIT_DATA, (intptr_t) &data_limit);
assert (ret == 0);
@ -371,6 +371,6 @@ jrt_set_mem_limits (size_t data_size, /**< limit for data + bss + brk heap */
# error "__TARGET_HOST_x86 case is not implemented"
#else /* !__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86 */
# error "!__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86"
#endif /* !__TARGET_HOST_x64 && !__TARGET_HOST_ARMv7 && !__TARGET_HOST_x86 */
#endif /* __TARGET_HOST_x64 */
} /* jrt_set_mem_limits */
#endif // FIXME
#endif /* 0 */

View File

@ -20,7 +20,7 @@
#ifdef __cplusplus
extern "C"
{
#endif /* !__cplusplus */
#endif /* __cplusplus */
// General Constants
@ -78,5 +78,5 @@ double fmod (double, double);
#ifdef __cplusplus
}
#endif /* !__cplusplus */
#endif /* __cplusplus */
#endif /* !JERRY_LIBM_MATH_H */

View File

@ -42,10 +42,10 @@
#ifdef __LITTLE_ENDIAN
#define __HI(x) *(1 + (int *) &x)
#define __LO(x) *(int *) &x
#else
#else /* !__LITTLE_ENDIAN */
#define __HI(x) *(int *) &x
#define __LO(x) *(1 + (int *) &x)
#endif
#endif /* __LITTLE_ENDIAN */
/*
* ANSI/POSIX

View File

@ -1,4 +1,4 @@
/* Copyright 2015 Samsung Electronics Co., Ltd.
/* Copyright 2015-2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -250,7 +250,7 @@ static bool foreach (const jerry_api_string_t *name,
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
JERRY_ASSERT (value->type == JERRY_API_DATA_TYPE_FLOAT64);
JERRY_ASSERT (value->u.v_float64 == 32.0);
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
}
else if (!strncmp (str_buf_p, "bravo", (size_t) sz))
{
@ -269,7 +269,7 @@ static bool foreach (const jerry_api_string_t *name,
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
JERRY_ASSERT (value->type == JERRY_API_DATA_TYPE_FLOAT64);
JERRY_ASSERT (value->u.v_float64 == 123.45);
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
}
else if (!strncmp (str_buf_p, "echo", (size_t) sz))
{