Add new coding style rules and fix appeared issues.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
@@ -78,8 +78,8 @@ JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t)
|
||||
* Declaration of alloc/free routine for specified ecma-type.
|
||||
*/
|
||||
#define DECLARE_ROUTINES_FOR(ecma_type) \
|
||||
ALLOC(ecma_type) \
|
||||
DEALLOC(ecma_type)
|
||||
ALLOC (ecma_type) \
|
||||
DEALLOC (ecma_type)
|
||||
|
||||
DECLARE_ROUTINES_FOR (object)
|
||||
DECLARE_ROUTINES_FOR (property)
|
||||
|
||||
@@ -55,7 +55,7 @@ typedef enum
|
||||
/**
|
||||
* List of marked (visited during current GC session) and umarked objects
|
||||
*/
|
||||
static ecma_object_t *ecma_gc_objects_lists [ECMA_GC_COLOR__COUNT];
|
||||
static ecma_object_t *ecma_gc_objects_lists[ECMA_GC_COLOR__COUNT];
|
||||
|
||||
/**
|
||||
* Current state of an object's visited flag that indicates whether the object is in visited state:
|
||||
@@ -177,8 +177,8 @@ ecma_init_gc_info (ecma_object_t *object_p) /**< object */
|
||||
{
|
||||
ecma_gc_set_object_refs (object_p, 1);
|
||||
|
||||
ecma_gc_set_object_next (object_p, ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY]);
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = object_p;
|
||||
ecma_gc_set_object_next (object_p, ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY]);
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = object_p;
|
||||
|
||||
/* Should be set to false at the beginning of garbage collection */
|
||||
ecma_gc_set_object_visited (object_p, false);
|
||||
@@ -199,7 +199,7 @@ ecma_ref_object (ecma_object_t *object_p) /**< object */
|
||||
void
|
||||
ecma_deref_object (ecma_object_t *object_p) /**< object */
|
||||
{
|
||||
JERRY_ASSERT(ecma_gc_get_object_refs (object_p) > 0);
|
||||
JERRY_ASSERT (ecma_gc_get_object_refs (object_p) > 0);
|
||||
ecma_gc_set_object_refs (object_p, ecma_gc_get_object_refs (object_p) - 1);
|
||||
} /* ecma_deref_object */
|
||||
|
||||
@@ -209,8 +209,8 @@ ecma_deref_object (ecma_object_t *object_p) /**< object */
|
||||
void
|
||||
ecma_gc_init (void)
|
||||
{
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = NULL;
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = NULL;
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;
|
||||
} /* ecma_gc_init */
|
||||
|
||||
/**
|
||||
@@ -219,7 +219,7 @@ ecma_gc_init (void)
|
||||
void
|
||||
ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
{
|
||||
JERRY_ASSERT(object_p != NULL);
|
||||
JERRY_ASSERT (object_p != NULL);
|
||||
JERRY_ASSERT (ecma_gc_is_object_visited (object_p));
|
||||
|
||||
bool traverse_properties = true;
|
||||
@@ -302,7 +302,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
|
||||
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection of ecma-values */
|
||||
{
|
||||
JERRY_UNIMPLEMENTED("Indexed array storage is not implemented yet.");
|
||||
JERRY_UNIMPLEMENTED ("Indexed array storage is not implemented yet.");
|
||||
}
|
||||
|
||||
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t
|
||||
@@ -312,7 +312,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
case ECMA_INTERNAL_PROPERTY__COUNT: /* not a real internal property type,
|
||||
* but number of the real internal property types */
|
||||
{
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
}
|
||||
|
||||
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* a collection of strings */
|
||||
@@ -336,7 +336,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
|
||||
case ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP: /* an object */
|
||||
{
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(ecma_object_t, property_value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, property_value);
|
||||
|
||||
ecma_gc_set_object_visited (obj_p, true);
|
||||
|
||||
@@ -357,9 +357,9 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
|
||||
void
|
||||
ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
|
||||
{
|
||||
JERRY_ASSERT(object_p != NULL
|
||||
&& !ecma_gc_is_object_visited (object_p)
|
||||
&& ecma_gc_get_object_refs (object_p) == 0);
|
||||
JERRY_ASSERT (object_p != NULL
|
||||
&& !ecma_gc_is_object_visited (object_p)
|
||||
&& ecma_gc_get_object_refs (object_p) == 0);
|
||||
|
||||
if (!ecma_is_lexical_environment (object_p))
|
||||
{
|
||||
@@ -405,10 +405,10 @@ ecma_gc_sweep (ecma_object_t *object_p) /**< object to free */
|
||||
void
|
||||
ecma_gc_run (void)
|
||||
{
|
||||
JERRY_ASSERT (ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] == NULL);
|
||||
JERRY_ASSERT (ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] == NULL);
|
||||
|
||||
/* if some object is referenced from stack or globals (i.e. it is root), mark it */
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY];
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY];
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = ecma_gc_get_object_next (obj_iter_p))
|
||||
{
|
||||
@@ -445,7 +445,7 @@ ecma_gc_run (void)
|
||||
{
|
||||
marked_anything_during_current_iteration = false;
|
||||
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_prev_p = NULL, *obj_next_p;
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = obj_next_p)
|
||||
{
|
||||
@@ -454,8 +454,8 @@ ecma_gc_run (void)
|
||||
if (ecma_gc_is_object_visited (obj_iter_p))
|
||||
{
|
||||
/* Moving the object to list of marked objects */
|
||||
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK]);
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = obj_iter_p;
|
||||
ecma_gc_set_object_next (obj_iter_p, ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK]);
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = obj_iter_p;
|
||||
|
||||
if (likely (obj_prev_p != NULL))
|
||||
{
|
||||
@@ -465,7 +465,7 @@ ecma_gc_run (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = obj_next_p;
|
||||
}
|
||||
|
||||
ecma_gc_mark (obj_iter_p);
|
||||
@@ -476,10 +476,11 @@ ecma_gc_run (void)
|
||||
obj_prev_p = obj_iter_p;
|
||||
}
|
||||
}
|
||||
} while (marked_anything_during_current_iteration);
|
||||
}
|
||||
while (marked_anything_during_current_iteration);
|
||||
|
||||
/* Sweeping objects that are currently unmarked */
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
|
||||
for (ecma_object_t *obj_iter_p = ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY], *obj_next_p;
|
||||
obj_iter_p != NULL;
|
||||
obj_iter_p = obj_next_p)
|
||||
{
|
||||
@@ -491,8 +492,8 @@ ecma_gc_run (void)
|
||||
}
|
||||
|
||||
/* Unmarking all objects */
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK];
|
||||
ecma_gc_objects_lists [ECMA_GC_COLOR_BLACK] = NULL;
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_WHITE_GRAY] = ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK];
|
||||
ecma_gc_objects_lists[ECMA_GC_COLOR_BLACK] = NULL;
|
||||
|
||||
ecma_gc_visited_flip_flag = !ecma_gc_visited_flip_flag;
|
||||
} /* ecma_gc_run */
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_copy_to); \
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_copy_from); \
|
||||
\
|
||||
name_copy_to[0] = name_copy_from [0]; \
|
||||
name_copy_to[1] = name_copy_from [1]; \
|
||||
name_copy_to[2] = name_copy_from [2]; \
|
||||
name_copy_to[3] = name_copy_from [3]; \
|
||||
name_copy_to[0] = name_copy_from[0]; \
|
||||
name_copy_to[1] = name_copy_from[1]; \
|
||||
name_copy_to[2] = name_copy_from[2]; \
|
||||
name_copy_to[3] = name_copy_from[3]; \
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,13 +176,13 @@
|
||||
{ \
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
|
||||
\
|
||||
name [0] += 1ull; \
|
||||
name [1] += (name [0] >> 32u); \
|
||||
name [0] = (uint32_t) name [0]; \
|
||||
name [2] += (name [1] >> 32u); \
|
||||
name [1] = (uint32_t) name [1]; \
|
||||
name [3] += (name [2] >> 32u); \
|
||||
name [2] = (uint32_t) name [2]; \
|
||||
name[0] += 1ull; \
|
||||
name[1] += (name[0] >> 32u); \
|
||||
name[0] = (uint32_t) name[0]; \
|
||||
name[2] += (name[1] >> 32u); \
|
||||
name[1] = (uint32_t) name[1]; \
|
||||
name[3] += (name[2] >> 32u); \
|
||||
name[2] = (uint32_t) name[2]; \
|
||||
\
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
|
||||
}
|
||||
@@ -195,17 +195,17 @@
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_add_to); \
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_to_add); \
|
||||
\
|
||||
name_add_to [0] += name_to_add [0]; \
|
||||
name_add_to [1] += name_to_add [1]; \
|
||||
name_add_to [2] += name_to_add [2]; \
|
||||
name_add_to [3] += name_to_add [3]; \
|
||||
name_add_to[0] += name_to_add[0]; \
|
||||
name_add_to[1] += name_to_add[1]; \
|
||||
name_add_to[2] += name_to_add[2]; \
|
||||
name_add_to[3] += name_to_add[3]; \
|
||||
\
|
||||
name_add_to [1] += (name_add_to [0] >> 32u); \
|
||||
name_add_to [0] = (uint32_t) name_add_to [0]; \
|
||||
name_add_to [2] += (name_add_to [1] >> 32u); \
|
||||
name_add_to [1] = (uint32_t) name_add_to [1]; \
|
||||
name_add_to [3] += (name_add_to [2] >> 32u); \
|
||||
name_add_to [2] = (uint32_t) name_add_to [2]; \
|
||||
name_add_to[1] += (name_add_to[0] >> 32u); \
|
||||
name_add_to[0] = (uint32_t) name_add_to[0]; \
|
||||
name_add_to[2] += (name_add_to[1] >> 32u); \
|
||||
name_add_to[1] = (uint32_t) name_add_to[1]; \
|
||||
name_add_to[3] += (name_add_to[2] >> 32u); \
|
||||
name_add_to[2] = (uint32_t) name_add_to[2]; \
|
||||
\
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_add_to); \
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name_to_add); \
|
||||
@@ -244,7 +244,7 @@
|
||||
const uint64_t div10_p_mid = 0x99999999ul; \
|
||||
const uint64_t div10_p_high = 0x19999999ul; \
|
||||
\
|
||||
uint64_t intermediate [8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; \
|
||||
uint64_t intermediate[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; \
|
||||
uint64_t l0, l1, l2, l3, m0, m1, m2, m3, h0, h1, h2, h3; \
|
||||
l0 = name[0] * div10_p_low; \
|
||||
l1 = name[1] * div10_p_low; \
|
||||
@@ -297,25 +297,25 @@
|
||||
intermediate[6] += (uint32_t) h3; \
|
||||
intermediate[7] += h3 >> 32u; \
|
||||
\
|
||||
intermediate [1] += intermediate[0] >> 32u; \
|
||||
intermediate [0] = (uint32_t) intermediate[0]; \
|
||||
intermediate [2] += intermediate[1] >> 32u; \
|
||||
intermediate [1] = (uint32_t) intermediate[1]; \
|
||||
intermediate [3] += intermediate[2] >> 32u; \
|
||||
intermediate [2] = (uint32_t) intermediate[2]; \
|
||||
intermediate [4] += intermediate[3] >> 32u; \
|
||||
intermediate [3] = (uint32_t) intermediate[3]; \
|
||||
intermediate [5] += intermediate[4] >> 32u; \
|
||||
intermediate [4] = (uint32_t) intermediate[4]; \
|
||||
intermediate [6] += intermediate[5] >> 32u; \
|
||||
intermediate [5] = (uint32_t) intermediate[5]; \
|
||||
intermediate [7] += intermediate[6] >> 32u; \
|
||||
intermediate [6] = (uint32_t) intermediate[6]; \
|
||||
intermediate[1] += intermediate[0] >> 32u; \
|
||||
intermediate[0] = (uint32_t) intermediate[0]; \
|
||||
intermediate[2] += intermediate[1] >> 32u; \
|
||||
intermediate[1] = (uint32_t) intermediate[1]; \
|
||||
intermediate[3] += intermediate[2] >> 32u; \
|
||||
intermediate[2] = (uint32_t) intermediate[2]; \
|
||||
intermediate[4] += intermediate[3] >> 32u; \
|
||||
intermediate[3] = (uint32_t) intermediate[3]; \
|
||||
intermediate[5] += intermediate[4] >> 32u; \
|
||||
intermediate[4] = (uint32_t) intermediate[4]; \
|
||||
intermediate[6] += intermediate[5] >> 32u; \
|
||||
intermediate[5] = (uint32_t) intermediate[5]; \
|
||||
intermediate[7] += intermediate[6] >> 32u; \
|
||||
intermediate[6] = (uint32_t) intermediate[6]; \
|
||||
\
|
||||
name[0] = intermediate [4]; \
|
||||
name[1] = intermediate [5]; \
|
||||
name[2] = intermediate [6]; \
|
||||
name[3] = intermediate [7]; \
|
||||
name[0] = intermediate[4]; \
|
||||
name[1] = intermediate[5]; \
|
||||
name[2] = intermediate[6]; \
|
||||
name[3] = intermediate[7]; \
|
||||
\
|
||||
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_CHECK_PARTS_ARE_32BIT (name); \
|
||||
}
|
||||
@@ -342,7 +342,7 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
const ecma_char_t hex_upper_digits_range[10] = { 'A', 'F' };
|
||||
const ecma_char_t hex_x_chars[2] = { 'x', 'X' };
|
||||
const ecma_char_t white_space[2] = { ' ', '\n' };
|
||||
const ecma_char_t e_chars [2] = { 'e', 'E' };
|
||||
const ecma_char_t e_chars[2] = { 'e', 'E' };
|
||||
const ecma_char_t plus_char = '+';
|
||||
const ecma_char_t minus_char = '-';
|
||||
const ecma_char_t dot_char = '.';
|
||||
@@ -393,8 +393,8 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
{
|
||||
int32_t digit_value;
|
||||
|
||||
if (*iter_p >= dec_digits_range [0]
|
||||
&& *iter_p <= dec_digits_range [1])
|
||||
if (*iter_p >= dec_digits_range[0]
|
||||
&& *iter_p <= dec_digits_range[1])
|
||||
{
|
||||
digit_value = (*iter_p - dec_digits_range[0]);
|
||||
}
|
||||
@@ -464,8 +464,8 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
{
|
||||
int32_t digit_value;
|
||||
|
||||
if (*begin_p >= dec_digits_range [0]
|
||||
&& *begin_p <= dec_digits_range [1])
|
||||
if (*begin_p >= dec_digits_range[0]
|
||||
&& *begin_p <= dec_digits_range[1])
|
||||
{
|
||||
digit_value = (*begin_p - dec_digits_range[0]);
|
||||
}
|
||||
@@ -502,8 +502,8 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
{
|
||||
int32_t digit_value;
|
||||
|
||||
if (*begin_p >= dec_digits_range [0]
|
||||
&& *begin_p <= dec_digits_range [1])
|
||||
if (*begin_p >= dec_digits_range[0]
|
||||
&& *begin_p <= dec_digits_range[1])
|
||||
{
|
||||
digit_value = (*begin_p - dec_digits_range[0]);
|
||||
}
|
||||
@@ -556,8 +556,8 @@ ecma_zt_string_to_number (const ecma_char_t *str_p) /**< zero-terminated string
|
||||
{
|
||||
int32_t digit_value;
|
||||
|
||||
if (*begin_p >= dec_digits_range [0]
|
||||
&& *begin_p <= dec_digits_range [1])
|
||||
if (*begin_p >= dec_digits_range[0]
|
||||
&& *begin_p <= dec_digits_range[1])
|
||||
{
|
||||
digit_value = (*begin_p - dec_digits_range[0]);
|
||||
}
|
||||
@@ -1120,7 +1120,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
ssize_t buffer_size) /**< size of buffer */
|
||||
{
|
||||
const ecma_char_t digits[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
||||
const ecma_char_t e_chars [2] = { 'e', 'E' };
|
||||
const ecma_char_t e_chars[2] = { 'e', 'E' };
|
||||
const ecma_char_t plus_char = '+';
|
||||
const ecma_char_t minus_char = '-';
|
||||
const ecma_char_t dot_char = '.';
|
||||
@@ -1324,12 +1324,12 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
|
||||
for (int32_t i = 0; i < n - k; i++)
|
||||
{
|
||||
*--dst_p = digits [0];
|
||||
*--dst_p = digits[0];
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < k; i++)
|
||||
{
|
||||
*--dst_p = digits [s % 10];
|
||||
*--dst_p = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
}
|
||||
@@ -1343,7 +1343,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
|
||||
for (int32_t i = 0; i < k - n; i++)
|
||||
{
|
||||
*--dst_p = digits [s % 10];
|
||||
*--dst_p = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
|
||||
@@ -1351,7 +1351,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
|
||||
for (int32_t i = 0; i < n; i++)
|
||||
{
|
||||
*--dst_p = digits [s % 10];
|
||||
*--dst_p = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
}
|
||||
@@ -1365,13 +1365,13 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
|
||||
for (int32_t i = 0; i < k; i++)
|
||||
{
|
||||
*--dst_p = digits [s % 10];
|
||||
*--dst_p = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < -n; i++)
|
||||
{
|
||||
*--dst_p = digits [0];
|
||||
*--dst_p = digits[0];
|
||||
}
|
||||
|
||||
*--dst_p = dot_char;
|
||||
@@ -1384,7 +1384,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
// 9.
|
||||
JERRY_ASSERT ((ssize_t) sizeof (ecma_char_t) <= buffer_size);
|
||||
|
||||
*dst_p++ = digits [s % 10];
|
||||
*dst_p++ = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
else
|
||||
@@ -1395,7 +1395,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
|
||||
for (int32_t i = 0; i < k - 1; i++)
|
||||
{
|
||||
*--dst_p = digits [s % 10];
|
||||
*--dst_p = digits[s % 10];
|
||||
s /= 10;
|
||||
}
|
||||
|
||||
@@ -1415,7 +1415,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
if (t == 0)
|
||||
{
|
||||
JERRY_ASSERT ((ssize_t) sizeof (ecma_char_t) * (dst_p - buffer_p + 1) <= buffer_size);
|
||||
*dst_p++ = digits [0];
|
||||
*dst_p++ = digits[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1431,7 +1431,7 @@ ecma_number_to_zt_string (ecma_number_t num, /**< ecma-number */
|
||||
while (t_mod != 0)
|
||||
{
|
||||
JERRY_ASSERT ((ssize_t) sizeof (ecma_char_t) * (dst_p - buffer_p + 1) <= buffer_size);
|
||||
*dst_p++ = digits [t / t_mod];
|
||||
*dst_p++ = digits[t / t_mod];
|
||||
|
||||
t -= (t / t_mod) * t_mod;
|
||||
t_mod /= 10;
|
||||
|
||||
@@ -49,7 +49,7 @@ JERRY_STATIC_ASSERT ((uint32_t) ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH)
|
||||
/**
|
||||
* Lengths of magic strings
|
||||
*/
|
||||
static ecma_length_t ecma_magic_string_lengths [ECMA_MAGIC_STRING__COUNT];
|
||||
static ecma_length_t ecma_magic_string_lengths[ECMA_MAGIC_STRING__COUNT];
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
/**
|
||||
@@ -286,10 +286,10 @@ ecma_strings_init (void)
|
||||
id < ECMA_MAGIC_STRING__COUNT;
|
||||
id = (ecma_magic_string_id_t) (id + 1))
|
||||
{
|
||||
ecma_magic_string_lengths [id] = ecma_zt_string_length (ecma_get_magic_string_zt (id));
|
||||
ecma_magic_string_lengths[id] = ecma_zt_string_length (ecma_get_magic_string_zt (id));
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
ecma_magic_string_max_length = JERRY_MAX (ecma_magic_string_max_length, ecma_magic_string_lengths [id]);
|
||||
ecma_magic_string_max_length = JERRY_MAX (ecma_magic_string_max_length, ecma_magic_string_lengths[id]);
|
||||
|
||||
JERRY_ASSERT (ecma_magic_string_max_length <= ECMA_STRING_MAGIC_STRING_LENGTH_LIMIT);
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
@@ -348,7 +348,7 @@ ecma_init_ecma_string_from_magic_string_id (ecma_string_t *string_p, /**< descri
|
||||
string_p->is_stack_var = (is_stack_var != 0);
|
||||
string_p->container = ECMA_STRING_CONTAINER_MAGIC_STRING;
|
||||
string_p->hash = ecma_chars_buffer_calc_hash_last_chars (ecma_get_magic_string_zt (magic_string_id),
|
||||
ecma_magic_string_lengths [magic_string_id]);
|
||||
ecma_magic_string_lengths[magic_string_id]);
|
||||
|
||||
string_p->u.common_field = 0;
|
||||
string_p->u.magic_string_id = magic_string_id;
|
||||
@@ -413,10 +413,10 @@ ecma_new_ecma_string_from_uint32 (uint32_t uint32_number) /**< UInt32-represente
|
||||
FIXME (/* Use digit to char conversion routine */);
|
||||
const ecma_char_t digits[10] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
||||
const bool is_one_char_or_more = (uint32_number >= 10);
|
||||
const ecma_char_t last_chars [ECMA_STRING_HASH_LAST_CHARS_COUNT] =
|
||||
const ecma_char_t last_chars[ECMA_STRING_HASH_LAST_CHARS_COUNT] =
|
||||
{
|
||||
is_one_char_or_more ? digits [digit_pl] : digits[digit_l],
|
||||
is_one_char_or_more ? digits [digit_l] : ECMA_CHAR_NULL
|
||||
is_one_char_or_more ? digits[digit_pl] : digits[digit_l],
|
||||
is_one_char_or_more ? digits[digit_l] : ECMA_CHAR_NULL
|
||||
};
|
||||
|
||||
/* Only last two chars are really used for hash calculation */
|
||||
@@ -424,7 +424,7 @@ ecma_new_ecma_string_from_uint32 (uint32_t uint32_number) /**< UInt32-represente
|
||||
is_one_char_or_more ? 2 : 1);
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
ecma_char_t char_buf [ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
|
||||
ecma_char_t char_buf[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
|
||||
ssize_t chars_copied = ecma_uint32_to_string (uint32_number,
|
||||
char_buf,
|
||||
ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32);
|
||||
@@ -962,7 +962,7 @@ ecma_string_to_zt_string (const ecma_string_t *string_desc_p, /**< ecma-string d
|
||||
case ECMA_STRING_CONTAINER_MAGIC_STRING:
|
||||
{
|
||||
const ecma_magic_string_id_t id = string_desc_p->u.magic_string_id;
|
||||
const size_t length = ecma_magic_string_lengths [id];
|
||||
const size_t length = ecma_magic_string_lengths[id];
|
||||
|
||||
size_t bytes_to_copy = (length + 1) * sizeof (ecma_char_t);
|
||||
|
||||
@@ -1184,8 +1184,8 @@ ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, /**< ecma-
|
||||
|
||||
const ecma_char_t *zt_string1_p, *zt_string2_p;
|
||||
bool is_zt_string1_on_heap = false, is_zt_string2_on_heap = false;
|
||||
ecma_char_t zt_string1_buffer [ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER + 1];
|
||||
ecma_char_t zt_string2_buffer [ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER + 1];
|
||||
ecma_char_t zt_string1_buffer[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER + 1];
|
||||
ecma_char_t zt_string2_buffer[ECMA_MAX_CHARS_IN_STRINGIFIED_NUMBER + 1];
|
||||
|
||||
if (string1_p->container == ECMA_STRING_CONTAINER_LIT_TABLE)
|
||||
{
|
||||
@@ -1292,7 +1292,7 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
|
||||
}
|
||||
else if (container == ECMA_STRING_CONTAINER_MAGIC_STRING)
|
||||
{
|
||||
return ecma_magic_string_lengths [string_p->u.magic_string_id];
|
||||
return ecma_magic_string_lengths[string_p->u.magic_string_id];
|
||||
}
|
||||
else if (container == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
|
||||
{
|
||||
@@ -1315,7 +1315,7 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
|
||||
int32_t length = 1;
|
||||
|
||||
while (length < max_uint32_len
|
||||
&& uint32_number >= nums_with_ascending_length [length])
|
||||
&& uint32_number >= nums_with_ascending_length[length])
|
||||
{
|
||||
length++;
|
||||
}
|
||||
@@ -1376,7 +1376,7 @@ ecma_string_get_char_at_pos (const ecma_string_t *string_p, /**< ecma-string */
|
||||
|
||||
ecma_string_to_zt_string (string_p, zt_str_p, (ssize_t) buffer_size);
|
||||
|
||||
ecma_char_t ch = zt_str_p [index];
|
||||
ecma_char_t ch = zt_str_p[index];
|
||||
|
||||
mem_heap_free_block (zt_str_p);
|
||||
|
||||
@@ -1586,7 +1586,7 @@ ecma_zt_string_length (const ecma_char_t *string_p) /**< zero-terminated string
|
||||
const ecma_char_t*
|
||||
ecma_get_magic_string_zt (ecma_magic_string_id_t id) /**< magic string id */
|
||||
{
|
||||
TODO(Support UTF-16);
|
||||
TODO (Support UTF-16);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
@@ -1598,7 +1598,7 @@ ecma_get_magic_string_zt (ecma_magic_string_id_t id) /**< magic string id */
|
||||
case ECMA_MAGIC_STRING__COUNT: break;
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_get_magic_string_zt */
|
||||
|
||||
/**
|
||||
@@ -1655,7 +1655,7 @@ static bool
|
||||
ecma_is_string_magic_longpath (const ecma_string_t *string_p, /**< ecma-string */
|
||||
ecma_magic_string_id_t *out_id_p) /**< out: magic string's id */
|
||||
{
|
||||
ecma_char_t zt_string_buffer [ECMA_STRING_MAGIC_STRING_LENGTH_LIMIT + 1];
|
||||
ecma_char_t zt_string_buffer[ECMA_STRING_MAGIC_STRING_LENGTH_LIMIT + 1];
|
||||
|
||||
ssize_t copied = ecma_string_to_zt_string (string_p, zt_string_buffer, (ssize_t) sizeof (zt_string_buffer));
|
||||
JERRY_ASSERT (copied > 0);
|
||||
|
||||
@@ -226,7 +226,7 @@ ecma_make_simple_value (const ecma_simple_value_t value) /**< simple value */
|
||||
ecma_value_t __attr_const___
|
||||
ecma_make_number_value (const ecma_number_t* num_p) /**< number to reference in value */
|
||||
{
|
||||
JERRY_ASSERT(num_p != NULL);
|
||||
JERRY_ASSERT (num_p != NULL);
|
||||
|
||||
mem_cpointer_t num_cp;
|
||||
ECMA_SET_NON_NULL_POINTER (num_cp, num_p);
|
||||
@@ -245,7 +245,7 @@ ecma_make_number_value (const ecma_number_t* num_p) /**< number to reference in
|
||||
ecma_value_t __attr_const___
|
||||
ecma_make_string_value (const ecma_string_t* ecma_string_p) /**< string to reference in value */
|
||||
{
|
||||
JERRY_ASSERT(ecma_string_p != NULL);
|
||||
JERRY_ASSERT (ecma_string_p != NULL);
|
||||
|
||||
mem_cpointer_t string_cp;
|
||||
ECMA_SET_NON_NULL_POINTER (string_cp, ecma_string_p);
|
||||
@@ -264,7 +264,7 @@ ecma_make_string_value (const ecma_string_t* ecma_string_p) /**< string to refer
|
||||
ecma_value_t __attr_const___
|
||||
ecma_make_object_value (const ecma_object_t* object_p) /**< object to reference in value */
|
||||
{
|
||||
JERRY_ASSERT(object_p != NULL);
|
||||
JERRY_ASSERT (object_p != NULL);
|
||||
|
||||
mem_cpointer_t object_cp;
|
||||
ECMA_SET_NON_NULL_POINTER (object_cp, object_p);
|
||||
@@ -591,10 +591,10 @@ ecma_make_label_completion_value (ecma_completion_type_t type, /**< type */
|
||||
ecma_completion_value_t __attr_const___ __attr_always_inline___
|
||||
ecma_make_simple_completion_value (ecma_simple_value_t simple_value) /**< simple ecma-value */
|
||||
{
|
||||
JERRY_ASSERT(simple_value == ECMA_SIMPLE_VALUE_UNDEFINED
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_NULL
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_FALSE
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_TRUE);
|
||||
JERRY_ASSERT (simple_value == ECMA_SIMPLE_VALUE_UNDEFINED
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_NULL
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_FALSE
|
||||
|| simple_value == ECMA_SIMPLE_VALUE_TRUE);
|
||||
|
||||
return ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
|
||||
ecma_make_simple_value (simple_value));
|
||||
@@ -630,8 +630,8 @@ ecma_make_throw_completion_value (ecma_value_t value) /**< value */
|
||||
ecma_completion_value_t __attr_const___
|
||||
ecma_make_throw_obj_completion_value (ecma_object_t *exception_p) /**< an object */
|
||||
{
|
||||
JERRY_ASSERT(exception_p != NULL
|
||||
&& !ecma_is_lexical_environment (exception_p));
|
||||
JERRY_ASSERT (exception_p != NULL
|
||||
&& !ecma_is_lexical_environment (exception_p));
|
||||
|
||||
ecma_value_t exception = ecma_make_object_value (exception_p);
|
||||
|
||||
@@ -781,7 +781,7 @@ ecma_free_completion_value (ecma_completion_value_t completion_value) /**< compl
|
||||
case ECMA_COMPLETION_TYPE_EXIT:
|
||||
{
|
||||
ecma_value_t v = ecma_get_completion_value_value_field (completion_value);
|
||||
JERRY_ASSERT(ecma_get_value_type_field (v) == ECMA_TYPE_SIMPLE);
|
||||
JERRY_ASSERT (ecma_get_value_type_field (v) == ECMA_TYPE_SIMPLE);
|
||||
break;
|
||||
}
|
||||
case ECMA_COMPLETION_TYPE_CONTINUE:
|
||||
|
||||
@@ -140,8 +140,8 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out
|
||||
ecma_object_t *binding_obj_p, /**< binding object */
|
||||
bool provide_this) /**< provideThis flag */
|
||||
{
|
||||
JERRY_ASSERT(binding_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (binding_obj_p));
|
||||
JERRY_ASSERT (binding_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (binding_obj_p));
|
||||
|
||||
ecma_object_t *new_lexical_environment_p = ecma_alloc_object ();
|
||||
|
||||
@@ -432,7 +432,7 @@ ecma_create_internal_property (ecma_object_t *object_p, /**< the object */
|
||||
new_property_p->type = ECMA_PROPERTY_INTERNAL;
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_property_list (object_p);
|
||||
ECMA_SET_POINTER(new_property_p->next_property_p, list_head_p);
|
||||
ECMA_SET_POINTER (new_property_p->next_property_p, list_head_p);
|
||||
ecma_set_property_list (object_p, new_property_p);
|
||||
|
||||
JERRY_STATIC_ASSERT (ECMA_INTERNAL_PROPERTY__COUNT <= (1ull << ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH));
|
||||
@@ -454,10 +454,10 @@ ecma_property_t*
|
||||
ecma_find_internal_property (ecma_object_t *object_p, /**< object descriptor */
|
||||
ecma_internal_property_id_t property_id) /**< internal property identifier */
|
||||
{
|
||||
JERRY_ASSERT(object_p != NULL);
|
||||
JERRY_ASSERT (object_p != NULL);
|
||||
|
||||
JERRY_ASSERT(property_id != ECMA_INTERNAL_PROPERTY_PROTOTYPE
|
||||
&& property_id != ECMA_INTERNAL_PROPERTY_EXTENSIBLE);
|
||||
JERRY_ASSERT (property_id != ECMA_INTERNAL_PROPERTY_PROTOTYPE
|
||||
&& property_id != ECMA_INTERNAL_PROPERTY_EXTENSIBLE);
|
||||
|
||||
for (ecma_property_t *property_p = ecma_get_property_list (object_p);
|
||||
property_p != NULL;
|
||||
@@ -489,7 +489,7 @@ ecma_get_internal_property (ecma_object_t *object_p, /**< object descriptor */
|
||||
{
|
||||
ecma_property_t *property_p = ecma_find_internal_property (object_p, property_id);
|
||||
|
||||
JERRY_ASSERT(property_p != NULL);
|
||||
JERRY_ASSERT (property_p != NULL);
|
||||
|
||||
return property_p;
|
||||
} /* ecma_get_internal_property */
|
||||
@@ -507,15 +507,15 @@ ecma_create_named_data_property (ecma_object_t *obj_p, /**< object */
|
||||
bool is_enumerable, /**< 'Enumerable' attribute */
|
||||
bool is_configurable) /**< 'Configurable' attribute */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL && name_p != NULL);
|
||||
JERRY_ASSERT(ecma_find_named_property (obj_p, name_p) == NULL);
|
||||
JERRY_ASSERT (obj_p != NULL && name_p != NULL);
|
||||
JERRY_ASSERT (ecma_find_named_property (obj_p, name_p) == NULL);
|
||||
|
||||
ecma_property_t *prop_p = ecma_alloc_property ();
|
||||
|
||||
prop_p->type = ECMA_PROPERTY_NAMEDDATA;
|
||||
|
||||
name_p = ecma_copy_or_ref_ecma_string (name_p);
|
||||
ECMA_SET_NON_NULL_POINTER(prop_p->u.named_data_property.name_p, name_p);
|
||||
ECMA_SET_NON_NULL_POINTER (prop_p->u.named_data_property.name_p, name_p);
|
||||
|
||||
prop_p->u.named_data_property.writable = is_writable ? ECMA_PROPERTY_WRITABLE : ECMA_PROPERTY_NOT_WRITABLE;
|
||||
prop_p->u.named_data_property.enumerable = is_enumerable ? ECMA_PROPERTY_ENUMERABLE : ECMA_PROPERTY_NOT_ENUMERABLE;
|
||||
@@ -529,7 +529,7 @@ ecma_create_named_data_property (ecma_object_t *obj_p, /**< object */
|
||||
ecma_lcache_invalidate (obj_p, name_p, NULL);
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_property_list (obj_p);
|
||||
ECMA_SET_POINTER(prop_p->next_property_p, list_head_p);
|
||||
ECMA_SET_POINTER (prop_p->next_property_p, list_head_p);
|
||||
ecma_set_property_list (obj_p, prop_p);
|
||||
|
||||
return prop_p;
|
||||
@@ -548,15 +548,15 @@ ecma_create_named_accessor_property (ecma_object_t *obj_p, /**< object */
|
||||
bool is_enumerable, /**< 'enumerable' attribute */
|
||||
bool is_configurable) /**< 'configurable' attribute */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL && name_p != NULL);
|
||||
JERRY_ASSERT(ecma_find_named_property (obj_p, name_p) == NULL);
|
||||
JERRY_ASSERT (obj_p != NULL && name_p != NULL);
|
||||
JERRY_ASSERT (ecma_find_named_property (obj_p, name_p) == NULL);
|
||||
|
||||
ecma_property_t *prop_p = ecma_alloc_property ();
|
||||
|
||||
prop_p->type = ECMA_PROPERTY_NAMEDACCESSOR;
|
||||
|
||||
name_p = ecma_copy_or_ref_ecma_string (name_p);
|
||||
ECMA_SET_NON_NULL_POINTER(prop_p->u.named_accessor_property.name_p, name_p);
|
||||
ECMA_SET_NON_NULL_POINTER (prop_p->u.named_accessor_property.name_p, name_p);
|
||||
|
||||
prop_p->u.named_accessor_property.enumerable = (is_enumerable ?
|
||||
ECMA_PROPERTY_ENUMERABLE : ECMA_PROPERTY_NOT_ENUMERABLE);
|
||||
@@ -568,7 +568,7 @@ ecma_create_named_accessor_property (ecma_object_t *obj_p, /**< object */
|
||||
ecma_lcache_invalidate (obj_p, name_p, NULL);
|
||||
|
||||
ecma_property_t *list_head_p = ecma_get_property_list (obj_p);
|
||||
ECMA_SET_POINTER(prop_p->next_property_p, list_head_p);
|
||||
ECMA_SET_POINTER (prop_p->next_property_p, list_head_p);
|
||||
ecma_set_property_list (obj_p, prop_p);
|
||||
|
||||
ecma_getter_setter_pointers_t *getter_setter_pointers_p = ecma_alloc_getter_setter_pointers ();
|
||||
@@ -593,8 +593,8 @@ ecma_property_t*
|
||||
ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
||||
ecma_string_t *name_p) /**< property's name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL);
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
ecma_property_t *property_p;
|
||||
|
||||
@@ -616,15 +616,15 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
}
|
||||
else if (property_p->type == ECMA_PROPERTY_NAMEDACCESSOR)
|
||||
{
|
||||
property_name_p = ECMA_GET_NON_NULL_POINTER(ecma_string_t,
|
||||
property_p->u.named_accessor_property.name_p);
|
||||
property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
|
||||
property_p->u.named_accessor_property.name_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
if (ecma_compare_ecma_strings (name_p, property_name_p))
|
||||
{
|
||||
@@ -650,12 +650,12 @@ ecma_property_t*
|
||||
ecma_get_named_property (ecma_object_t *obj_p, /**< object to find property in */
|
||||
ecma_string_t *name_p) /**< property's name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL);
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
ecma_property_t *property_p = ecma_find_named_property (obj_p, name_p);
|
||||
|
||||
JERRY_ASSERT(property_p != NULL);
|
||||
JERRY_ASSERT (property_p != NULL);
|
||||
|
||||
return property_p;
|
||||
} /* ecma_get_named_property */
|
||||
@@ -871,14 +871,14 @@ ecma_delete_property (ecma_object_t *obj_p, /**< object */
|
||||
}
|
||||
else
|
||||
{
|
||||
ECMA_SET_POINTER(prev_prop_p->next_property_p, next_prop_p);
|
||||
ECMA_SET_POINTER (prev_prop_p->next_property_p, next_prop_p);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_delete_property */
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,7 +88,7 @@ ecma_stack_add_frame (ecma_stack_frame_t *frame_p, /**< frame to initialize */
|
||||
|
||||
for (int32_t i = 0; i < regs_num; i++)
|
||||
{
|
||||
regs_p [i] = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
regs_p[i] = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
}
|
||||
} /* ecma_stack_add_frame */
|
||||
|
||||
@@ -115,7 +115,7 @@ ecma_stack_free_frame (ecma_stack_frame_t *frame_p) /**< frame to initialize */
|
||||
reg_index < frame_p->regs_number;
|
||||
reg_index++)
|
||||
{
|
||||
ecma_free_value (frame_p->regs_p [reg_index], false);
|
||||
ecma_free_value (frame_p->regs_p[reg_index], false);
|
||||
}
|
||||
} /* ecma_stack_free_frame */
|
||||
|
||||
@@ -130,7 +130,7 @@ ecma_stack_frame_get_reg_value (ecma_stack_frame_t *frame_p, /**< frame */
|
||||
{
|
||||
JERRY_ASSERT (reg_index >= 0 && reg_index < frame_p->regs_number);
|
||||
|
||||
return frame_p->regs_p [reg_index];
|
||||
return frame_p->regs_p[reg_index];
|
||||
} /* ecma_stack_frame_get_reg_value */
|
||||
|
||||
/**
|
||||
@@ -143,7 +143,7 @@ ecma_stack_frame_set_reg_value (ecma_stack_frame_t *frame_p, /**< frame */
|
||||
{
|
||||
JERRY_ASSERT (reg_index >= 0 && reg_index < frame_p->regs_number);
|
||||
|
||||
frame_p->regs_p [reg_index] = value;
|
||||
frame_p->regs_p[reg_index] = value;
|
||||
} /* ecma_stack_frame_set_reg_value */
|
||||
|
||||
/**
|
||||
@@ -199,7 +199,7 @@ ecma_stack_push_value (ecma_stack_frame_t *frame_p, /**< ecma-stack frame */
|
||||
|
||||
JERRY_ASSERT (frame_p->current_slot_index < ecma_stack_slots_in_top_chunk (frame_p));
|
||||
|
||||
frame_p->dynamically_allocated_value_slots_p [frame_p->current_slot_index] = value;
|
||||
frame_p->dynamically_allocated_value_slots_p[frame_p->current_slot_index] = value;
|
||||
} /* ecma_stack_push_value */
|
||||
|
||||
/**
|
||||
@@ -212,7 +212,7 @@ ecma_stack_top_value (ecma_stack_frame_t *frame_p) /**< ecma-stack frame */
|
||||
|
||||
JERRY_ASSERT (frame_p->current_slot_index < slots_in_top_chunk);
|
||||
|
||||
return frame_p->dynamically_allocated_value_slots_p [frame_p->current_slot_index];
|
||||
return frame_p->dynamically_allocated_value_slots_p[frame_p->current_slot_index];
|
||||
} /* ecma_stack_top_value */
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,9 +49,9 @@ typedef struct ecma_stack_frame_t
|
||||
ecma_value_t *dynamically_allocated_value_slots_p; /**< pointer to dynamically allocated value slots
|
||||
* in the top-most chunk */
|
||||
uint32_t current_slot_index; /**< index of first free slot in the top chunk */
|
||||
ecma_value_t inlined_values [ECMA_STACK_FRAME_INLINED_VALUES_NUMBER]; /**< place for values inlined in stack frame
|
||||
* (instead of being dynamically allocated
|
||||
* on the heap) */
|
||||
ecma_value_t inlined_values[ECMA_STACK_FRAME_INLINED_VALUES_NUMBER]; /**< place for values inlined in stack frame
|
||||
* (instead of being dynamically allocated
|
||||
* on the heap) */
|
||||
ecma_value_t *regs_p; /**< register variables */
|
||||
int32_t regs_number; /**< number of register variables */
|
||||
} ecma_stack_frame_t;
|
||||
|
||||
@@ -181,7 +181,7 @@ ecma_builtin_array_prototype_object_push (ecma_value_t this_arg, /**< this argum
|
||||
{
|
||||
JERRY_ASSERT (argument_list_p == NULL || arguments_number > 0);
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value();
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
// 1.
|
||||
ECMA_TRY_CATCH (obj_this_value, ecma_op_to_object (this_arg), ret_value);
|
||||
@@ -240,7 +240,7 @@ ecma_builtin_array_prototype_object_push (ecma_value_t this_arg, /**< this argum
|
||||
true);
|
||||
|
||||
if (unlikely (ecma_is_completion_value_throw (completion)
|
||||
|| ecma_is_completion_value_exit(completion)))
|
||||
|| ecma_is_completion_value_exit (completion)))
|
||||
{
|
||||
ret_value = completion;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
|
||||
}
|
||||
else
|
||||
{
|
||||
arg_value = arguments_list_p [0];
|
||||
arg_value = arguments_list_p[0];
|
||||
}
|
||||
|
||||
return ecma_op_to_boolean (arg_value);
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_eval_error_dispatch_call (const ecma_value_t *arguments_list_p, /**
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ ecma_builtin_function_prototype_object_call (ecma_value_t this_arg, /**< this ar
|
||||
else
|
||||
{
|
||||
return ecma_op_function_call (func_obj_p,
|
||||
arguments_list_p [0],
|
||||
arguments_list_p[0],
|
||||
(arguments_number == 1u) ? NULL : (arguments_list_p + 1),
|
||||
(ecma_length_t) (arguments_number - 1u));
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ SORT_PROPERTY_NAMES_ROUTINE_NAME (BUILTIN_UNDERSCORED_ID) (void)
|
||||
swapped = false;
|
||||
|
||||
for (ecma_length_t i = 1;
|
||||
i < (sizeof (ecma_builtin_property_names) / sizeof (ecma_builtin_property_names [0]));
|
||||
i < (sizeof (ecma_builtin_property_names) / sizeof (ecma_builtin_property_names[0]));
|
||||
i++)
|
||||
{
|
||||
if (ecma_builtin_property_names [i] < ecma_builtin_property_names [i - 1])
|
||||
if (ecma_builtin_property_names[i] < ecma_builtin_property_names[i - 1])
|
||||
{
|
||||
ecma_magic_string_id_t id_temp = ecma_builtin_property_names [i - 1];
|
||||
ecma_builtin_property_names [i - 1] = ecma_builtin_property_names [i];
|
||||
ecma_builtin_property_names [i] = id_temp;
|
||||
ecma_magic_string_id_t id_temp = ecma_builtin_property_names[i - 1];
|
||||
ecma_builtin_property_names[i - 1] = ecma_builtin_property_names[i];
|
||||
ecma_builtin_property_names[i] = id_temp;
|
||||
|
||||
swapped = true;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ TRY_TO_INSTANTIATE_PROPERTY_ROUTINE_NAME (BUILTIN_UNDERSCORED_ID) (ecma_object_t
|
||||
}
|
||||
|
||||
const ecma_length_t property_numbers = (ecma_length_t) (sizeof (ecma_builtin_property_names) /
|
||||
sizeof (ecma_builtin_property_names [0]));
|
||||
sizeof (ecma_builtin_property_names[0]));
|
||||
int32_t index;
|
||||
index = ecma_builtin_bin_search_for_magic_string_id_in_array (ecma_builtin_property_names,
|
||||
property_numbers,
|
||||
@@ -279,7 +279,7 @@ DISPATCH_ROUTINE_ROUTINE_NAME (BUILTIN_UNDERSCORED_ID) (uint16_t builtin_routine
|
||||
identifier */
|
||||
ecma_value_t this_arg_value, /**< 'this' argument
|
||||
value */
|
||||
const ecma_value_t arguments_list [], /**< list of arguments
|
||||
const ecma_value_t arguments_list[], /**< list of arguments
|
||||
passed to routine */
|
||||
ecma_length_t arguments_number) /**< length of
|
||||
arguments' list */
|
||||
|
||||
@@ -118,8 +118,8 @@ ecma_builtin_jerry_try_to_instantiate_property (ecma_object_t *obj_p, /**< objec
|
||||
ecma_completion_value_t
|
||||
ecma_builtin_jerry_dispatch_routine (uint16_t builtin_routine_id, /**< built-in wide identifier of routine */
|
||||
ecma_value_t this_arg_value __attr_unused___, /**< 'this' argument value */
|
||||
const ecma_value_t arguments_list [], /**< list of arguments
|
||||
* passed to routine */
|
||||
const ecma_value_t arguments_list[], /**< list of arguments
|
||||
* passed to routine */
|
||||
ecma_length_t arguments_number) /**< length of arguments' list */
|
||||
{
|
||||
uint32_t extension_object_index = builtin_routine_id / ECMA_EXTENSION_MAX_FUNCTIONS_IN_EXTENSION;
|
||||
@@ -138,7 +138,7 @@ ecma_builtin_jerry_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
JERRY_ASSERT (desc_p != NULL);
|
||||
|
||||
JERRY_ASSERT (function_index < desc_p->functions_count);
|
||||
jerry_extension_function_t *function_p = &desc_p->functions_p [function_index];
|
||||
jerry_extension_function_t *function_p = &desc_p->functions_p[function_index];
|
||||
|
||||
bool throw_type_error = false;
|
||||
if (function_p->args_number != arguments_number)
|
||||
@@ -150,8 +150,8 @@ ecma_builtin_jerry_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
uint32_t arg_index;
|
||||
for (arg_index = 0; arg_index < function_p->args_number; arg_index++)
|
||||
{
|
||||
jerry_api_value_t *arg_p = &function_p->args_p [arg_index];
|
||||
const ecma_value_t arg_value = arguments_list [arg_index];
|
||||
jerry_api_value_t *arg_p = &function_p->args_p[arg_index];
|
||||
const ecma_value_t arg_value = arguments_list[arg_index];
|
||||
|
||||
if (arg_p->type == JERRY_API_DATA_TYPE_BOOLEAN)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ ecma_builtin_jerry_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
|
||||
arg_index < initialized_args_count;
|
||||
arg_index++)
|
||||
{
|
||||
jerry_api_value_t *arg_p = &function_p->args_p [arg_index];
|
||||
jerry_api_value_t *arg_p = &function_p->args_p[arg_index];
|
||||
|
||||
if (arg_p->type == JERRY_API_DATA_TYPE_STRING)
|
||||
{
|
||||
@@ -342,8 +342,8 @@ ecma_extension_register (jerry_extension_descriptor_t *extension_desc_p) /**< ex
|
||||
for (uint32_t j = 0; j < extension_desc_p->fields_count; j++)
|
||||
{
|
||||
if (i != j
|
||||
&& !strcmp (extension_desc_p->fields_p [i].field_name_p,
|
||||
extension_desc_p->fields_p [j].field_name_p))
|
||||
&& !strcmp (extension_desc_p->fields_p[i].field_name_p,
|
||||
extension_desc_p->fields_p[j].field_name_p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -352,14 +352,14 @@ ecma_extension_register (jerry_extension_descriptor_t *extension_desc_p) /**< ex
|
||||
|
||||
for (uint32_t i = 0; i < extension_desc_p->functions_count; i++)
|
||||
{
|
||||
if (extension_desc_p->functions_p [i].args_number >= ECMA_EXTENSION_MAX_ARGUMENTS_IN_FUNCTION)
|
||||
if (extension_desc_p->functions_p[i].args_number >= ECMA_EXTENSION_MAX_ARGUMENTS_IN_FUNCTION)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
|
||||
/* Check if we can represent the arguments' values */
|
||||
for (uint32_t j = 0; j < extension_desc_p->functions_p [i].args_number; j++)
|
||||
for (uint32_t j = 0; j < extension_desc_p->functions_p[i].args_number; j++)
|
||||
{
|
||||
if (extension_desc_p->functions_p[i].args_p[j].type == JERRY_API_DATA_TYPE_FLOAT64)
|
||||
{
|
||||
@@ -371,8 +371,8 @@ ecma_extension_register (jerry_extension_descriptor_t *extension_desc_p) /**< ex
|
||||
for (uint32_t j = 0; j < extension_desc_p->functions_count; j++)
|
||||
{
|
||||
if (i != j
|
||||
&& !strcmp (extension_desc_p->functions_p [i].function_name_p,
|
||||
extension_desc_p->functions_p [j].function_name_p))
|
||||
&& !strcmp (extension_desc_p->functions_p[i].function_name_p,
|
||||
extension_desc_p->functions_p[j].function_name_p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -399,8 +399,8 @@ ecma_extension_register (jerry_extension_descriptor_t *extension_desc_p) /**< ex
|
||||
|
||||
for (uint32_t j = 0; j < extension_desc_p->functions_count; j++)
|
||||
{
|
||||
if (!strcmp (extension_desc_p->fields_p [i].field_name_p,
|
||||
extension_desc_p->functions_p [j].function_name_p))
|
||||
if (!strcmp (extension_desc_p->fields_p[i].field_name_p,
|
||||
extension_desc_p->functions_p[j].function_name_p))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -480,7 +480,7 @@ ecma_op_extension_object_get_own_property (ecma_object_t *obj_p, /**< the extens
|
||||
field_index < desc_p->fields_count;
|
||||
field_index++)
|
||||
{
|
||||
if (!strcmp (name_p, desc_p->fields_p [field_index].field_name_p))
|
||||
if (!strcmp (name_p, desc_p->fields_p[field_index].field_name_p))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -488,7 +488,7 @@ ecma_op_extension_object_get_own_property (ecma_object_t *obj_p, /**< the extens
|
||||
|
||||
if (field_index < desc_p->fields_count)
|
||||
{
|
||||
const jerry_extension_field_t *field_p = &desc_p->fields_p [field_index];
|
||||
const jerry_extension_field_t *field_p = &desc_p->fields_p[field_index];
|
||||
|
||||
ecma_value_t value;
|
||||
prop_p = ecma_create_named_data_property (obj_p,
|
||||
@@ -549,7 +549,7 @@ ecma_op_extension_object_get_own_property (ecma_object_t *obj_p, /**< the extens
|
||||
function_index < desc_p->functions_count;
|
||||
function_index++)
|
||||
{
|
||||
if (!strcmp (name_p, desc_p->functions_p [function_index].function_name_p))
|
||||
if (!strcmp (name_p, desc_p->functions_p[function_index].function_name_p))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -557,7 +557,7 @@ ecma_op_extension_object_get_own_property (ecma_object_t *obj_p, /**< the extens
|
||||
|
||||
if (function_index < desc_p->functions_count)
|
||||
{
|
||||
const jerry_extension_function_t *function_p = &desc_p->functions_p [function_index];
|
||||
const jerry_extension_function_t *function_p = &desc_p->functions_p[function_index];
|
||||
|
||||
/* Currently, combined identifier of extension object and extension function should fit in uint16_t. */
|
||||
JERRY_STATIC_ASSERT (ECMA_EXTENSION_MAX_NUMBER_OF_EXTENSIONS * ECMA_EXTENSION_MAX_FUNCTIONS_IN_EXTENSION
|
||||
|
||||
@@ -66,7 +66,7 @@ ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ecma_op_to_number (arguments_list_p [0]);
|
||||
ret_value = ecma_op_to_number (arguments_list_p[0]);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
|
||||
@@ -57,13 +57,13 @@ ecma_builtin_object_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
|
||||
|
||||
if (arguments_list_len == 0
|
||||
|| ecma_is_value_undefined (arguments_list_p[0])
|
||||
|| ecma_is_value_null (arguments_list_p [0]))
|
||||
|| ecma_is_value_null (arguments_list_p[0]))
|
||||
{
|
||||
ret_value = ecma_builtin_object_dispatch_construct (arguments_list_p, arguments_list_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ecma_op_to_object (arguments_list_p [0]);
|
||||
ret_value = ecma_op_to_object (arguments_list_p[0]);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
@@ -88,7 +88,7 @@ ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /*
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_completion_value_t new_obj_value = ecma_op_create_object_object_arg (arguments_list_p [0]);
|
||||
ecma_completion_value_t new_obj_value = ecma_op_create_object_object_arg (arguments_list_p[0]);
|
||||
|
||||
if (!ecma_is_completion_value_normal (new_obj_value))
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_range_error_dispatch_call (const ecma_value_t *arguments_list_p, /*
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_reference_error_dispatch_call (const ecma_value_t *arguments_list_p
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __attr_unused__
|
||||
|
||||
ecma_char_t *ret_zt_str_p = (ecma_char_t*) mem_heap_alloc_block (zt_str_buffer_size,
|
||||
MEM_HEAP_ALLOC_SHORT_TERM);
|
||||
ret_zt_str_p [args_number] = ECMA_CHAR_NULL;
|
||||
ret_zt_str_p[args_number] = ECMA_CHAR_NULL;
|
||||
|
||||
for (ecma_length_t arg_index = 0;
|
||||
arg_index < args_number;
|
||||
@@ -82,10 +82,10 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg __attr_unused__
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_zt_str_p [arg_index] = (ecma_char_t) uint16_char_code;
|
||||
ret_zt_str_p[arg_index] = (ecma_char_t) uint16_char_code;
|
||||
}
|
||||
#elif CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_UTF16
|
||||
ret_zt_str_p [arg_index] = (ecma_char_t) uint16_char_code;
|
||||
ret_zt_str_p[arg_index] = (ecma_char_t) uint16_char_code;
|
||||
#endif /* CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_UTF16 */
|
||||
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (arg_num);
|
||||
@@ -129,7 +129,7 @@ ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ecma_op_to_string (arguments_list_p [0]);
|
||||
ret_value = ecma_op_to_string (arguments_list_p[0]);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_syntax_error_dispatch_call (const ecma_value_t *arguments_list_p, /
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_type_error_dispatch_call (const ecma_value_t *arguments_list_p, /**
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ecma_builtin_uri_error_dispatch_call (const ecma_value_t *arguments_list_p, /**<
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (arguments_list_len != 0
|
||||
&& !ecma_is_value_undefined (arguments_list_p [0]))
|
||||
&& !ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ ecma_builtin_ ## lowercase_name ## _dispatch_construct (const ecma_value_t *argu
|
||||
extern ecma_completion_value_t \
|
||||
ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \
|
||||
ecma_value_t this_arg_value, \
|
||||
const ecma_value_t arguments_list [], \
|
||||
const ecma_value_t arguments_list[], \
|
||||
ecma_length_t arguments_number); \
|
||||
extern ecma_property_t* \
|
||||
ecma_builtin_ ## lowercase_name ## _try_to_instantiate_property (ecma_object_t *obj_p, \
|
||||
|
||||
@@ -35,14 +35,14 @@ static ecma_completion_value_t
|
||||
ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id,
|
||||
uint16_t builtin_routine_id,
|
||||
ecma_value_t this_arg_value,
|
||||
const ecma_value_t arguments_list [],
|
||||
const ecma_value_t arguments_list[],
|
||||
ecma_length_t arguments_number);
|
||||
static void ecma_instantiate_builtin (ecma_builtin_id_t id);
|
||||
|
||||
/**
|
||||
* Pointer to instances of built-in objects
|
||||
*/
|
||||
static ecma_object_t* ecma_builtin_objects [ECMA_BUILTIN_ID__COUNT];
|
||||
static ecma_object_t* ecma_builtin_objects[ECMA_BUILTIN_ID__COUNT];
|
||||
|
||||
/**
|
||||
* Check if passed object is the instance of specified built-in.
|
||||
@@ -54,12 +54,12 @@ ecma_builtin_is (ecma_object_t *obj_p, /**< pointer to an object */
|
||||
JERRY_ASSERT (obj_p != NULL && !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
|
||||
|
||||
if (unlikely (ecma_builtin_objects [builtin_id] == NULL))
|
||||
if (unlikely (ecma_builtin_objects[builtin_id] == NULL))
|
||||
{
|
||||
ecma_instantiate_builtin (builtin_id);
|
||||
}
|
||||
|
||||
return (obj_p == ecma_builtin_objects [builtin_id]);
|
||||
return (obj_p == ecma_builtin_objects[builtin_id]);
|
||||
} /* ecma_builtin_is */
|
||||
|
||||
/**
|
||||
@@ -72,14 +72,14 @@ ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on
|
||||
{
|
||||
JERRY_ASSERT (builtin_id < ECMA_BUILTIN_ID__COUNT);
|
||||
|
||||
if (unlikely (ecma_builtin_objects [builtin_id] == NULL))
|
||||
if (unlikely (ecma_builtin_objects[builtin_id] == NULL))
|
||||
{
|
||||
ecma_instantiate_builtin (builtin_id);
|
||||
}
|
||||
|
||||
ecma_ref_object (ecma_builtin_objects [builtin_id]);
|
||||
ecma_ref_object (ecma_builtin_objects[builtin_id]);
|
||||
|
||||
return ecma_builtin_objects [builtin_id];
|
||||
return ecma_builtin_objects[builtin_id];
|
||||
} /* ecma_builtin_get */
|
||||
|
||||
/**
|
||||
@@ -169,7 +169,7 @@ ecma_init_builtins (void)
|
||||
id < ECMA_BUILTIN_ID__COUNT;
|
||||
id = (ecma_builtin_id_t) (id + 1))
|
||||
{
|
||||
ecma_builtin_objects [id] = NULL;
|
||||
ecma_builtin_objects[id] = NULL;
|
||||
}
|
||||
} /* ecma_init_builtins */
|
||||
|
||||
@@ -190,7 +190,7 @@ ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
|
||||
lowercase_name) \
|
||||
case builtin_id: \
|
||||
{ \
|
||||
JERRY_ASSERT (ecma_builtin_objects [builtin_id] == NULL); \
|
||||
JERRY_ASSERT (ecma_builtin_objects[builtin_id] == NULL); \
|
||||
if (is_static) \
|
||||
{ \
|
||||
ecma_builtin_ ## lowercase_name ## _sort_property_names (); \
|
||||
@@ -203,11 +203,11 @@ ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (ecma_builtin_objects [object_prototype_builtin_id] == NULL) \
|
||||
if (ecma_builtin_objects[object_prototype_builtin_id] == NULL) \
|
||||
{ \
|
||||
ecma_instantiate_builtin (object_prototype_builtin_id); \
|
||||
} \
|
||||
prototype_obj_p = ecma_builtin_objects [object_prototype_builtin_id]; \
|
||||
prototype_obj_p = ecma_builtin_objects[object_prototype_builtin_id]; \
|
||||
JERRY_ASSERT (prototype_obj_p != NULL); \
|
||||
} \
|
||||
\
|
||||
@@ -216,7 +216,7 @@ ecma_instantiate_builtin (ecma_builtin_id_t id) /**< built-in id */
|
||||
object_type, \
|
||||
object_class, \
|
||||
is_extensible); \
|
||||
ecma_builtin_objects [builtin_id] = builtin_obj_p; \
|
||||
ecma_builtin_objects[builtin_id] = builtin_obj_p; \
|
||||
\
|
||||
break; \
|
||||
}
|
||||
@@ -241,11 +241,11 @@ ecma_finalize_builtins (void)
|
||||
id < ECMA_BUILTIN_ID__COUNT;
|
||||
id = (ecma_builtin_id_t) (id + 1))
|
||||
{
|
||||
if (ecma_builtin_objects [id] != NULL)
|
||||
if (ecma_builtin_objects[id] != NULL)
|
||||
{
|
||||
ecma_deref_object (ecma_builtin_objects [id]);
|
||||
ecma_deref_object (ecma_builtin_objects[id]);
|
||||
|
||||
ecma_builtin_objects [id] = NULL;
|
||||
ecma_builtin_objects[id] = NULL;
|
||||
}
|
||||
}
|
||||
} /* ecma_finalize_builtins */
|
||||
@@ -523,7 +523,7 @@ ecma_builtin_dispatch_routine (ecma_builtin_id_t builtin_object_id, /**< built-i
|
||||
* of the built-in object's
|
||||
* routine property */
|
||||
ecma_value_t this_arg_value, /**< 'this' argument value */
|
||||
const ecma_value_t arguments_list [], /**< list of arguments passed to routine */
|
||||
const ecma_value_t arguments_list[], /**< list of arguments passed to routine */
|
||||
ecma_length_t arguments_number) /**< length of arguments' list */
|
||||
{
|
||||
switch (builtin_object_id)
|
||||
@@ -583,7 +583,7 @@ ecma_builtin_bin_search_for_magic_string_id_in_array (const ecma_magic_string_id
|
||||
id_index < array_length;
|
||||
id_index++)
|
||||
{
|
||||
JERRY_ASSERT (ids [id_index - 1] < ids [id_index]);
|
||||
JERRY_ASSERT (ids[id_index - 1] < ids[id_index]);
|
||||
}
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
ecma_property_descriptor_t item_prop_desc = ecma_make_empty_property_descriptor ();
|
||||
{
|
||||
item_prop_desc.is_value_defined = true;
|
||||
item_prop_desc.value = array_items_p [index];
|
||||
item_prop_desc.value = array_items_p[index];
|
||||
|
||||
item_prop_desc.is_writable_defined = true;
|
||||
item_prop_desc.is_writable = true;
|
||||
@@ -377,7 +377,7 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -453,7 +453,7 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
|
||||
return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_array_object_define_own_property */
|
||||
|
||||
/**
|
||||
|
||||
@@ -120,7 +120,7 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
}
|
||||
else
|
||||
{ // f.
|
||||
JERRY_ASSERT(is_x_object);
|
||||
JERRY_ASSERT (is_x_object);
|
||||
|
||||
bool is_equal = (ecma_get_object_from_value (x) == ecma_get_object_from_value (y));
|
||||
|
||||
@@ -339,12 +339,12 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
ecma_value_t second_converted_value = left_first ? y : x;
|
||||
|
||||
// 1., 2.
|
||||
ECMA_TRY_CATCH(prim_first_converted_value,
|
||||
ecma_op_to_primitive (first_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
ECMA_TRY_CATCH(prim_second_converted_value,
|
||||
ecma_op_to_primitive (second_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
ECMA_TRY_CATCH (prim_first_converted_value,
|
||||
ecma_op_to_primitive (first_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
ECMA_TRY_CATCH (prim_second_converted_value,
|
||||
ecma_op_to_primitive (second_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
|
||||
const ecma_value_t &px = left_first ? prim_first_converted_value : prim_second_converted_value;
|
||||
const ecma_value_t &py = left_first ? prim_second_converted_value : prim_first_converted_value;
|
||||
@@ -448,8 +448,8 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
: ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
ECMA_FINALIZE(prim_second_converted_value);
|
||||
ECMA_FINALIZE(prim_first_converted_value);
|
||||
ECMA_FINALIZE (prim_second_converted_value);
|
||||
ECMA_FINALIZE (prim_first_converted_value);
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_op_abstract_relational_compare */
|
||||
|
||||
@@ -142,7 +142,7 @@ ecma_op_same_value (ecma_value_t x, /**< ecma-value */
|
||||
return (ecma_is_value_true (x) == ecma_is_value_true (y));
|
||||
}
|
||||
|
||||
JERRY_ASSERT(is_x_object);
|
||||
JERRY_ASSERT (is_x_object);
|
||||
|
||||
return (ecma_get_object_from_value (x) == ecma_get_object_from_value (y));
|
||||
} /* ecma_op_same_value */
|
||||
|
||||
@@ -49,7 +49,7 @@ ecma_pack_code_internal_property_value (bool is_strict, /**< is code strict? */
|
||||
uint32_t value = opcode_idx;
|
||||
const uint32_t is_strict_bit_offset = (uint32_t) (sizeof (value) * JERRY_BITSINBYTE - 1);
|
||||
|
||||
JERRY_ASSERT(((value) & (1u << is_strict_bit_offset)) == 0);
|
||||
JERRY_ASSERT (((value) & (1u << is_strict_bit_offset)) == 0);
|
||||
|
||||
if (is_strict)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ static opcode_counter_t
|
||||
ecma_unpack_code_internal_property_value (uint32_t value, /**< packed value */
|
||||
bool* out_is_strict_p) /**< out: is code strict? */
|
||||
{
|
||||
JERRY_ASSERT(out_is_strict_p != NULL);
|
||||
JERRY_ASSERT (out_is_strict_p != NULL);
|
||||
|
||||
const uint32_t is_strict_bit_offset = (uint32_t) (sizeof (value) * JERRY_BITSINBYTE - 1);
|
||||
|
||||
@@ -99,8 +99,8 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma-value */
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (value);
|
||||
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(!ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL);
|
||||
JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
|
||||
|
||||
return (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION
|
||||
|| ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION
|
||||
@@ -124,8 +124,8 @@ ecma_is_constructor (ecma_value_t value) /**< ecma-value */
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (value);
|
||||
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(!ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL);
|
||||
JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
|
||||
|
||||
return (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION
|
||||
|| ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION
|
||||
@@ -166,7 +166,7 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], /**< f
|
||||
|
||||
// 9.
|
||||
ecma_property_t *scope_prop_p = ecma_create_internal_property (f, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ECMA_SET_POINTER(scope_prop_p->u.internal_property.value, scope_p);
|
||||
ECMA_SET_POINTER (scope_prop_p->u.internal_property.value, scope_p);
|
||||
|
||||
// 10., 11.
|
||||
ecma_property_t *formal_parameters_prop_p = ecma_create_internal_property (f,
|
||||
@@ -434,8 +434,8 @@ ecma_completion_value_t
|
||||
ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ecma_value_t value) /**< argument 'V' */
|
||||
{
|
||||
JERRY_ASSERT(func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
JERRY_ASSERT (func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
|
||||
if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION)
|
||||
{
|
||||
@@ -516,10 +516,10 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
const ecma_value_t* arguments_list_p, /**< arguments list */
|
||||
ecma_length_t arguments_list_len) /**< length of arguments list */
|
||||
{
|
||||
JERRY_ASSERT(func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
JERRY_ASSERT(ecma_op_is_callable (ecma_make_object_value (func_obj_p)));
|
||||
JERRY_ASSERT(arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
JERRY_ASSERT (func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
JERRY_ASSERT (ecma_op_is_callable (ecma_make_object_value (func_obj_p)));
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -622,7 +622,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT(ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
|
||||
JERRY_UNIMPLEMENTED ("Bound functions are not implemented.");
|
||||
}
|
||||
@@ -727,10 +727,10 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
const ecma_value_t* arguments_list_p, /**< arguments list */
|
||||
ecma_length_t arguments_list_len) /**< length of arguments list */
|
||||
{
|
||||
JERRY_ASSERT(func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
JERRY_ASSERT(ecma_is_constructor (ecma_make_object_value (func_obj_p)));
|
||||
JERRY_ASSERT(arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
JERRY_ASSERT (func_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (func_obj_p));
|
||||
JERRY_ASSERT (ecma_is_constructor (ecma_make_object_value (func_obj_p)));
|
||||
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
|
||||
|
||||
if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION)
|
||||
{
|
||||
@@ -748,7 +748,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT(ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
|
||||
JERRY_UNIMPLEMENTED ("Bound functions are not implemented.");
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ ecma_op_get_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< referenc
|
||||
}
|
||||
|
||||
// 5.
|
||||
JERRY_ASSERT(ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
JERRY_ASSERT (ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
|
||||
// 5.a
|
||||
return ecma_op_get_binding_value (ref_base_lex_env_p,
|
||||
@@ -94,8 +94,8 @@ ecma_op_get_value_object_base (ecma_reference_t ref) /**< ECMA-reference */
|
||||
// 4.b case 1
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (base);
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
return ecma_op_object_get (obj_p, ECMA_GET_NON_NULL_POINTER (ecma_string_t,
|
||||
ref.referenced_name_cp));
|
||||
@@ -156,16 +156,16 @@ ecma_op_put_value_lex_env_base (ecma_object_t *ref_base_lex_env_p, /**< referenc
|
||||
|
||||
ecma_deref_object (global_object_p);
|
||||
|
||||
JERRY_ASSERT(ecma_is_completion_value_normal_true (completion)
|
||||
|| ecma_is_completion_value_normal_false (completion));
|
||||
JERRY_ASSERT (ecma_is_completion_value_normal_true (completion)
|
||||
|| ecma_is_completion_value_normal_false (completion));
|
||||
|
||||
return ecma_make_empty_completion_value ();
|
||||
}
|
||||
}
|
||||
|
||||
// 5.
|
||||
JERRY_ASSERT(ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
JERRY_ASSERT (ref_base_lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (ref_base_lex_env_p));
|
||||
|
||||
// 5.a
|
||||
return ecma_op_set_mutable_binding (ref_base_lex_env_p,
|
||||
|
||||
@@ -92,8 +92,8 @@ ecma_get_global_environment (void)
|
||||
bool
|
||||
ecma_is_lexical_environment_global (ecma_object_t *lex_env_p) /**< lexical environment */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
return (lex_env_p == ecma_global_lex_env_p);
|
||||
} /* ecma_is_lexical_environment_global */
|
||||
@@ -113,8 +113,8 @@ bool
|
||||
ecma_op_has_binding (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
ecma_string_t *name_p) /**< argument N */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
{
|
||||
@@ -145,9 +145,9 @@ ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
ecma_string_t *name_p, /**< argument N */
|
||||
bool is_deletable) /**< argument D */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
{
|
||||
@@ -209,9 +209,9 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
|
||||
ecma_value_t value, /**< argument V */
|
||||
bool is_strict) /**< argument S */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
{
|
||||
@@ -284,9 +284,9 @@ ecma_op_get_binding_value (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
ecma_string_t *name_p, /**< argument N */
|
||||
bool is_strict) /**< argument S */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
{
|
||||
@@ -366,9 +366,9 @@ ecma_completion_value_t
|
||||
ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
ecma_string_t *name_p) /**< argument N */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT(name_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (name_p != NULL);
|
||||
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
@@ -382,7 +382,7 @@ ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT(prop_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
|
||||
if (!ecma_is_property_configurable (prop_p))
|
||||
{
|
||||
@@ -419,8 +419,8 @@ ecma_op_delete_binding (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
ecma_completion_value_t
|
||||
ecma_op_implicit_this_value (ecma_object_t *lex_env_p) /**< lexical environment */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE)
|
||||
{
|
||||
@@ -453,8 +453,8 @@ void
|
||||
ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environment */
|
||||
ecma_string_t *name_p) /**< argument N */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
||||
|
||||
/*
|
||||
@@ -465,7 +465,7 @@ ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environ
|
||||
name_p,
|
||||
false, false, false);
|
||||
|
||||
JERRY_ASSERT(ecma_is_value_undefined (ecma_get_named_data_property_value (prop_p)));
|
||||
JERRY_ASSERT (ecma_is_value_undefined (ecma_get_named_data_property_value (prop_p)));
|
||||
|
||||
ecma_set_named_data_property_value (prop_p,
|
||||
ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY));
|
||||
@@ -481,15 +481,15 @@ ecma_op_initialize_immutable_binding (ecma_object_t *lex_env_p, /**< lexical env
|
||||
ecma_string_t *name_p, /**< argument N */
|
||||
ecma_value_t value) /**< argument V */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
||||
|
||||
ecma_property_t *prop_p = ecma_get_named_data_property (lex_env_p, name_p);
|
||||
|
||||
/* The binding must be unitialized immutable binding */
|
||||
JERRY_ASSERT(!ecma_is_property_writable (prop_p)
|
||||
&& ecma_is_value_empty (ecma_get_named_data_property_value (prop_p)));
|
||||
JERRY_ASSERT (!ecma_is_property_writable (prop_p)
|
||||
&& ecma_is_value_empty (ecma_get_named_data_property_value (prop_p)));
|
||||
|
||||
ecma_named_data_property_assign_value (lex_env_p, prop_p, value);
|
||||
} /* ecma_op_initialize_immutable_binding */
|
||||
|
||||
@@ -192,11 +192,11 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
|
||||
|
||||
ecma_property_t *parameters_map_prop_p = ecma_create_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ECMA_SET_POINTER(parameters_map_prop_p->u.internal_property.value, map_p);
|
||||
ECMA_SET_POINTER (parameters_map_prop_p->u.internal_property.value, map_p);
|
||||
|
||||
ecma_property_t *scope_prop_p = ecma_create_internal_property (map_p,
|
||||
ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ECMA_SET_POINTER(scope_prop_p->u.internal_property.value, lex_env_p);
|
||||
ECMA_SET_POINTER (scope_prop_p->u.internal_property.value, lex_env_p);
|
||||
|
||||
ecma_deref_object (map_p);
|
||||
}
|
||||
@@ -281,8 +281,8 @@ ecma_arguments_get_mapped_arg_value (ecma_object_t *map_p, /**< [[ParametersMap]
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property (map_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t,
|
||||
scope_prop_p->u.internal_property.value);
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
JERRY_ASSERT (lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
ecma_value_t arg_name_prop_value = ecma_get_named_data_property_value (arg_name_prop_p);
|
||||
|
||||
|
||||
@@ -118,9 +118,9 @@ ecma_completion_value_t
|
||||
ecma_op_general_object_get (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
const ecma_property_t* prop_p = ecma_op_object_get_property (obj_p, property_name_p);
|
||||
@@ -156,7 +156,7 @@ ecma_op_general_object_get (ecma_object_t *obj_p, /**< the object */
|
||||
}
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_general_object_get */
|
||||
|
||||
/**
|
||||
@@ -173,9 +173,9 @@ ecma_property_t*
|
||||
ecma_op_general_object_get_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
return ecma_find_named_property (obj_p, property_name_p);
|
||||
} /* ecma_op_general_object_get_own_property */
|
||||
@@ -194,9 +194,9 @@ ecma_property_t*
|
||||
ecma_op_general_object_get_property (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
ecma_property_t *prop_p = ecma_op_object_get_own_property (obj_p, property_name_p);
|
||||
@@ -237,9 +237,9 @@ ecma_op_general_object_put (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_value_t value, /**< ecma-value */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
if (!ecma_op_object_can_put (obj_p, property_name_p))
|
||||
@@ -286,7 +286,7 @@ ecma_op_general_object_put (ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
// a.
|
||||
ecma_object_t *setter_p = ecma_get_named_accessor_property_setter (desc_p);
|
||||
JERRY_ASSERT(setter_p != NULL);
|
||||
JERRY_ASSERT (setter_p != NULL);
|
||||
|
||||
ecma_completion_value_t ret_value = ecma_make_empty_completion_value ();
|
||||
|
||||
@@ -330,7 +330,7 @@ ecma_op_general_object_put (ecma_object_t *obj_p, /**< the object */
|
||||
is_throw);
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_general_object_put */
|
||||
|
||||
/**
|
||||
@@ -347,9 +347,9 @@ bool
|
||||
ecma_op_general_object_can_put (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
ecma_property_t *prop_p = ecma_op_object_get_own_property (obj_p, property_name_p);
|
||||
@@ -375,7 +375,7 @@ ecma_op_general_object_can_put (ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
// b.
|
||||
|
||||
JERRY_ASSERT(prop_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
JERRY_ASSERT (prop_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
|
||||
return ecma_is_property_writable (prop_p);
|
||||
}
|
||||
@@ -416,7 +416,7 @@ ecma_op_general_object_can_put (ecma_object_t *obj_p, /**< the object */
|
||||
else
|
||||
{
|
||||
// 8.
|
||||
JERRY_ASSERT(inherited_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
JERRY_ASSERT (inherited_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
|
||||
// a.
|
||||
if (!ecma_get_object_extensible (obj_p))
|
||||
@@ -430,7 +430,7 @@ ecma_op_general_object_can_put (ecma_object_t *obj_p, /**< the object */
|
||||
}
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_general_object_can_put */
|
||||
|
||||
/**
|
||||
@@ -448,9 +448,9 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p, /**< property name */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
// 1.
|
||||
ecma_property_t *desc_p = ecma_op_object_get_own_property (obj_p, property_name_p);
|
||||
@@ -481,7 +481,7 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_general_object_delete */
|
||||
|
||||
/**
|
||||
@@ -498,8 +498,8 @@ ecma_completion_value_t
|
||||
ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_preferred_type_hint_t hint) /**< hint on preferred result type */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
if (hint == ECMA_PREFERRED_TYPE_NO)
|
||||
{
|
||||
@@ -589,9 +589,9 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
* descriptor */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const bool is_property_desc_generic_descriptor = (!property_desc_p->is_value_defined
|
||||
&& !property_desc_p->is_writable_defined
|
||||
@@ -633,7 +633,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
else
|
||||
{
|
||||
// b.
|
||||
JERRY_ASSERT(is_property_desc_accessor_descriptor);
|
||||
JERRY_ASSERT (is_property_desc_accessor_descriptor);
|
||||
|
||||
ecma_create_named_accessor_property (obj_p,
|
||||
property_name_p,
|
||||
@@ -659,7 +659,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
const bool is_current_data_descriptor = (current_p->type == ECMA_PROPERTY_NAMEDDATA);
|
||||
const bool is_current_accessor_descriptor = (current_p->type == ECMA_PROPERTY_NAMEDACCESSOR);
|
||||
|
||||
JERRY_ASSERT(is_current_data_descriptor || is_current_accessor_descriptor);
|
||||
JERRY_ASSERT (is_current_data_descriptor || is_current_accessor_descriptor);
|
||||
|
||||
bool is_every_field_in_desc_also_occurs_in_current_desc_with_same_value = true;
|
||||
if (property_desc_p->is_value_defined)
|
||||
@@ -796,7 +796,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT(is_property_desc_accessor_descriptor && is_current_accessor_descriptor);
|
||||
JERRY_ASSERT (is_property_desc_accessor_descriptor && is_current_accessor_descriptor);
|
||||
|
||||
// 11.
|
||||
|
||||
@@ -818,28 +818,28 @@ ecma_op_general_object_define_own_property (ecma_object_t *obj_p, /**< the objec
|
||||
// 12.
|
||||
if (property_desc_p->is_value_defined)
|
||||
{
|
||||
JERRY_ASSERT(is_current_data_descriptor);
|
||||
JERRY_ASSERT (is_current_data_descriptor);
|
||||
|
||||
ecma_named_data_property_assign_value (obj_p, current_p, property_desc_p->value);
|
||||
}
|
||||
|
||||
if (property_desc_p->is_writable_defined)
|
||||
{
|
||||
JERRY_ASSERT(is_current_data_descriptor);
|
||||
JERRY_ASSERT (is_current_data_descriptor);
|
||||
|
||||
ecma_set_property_writable_attr (current_p, property_desc_p->is_writable);
|
||||
}
|
||||
|
||||
if (property_desc_p->is_get_defined)
|
||||
{
|
||||
JERRY_ASSERT(is_current_accessor_descriptor);
|
||||
JERRY_ASSERT (is_current_accessor_descriptor);
|
||||
|
||||
ecma_set_named_accessor_property_getter (obj_p, current_p, property_desc_p->get_p);
|
||||
}
|
||||
|
||||
if (property_desc_p->is_set_defined)
|
||||
{
|
||||
JERRY_ASSERT(is_current_accessor_descriptor);
|
||||
JERRY_ASSERT (is_current_accessor_descriptor);
|
||||
|
||||
ecma_set_named_accessor_property_setter (obj_p, current_p, property_desc_p->set_p);
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ ecma_completion_value_t
|
||||
ecma_op_object_get (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -173,9 +173,9 @@ ecma_property_t*
|
||||
ecma_op_object_get_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
ecma_property_t *prop_p = NULL;
|
||||
|
||||
@@ -202,9 +202,9 @@ ecma_property_t*
|
||||
ecma_op_object_get_property (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -245,9 +245,9 @@ ecma_op_object_put (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_value_t value, /**< ecma-value */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -286,9 +286,9 @@ bool
|
||||
ecma_op_object_can_put (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p) /**< property name */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -328,9 +328,9 @@ ecma_op_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_string_t *property_name_p, /**< property name */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -377,8 +377,8 @@ ecma_completion_value_t
|
||||
ecma_op_object_default_value (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_preferred_type_hint_t hint) /**< hint on preferred result type */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -420,9 +420,9 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
* descriptor */
|
||||
bool is_throw) /**< flag that controls failure handling */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT(property_name_p != NULL);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (property_name_p != NULL);
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -475,8 +475,8 @@ ecma_completion_value_t
|
||||
ecma_op_object_has_instance (ecma_object_t *obj_p, /**< the object */
|
||||
ecma_value_t value) /**< argument 'V' */
|
||||
{
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
const ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
ecma_assert_object_type_is_valid (type);
|
||||
@@ -501,7 +501,7 @@ ecma_op_object_has_instance (ecma_object_t *obj_p, /**< the object */
|
||||
}
|
||||
}
|
||||
|
||||
JERRY_UNREACHABLE();
|
||||
JERRY_UNREACHABLE ();
|
||||
} /* ecma_op_object_has_instance */
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ ecma_object_t*
|
||||
ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical environment */
|
||||
ecma_string_t *name_p) /**< identifier's name */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL);
|
||||
|
||||
ecma_object_t *lex_env_iter_p = lex_env_p;
|
||||
|
||||
@@ -68,7 +68,7 @@ ecma_op_get_identifier_reference (ecma_object_t *lex_env_p, /**< lexical environ
|
||||
ecma_string_t *name_p, /**< identifier's name */
|
||||
bool is_strict) /**< strict reference flag */
|
||||
{
|
||||
JERRY_ASSERT(lex_env_p != NULL);
|
||||
JERRY_ASSERT (lex_env_p != NULL);
|
||||
|
||||
ecma_object_t *base_lex_env_p = ecma_op_resolve_reference_base (lex_env_p, name_p);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_completion_value_t to_str_arg_value = ecma_op_to_string (arguments_list_p [0]);
|
||||
ecma_completion_value_t to_str_arg_value = ecma_op_to_string (arguments_list_p[0]);
|
||||
|
||||
if (ecma_is_completion_value_throw (to_str_arg_value))
|
||||
{
|
||||
@@ -187,7 +187,7 @@ ecma_op_string_object_get_own_property (ecma_object_t *obj_p, /**< the string ob
|
||||
ecma_char_t c = ecma_string_get_char_at_pos (prim_value_str_p, uint32_index);
|
||||
|
||||
// 9.
|
||||
ecma_char_t new_prop_zt_str_p [2] = { c, ECMA_CHAR_NULL };
|
||||
ecma_char_t new_prop_zt_str_p[2] = { c, ECMA_CHAR_NULL };
|
||||
ecma_string_t *new_prop_str_value_p = ecma_new_ecma_string (new_prop_zt_str_p);
|
||||
|
||||
new_prop_p = ecma_create_named_data_property (obj_p,
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
JERRY_ASSERT(ecma_is_completion_value_normal (var ## _completion)); \
|
||||
JERRY_ASSERT (ecma_is_completion_value_normal (var ## _completion)); \
|
||||
\
|
||||
ecma_value_t var __attr_unused___ = ecma_get_completion_value_value (var ## _completion)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user