Remove the usage of ecma_length_t (#4009)

Now the following conventions are applied:
 - passing the number of arguments for a function call is always uint32_t
 - string size/length/position related operation should use lit_utf8_size_t
 - Extended objects internal fields must be uint32_t

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-07-20 16:36:27 +02:00
committed by GitHub
parent 321215fdbb
commit 39cb67397d
110 changed files with 417 additions and 415 deletions
+6
View File
@@ -739,6 +739,12 @@ typedef
char wrong_newlines_again_t;
```
### Type usage conventions
- Passing the number of arguments for a function call is always `uint32_t`
- String size/length/position related operation should use `lit_utf8_size_t`
- Extended objects internal fields must be `uint32_t`
## Function declarations
Function declarations in JerryScript are verbose but this format
+2 -2
View File
@@ -189,7 +189,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
ecma_value_t pattern = ((re_compiled_code_t *) compiled_code_p)->source;
ecma_string_t *pattern_string_p = ecma_get_string_from_value (pattern);
ecma_length_t pattern_size = 0;
lit_utf8_size_t pattern_size = 0;
ECMA_STRING_TO_UTF8_STRING (pattern_string_p, buffer_p, buffer_size);
@@ -219,7 +219,7 @@ snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< compiled
/* Regexp character size is stored in refs. */
copied_code_p->refs = (uint16_t) pattern_size;
pattern_size += (ecma_length_t) sizeof (ecma_compiled_code_t);
pattern_size += (lit_utf8_size_t) sizeof (ecma_compiled_code_t);
copied_code_p->size = (uint16_t) ((pattern_size + JMEM_ALIGNMENT - 1) >> JMEM_ALIGNMENT_LOG);
copied_code_p->status_flags = compiled_code_p->status_flags;
+6 -6
View File
@@ -1200,7 +1200,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
case LIT_MAGIC_STRING_ARRAY_BUFFER_UL:
{
ecma_length_t arraybuffer_length = ext_object_p->u.class_prop.u.length;
uint32_t arraybuffer_length = ext_object_p->u.class_prop.u.length;
if (ECMA_ARRAYBUFFER_HAS_EXTERNAL_MEMORY (ext_object_p))
{
@@ -1340,14 +1340,14 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
{
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
ecma_length_t formal_params_number = ext_object_p->u.pseudo_array.u1.length;
ecma_value_t *arg_Literal_p = (ecma_value_t *) (ext_object_p + 1);
uint32_t formal_params_number = ext_object_p->u.pseudo_array.u1.length;
ecma_value_t *arg_literal_p = (ecma_value_t *) (ext_object_p + 1);
for (ecma_length_t i = 0; i < formal_params_number; i++)
for (uint32_t i = 0; i < formal_params_number; i++)
{
if (arg_Literal_p[i] != ECMA_VALUE_EMPTY)
if (arg_literal_p[i] != ECMA_VALUE_EMPTY)
{
ecma_string_t *name_p = ecma_get_string_from_value (arg_Literal_p[i]);
ecma_string_t *name_p = ecma_get_string_from_value (arg_literal_p[i]);
ecma_deref_ecma_string (name_p);
}
}
+4 -4
View File
@@ -288,7 +288,7 @@ typedef ecma_value_t (*ecma_vm_exec_stop_callback_t) (void *user_p);
typedef ecma_value_t (*ecma_external_handler_t) (const ecma_value_t function_obj,
const ecma_value_t this_val,
const ecma_value_t args_p[],
const ecma_length_t args_count);
const uint32_t args_count);
/**
* Native free callback of an object.
@@ -1851,8 +1851,8 @@ typedef struct
typedef struct
{
ecma_extended_object_t extended_object; /**< extended object part */
ecma_length_t byte_offset; /**< the byteoffset of the above arraybuffer */
ecma_length_t array_length; /**< the array length */
uint32_t byte_offset; /**< the byteoffset of the above arraybuffer */
uint32_t array_length; /**< the array length */
} ecma_extended_typedarray_object_t;
/**
@@ -1867,7 +1867,7 @@ typedef struct
* - This address must be used during indexed read/write operation. */
ecma_typedarray_type_t id; /**< [[TypedArrayName]] internal slot */
uint32_t length; /**< [[ByteLength]] internal slot */
ecma_length_t offset; /**< [[ByteOffset]] internal slot. */
uint32_t offset; /**< [[ByteOffset]] internal slot. */
uint8_t shift; /**< the element size shift in the typedArray */
uint8_t element_size; /**< element size based on [[TypedArrayName]] in Table 49 */
} ecma_typedarray_info_t;
+28 -28
View File
@@ -372,7 +372,7 @@ ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string
{
JERRY_ASSERT (string_p != NULL || string_size == 0);
ecma_length_t converted_string_length = 0;
lit_utf8_size_t converted_string_length = 0;
lit_utf8_size_t converted_string_size = 0;
lit_utf8_size_t pos = 0;
@@ -1057,8 +1057,8 @@ ecma_string_copy_to_utf8_buffer (const ecma_string_t *string_p, /**< ecma-string
*/
lit_utf8_size_t
ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
ecma_length_t start_pos, /**< position of the first character */
ecma_length_t end_pos, /**< position of the last character */
lit_utf8_size_t start_pos, /**< position of the first character */
lit_utf8_size_t end_pos, /**< position of the last character */
lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
* (can be NULL if buffer_size == 0) */
lit_utf8_size_t buffer_size) /**< size of buffer */
@@ -1066,7 +1066,7 @@ ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, /**< ec
JERRY_ASSERT (string_desc_p != NULL);
JERRY_ASSERT (buffer_p != NULL || buffer_size == 0);
ecma_length_t string_length = ecma_string_get_length (string_desc_p);
lit_utf8_size_t string_length = ecma_string_get_length (string_desc_p);
lit_utf8_size_t size = 0;
if (start_pos >= string_length || start_pos >= end_pos)
@@ -1136,8 +1136,8 @@ ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p, /**< ec
*/
lit_utf8_size_t
ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, /**< ecma-string descriptor */
ecma_length_t start_pos, /**< position of the first character */
ecma_length_t end_pos, /**< position of the last character */
lit_utf8_size_t start_pos, /**< position of the first character */
lit_utf8_size_t end_pos, /**< position of the last character */
lit_utf8_byte_t *buffer_p, /**< destination buffer pointer
* (can be NULL if buffer_size == 0) */
lit_utf8_size_t buffer_size) /**< size of buffer */
@@ -1148,7 +1148,7 @@ ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, /**< ecm
lit_utf8_size_t size = 0;
ecma_length_t utf8_str_length = ecma_string_get_utf8_length (string_desc_p);
lit_utf8_size_t utf8_str_length = ecma_string_get_utf8_length (string_desc_p);
if (start_pos >= utf8_str_length || start_pos >= end_pos)
{
@@ -1161,7 +1161,7 @@ ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p, /**< ecm
}
ECMA_STRING_TO_UTF8_STRING (string_desc_p, cesu8_str_p, cesu8_str_size);
ecma_length_t cesu8_str_length = ecma_string_get_length (string_desc_p);
lit_utf8_size_t cesu8_str_length = ecma_string_get_length (string_desc_p);
if (cesu8_str_length == cesu8_str_size)
{
@@ -1280,12 +1280,12 @@ ecma_string_to_utf8_bytes (const ecma_string_t *string_desc_p, /**< ecma-string
*
* @return size in bytes
*/
static inline ecma_length_t JERRY_ATTR_ALWAYS_INLINE
static inline lit_utf8_size_t JERRY_ATTR_ALWAYS_INLINE
ecma_string_get_uint32_size (const uint32_t uint32_number) /**< number in the string-descriptor */
{
uint32_t prev_number = 1;
uint32_t next_number = 100;
ecma_length_t size = 1;
lit_utf8_size_t size = 1;
const uint32_t max_size = 9;
@@ -1330,7 +1330,7 @@ ecma_string_get_chars (const ecma_string_t *string_p, /**< ecma-string */
* uint32 string descriptor */
uint8_t *flags_p) /**< [in,out] any combination of ecma_string_flag_t bits */
{
ecma_length_t length;
lit_utf8_size_t length;
lit_utf8_size_t size;
const lit_utf8_byte_t *result_p;
@@ -1896,7 +1896,7 @@ ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, /**< ecma-
*
* @return number of characters in the string
*/
static ecma_length_t
static lit_utf8_size_t
ecma_string_get_ascii_size (const ecma_string_t *string_p) /**< ecma-string */
{
if (ECMA_IS_DIRECT_STRING (string_p))
@@ -1945,10 +1945,10 @@ ecma_string_get_ascii_size (const ecma_string_t *string_p) /**< ecma-string */
*
* @return number of characters in the string
*/
ecma_length_t
lit_utf8_size_t
ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
{
ecma_length_t length = ecma_string_get_ascii_size (string_p);
lit_utf8_size_t length = ecma_string_get_ascii_size (string_p);
if (length != ECMA_STRING_NO_ASCII_SIZE)
{
@@ -1967,12 +1967,12 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
if (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_HEAP_UTF8_STRING)
{
return (ecma_length_t) (((ecma_utf8_string_t *) string_p)->length);
return (lit_utf8_size_t) (((ecma_utf8_string_t *) string_p)->length);
}
if (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_HEAP_LONG_UTF8_STRING)
{
return (ecma_length_t) (((ecma_long_utf8_string_t *) string_p)->length);
return (lit_utf8_size_t) (((ecma_long_utf8_string_t *) string_p)->length);
}
JERRY_ASSERT (ECMA_STRING_GET_CONTAINER (string_p) == ECMA_STRING_CONTAINER_MAGIC_STRING_EX);
@@ -1987,10 +1987,10 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
*
* @return number of characters in the UTF-8 encoded string
*/
ecma_length_t
lit_utf8_size_t
ecma_string_get_utf8_length (const ecma_string_t *string_p) /**< ecma-string */
{
ecma_length_t length = ecma_string_get_ascii_size (string_p);
lit_utf8_size_t length = ecma_string_get_ascii_size (string_p);
if (length != ECMA_STRING_NO_ASCII_SIZE)
{
@@ -2013,7 +2013,7 @@ ecma_string_get_utf8_length (const ecma_string_t *string_p) /**< ecma-string */
if (utf8_string_p->size == utf8_string_p->length)
{
return (ecma_length_t) (utf8_string_p->length);
return (lit_utf8_size_t) (utf8_string_p->length);
}
return lit_get_utf8_length_of_cesu8_string (ECMA_UTF8_STRING_GET_BUFFER (string_p), utf8_string_p->size);
@@ -2025,7 +2025,7 @@ ecma_string_get_utf8_length (const ecma_string_t *string_p) /**< ecma-string */
if (long_utf8_string_p->size == long_utf8_string_p->length)
{
return (ecma_length_t) (long_utf8_string_p->length);
return (lit_utf8_size_t) (long_utf8_string_p->length);
}
return lit_get_utf8_length_of_cesu8_string (ECMA_LONG_UTF8_STRING_GET_BUFFER (string_p),
@@ -2048,7 +2048,7 @@ ecma_string_get_utf8_length (const ecma_string_t *string_p) /**< ecma-string */
lit_utf8_size_t
ecma_string_get_size (const ecma_string_t *string_p) /**< ecma-string */
{
ecma_length_t length = ecma_string_get_ascii_size (string_p);
lit_utf8_size_t length = ecma_string_get_ascii_size (string_p);
if (length != ECMA_STRING_NO_ASCII_SIZE)
{
@@ -2086,7 +2086,7 @@ ecma_string_get_size (const ecma_string_t *string_p) /**< ecma-string */
lit_utf8_size_t
ecma_string_get_utf8_size (const ecma_string_t *string_p) /**< ecma-string */
{
ecma_length_t length = ecma_string_get_ascii_size (string_p);
lit_utf8_size_t length = ecma_string_get_ascii_size (string_p);
if (length != ECMA_STRING_NO_ASCII_SIZE)
{
@@ -2142,7 +2142,7 @@ ecma_string_get_utf8_size (const ecma_string_t *string_p) /**< ecma-string */
*/
static ecma_char_t JERRY_ATTR_NOINLINE
ecma_external_string_get_char_at_pos (lit_utf8_size_t id, /**< id of the external magic string */
ecma_length_t index) /**< index of character */
lit_utf8_size_t index) /**< index of character */
{
id -= LIT_MAGIC_STRING__COUNT;
const lit_utf8_byte_t *data_p = lit_get_magic_string_ex_utf8 (id);
@@ -2164,7 +2164,7 @@ ecma_external_string_get_char_at_pos (lit_utf8_size_t id, /**< id of the externa
*/
ecma_char_t
ecma_string_get_char_at_pos (const ecma_string_t *string_p, /**< ecma-string */
ecma_length_t index) /**< index of character */
lit_utf8_size_t index) /**< index of character */
{
JERRY_ASSERT (index < ecma_string_get_length (string_p));
@@ -2297,10 +2297,10 @@ ecma_string_hash (const ecma_string_t *string_p) /**< ecma-string to calculate h
*/
ecma_string_t *
ecma_string_substr (const ecma_string_t *string_p, /**< pointer to an ecma string */
ecma_length_t start_pos, /**< start position, should be less or equal than string length */
ecma_length_t end_pos) /**< end position, should be less or equal than string length */
lit_utf8_size_t start_pos, /**< start position, should be less or equal than string length */
lit_utf8_size_t end_pos) /**< end position, should be less or equal than string length */
{
const ecma_length_t string_length = ecma_string_get_length (string_p);
const lit_utf8_size_t string_length = ecma_string_get_length (string_p);
JERRY_ASSERT (start_pos <= string_length);
JERRY_ASSERT (end_pos <= string_length);
@@ -2767,7 +2767,7 @@ ecma_op_advance_string_index (ecma_string_t *str_p, /**< input string */
return next_index;
}
ecma_length_t str_len = ecma_string_get_length (str_p);
lit_utf8_size_t str_len = ecma_string_get_length (str_p);
if (next_index >= str_len)
{
+1 -1
View File
@@ -1489,7 +1489,7 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b
*
* @return number of formal parameters
*/
ecma_length_t
uint32_t
ecma_compiled_code_get_formal_params (const ecma_compiled_code_t *bytecode_header_p) /**< compiled code */
{
if (!(bytecode_header_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED))
+9 -9
View File
@@ -336,14 +336,14 @@ ecma_string_copy_to_utf8_buffer (const ecma_string_t *string_desc_p,
lit_utf8_size_t buffer_size);
lit_utf8_size_t
ecma_substring_copy_to_cesu8_buffer (const ecma_string_t *string_desc_p,
ecma_length_t start_pos,
ecma_length_t end_pos,
lit_utf8_size_t start_pos,
lit_utf8_size_t end_pos,
lit_utf8_byte_t *buffer_p,
lit_utf8_size_t buffer_size);
lit_utf8_size_t
ecma_substring_copy_to_utf8_buffer (const ecma_string_t *string_desc_p,
ecma_length_t start_pos,
ecma_length_t end_pos,
lit_utf8_size_t start_pos,
lit_utf8_size_t end_pos,
lit_utf8_byte_t *buffer_p,
lit_utf8_size_t buffer_size);
void ecma_string_to_utf8_bytes (const ecma_string_t *string_desc_p, lit_utf8_byte_t *buffer_p,
@@ -367,16 +367,16 @@ bool ecma_string_compare_to_property_name (ecma_property_t property, jmem_cpoint
bool ecma_compare_ecma_strings (const ecma_string_t *string1_p, const ecma_string_t *string2_p);
bool ecma_compare_ecma_non_direct_strings (const ecma_string_t *string1_p, const ecma_string_t *string2_p);
bool ecma_compare_ecma_strings_relational (const ecma_string_t *string1_p, const ecma_string_t *string2_p);
ecma_length_t ecma_string_get_length (const ecma_string_t *string_p);
ecma_length_t ecma_string_get_utf8_length (const ecma_string_t *string_p);
lit_utf8_size_t ecma_string_get_length (const ecma_string_t *string_p);
lit_utf8_size_t ecma_string_get_utf8_length (const ecma_string_t *string_p);
lit_utf8_size_t ecma_string_get_size (const ecma_string_t *string_p);
lit_utf8_size_t ecma_string_get_utf8_size (const ecma_string_t *string_p);
ecma_char_t ecma_string_get_char_at_pos (const ecma_string_t *string_p, ecma_length_t index);
ecma_char_t ecma_string_get_char_at_pos (const ecma_string_t *string_p, lit_utf8_size_t index);
lit_magic_string_id_t ecma_get_string_magic (const ecma_string_t *string_p);
lit_string_hash_t ecma_string_hash (const ecma_string_t *string_p);
ecma_string_t *ecma_string_substr (const ecma_string_t *string_p, ecma_length_t start_pos, ecma_length_t end_pos);
ecma_string_t *ecma_string_substr (const ecma_string_t *string_p, lit_utf8_size_t start_pos, lit_utf8_size_t end_pos);
void ecma_string_trim_helper (const lit_utf8_byte_t **utf8_str_p,
lit_utf8_size_t *utf8_str_size);
ecma_string_t *ecma_string_trim (const ecma_string_t *string_p);
@@ -502,7 +502,7 @@ void ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p);
ecma_collection_t *ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *bytecode_header_p);
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_ESNEXT)
ecma_length_t ecma_compiled_code_get_formal_params (const ecma_compiled_code_t *bytecode_p);
uint32_t ecma_compiled_code_get_formal_params (const ecma_compiled_code_t *bytecode_p);
ecma_value_t *ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode_header_p);
ecma_value_t *ecma_compiled_code_resolve_function_name (const ecma_compiled_code_t *bytecode_header_p);
#endif /* ENABLED (JERRY_ESNEXT) */
+2 -2
View File
@@ -453,7 +453,7 @@ ecma_save_literals_for_snapshot (ecma_collection_t *lit_pool_p, /**< list of kno
}
lit_mem_to_snapshot_id_map_entry_t *map_p;
ecma_length_t total_count = lit_pool_p->item_count;
uint32_t total_count = lit_pool_p->item_count;
map_p = jmem_heap_alloc_block (total_count * sizeof (lit_mem_to_snapshot_id_map_entry_t));
@@ -475,7 +475,7 @@ ecma_save_literals_for_snapshot (ecma_collection_t *lit_pool_p, /**< list of kno
map_p->literal_id = lit_buffer_p[i];
map_p->literal_offset = (literal_offset << JERRY_SNAPSHOT_LITERAL_SHIFT) | ECMA_TYPE_SNAPSHOT_OFFSET;
ecma_length_t length;
lit_utf8_size_t length;
if (ecma_is_value_float_number (lit_buffer_p[i]))
{
@@ -218,7 +218,7 @@ ecma_builtin_array_prototype_object_to_locale_string (ecma_object_t *obj_p, /**<
*/
static ecma_value_t
ecma_builtin_array_prototype_object_concat (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p) /**< array object */
{
/* 2. */
@@ -472,7 +472,7 @@ ecma_builtin_array_prototype_object_pop (ecma_object_t *obj_p, /**< array object
*/
static ecma_value_t
ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /**< arguments list */
ecma_length_t arguments_number, /**< number of arguments */
uint32_t arguments_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t length) /**< array object's length */
{
@@ -1259,7 +1259,7 @@ clean_up:
*/
static ecma_value_t
ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -1380,11 +1380,11 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
#endif /* ENABLED (JERRY_ESNEXT) */
/* 11. */
ecma_length_t item_count;
uint32_t item_count;
if (args_number > 2)
{
item_count = (ecma_length_t) (args_number - 2);
item_count = (uint32_t) (args_number - 2);
}
else
{
@@ -1489,8 +1489,8 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
}
/* 15. */
ecma_length_t idx = 0;
for (ecma_length_t arg_index = 2; arg_index < args_number; arg_index++, idx++)
uint32_t idx = 0;
for (uint32_t arg_index = 2; arg_index < args_number; arg_index++, idx++)
{
ecma_value_t put_value = ecma_op_object_put_by_uint32_index (obj_p,
(uint32_t) (start + idx),
@@ -1527,7 +1527,7 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
*/
static ecma_value_t
ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -1635,7 +1635,7 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg
*/
static ecma_value_t
ecma_builtin_array_prototype_object_index_of (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -1740,7 +1740,7 @@ ecma_builtin_array_prototype_object_index_of (const ecma_value_t args[], /**< ar
*/
static ecma_value_t
ecma_builtin_array_prototype_object_last_index_of (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -2142,7 +2142,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
*/
static ecma_value_t
ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's arguments */
ecma_length_t args_number, /**< arguments list length */
uint32_t args_number, /**< arguments list length */
bool start_from_left, /**< whether the reduce starts from left or right */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
@@ -2436,7 +2436,7 @@ ecma_builtin_array_prototype_object_find (ecma_value_t predicate, /**< callback
*/
static ecma_value_t
ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -2592,7 +2592,7 @@ ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**<
*/
static ecma_value_t
ecma_builtin_array_prototype_includes (const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number, /**< number of arguments */
uint32_t args_number, /**< number of arguments */
ecma_object_t *obj_p, /**< array object */
uint32_t len) /**< array object's length */
{
@@ -2678,7 +2678,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
ecma_value_t obj_this = ecma_op_to_object (this_arg);
@@ -78,7 +78,7 @@ ecma_builtin_array_object_is_array (ecma_value_t this_arg, /**< 'this' argument
static ecma_value_t
ecma_builtin_array_object_from (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
/* 1. */
ecma_value_t constructor = this_arg;
@@ -408,7 +408,7 @@ cleanup:
static ecma_value_t
ecma_builtin_array_object_of (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
if (!ecma_is_constructor (this_arg))
{
@@ -485,7 +485,7 @@ ecma_builtin_array_species_get (ecma_value_t this_value) /**< This Value */
*/
ecma_value_t
ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -499,7 +499,7 @@ ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
*/
ecma_value_t
ecma_builtin_array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -65,7 +65,7 @@ ecma_builtin_arraybuffer_prototype_bytelength_getter (ecma_value_t this_arg) /**
{
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
}
ecma_length_t len = ecma_arraybuffer_get_length (object_p);
uint32_t len = ecma_arraybuffer_get_length (object_p);
return ecma_make_uint32_value (len);
}
@@ -105,9 +105,9 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
}
ecma_length_t len = ecma_arraybuffer_get_length (object_p);
uint32_t len = ecma_arraybuffer_get_length (object_p);
ecma_length_t start = 0, end = len;
uint32_t start = 0, end = len;
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
@@ -134,7 +134,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
}
JERRY_ASSERT (start <= len && end <= len);
ecma_length_t new_len = (end >= start) ? (end - start) : 0;
uint32_t new_len = (end >= start) ? (end - start) : 0;
ecma_object_t *new_arraybuffer_p = ecma_arraybuffer_new_object (new_len);
lit_utf8_byte_t *old_buf = ecma_arraybuffer_get_buffer (object_p);
lit_utf8_byte_t *new_buf = ecma_arraybuffer_get_buffer (new_arraybuffer_p);
@@ -72,7 +72,7 @@ ecma_builtin_arraybuffer_object_is_view (ecma_value_t this_arg, /**< 'this' argu
*/
ecma_value_t
ecma_builtin_arraybuffer_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -86,7 +86,7 @@ ecma_builtin_arraybuffer_dispatch_call (const ecma_value_t *arguments_list_p, /*
*/
ecma_value_t
ecma_builtin_arraybuffer_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_async_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -60,7 +60,7 @@ ecma_builtin_async_function_dispatch_call (const ecma_value_t *arguments_list_p,
*/
ecma_value_t
ecma_builtin_async_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_async_function_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_async_function_dispatch_construct */
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_async_generator_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -60,7 +60,7 @@ ecma_builtin_async_generator_function_dispatch_call (const ecma_value_t *argumen
*/
ecma_value_t
ecma_builtin_async_generator_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_async_generator_function_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_async_generator_function_dispatch_construct */
@@ -91,8 +91,8 @@ ecma_builtin_async_generator_prototype_dispatch_routine (uint16_t builtin_routin
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to
* routine */
ecma_length_t arguments_number) /**< length of arguments'
* list */
uint32_t arguments_number) /**< length of arguments'
* list */
{
JERRY_UNUSED (arguments_number);
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -76,7 +76,7 @@ ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
*/
ecma_value_t
ecma_builtin_boolean_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -142,7 +142,7 @@ ecma_builtin_dataview_prototype_dispatch_routine (uint16_t builtin_routine_id, /
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
ecma_value_t byte_offset = arguments_number > 0 ? arguments_list_p[0] : ECMA_VALUE_UNDEFINED;
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_dataview_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -57,7 +57,7 @@ ecma_builtin_dataview_dispatch_call (const ecma_value_t *arguments_list_p, /**<
*/
ecma_value_t
ecma_builtin_dataview_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_dataview_create (arguments_list_p, arguments_list_len);
} /* ecma_builtin_dataview_dispatch_construct */
@@ -340,10 +340,10 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
ecma_number_t date_num, /**< date converted to number */
const ecma_value_t arguments_list[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
ecma_number_t converted_number[4];
ecma_length_t conversions = 0;
uint32_t conversions = 0;
/* If the first argument is not specified, it is always converted to NaN. */
converted_number[0] = ecma_number_make_nan ();
@@ -392,7 +392,7 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
conversions = arguments_number;
}
for (ecma_length_t i = 0; i < conversions; i++)
for (uint32_t i = 0; i < conversions; i++)
{
ecma_value_t value = ecma_op_to_number (arguments_list[i]);
@@ -591,7 +591,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
if (JERRY_UNLIKELY (builtin_routine_id == ECMA_DATE_PROTOTYPE_TO_JSON))
{
@@ -195,7 +195,7 @@ ecma_date_parse_month_name (const lit_utf8_byte_t **str_p, /**< pointer to the c
*/
static ecma_value_t
ecma_date_construct_helper (const ecma_value_t *args, /**< arguments passed to the Date constructor */
ecma_length_t args_len) /**< number of arguments */
uint32_t args_len) /**< number of arguments */
{
ecma_number_t date_nums[7] =
{
@@ -301,8 +301,8 @@ ecma_builtin_date_parse_ISO_string_format (const lit_utf8_byte_t *date_str_curr_
ecma_number_t seconds = ECMA_NUMBER_ZERO;
ecma_number_t milliseconds = ECMA_NUMBER_ZERO;
ecma_length_t remaining_length = lit_utf8_string_length (date_str_curr_p,
(lit_utf8_size_t) (date_str_end_p - date_str_curr_p));
lit_utf8_size_t remaining_length = lit_utf8_string_length (date_str_curr_p,
(lit_utf8_size_t) (date_str_end_p - date_str_curr_p));
if (remaining_length >= 5)
{
@@ -613,7 +613,7 @@ ecma_builtin_date_parse (ecma_value_t this_arg, /**< this argument */
static ecma_value_t
ecma_builtin_date_utc (ecma_value_t this_arg, /**< this argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
JERRY_UNUSED (this_arg);
@@ -677,7 +677,7 @@ ecma_builtin_date_now (ecma_value_t this_arg) /**< this argument */
*/
ecma_value_t
ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_UNUSED (arguments_list_p);
JERRY_UNUSED (arguments_list_len);
@@ -698,7 +698,7 @@ ecma_builtin_date_dispatch_call (const ecma_value_t *arguments_list_p, /**< argu
*/
ecma_value_t
ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
#if ENABLED (JERRY_ESNEXT)
JERRY_ASSERT (JERRY_CONTEXT (current_new_target));
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_COMMON, arguments_list_p, arguments_list_len);
} /* ecma_builtin_error_dispatch_call */
@@ -61,7 +61,7 @@ ecma_builtin_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
*/
ecma_value_t
ecma_builtin_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_error_dispatch_construct */
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_eval_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_EVAL, arguments_list_p, arguments_list_len);
} /* ecma_builtin_eval_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_eval_error_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_eval_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_eval_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_eval_error_dispatch_construct */
@@ -177,7 +177,7 @@ ecma_builtin_function_prototype_object_apply (ecma_object_t *func_obj_p, /**< th
static ecma_value_t
ecma_builtin_function_prototype_object_call (ecma_object_t *func_obj_p , /**< this argument object */
const ecma_value_t *arguments_list_p, /**< list of arguments */
ecma_length_t arguments_number) /**< number of arguments */
uint32_t arguments_number) /**< number of arguments */
{
if (arguments_number == 0)
{
@@ -191,7 +191,7 @@ ecma_builtin_function_prototype_object_call (ecma_object_t *func_obj_p , /**< th
return ecma_op_function_call (func_obj_p,
arguments_list_p[0],
arguments_list_p + 1,
(ecma_length_t) (arguments_number - 1u));
(uint32_t) (arguments_number - 1u));
} /* ecma_builtin_function_prototype_object_call */
/**
@@ -206,7 +206,7 @@ ecma_builtin_function_prototype_object_call (ecma_object_t *func_obj_p , /**< th
static ecma_value_t
ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**< this argument object */
const ecma_value_t *arguments_list_p, /**< list of arguments */
ecma_length_t arguments_number) /**< number of arguments */
uint32_t arguments_number) /**< number of arguments */
{
/* 4. 11. 18. */
ecma_object_t *prototype_obj_p;
@@ -287,7 +287,7 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
bound_func_p->header.u.bound_function.args_len_or_this = ECMA_VALUE_UNDEFINED;
ecma_value_t *args_p = (ecma_value_t *) (bound_func_p + 1);
for (ecma_length_t i = 0; i < arguments_number; i++)
for (uint32_t i = 0; i < arguments_number; i++)
{
*args_p++ = ecma_copy_value_if_not_object (arguments_list_p[i]);
}
@@ -390,7 +390,7 @@ ecma_builtin_function_prototype_object_bind (ecma_object_t *this_arg_obj_p , /**
*/
ecma_value_t
ecma_builtin_function_prototype_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -404,7 +404,7 @@ ecma_builtin_function_prototype_dispatch_call (const ecma_value_t *arguments_lis
*/
ecma_value_t
ecma_builtin_function_prototype_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -423,7 +423,7 @@ ecma_builtin_function_prototype_dispatch_routine (uint16_t builtin_routine_id, /
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
if (!ecma_op_is_callable (this_arg))
{
@@ -48,7 +48,7 @@
*/
ecma_value_t
ecma_builtin_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -65,7 +65,7 @@ ecma_builtin_function_dispatch_call (const ecma_value_t *arguments_list_p, /**<
*/
ecma_value_t
ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_create_dynamic_function (arguments_list_p, arguments_list_len, ECMA_PARSE_NO_OPTS);
} /* ecma_builtin_function_dispatch_construct */
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_generator_function_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -58,7 +58,7 @@ ecma_builtin_generator_function_dispatch_call (const ecma_value_t *arguments_lis
*/
ecma_value_t
ecma_builtin_generator_function_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_generator_function_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_generator_function_dispatch_construct */
@@ -205,7 +205,7 @@ ecma_builtin_generator_prototype_dispatch_routine (uint16_t builtin_routine_id,
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
@@ -595,7 +595,7 @@ ecma_builtin_global_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_list_p);
@@ -40,7 +40,7 @@
ecma_value_t
ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, /**< native error type */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -414,11 +414,11 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
* - The String.prototype.substring routine.
* - The ecma_builtin_helper_string_prototype_object_index_of helper routine.
*
* @return uint32_t - the normalized value of the index
* @return lit_utf8_size_t - the normalized value of the index
*/
uint32_t
lit_utf8_size_t
ecma_builtin_helper_string_index_normalize (ecma_number_t index, /**< index */
uint32_t length, /**< string's length */
lit_utf8_size_t length, /**< string's length */
bool nan_to_zero) /**< whether NaN is mapped to zero (t) or length (f) */
{
uint32_t norm_index = 0;
@@ -477,7 +477,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
ecma_string_index_of_mode_t mode) /**< routine's mode */
{
/* 5 (indexOf) -- 6 (lastIndexOf) */
const ecma_length_t original_len = ecma_string_get_length (original_str_p);
const lit_utf8_size_t original_len = ecma_string_get_length (original_str_p);
#if ENABLED (JERRY_ESNEXT)
/* 4, 6 (startsWith, includes, endsWith) */
@@ -532,11 +532,11 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
bool use_first_index = mode != ECMA_STRING_LAST_INDEX_OF;
/* 4b, 6 (indexOf) - 4b, 5, 7 (lastIndexOf) */
ecma_length_t start = ecma_builtin_helper_string_index_normalize (pos_num, original_len, use_first_index);
lit_utf8_size_t start = ecma_builtin_helper_string_index_normalize (pos_num, original_len, use_first_index);
ecma_number_t ret_num = ECMA_NUMBER_MINUS_ONE;
ecma_length_t index_of = 0;
lit_utf8_size_t index_of = 0;
ret_value = ECMA_VALUE_FALSE;
@@ -545,7 +545,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
#if ENABLED (JERRY_ESNEXT)
case ECMA_STRING_STARTS_WITH:
{
const ecma_length_t search_len = ecma_string_get_length (search_str_p);
const lit_utf8_size_t search_len = ecma_string_get_length (search_str_p);
if (search_len + start > original_len)
{
@@ -574,7 +574,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
start = original_len;
}
ecma_length_t search_str_len = ecma_string_get_length (search_str_p);
lit_utf8_size_t search_str_len = ecma_string_get_length (search_str_p);
if (search_str_len == 0)
{
@@ -589,9 +589,9 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
break;
}
if (ecma_builtin_helper_string_find_index (original_str_p, search_str_p, true,
(ecma_length_t) start_ends_with, &index_of))
(lit_utf8_size_t) start_ends_with, &index_of))
{
ret_value = ecma_make_boolean_value (index_of == (ecma_length_t) start_ends_with);
ret_value = ecma_make_boolean_value (index_of == (lit_utf8_size_t) start_ends_with);
}
break;
}
@@ -637,12 +637,12 @@ bool
ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, /**< index */
ecma_string_t *search_str_p, /**< string's length */
bool first_index, /**< whether search for first (t) or last (f) index */
ecma_length_t start_pos, /**< start position */
ecma_length_t *ret_index_p) /**< [out] position found in original string */
lit_utf8_size_t start_pos, /**< start position */
lit_utf8_size_t *ret_index_p) /**< [out] position found in original string */
{
bool match_found = false;
const ecma_length_t original_len = ecma_string_get_length (original_str_p);
const ecma_length_t search_len = ecma_string_get_length (search_str_p);
const lit_utf8_size_t original_len = ecma_string_get_length (original_str_p);
const lit_utf8_size_t search_len = ecma_string_get_length (search_str_p);
if (search_len <= original_len)
{
@@ -656,10 +656,10 @@ ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, /**< index
/* create utf8 string from original string and advance to position */
ECMA_STRING_TO_UTF8_STRING (original_str_p, original_str_utf8_p, original_str_size);
ecma_length_t index = start_pos;
lit_utf8_size_t index = start_pos;
const lit_utf8_byte_t *original_str_curr_p = original_str_utf8_p;
for (ecma_length_t idx = 0; idx < index; idx++)
for (lit_utf8_size_t idx = 0; idx < index; idx++)
{
lit_utf8_incr (&original_str_curr_p);
}
@@ -675,7 +675,7 @@ ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, /**< index
while (searching)
{
/* match as long as possible */
ecma_length_t match_len = 0;
lit_utf8_size_t match_len = 0;
const lit_utf8_byte_t *stored_original_str_curr_p = original_str_curr_p;
if (match_len < search_len &&
@@ -58,7 +58,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
ecma_value_t arg2, ecma_string_index_of_mode_t mode);
bool
ecma_builtin_helper_string_find_index (ecma_string_t *original_str_p, ecma_string_t *search_str_p, bool first_index,
ecma_length_t start_pos, ecma_length_t *ret_index_p);
lit_utf8_size_t start_pos, lit_utf8_size_t *ret_index_p);
ecma_value_t
ecma_builtin_helper_def_prop (ecma_object_t *obj_p, ecma_string_t *name_p, ecma_value_t value, uint32_t opts);
@@ -227,7 +227,7 @@ ecma_builtin_helper_json_create_non_formatted_json (lit_utf8_byte_t left_bracket
ecma_value_t
ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, const ecma_value_t *arguments_list_p,
ecma_length_t arguments_list_len);
uint32_t arguments_list_len);
/* ecma-builtin-helpers-sort.c */
@@ -40,7 +40,7 @@
#define ROUTINE_ARG_LIST_2 ROUTINE_ARG_LIST_1 ROUTINE_ARG(2)
#define ROUTINE_ARG_LIST_3 ROUTINE_ARG_LIST_2 ROUTINE_ARG(3)
#define ROUTINE_ARG_LIST_NON_FIXED ROUTINE_ARG_LIST_0, \
const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len
const ecma_value_t *arguments_list_p, uint32_t arguments_list_len
#define ROUTINE(name, c_function_name, args_number, length_prop_value) \
static ecma_value_t c_function_name (ROUTINE_ARG_LIST_ ## args_number);
#define ROUTINE_CONFIGURABLE_ONLY(name, c_function_name, args_number, length_prop_value) \
@@ -236,8 +236,8 @@ DISPATCH_ROUTINE_ROUTINE_NAME (uint16_t builtin_routine_id, /**< built-in wide r
value */
const ecma_value_t arguments_list[], /**< list of arguments
passed to routine */
ecma_length_t arguments_number) /**< length of
arguments' list */
uint32_t arguments_number) /**< length of
* arguments' list */
{
/* the arguments may be unused for some built-ins */
JERRY_UNUSED (this_arg_value);
@@ -120,7 +120,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint16_t builtin_routine_id, /**< built
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
@@ -1668,7 +1668,7 @@ ecma_builtin_json_stringify (ecma_value_t this_arg, /**< 'this' argument */
else if (ecma_is_value_string (space))
{
ecma_string_t *space_str_p = ecma_get_string_from_value (space);
ecma_length_t num_of_chars = ecma_string_get_length (space_str_p);
lit_utf8_size_t num_of_chars = ecma_string_get_length (space_str_p);
if (num_of_chars < 10)
{
@@ -50,7 +50,7 @@ ecma_builtin_map_prototype_dispatch_routine (uint16_t builtin_routine_id, /**< b
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
return ecma_builtin_container_dispatch_routine (builtin_routine_id,
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_map_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -57,7 +57,7 @@ ecma_builtin_map_dispatch_call (const ecma_value_t *arguments_list_p, /**< argum
*/
ecma_value_t
ecma_builtin_map_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_container_create (arguments_list_p,
arguments_list_len,
@@ -120,7 +120,7 @@ enum
static ecma_value_t
ecma_builtin_math_object_max_min (bool is_max, /**< 'max' or 'min' operation */
const ecma_value_t *arg, /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
ecma_number_t result_num = ecma_number_make_infinity (is_max);
bool nan_found = false;
@@ -195,7 +195,7 @@ ecma_builtin_math_object_max_min (bool is_max, /**< 'max' or 'min' operation */
*/
static ecma_value_t
ecma_builtin_math_object_hypot (const ecma_value_t *arg, /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
if (args_number == 0)
{
@@ -340,7 +340,7 @@ ecma_builtin_math_dispatch_routine (uint16_t builtin_routine_id, /**< built-in w
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
@@ -247,7 +247,7 @@ ecma_builtin_number_prototype_helper_round (lit_utf8_byte_t *digits_p, /**< [in,
static ecma_value_t
ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /**< this argument number */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
static const lit_utf8_byte_t digit_chars[36] =
{
@@ -977,7 +977,7 @@ ecma_builtin_number_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
ecma_value_t this_value = ecma_builtin_number_prototype_object_value_of (this_arg);
@@ -53,7 +53,7 @@
*/
ecma_value_t
ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -78,7 +78,7 @@ ecma_builtin_number_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
*/
ecma_value_t
ecma_builtin_number_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -215,7 +215,7 @@ ecma_builtin_object_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
@@ -94,7 +94,7 @@ enum
*/
ecma_value_t
ecma_builtin_object_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -115,7 +115,7 @@ ecma_builtin_object_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
*/
ecma_value_t
ecma_builtin_object_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -1048,7 +1048,7 @@ ecma_builtin_object_object_define_property (ecma_object_t *obj_p, /**< routine's
static ecma_value_t
ecma_builtin_object_object_assign (ecma_object_t *target_p, /**< target object */
const ecma_value_t arguments_list_p[], /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
@@ -1178,7 +1178,7 @@ ecma_builtin_object_dispatch_routine (uint16_t builtin_routine_id, /**< built-in
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_list_p);
@@ -453,7 +453,7 @@ ecma_builtin_promise_all (ecma_value_t this_arg, /**< 'this' argument */
*/
ecma_value_t
ecma_builtin_promise_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -467,7 +467,7 @@ ecma_builtin_promise_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
*/
ecma_value_t
ecma_builtin_promise_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -76,7 +76,7 @@ ecma_builtin_proxy_object_revocable (ecma_value_t this_arg, /**< 'this' argument
*/
ecma_value_t
ecma_builtin_proxy_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -95,7 +95,7 @@ ecma_builtin_proxy_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
*/
ecma_value_t
ecma_builtin_proxy_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_range_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_RANGE, arguments_list_p, arguments_list_len);
} /* ecma_builtin_range_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_range_error_dispatch_call (const ecma_value_t *arguments_list_p, /*
*/
ecma_value_t
ecma_builtin_range_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_range_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_range_error_dispatch_construct */
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_reference_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_REFERENCE, arguments_list_p, arguments_list_len);
} /* ecma_builtin_reference_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_reference_error_dispatch_call (const ecma_value_t *arguments_list_p
*/
ecma_value_t
ecma_builtin_reference_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_reference_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_reference_error_dispatch_construct */
@@ -82,7 +82,7 @@ ecma_builtin_reflect_dispatch_routine (uint16_t builtin_routine_id, /**< built-i
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (this_arg);
JERRY_UNUSED (arguments_number);
@@ -45,7 +45,7 @@
static ecma_value_t
ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
ecma_value_t pattern_value = ECMA_VALUE_UNDEFINED;
ecma_value_t flags_value = ECMA_VALUE_UNDEFINED;
@@ -199,7 +199,7 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
*/
ecma_value_t
ecma_builtin_regexp_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_regexp_dispatch_helper (arguments_list_p,
arguments_list_len);
@@ -213,7 +213,7 @@ ecma_builtin_regexp_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
*/
ecma_value_t
ecma_builtin_regexp_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_regexp_dispatch_helper (arguments_list_p,
arguments_list_len);
@@ -49,7 +49,7 @@ ecma_builtin_set_prototype_dispatch_routine (uint16_t builtin_routine_id, /**< b
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
return ecma_builtin_container_dispatch_routine (builtin_routine_id,
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_set_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -57,7 +57,7 @@ ecma_builtin_set_dispatch_call (const ecma_value_t *arguments_list_p, /**< argum
*/
ecma_value_t
ecma_builtin_set_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_container_create (arguments_list_p,
arguments_list_len,
@@ -80,7 +80,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
ecma_string_t *string_p = ecma_get_string_from_value (iterated_value);
/* 6. */
ecma_length_t position = ext_obj_p->u.pseudo_array.u1.iterator_index;
lit_utf8_size_t position = ext_obj_p->u.pseudo_array.u1.iterator_index;
if (JERRY_UNLIKELY (position == ECMA_ITERATOR_INDEX_LIMIT))
{
@@ -88,7 +88,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
}
/* 7. */
ecma_length_t len = ecma_string_get_length (string_p);
lit_utf8_size_t len = ecma_string_get_length (string_p);
/* 8. */
if (position >= len)
@@ -102,7 +102,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
ecma_char_t first = ecma_string_get_char_at_pos (string_p, position);
ecma_string_t *result_str_p;
ecma_length_t result_size = 1;
lit_utf8_size_t result_size = 1;
/* 10. */
if (first < LIT_UTF16_HIGH_SURROGATE_MIN || first > LIT_UTF16_HIGH_SURROGATE_MAX || (position + 1 == len))
@@ -113,7 +113,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
else
{
/* 11.a */
ecma_char_t second = ecma_string_get_char_at_pos (string_p, (ecma_length_t) (position + 1));
ecma_char_t second = ecma_string_get_char_at_pos (string_p, position + 1);
/* 11.b */
if (second < LIT_UTF16_LOW_SURROGATE_MIN || second > LIT_UTF16_LOW_SURROGATE_MAX)
@@ -167,7 +167,7 @@ ecma_builtin_string_prototype_char_at_helper (ecma_value_t this_arg, /**< this a
}
/* 4 */
const ecma_length_t len = ecma_string_get_length (original_string_p);
const lit_utf8_size_t len = ecma_string_get_length (original_string_p);
/* 5 */
// When index_num is NaN, then the first two comparisons are false
@@ -206,7 +206,7 @@ ecma_builtin_string_prototype_char_at_helper (ecma_value_t this_arg, /**< this a
static ecma_value_t
ecma_builtin_string_prototype_object_concat (ecma_string_t *this_string_p, /**< this argument */
const ecma_value_t *argument_list_p, /**< arguments list */
ecma_length_t arguments_number) /**< number of arguments */
uint32_t arguments_number) /**< number of arguments */
{
ecma_stringbuilder_t builder = ecma_stringbuilder_create_from (this_string_p);
@@ -475,7 +475,7 @@ ecma_builtin_string_prototype_object_replace (ecma_value_t this_value, /**< this
const lit_utf8_byte_t *const input_end_p = replace_ctx.string_p + replace_ctx.string_size;
const lit_utf8_byte_t *const loop_end_p = input_end_p - search_size;
uint32_t pos = 0;
lit_utf8_size_t pos = 0;
for (const lit_utf8_byte_t *curr_p = replace_ctx.string_p;
curr_p <= loop_end_p;
lit_utf8_incr (&curr_p), pos++)
@@ -681,10 +681,10 @@ ecma_builtin_string_prototype_object_slice (ecma_string_t *get_string_val, /**<
ecma_value_t arg1, /**< routine's first argument */
ecma_value_t arg2) /**< routine's second argument */
{
const ecma_length_t len = ecma_string_get_length (get_string_val);
const lit_utf8_size_t len = ecma_string_get_length (get_string_val);
/* 4. 6. */
ecma_length_t start = 0, end = len;
lit_utf8_size_t start = 0, end = len;
if (ECMA_IS_VALUE_ERROR (ecma_builtin_helper_array_index_normalize (arg1,
len,
@@ -805,7 +805,7 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_value, /**< this a
}
ecma_object_t *array_p = ecma_get_object_from_value (result);
ecma_length_t array_length = 0;
lit_utf8_size_t array_length = 0;
/* 15. */
if (ecma_is_value_undefined (separator_value))
@@ -923,8 +923,8 @@ ecma_builtin_string_prototype_object_substring (ecma_string_t *original_string_p
ecma_value_t arg2) /**< routine's second argument */
{
/* 3 */
const ecma_length_t len = ecma_string_get_length (original_string_p);
ecma_length_t start = 0, end = len;
const lit_utf8_size_t len = ecma_string_get_length (original_string_p);
lit_utf8_size_t start = 0, end = len;
/* 4 */
ecma_number_t start_num;
@@ -1130,9 +1130,9 @@ ecma_builtin_string_prototype_object_code_point_at (ecma_string_t *this_string_p
return error;
}
ecma_length_t size = ecma_string_get_length (this_string_p);
lit_utf8_size_t length = ecma_string_get_length (this_string_p);
if (pos_num < 0 || pos_num >= size)
if (pos_num < 0 || pos_num >= length)
{
return ECMA_VALUE_UNDEFINED;
}
@@ -1143,7 +1143,7 @@ ecma_builtin_string_prototype_object_code_point_at (ecma_string_t *this_string_p
if (first < LIT_UTF16_HIGH_SURROGATE_MIN
|| first > LIT_UTF16_HIGH_SURROGATE_MAX
|| index + 1 == size)
|| index + 1 == length)
{
return ecma_make_uint32_value (first);
}
@@ -1201,7 +1201,7 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**<
}
/* 4. */
ecma_length_t this_len = ecma_string_get_length (this_string_p);
lit_utf8_size_t this_len = ecma_string_get_length (this_string_p);
/* 5. */
uint32_t from = (uint32_t) ((start_num < 0) ? JERRY_MAX (this_len + start_num, 0) : start_num);
@@ -1258,7 +1258,7 @@ ecma_builtin_string_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
if (builtin_routine_id <= ECMA_STRING_PROTOTYPE_VALUE_OF)
{
@@ -60,7 +60,7 @@
static ecma_value_t
ecma_builtin_string_object_from_char_code (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
JERRY_UNUSED (this_arg);
@@ -79,7 +79,7 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg, /**< 'this' ar
lit_utf8_size_t utf8_buf_used = 0;
for (ecma_length_t arg_index = 0;
for (uint32_t arg_index = 0;
arg_index < args_number && ecma_is_value_empty (ret_value);
arg_index++)
{
@@ -124,13 +124,13 @@ ecma_builtin_string_object_from_char_code (ecma_value_t this_arg, /**< 'this' ar
static ecma_value_t
ecma_builtin_string_object_raw (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
JERRY_UNUSED (this_arg);
/* 1 - 2. */
const ecma_value_t *substitutions;
ecma_length_t number_of_substitutions;
uint32_t number_of_substitutions;
if (args_number > 1)
{
@@ -278,7 +278,7 @@ cleanup:
static ecma_value_t
ecma_builtin_string_object_from_code_point (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
JERRY_UNUSED (this_arg);
@@ -289,7 +289,7 @@ ecma_builtin_string_object_from_code_point (ecma_value_t this_arg, /**< 'this' a
ecma_stringbuilder_t builder = ecma_stringbuilder_create ();
for (ecma_length_t index = 0; index < args_number; index++)
for (uint32_t index = 0; index < args_number; index++)
{
ecma_value_t to_number_value = ecma_op_to_number (args[index]);
@@ -317,7 +317,7 @@ ecma_builtin_string_object_from_code_point (ecma_value_t this_arg, /**< 'this' a
return ecma_raise_range_error (ECMA_ERR_MSG ("Error: Invalid code point"));
}
lit_code_point_t code_point = (uint32_t) to_int_num;
lit_code_point_t code_point = (lit_code_point_t) to_int_num;
ecma_char_t converted_cp[2];
uint8_t encoded_size = lit_utf16_encode_code_point (code_point, converted_cp);
@@ -345,7 +345,7 @@ ecma_builtin_string_object_from_code_point (ecma_value_t this_arg, /**< 'this' a
*/
ecma_value_t
ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -385,7 +385,7 @@ ecma_builtin_string_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
*/
ecma_value_t
ecma_builtin_string_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -73,7 +73,7 @@ ecma_builtin_symbol_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED_2 (arguments_list, arguments_number);
@@ -53,7 +53,7 @@
*/
ecma_value_t
ecma_builtin_symbol_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -72,7 +72,7 @@ ecma_builtin_symbol_dispatch_call (const ecma_value_t *arguments_list_p, /**< ar
*/
ecma_value_t
ecma_builtin_symbol_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_syntax_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_SYNTAX, arguments_list_p, arguments_list_len);
} /* ecma_builtin_syntax_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_syntax_error_dispatch_call (const ecma_value_t *arguments_list_p, /
*/
ecma_value_t
ecma_builtin_syntax_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_syntax_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_syntax_error_dispatch_construct */
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_type_error_thrower_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -69,7 +69,7 @@ ecma_builtin_type_error_thrower_dispatch_call (const ecma_value_t *arguments_lis
*/
ecma_value_t
ecma_builtin_type_error_thrower_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_type_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_TYPE, arguments_list_p, arguments_list_len);
} /* ecma_builtin_type_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_type_error_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_type_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_type_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_type_error_dispatch_construct */
@@ -51,7 +51,7 @@
*/
ecma_value_t
ecma_builtin_uri_error_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_helper_error_dispatch_call (ECMA_ERROR_URI, arguments_list_p, arguments_list_len);
} /* ecma_builtin_uri_error_dispatch_call */
@@ -63,7 +63,7 @@ ecma_builtin_uri_error_dispatch_call (const ecma_value_t *arguments_list_p, /**<
*/
ecma_value_t
ecma_builtin_uri_error_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_builtin_uri_error_dispatch_call (arguments_list_p, arguments_list_len);
} /* ecma_builtin_uri_error_dispatch_construct */
@@ -49,7 +49,7 @@ ecma_builtin_weakmap_prototype_dispatch_routine (uint16_t builtin_routine_id, /*
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
return ecma_builtin_container_dispatch_routine (builtin_routine_id,
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_weakmap_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -57,7 +57,7 @@ ecma_builtin_weakmap_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
*/
ecma_value_t
ecma_builtin_weakmap_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_container_create (arguments_list_p,
arguments_list_len,
@@ -50,7 +50,7 @@ ecma_builtin_weakset_prototype_dispatch_routine (uint16_t builtin_routine_id, /*
ecma_value_t this_arg, /**< 'this' argument value */
const ecma_value_t arguments_list_p[], /**< list of arguments
* passed to routine */
ecma_length_t arguments_number) /**< length of arguments' list */
uint32_t arguments_number) /**< length of arguments' list */
{
JERRY_UNUSED (arguments_number);
return ecma_builtin_container_dispatch_routine (builtin_routine_id,
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_builtin_weakset_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -57,7 +57,7 @@ ecma_builtin_weakset_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
*/
ecma_value_t
ecma_builtin_weakset_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_op_container_create (arguments_list_p,
arguments_list_len,
@@ -89,15 +89,15 @@ extern const ecma_builtin_property_descriptor_t \
ecma_builtin_ ## lowercase_name ## _property_descriptor_list[]; \
ecma_value_t \
ecma_builtin_ ## lowercase_name ## _dispatch_call (const ecma_value_t *, \
ecma_length_t); \
uint32_t); \
ecma_value_t \
ecma_builtin_ ## lowercase_name ## _dispatch_construct (const ecma_value_t *, \
ecma_length_t); \
uint32_t); \
ecma_value_t \
ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \
ecma_value_t this_arg_value, \
const ecma_value_t [], \
ecma_length_t);
uint32_t);
#define BUILTIN(builtin_id, \
object_type, \
object_prototype_builtin_id, \
@@ -109,7 +109,7 @@ ecma_value_t \
ecma_builtin_ ## lowercase_name ## _dispatch_routine (uint16_t builtin_routine_id, \
ecma_value_t this_arg_value, \
const ecma_value_t [], \
ecma_length_t);
uint32_t);
#include "ecma-builtins.inc.h"
#undef BUILTIN_ROUTINE
@@ -47,12 +47,12 @@ typedef const ecma_builtin_property_descriptor_t *ecma_builtin_property_list_ref
typedef ecma_value_t (*ecma_builtin_dispatch_routine_t) (uint16_t builtin_routine_id,
ecma_value_t this_arg,
const ecma_value_t arguments_list[],
ecma_length_t arguments_number);
uint32_t arguments_number);
/**
* Definition of built-in dispatch call function pointer.
*/
typedef ecma_value_t (*ecma_builtin_dispatch_call_t) (const ecma_value_t arguments_list[],
ecma_length_t arguments_number);
uint32_t arguments_number);
/**
* Definition of a builtin descriptor which contains the builtin object's:
* - prototype objects's id (13-bits)
@@ -1118,7 +1118,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
const ecma_builtin_property_descriptor_t *curr_property_p = ecma_builtin_property_list_references[builtin_id];
ecma_length_t index = 0;
uint32_t index = 0;
uint32_t *bitset_p = built_in_props_p->u.instantiated_bitset;
ecma_collection_t *for_non_enumerable_p = (separate_enumerable ? non_enum_collection_p
@@ -1182,7 +1182,7 @@ static ecma_value_t
ecma_builtin_dispatch_routine (ecma_extended_object_t *func_obj_p, /**< builtin object */
ecma_value_t this_arg_value, /**< 'this' argument value */
const ecma_value_t *arguments_list_p, /**< list of arguments passed to routine */
ecma_length_t arguments_list_len) /**< length of arguments' list */
uint32_t arguments_list_len) /**< length of arguments' list */
{
JERRY_ASSERT (ecma_builtin_function_is_routine ((ecma_object_t *) func_obj_p));
@@ -1226,7 +1226,7 @@ ecma_value_t
ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
ecma_value_t this_arg_value, /**< 'this' argument value */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< arguments list length */
uint32_t arguments_list_len) /**< arguments list length */
{
JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
JERRY_ASSERT (ecma_get_object_is_builtin (obj_p));
@@ -1255,7 +1255,7 @@ ecma_value_t
ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
ecma_object_t *new_target_p, /**< new target */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< arguments list length */
uint32_t arguments_list_len) /**< arguments list length */
{
JERRY_ASSERT (ecma_get_object_type (obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
JERRY_ASSERT (ecma_get_object_is_builtin (obj_p));
@@ -83,10 +83,10 @@ void ecma_finalize_builtins (void);
ecma_value_t
ecma_builtin_dispatch_call (ecma_object_t *obj_p, ecma_value_t this_arg_value,
const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
ecma_value_t
ecma_builtin_dispatch_construct (ecma_object_t *obj_p, ecma_object_t *new_target_p,
const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
ecma_property_t *
ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, ecma_string_t *string_p);
ecma_property_t *
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_float32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_float32array_dispatch_call (const ecma_value_t *arguments_list_p, /
*/
ecma_value_t
ecma_builtin_float32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_FLOAT32_ARRAY);
@@ -50,7 +50,7 @@
*/
ecma_value_t
ecma_builtin_float64array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -64,7 +64,7 @@ ecma_builtin_float64array_dispatch_call (const ecma_value_t *arguments_list_p, /
*/
ecma_value_t
ecma_builtin_float64array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_FLOAT64_ARRAY);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_int16array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_int16array_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_int16array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_INT16_ARRAY);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_int32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_int32array_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_int32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_INT32_ARRAY);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_int8array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_int8array_dispatch_call (const ecma_value_t *arguments_list_p, /**<
*/
ecma_value_t
ecma_builtin_int8array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_INT8_ARRAY);
@@ -33,7 +33,7 @@
*/
ecma_value_t
ecma_typedarray_helper_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len, /**< number of arguments */
uint32_t arguments_list_len, /**< number of arguments */
ecma_typedarray_type_t typedarray_id) /**< id of the typedarray */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -28,7 +28,7 @@
ecma_value_t
ecma_typedarray_helper_dispatch_construct (const ecma_value_t *arguments_list_p,
ecma_length_t arguments_list_len,
uint32_t arguments_list_len,
ecma_typedarray_type_t typedarray_id);
/**
@@ -213,7 +213,7 @@ ecma_builtin_typedarray_prototype_exec_routine (ecma_value_t this_arg, /**< this
ecma_typedarray_getter_fn_t typedarray_getter_cb = ecma_get_typedarray_getter_fn (info.id);
ecma_object_t *func_object_p = ecma_get_object_from_value (cb_func_val);
ecma_length_t byte_pos = 0;
uint32_t byte_pos = 0;
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
for (uint32_t index = 0; index < info.length && ecma_is_value_empty (ret_value); index++)
@@ -459,7 +459,7 @@ ecma_builtin_typedarray_prototype_map (ecma_value_t this_arg, /**< this argument
ecma_typedarray_getter_fn_t src_typedarray_getter_cb = ecma_get_typedarray_getter_fn (src_info.id);
ecma_typedarray_setter_fn_t target_typedarray_setter_cb = ecma_get_typedarray_setter_fn (target_info.id);
ecma_length_t src_byte_pos = 0;
uint32_t src_byte_pos = 0;
for (uint32_t index = 0; index < src_info.length; index++)
{
@@ -488,7 +488,7 @@ ecma_builtin_typedarray_prototype_map (ecma_value_t this_arg, /**< this argument
}
else
{
ecma_length_t target_byte_pos = index << target_info.shift;
uint32_t target_byte_pos = index << target_info.shift;
target_typedarray_setter_cb (target_info.buffer_p + target_byte_pos, mapped_num);
}
@@ -535,7 +535,7 @@ ecma_builtin_typedarray_prototype_reduce_with_direction (ecma_value_t this_arg,
ecma_typedarray_info_t info = ecma_typedarray_get_info (obj_p);
ecma_typedarray_getter_fn_t getter_cb = ecma_get_typedarray_getter_fn (info.id);
ecma_length_t byte_pos;
uint32_t byte_pos;
if (info.length == 0)
{
@@ -717,7 +717,7 @@ ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this argum
JMEM_DEFINE_LOCAL_ARRAY (pass_value_list_p, info.length * info.element_size, lit_utf8_byte_t);
lit_utf8_byte_t *pass_value_p = pass_value_list_p;
ecma_length_t byte_pos = 0;
uint32_t byte_pos = 0;
for (uint32_t index = 0; index < info.length; index++)
{
@@ -1286,7 +1286,7 @@ ecma_builtin_typedarray_prototype_subarray (ecma_value_t this_arg, /**< this arg
}
/* 13. newLength */
ecma_length_t subarray_length = 0;
uint32_t subarray_length = 0;
if (end_index_uint32 > begin_index_uint32)
{
@@ -1294,7 +1294,7 @@ ecma_builtin_typedarray_prototype_subarray (ecma_value_t this_arg, /**< this arg
}
/* 17. beginByteOffset */
ecma_length_t begin_byte_offset = info.offset + begin_index_uint32 * info.element_size;
uint32_t begin_byte_offset = info.offset + begin_index_uint32 * info.element_size;
ecma_value_t arguments_p[3] =
{
@@ -1364,7 +1364,7 @@ ecma_builtin_typedarray_prototype_fill (ecma_value_t this_arg, /**< this argumen
}
}
ecma_length_t subarray_length = 0;
uint32_t subarray_length = 0;
if (end_index_uint32 > begin_index_uint32)
{
@@ -1695,7 +1695,7 @@ ecma_builtin_typedarray_prototype_find_index (ecma_value_t this_arg, /**< this a
static ecma_value_t
ecma_builtin_typedarray_prototype_index_of (ecma_value_t this_arg, /**< this argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
if (!ecma_is_typedarray (this_arg))
{
@@ -1775,7 +1775,7 @@ ecma_builtin_typedarray_prototype_index_of (ecma_value_t this_arg, /**< this arg
static ecma_value_t
ecma_builtin_typedarray_prototype_last_index_of (ecma_value_t this_arg, /**< this argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
if (!ecma_is_typedarray (this_arg))
{
@@ -1856,7 +1856,7 @@ ecma_builtin_typedarray_prototype_last_index_of (ecma_value_t this_arg, /**< thi
static ecma_value_t
ecma_builtin_typedarray_prototype_copy_within (ecma_value_t this_arg, /**< this argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
if (!ecma_is_typedarray (this_arg))
{
@@ -1929,7 +1929,7 @@ ecma_builtin_typedarray_prototype_copy_within (ecma_value_t this_arg, /**< this
static ecma_value_t
ecma_builtin_typedarray_prototype_slice (ecma_value_t this_arg, /**< this argument */
const ecma_value_t args[], /**< arguments list */
ecma_length_t args_number) /**< number of arguments */
uint32_t args_number) /**< number of arguments */
{
if (!ecma_is_typedarray (this_arg))
{
@@ -57,7 +57,7 @@
static ecma_value_t
ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -126,7 +126,7 @@ ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
static ecma_value_t
ecma_builtin_typedarray_of (ecma_value_t this_arg, /**< 'this' argument */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
if (!ecma_is_constructor (this_arg))
{
@@ -192,7 +192,7 @@ ecma_builtin_typedarray_of (ecma_value_t this_arg, /**< 'this' argument */
*/
ecma_value_t
ecma_builtin_typedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -209,7 +209,7 @@ ecma_builtin_typedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_typedarray_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_uint16array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_uint16array_dispatch_call (const ecma_value_t *arguments_list_p, /*
*/
ecma_value_t
ecma_builtin_uint16array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_UINT16_ARRAY);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_uint32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_uint32array_dispatch_call (const ecma_value_t *arguments_list_p, /*
*/
ecma_value_t
ecma_builtin_uint32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_uint8array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_uint8array_dispatch_call (const ecma_value_t *arguments_list_p, /**
*/
ecma_value_t
ecma_builtin_uint8array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
return ecma_typedarray_helper_dispatch_construct (arguments_list_p, arguments_list_len,
ECMA_UINT8_ARRAY);
@@ -49,7 +49,7 @@
*/
ecma_value_t
ecma_builtin_uint8clampedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -63,7 +63,7 @@ ecma_builtin_uint8clampedarray_dispatch_call (const ecma_value_t *arguments_list
*/
ecma_value_t
ecma_builtin_uint8clampedarray_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -67,7 +67,7 @@
* @return pointer to the constructed array object
*/
ecma_object_t *
ecma_op_new_array_object (ecma_length_t length) /**< length of the new array */
ecma_op_new_array_object (uint32_t length) /**< length of the new array */
{
#if ENABLED (JERRY_BUILTIN_ARRAY)
ecma_object_t *array_prototype_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
@@ -127,7 +127,7 @@ ecma_op_array_is_fast_array (ecma_extended_object_t *array_p) /**< ecma-array-ob
* pointer to the constructed fast access mode array object otherwise
*/
ecma_object_t *
ecma_op_new_fast_array_object (ecma_length_t length) /**< length of the new fast access mode array */
ecma_op_new_fast_array_object (uint32_t length) /**< length of the new fast access mode array */
{
const uint32_t aligned_length = ECMA_FAST_ARRAY_ALIGN_LENGTH (length);
ecma_value_t *values_p = NULL;
@@ -579,7 +579,7 @@ ecma_fast_array_get_property_names (ecma_object_t *object_p, /**< fast access mo
ecma_value_t
ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
* are passed to Array constructor */
ecma_length_t arguments_list_len, /**< length of the arguments' list */
uint32_t arguments_list_len, /**< length of the arguments' list */
bool is_treat_single_arg_as_length) /**< if the value is true,
* arguments_list_len is 1
* and single argument is Number,
@@ -592,7 +592,7 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
uint32_t length;
const ecma_value_t *array_items_p;
ecma_length_t array_items_count;
uint32_t array_items_count;
if (is_treat_single_arg_as_length
&& arguments_list_len == 1
@@ -678,7 +678,7 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
ecma_value_t
ecma_op_array_species_create (ecma_object_t *original_array_p, /**< The object from whom the new array object
* is being created */
ecma_length_t length) /**< length of the array */
uint32_t length) /**< length of the array */
{
ecma_value_t constructor = ECMA_VALUE_UNDEFINED;
ecma_value_t original_array = ecma_make_object_value (original_array_p);
@@ -62,10 +62,10 @@ typedef enum
} ecma_array_object_set_length_flags_t;
ecma_object_t *
ecma_op_new_array_object (ecma_length_t length);
ecma_op_new_array_object (uint32_t length);
ecma_object_t *
ecma_op_new_fast_array_object (ecma_length_t length);
ecma_op_new_fast_array_object (uint32_t length);
bool
ecma_op_object_is_fast_array (ecma_object_t *object_p);
@@ -96,13 +96,13 @@ void
ecma_fast_array_convert_to_normal (ecma_object_t *object_p);
ecma_value_t
ecma_op_create_array_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len,
ecma_op_create_array_object (const ecma_value_t *arguments_list_p, uint32_t arguments_list_len,
bool is_treat_single_arg_as_length);
#if ENABLED (JERRY_ESNEXT)
ecma_value_t
ecma_op_array_species_create (ecma_object_t *original_array_p,
ecma_length_t length);
uint32_t length);
ecma_value_t
ecma_op_create_array_iterator (ecma_object_t *obj_p,
@@ -44,7 +44,7 @@
* @return ecma_object_t *
*/
ecma_object_t *
ecma_arraybuffer_new_object (ecma_length_t length) /**< length of the arraybuffer */
ecma_arraybuffer_new_object (uint32_t length) /**< length of the arraybuffer */
{
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE);
ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
@@ -73,7 +73,7 @@ ecma_arraybuffer_new_object (ecma_length_t length) /**< length of the arraybuffe
* @return ecma_object_t *, pointer to the created ArrayBuffer object
*/
ecma_object_t *
ecma_arraybuffer_new_object_external (ecma_length_t length, /**< length of the buffer_p to use */
ecma_arraybuffer_new_object_external (uint32_t length, /**< length of the buffer_p to use */
void *buffer_p, /**< pointer for ArrayBuffer's buffer backing */
ecma_object_native_free_callback_t free_cb) /**< buffer free callback */
{
@@ -104,7 +104,7 @@ ecma_arraybuffer_new_object_external (ecma_length_t length, /**< length of the b
ecma_value_t
ecma_op_create_arraybuffer_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
* are passed to String constructor */
ecma_length_t arguments_list_len) /**< length of the arguments' list */
uint32_t arguments_list_len) /**< length of the arguments' list */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -169,9 +169,9 @@ ecma_is_arraybuffer (ecma_value_t target) /**< the target value */
/**
* Helper function: return the length of the buffer inside the arraybuffer object
*
* @return ecma_length_t, the length of the arraybuffer
* @return uint32_t, the length of the arraybuffer
*/
ecma_length_t JERRY_ATTR_PURE
uint32_t JERRY_ATTR_PURE
ecma_arraybuffer_get_length (ecma_object_t *object_p) /**< pointer to the ArrayBuffer object */
{
JERRY_ASSERT (ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL));
@@ -28,20 +28,20 @@
*/
ecma_value_t
ecma_op_create_arraybuffer_object (const ecma_value_t *, ecma_length_t);
ecma_op_create_arraybuffer_object (const ecma_value_t *, uint32_t);
/**
* Helper functions for arraybuffer.
*/
ecma_object_t *
ecma_arraybuffer_new_object (ecma_length_t lengh);
ecma_arraybuffer_new_object (uint32_t lengh);
ecma_object_t *
ecma_arraybuffer_new_object_external (ecma_length_t length,
ecma_arraybuffer_new_object_external (uint32_t length,
void *buffer_p,
ecma_object_native_free_callback_t free_cb);
lit_utf8_byte_t * JERRY_ATTR_PURE
ecma_arraybuffer_get_buffer (ecma_object_t *obj_p);
ecma_length_t JERRY_ATTR_PURE
uint32_t JERRY_ATTR_PURE
ecma_arraybuffer_get_length (ecma_object_t *obj_p);
bool JERRY_ATTR_PURE
ecma_arraybuffer_is_detached (ecma_object_t *obj_p);
@@ -364,7 +364,7 @@ ecma_op_container_free_entries (ecma_object_t *object_p) /**< collection object
*/
ecma_value_t
ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len, /**< number of arguments */
uint32_t arguments_list_len, /**< number of arguments */
lit_magic_string_id_t lit_id, /**< internal class id */
ecma_builtin_id_t proto_id) /**< prototype builtin id */
{
@@ -51,7 +51,7 @@ enum
uint8_t ecma_op_container_entry_size (lit_magic_string_id_t lit_id);
ecma_extended_object_t *ecma_op_container_get_object (ecma_value_t this_arg, lit_magic_string_id_t lit_id);
ecma_value_t ecma_op_container_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len,
ecma_value_t ecma_op_container_create (const ecma_value_t *arguments_list_p, uint32_t arguments_list_len,
lit_magic_string_id_t lit_id, ecma_builtin_id_t proto_id);
ecma_value_t ecma_op_container_size (ecma_extended_object_t *map_object_p);
ecma_value_t ecma_op_container_get (ecma_extended_object_t *map_object_p, ecma_value_t key_arg,
+1 -1
View File
@@ -1026,7 +1026,7 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */
ecma_object_t *obj_p = ecma_get_object_from_value (arr);
/* 4. 5. */
ecma_length_t len;
uint32_t len;
if (ECMA_IS_VALUE_ERROR (ecma_op_object_get_length (obj_p, &len)))
{
return NULL;
@@ -44,7 +44,7 @@
*/
ecma_value_t
ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
JERRY_ASSERT (JERRY_CONTEXT (current_new_target));
@@ -96,10 +96,10 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
}
/* 9. */
ecma_length_t buffer_byte_length = ecma_arraybuffer_get_length (buffer_p);
uint32_t buffer_byte_length = ecma_arraybuffer_get_length (buffer_p);
/* 10. */
if ((ecma_length_t) offset > buffer_byte_length)
if (offset > buffer_byte_length)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Start offset is outside the bounds of the buffer."));
}
@@ -126,7 +126,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
else
{
/* 11.a */
viewByteLength = (uint32_t) (buffer_byte_length - (ecma_length_t) offset);
viewByteLength = (uint32_t) (buffer_byte_length - offset);
}
/* 13. */
@@ -27,7 +27,7 @@
* @{
*/
ecma_value_t ecma_op_dataview_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
ecma_value_t ecma_op_dataview_create (const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
ecma_dataview_object_t *ecma_op_dataview_get_object (ecma_value_t this_arg);
ecma_value_t ecma_op_dataview_get_set_view_value (ecma_value_t view, ecma_value_t request_index,
ecma_value_t little_endian, ecma_value_t value_to_set,
@@ -190,7 +190,7 @@ ecma_is_constructor (ecma_value_t value) /**< ecma value */
*/
static ecma_string_t *
ecma_op_create_dynamic_function_arguments_helper (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< number of arguments */
uint32_t arguments_list_len) /**< number of arguments */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -214,7 +214,7 @@ ecma_op_create_dynamic_function_arguments_helper (const ecma_value_t *arguments_
ecma_stringbuilder_t builder = ecma_stringbuilder_create_from (str_p);
ecma_deref_ecma_string (str_p);
for (ecma_length_t idx = 1; idx < arguments_list_len - 1; idx++)
for (uint32_t idx = 1; idx < arguments_list_len - 1; idx++)
{
str_p = ecma_op_to_string (arguments_list_p[idx]);
@@ -318,7 +318,7 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
*/
ecma_value_t
ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len, /**< number of arguments */
uint32_t arguments_list_len, /**< number of arguments */
ecma_parse_opts_t parse_opts) /**< parse options */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
@@ -835,7 +835,7 @@ static ecma_value_t
ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
ecma_value_t this_arg_value, /**< 'this' argument's value */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
@@ -989,7 +989,7 @@ static ecma_value_t JERRY_ATTR_NOINLINE
ecma_op_function_call_external (ecma_object_t *func_obj_p, /**< Function object */
ecma_value_t this_arg_value, /**< 'this' argument's value */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
@@ -1034,11 +1034,11 @@ ecma_op_bound_function_get_argument_list (ecma_object_t *func_obj_p, /**< bound
ecma_value_t args_len_or_this = bound_func_p->header.u.bound_function.args_len_or_this;
ecma_length_t args_length = 1;
uint32_t args_length = 1;
if (ecma_is_value_integer_number (args_len_or_this))
{
args_length = (ecma_length_t) ecma_get_integer_from_value (args_len_or_this);
args_length = (uint32_t) ecma_get_integer_from_value (args_len_or_this);
}
/* 5. */
@@ -1070,7 +1070,7 @@ ecma_op_bound_function_get_argument_list (ecma_object_t *func_obj_p, /**< bound
static ecma_value_t JERRY_ATTR_NOINLINE
ecma_op_function_call_bound (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 */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
@@ -1088,7 +1088,7 @@ ecma_op_function_call_bound (ecma_object_t *func_obj_p, /**< Function object */
ecma_value_t ret_value = ecma_op_function_call (target_obj_p,
bound_arg_list_p->buffer_p[0],
bound_arg_list_p->buffer_p + 1,
(ecma_length_t) (bound_arg_list_p->item_count - 1));
(uint32_t) (bound_arg_list_p->item_count - 1));
ecma_collection_destroy (bound_arg_list_p);
@@ -1109,7 +1109,7 @@ ecma_value_t
ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
ecma_value_t this_arg_value, /**< 'this' argument's value */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (func_obj_p != NULL
&& !ecma_is_lexical_environment (func_obj_p));
@@ -1166,7 +1166,7 @@ static ecma_value_t JERRY_ATTR_NOINLINE
ecma_op_function_construct_bound (ecma_object_t *func_obj_p, /**< Function object */
ecma_object_t *new_target_p, /**< new target */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
@@ -1185,7 +1185,7 @@ ecma_op_function_construct_bound (ecma_object_t *func_obj_p, /**< Function objec
ecma_value_t ret_value = ecma_op_function_construct (target_obj_p,
new_target_p,
bound_arg_list_p->buffer_p + 1,
(ecma_length_t) (bound_arg_list_p->item_count - 1));
(uint32_t) (bound_arg_list_p->item_count - 1));
ecma_collection_destroy (bound_arg_list_p);
@@ -1202,7 +1202,7 @@ static ecma_value_t JERRY_ATTR_NOINLINE
ecma_op_function_construct_external (ecma_object_t *func_obj_p, /**< Function object */
ecma_object_t *new_target_p, /**< new target */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
@@ -1251,7 +1251,7 @@ ecma_value_t
ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
ecma_object_t *new_target_p, /**< new target */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_list_len) /**< length of arguments list */
uint32_t arguments_list_len) /**< length of arguments list */
{
JERRY_ASSERT (func_obj_p != NULL
&& !ecma_is_lexical_environment (func_obj_p));
@@ -47,7 +47,7 @@ ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p);
ecma_value_t
ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p,
ecma_length_t arguments_list_len,
uint32_t arguments_list_len,
ecma_parse_opts_t opts);
#if ENABLED (JERRY_ESNEXT)
@@ -72,11 +72,11 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value);
ecma_value_t
ecma_op_function_call (ecma_object_t *func_obj_p, ecma_value_t this_arg_value,
const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
ecma_value_t
ecma_op_function_construct (ecma_object_t *func_obj_p, ecma_object_t *new_target_p,
const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
ecma_property_t *
ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p);
@@ -44,12 +44,12 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
ecma_object_t *lex_env_p, /**< lexical environment the Arguments
object is created for */
const ecma_value_t *arguments_list_p, /**< arguments list */
ecma_length_t arguments_number, /**< length of arguments list */
uint32_t arguments_number, /**< length of arguments list */
const ecma_compiled_code_t *bytecode_data_p) /**< byte code */
{
bool is_strict = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0;
ecma_length_t formal_params_number;
uint32_t formal_params_number;
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
{
@@ -86,19 +86,19 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
ext_object_p->u.pseudo_array.u1.length = (uint16_t) formal_params_number;
ecma_value_t *arg_Literal_p = (ecma_value_t *) (ext_object_p + 1);
ecma_value_t *arg_literal_p = (ecma_value_t *) (ext_object_p + 1);
uint8_t *byte_p = (uint8_t *) bytecode_data_p;
byte_p += ((size_t) bytecode_data_p->size) << JMEM_ALIGNMENT_LOG;
byte_p -= formal_params_size;
memcpy (arg_Literal_p, byte_p, formal_params_size);
memcpy (arg_literal_p, byte_p, formal_params_size);
for (ecma_length_t i = 0; i < formal_params_number; i++)
for (uint32_t i = 0; i < formal_params_number; i++)
{
if (arg_Literal_p[i] != ECMA_VALUE_EMPTY)
if (arg_literal_p[i] != ECMA_VALUE_EMPTY)
{
ecma_string_t *name_p = ecma_get_string_from_value (arg_Literal_p[i]);
ecma_string_t *name_p = ecma_get_string_from_value (arg_literal_p[i]);
ecma_ref_ecma_string (name_p);
}
}
@@ -114,7 +114,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
ecma_property_value_t *prop_value_p;
/* 11.a, 11.b */
for (ecma_length_t index = 0;
for (uint32_t index = 0;
index < arguments_number;
index++)
{
@@ -259,19 +259,19 @@ ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, /**< the
return ret_value;
}
ecma_value_t *arg_Literal_p = (ecma_value_t *) (ext_object_p + 1);
ecma_value_t *arg_literal_p = (ecma_value_t *) (ext_object_p + 1);
if (arg_Literal_p[index] == ECMA_VALUE_EMPTY)
if (arg_literal_p[index] == ECMA_VALUE_EMPTY)
{
return ret_value;
}
ecma_string_t *name_p = ecma_get_string_from_value (arg_Literal_p[index]);
ecma_string_t *name_p = ecma_get_string_from_value (arg_literal_p[index]);
if (property_desc_p->flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED))
{
ecma_deref_ecma_string (name_p);
arg_Literal_p[index] = ECMA_VALUE_EMPTY;
arg_literal_p[index] = ECMA_VALUE_EMPTY;
}
else
{
@@ -293,7 +293,7 @@ ecma_op_arguments_object_define_own_property (ecma_object_t *object_p, /**< the
&& !(property_desc_p->flags & ECMA_PROP_IS_WRITABLE))
{
ecma_deref_ecma_string (name_p);
arg_Literal_p[index] = ECMA_VALUE_EMPTY;
arg_literal_p[index] = ECMA_VALUE_EMPTY;
}
}
@@ -335,13 +335,13 @@ ecma_op_arguments_object_delete (ecma_object_t *object_p, /**< the object */
if (index < ext_object_p->u.pseudo_array.u1.length)
{
ecma_value_t *arg_Literal_p = (ecma_value_t *) (ext_object_p + 1);
ecma_value_t *arg_literal_p = (ecma_value_t *) (ext_object_p + 1);
if (arg_Literal_p[index] != ECMA_VALUE_EMPTY)
if (arg_literal_p[index] != ECMA_VALUE_EMPTY)
{
ecma_string_t *name_p = ecma_get_string_from_value (arg_Literal_p[index]);
ecma_string_t *name_p = ecma_get_string_from_value (arg_literal_p[index]);
ecma_deref_ecma_string (name_p);
arg_Literal_p[index] = ECMA_VALUE_EMPTY;
arg_literal_p[index] = ECMA_VALUE_EMPTY;
}
}
}
@@ -21,7 +21,7 @@
void
ecma_op_create_arguments_object (ecma_object_t *func_obj_p, ecma_object_t *lex_env_p,
const ecma_value_t *arguments_list_p, ecma_length_t arguments_number,
const ecma_value_t *arguments_list_p, uint32_t arguments_number,
const ecma_compiled_code_t *bytecode_data_p);
ecma_value_t
+12 -12
View File
@@ -101,7 +101,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
ecma_length_t length = ecma_string_get_length (prim_value_str_p);
lit_utf8_size_t length = ecma_string_get_length (prim_value_str_p);
property_ref_p->virtual_value = ecma_make_uint32_value (length);
}
@@ -193,7 +193,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
if (array_index < info.length)
{
ecma_length_t byte_pos = array_index << info.shift;
uint32_t byte_pos = array_index << info.shift;
ecma_number_t num = ecma_get_typedarray_element (info.buffer_p + byte_pos, info.id);
value = ecma_make_number_value (num);
}
@@ -464,7 +464,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
ecma_value_t prim_value_p = ext_object_p->u.class_prop.u.value;
ecma_string_t *prim_value_str_p = ecma_get_string_from_value (prim_value_p);
ecma_length_t length = ecma_string_get_length (prim_value_str_p);
lit_utf8_size_t length = ecma_string_get_length (prim_value_str_p);
return ecma_make_uint32_value (length);
}
@@ -564,7 +564,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
return ECMA_VALUE_UNDEFINED;
}
ecma_length_t byte_pos = array_index << info.shift;
uint32_t byte_pos = array_index << info.shift;
ecma_number_t num = ecma_get_typedarray_element (info.buffer_p + byte_pos, info.id);
return ecma_make_number_value (num);
}
@@ -1330,7 +1330,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
return ecma_reject (is_throw);
}
ecma_length_t byte_pos = array_index << info.shift;
uint32_t byte_pos = array_index << info.shift;
ecma_set_typedarray_element (info.buffer_p + byte_pos, num_var, info.id);
return ECMA_VALUE_TRUE;
@@ -2209,10 +2209,10 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
{
const ecma_object_type_t type = ecma_get_object_type (obj_p);
const bool obj_is_builtin = ecma_get_object_is_builtin (obj_p);
ecma_length_t string_named_properties_count = 0;
ecma_length_t array_index_named_properties_count = 0;
uint32_t string_named_properties_count = 0;
uint32_t array_index_named_properties_count = 0;
#if ENABLED (JERRY_ESNEXT)
ecma_length_t symbol_named_properties_count = 0;
uint32_t symbol_named_properties_count = 0;
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_collection_t *prop_names_p = ecma_new_collection ();
@@ -2537,7 +2537,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
}
}
ecma_length_t all_properties_count = array_index_named_properties_count + string_named_properties_count;
uint32_t all_properties_count = array_index_named_properties_count + string_named_properties_count;
#if ENABLED (JERRY_ESNEXT)
all_properties_count += symbol_named_properties_count;
@@ -3106,7 +3106,7 @@ inline ecma_value_t JERRY_ATTR_ALWAYS_INLINE
ecma_op_invoke_by_symbol_id (ecma_value_t object, /**< Object value */
lit_magic_string_id_t symbol_id, /**< Symbol ID */
ecma_value_t *args_p, /**< Argument list */
ecma_length_t args_len) /**< Argument list length */
uint32_t args_len) /**< Argument list length */
{
ecma_string_t *symbol_p = ecma_op_get_global_symbol (symbol_id);
ecma_value_t ret_value = ecma_op_invoke (object, symbol_p, args_p, args_len);
@@ -3126,7 +3126,7 @@ inline ecma_value_t JERRY_ATTR_ALWAYS_INLINE
ecma_op_invoke_by_magic_id (ecma_value_t object, /**< Object value */
lit_magic_string_id_t magic_string_id, /**< Magic string ID */
ecma_value_t *args_p, /**< Argument list */
ecma_length_t args_len) /**< Argument list length */
uint32_t args_len) /**< Argument list length */
{
return ecma_op_invoke (object, ecma_get_magic_string (magic_string_id), args_p, args_len);
} /* ecma_op_invoke_by_magic_id */
@@ -3141,7 +3141,7 @@ ecma_value_t
ecma_op_invoke (ecma_value_t object, /**< Object value */
ecma_string_t *property_name_p, /**< Property name */
ecma_value_t *args_p, /**< Argument list */
ecma_length_t args_len) /**< Argument list length */
uint32_t args_len) /**< Argument list length */
{
/* 3. */
ecma_value_t object_value = ecma_op_to_object (object);
+3 -3
View File
@@ -79,12 +79,12 @@ ecma_value_t ecma_op_is_concat_spreadable (ecma_value_t arg);
ecma_value_t ecma_op_is_regexp (ecma_value_t arg);
ecma_value_t ecma_op_species_constructor (ecma_object_t *this_value, ecma_builtin_id_t default_constructor_id);
ecma_value_t ecma_op_invoke_by_symbol_id (ecma_value_t object, lit_magic_string_id_t magic_string_id,
ecma_value_t *args_p, ecma_length_t args_len);
ecma_value_t *args_p, uint32_t args_len);
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t ecma_op_invoke (ecma_value_t object, ecma_string_t *property_name_p, ecma_value_t *args_p,
ecma_length_t args_len);
uint32_t args_len);
ecma_value_t ecma_op_invoke_by_magic_id (ecma_value_t object, lit_magic_string_id_t magic_string_id,
ecma_value_t *args_p, ecma_length_t args_len);
ecma_value_t *args_p, uint32_t args_len);
jmem_cpointer_t ecma_op_ordinary_object_get_prototype_of (ecma_object_t *obj_p);
ecma_value_t ecma_op_ordinary_object_set_prototype_of (ecma_object_t *base_p, ecma_value_t proto);
@@ -301,7 +301,7 @@ static ecma_value_t
ecma_promise_reject_handler (const ecma_value_t function, /**< the function itself */
const ecma_value_t this, /**< this_arg of the function */
const ecma_value_t argv[], /**< argument list */
const ecma_length_t argc) /**< argument number */
const uint32_t argc) /**< argument number */
{
JERRY_UNUSED (this);
@@ -338,7 +338,7 @@ static ecma_value_t
ecma_promise_resolve_handler (const ecma_value_t function, /**< the function itself */
const ecma_value_t this, /**< this_arg of the function */
const ecma_value_t argv[], /**< argument list */
const ecma_length_t argc) /**< argument number */
const uint32_t argc) /**< argument number */
{
JERRY_UNUSED (this);
@@ -545,7 +545,7 @@ ecma_op_create_promise_object (ecma_value_t executor, /**< the executor function
*
* @return the current remaining count after increase or decrease.
*/
ecma_length_t
uint32_t
ecma_promise_remaining_inc_or_dec (ecma_value_t remaining, /**< the remaining count */
bool is_inc) /**< whether to increase the count */
{
@@ -558,7 +558,7 @@ ecma_promise_remaining_inc_or_dec (ecma_value_t remaining, /**< the remaining co
JERRY_ASSERT (ecma_is_value_integer_number (ext_object_p->u.class_prop.u.value));
ecma_length_t current = (ecma_length_t) ecma_get_integer_from_value (ext_object_p->u.class_prop.u.value);
uint32_t current = (uint32_t) ecma_get_integer_from_value (ext_object_p->u.class_prop.u.value);
if (is_inc)
{
@@ -585,7 +585,7 @@ ecma_value_t
ecma_promise_all_handler_cb (const ecma_value_t function_obj, /**< the function itself */
const ecma_value_t this_val, /**< this_arg of the function */
const ecma_value_t args_p[], /**< argument list */
const ecma_length_t args_count) /**< argument number */
const uint32_t args_count) /**< argument number */
{
JERRY_UNUSED (this_val);
JERRY_UNUSED (args_count);
@@ -634,7 +634,7 @@ ecma_value_t
ecma_op_get_capabilities_executor_cb (const ecma_value_t function_obj, /**< the function itself */
const ecma_value_t this_val, /**< this_arg of the function */
const ecma_value_t args_p[], /**< argument list */
const ecma_length_t args_count) /**< argument number */
const uint32_t args_count) /**< argument number */
{
JERRY_UNUSED (this_val);
@@ -96,12 +96,12 @@ void ecma_promise_create_resolving_functions (ecma_object_t *object_p, ecma_prom
bool create_already_resolved);
void ecma_promise_free_resolving_functions (ecma_promise_resolving_functions_t *funcs);
ecma_length_t ecma_promise_remaining_inc_or_dec (ecma_value_t remaining, bool is_inc);
uint32_t ecma_promise_remaining_inc_or_dec (ecma_value_t remaining, bool is_inc);
ecma_value_t ecma_promise_all_handler_cb (const ecma_value_t function_obj, const ecma_value_t this_val,
const ecma_value_t args_p[], const ecma_length_t args_count);
const ecma_value_t args_p[], const uint32_t args_count);
ecma_value_t ecma_op_get_capabilities_executor_cb (const ecma_value_t function_obj, const ecma_value_t this_val,
const ecma_value_t args_p[], const ecma_length_t args_count);
const ecma_value_t args_p[], const uint32_t args_count);
/**
* @}
@@ -107,7 +107,7 @@ ecma_value_t
ecma_proxy_revoke_cb (const ecma_value_t function_obj, /**< the function itself */
const ecma_value_t this_val, /**< this_arg of the function */
const ecma_value_t args_p[], /**< argument list */
const ecma_length_t args_count) /**< argument number */
const uint32_t args_count) /**< argument number */
{
JERRY_UNUSED_3 (this_val, args_p, args_count);
@@ -1696,7 +1696,7 @@ ecma_value_t
ecma_proxy_object_call (ecma_object_t *obj_p, /**< proxy object */
ecma_value_t this_argument, /**< this argument to invoke the function */
const ecma_value_t *args_p, /**< argument list */
ecma_length_t argc) /**< number of arguments */
uint32_t argc) /**< number of arguments */
{
JERRY_ASSERT (ECMA_OBJECT_IS_PROXY (obj_p));
@@ -1750,7 +1750,7 @@ ecma_value_t
ecma_proxy_object_construct (ecma_object_t *obj_p, /**< proxy object */
ecma_object_t *new_target_p, /**< new target */
const ecma_value_t *args_p, /**< argument list */
ecma_length_t argc) /**< number of arguments */
uint32_t argc) /**< number of arguments */
{
JERRY_ASSERT (ECMA_OBJECT_IS_PROXY (obj_p));
@@ -39,7 +39,7 @@ ecma_value_t
ecma_proxy_revoke_cb (const ecma_value_t function_obj,
const ecma_value_t this_val,
const ecma_value_t args_p[],
const ecma_length_t args_count);
const uint32_t args_count);
jmem_cpointer_t
ecma_proxy_object_prototype_to_cp (ecma_value_t proto);
@@ -102,13 +102,13 @@ ecma_value_t
ecma_proxy_object_call (ecma_object_t *obj_p,
ecma_value_t this_argument,
const ecma_value_t *args_p,
ecma_length_t argc);
uint32_t argc);
ecma_value_t
ecma_proxy_object_construct (ecma_object_t *obj_p,
ecma_object_t *new_target_p,
const ecma_value_t *args_p,
ecma_length_t argc);
uint32_t argc);
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
@@ -2163,7 +2163,7 @@ ecma_regexp_split_helper (ecma_value_t this_arg, /**< this value */
const lit_utf8_size_t string_length = ecma_string_get_length (string_p);
ecma_object_t *const array_p = ecma_get_object_from_value (array);
ecma_length_t array_length = 0;
uint32_t array_length = 0;
/* 22. */
if (string_length == 0)
@@ -2379,7 +2379,7 @@ cleanup_string:
}
ecma_object_t *const array_p = ecma_get_object_from_value (array);
ecma_length_t array_length = 0;
uint32_t array_length = 0;
ecma_object_t *const regexp_p = ecma_get_object_from_value (this_arg);
ecma_extended_object_t *const ext_object_p = (ecma_extended_object_t *) regexp_p;
@@ -2561,7 +2561,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
const lit_utf8_byte_t *matched_p = NULL;
const lit_utf8_byte_t *current_p = ctx_p->string_p;
const lit_utf8_byte_t *last_append_p = current_p;
ecma_length_t index;
lit_utf8_size_t index;
ecma_regexp_ctx_t re_ctx;
ecma_regexp_initialize_context (&re_ctx,
@@ -2607,7 +2607,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
}
else
{
ecma_length_t counter = index;
lit_utf8_size_t counter = index;
while (counter--)
{
lit_utf8_incr (&current_p);
@@ -3039,7 +3039,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
replace_ctx.builder = ecma_stringbuilder_create ();
replace_ctx.matched_p = NULL;
replace_ctx.capture_count = 0;
ecma_length_t index = 0;
lit_utf8_size_t index = 0;
/* 15. */
const lit_utf8_byte_t *source_position_p = replace_ctx.string_p;
@@ -3101,7 +3101,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
}
/* 16.i */
ecma_length_t position = JERRY_MIN ((ecma_length_t) JERRY_MAX (position_num, 0.0f), string_length);
lit_utf8_size_t position = JERRY_MIN ((lit_utf8_size_t) JERRY_MAX (position_num, 0.0f), string_length);
/* 16.k */
ecma_collection_t *arguments_p = ecma_new_collection ();
@@ -41,7 +41,7 @@
ecma_value_t
ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of arguments that
are passed to String constructor */
ecma_length_t arguments_list_len) /**< length of the arguments' list */
uint32_t arguments_list_len) /**< length of the arguments' list */
{
JERRY_ASSERT (arguments_list_len == 0
|| arguments_list_p != NULL);
@@ -102,9 +102,9 @@ ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p, /**< a String obj
ecma_string_t *prim_value_str_p = ecma_get_string_from_value (ext_object_p->u.class_prop.u.value);
ecma_length_t length = ecma_string_get_length (prim_value_str_p);
lit_utf8_size_t length = ecma_string_get_length (prim_value_str_p);
for (ecma_length_t i = 0; i < length; i++)
for (lit_utf8_size_t i = 0; i < length; i++)
{
ecma_string_t *name_p = ecma_new_ecma_string_from_uint32 (i);
@@ -26,7 +26,7 @@
*/
ecma_value_t
ecma_op_create_string_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
ecma_op_create_string_object (const ecma_value_t *arguments_list_p, uint32_t arguments_list_len);
void
ecma_op_string_list_lazy_property_names (ecma_object_t *obj_p,
@@ -43,7 +43,7 @@
*/
ecma_value_t
ecma_op_create_symbol (const ecma_value_t *arguments_list_p, /**< list of arguments */
ecma_length_t arguments_list_len) /**< length of the arguments' list */
uint32_t arguments_list_len) /**< length of the arguments' list */
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);

Some files were not shown because too many files have changed in this diff Show More