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
@@ -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;
}
}
}