Introducing ECMA_GET_NON_NULL_POINTER macro that is ECMA_GET_POINTER without NULL pointer check.
Replacing invocations of ECMA_GET_POINTER passing non-NULL argument with introduced ECMA_GET_NON_NULL_POINTER.
This commit is contained in:
@@ -81,7 +81,7 @@ ecma_op_create_array_object (ecma_value_t *arguments_list_p, /**< list of argume
|
||||
&& arguments_list_len == 1
|
||||
&& arguments_list_p[0].value_type == ECMA_TYPE_NUMBER)
|
||||
{
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER (arguments_list_p[0].value);
|
||||
ecma_number_t *num_p = ECMA_GET_NON_NULL_POINTER (arguments_list_p[0].value);
|
||||
uint32_t num_uint32 = ecma_number_to_uint32 (*num_p);
|
||||
if (*num_p != ecma_uint32_to_number (num_uint32))
|
||||
{
|
||||
@@ -187,7 +187,7 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
|
||||
|
||||
JERRY_ASSERT (old_len_value.value_type == ECMA_TYPE_NUMBER);
|
||||
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER (old_len_value.value);
|
||||
ecma_number_t *num_p = ECMA_GET_NON_NULL_POINTER (old_len_value.value);
|
||||
uint32_t old_len_uint32 = ecma_number_to_uint32 (*num_p);
|
||||
|
||||
// 3.
|
||||
@@ -217,7 +217,7 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
|
||||
JERRY_ASSERT (ecma_is_completion_value_normal (completion)
|
||||
&& completion.u.value.value_type == ECMA_TYPE_NUMBER);
|
||||
|
||||
new_len_num = *(ecma_number_t*) ECMA_GET_POINTER (completion.u.value.value);
|
||||
new_len_num = *(ecma_number_t*) ECMA_GET_NON_NULL_POINTER (completion.u.value.value);
|
||||
|
||||
ecma_free_completion_value (completion);
|
||||
|
||||
@@ -317,7 +317,7 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
|
||||
{
|
||||
JERRY_ASSERT (new_len_property_desc.value.value_type == ECMA_TYPE_NUMBER);
|
||||
|
||||
ecma_number_t *new_len_num_p = ECMA_GET_POINTER (new_len_property_desc.value.value);
|
||||
ecma_number_t *new_len_num_p = ECMA_GET_NON_NULL_POINTER (new_len_property_desc.value.value);
|
||||
|
||||
// 1.
|
||||
*new_len_num_p = ecma_uint32_to_number (old_len_uint32 + 1);
|
||||
|
||||
@@ -73,8 +73,8 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
}
|
||||
else if (is_x_number)
|
||||
{ // c.
|
||||
ecma_number_t x_num = *(ecma_number_t*)(ECMA_GET_POINTER(x.value));
|
||||
ecma_number_t y_num = *(ecma_number_t*)(ECMA_GET_POINTER(y.value));
|
||||
ecma_number_t x_num = *(ecma_number_t*)(ECMA_GET_NON_NULL_POINTER(x.value));
|
||||
ecma_number_t y_num = *(ecma_number_t*)(ECMA_GET_NON_NULL_POINTER(y.value));
|
||||
|
||||
bool is_equal;
|
||||
|
||||
@@ -98,8 +98,8 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
}
|
||||
else if (is_x_string)
|
||||
{ // d.
|
||||
ecma_string_t* x_str_p = ECMA_GET_POINTER(x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_POINTER(y.value);
|
||||
ecma_string_t* x_str_p = ECMA_GET_NON_NULL_POINTER(x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_NON_NULL_POINTER(y.value);
|
||||
|
||||
bool is_equal = ecma_compare_ecma_strings (x_str_p, y_str_p);
|
||||
|
||||
@@ -267,8 +267,8 @@ ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
|
||||
// d. If x is +0 and y is -0, return true.
|
||||
// e. If x is -0 and y is +0, return true.
|
||||
|
||||
ecma_number_t x_num = *(ecma_number_t*) (ECMA_GET_POINTER (x.value));
|
||||
ecma_number_t y_num = *(ecma_number_t*) (ECMA_GET_POINTER (y.value));
|
||||
ecma_number_t x_num = *(ecma_number_t*) (ECMA_GET_NON_NULL_POINTER (x.value));
|
||||
ecma_number_t y_num = *(ecma_number_t*) (ECMA_GET_NON_NULL_POINTER (y.value));
|
||||
|
||||
if (ecma_number_is_nan (x_num)
|
||||
|| ecma_number_is_nan (y_num))
|
||||
@@ -291,8 +291,8 @@ ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
|
||||
// (same length and same characters in corresponding positions); otherwise, return false.
|
||||
if (is_x_string)
|
||||
{
|
||||
ecma_string_t* x_str_p = ECMA_GET_POINTER (x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_POINTER (y.value);
|
||||
ecma_string_t* x_str_p = ECMA_GET_NON_NULL_POINTER (x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_NON_NULL_POINTER (y.value);
|
||||
|
||||
return ecma_compare_ecma_strings (x_str_p, y_str_p);
|
||||
}
|
||||
@@ -306,7 +306,7 @@ ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
|
||||
// 7. Return true if x and y refer to the same object. Otherwise, return false.
|
||||
JERRY_ASSERT (is_x_object);
|
||||
|
||||
return (ECMA_GET_POINTER (x.value) == ECMA_GET_POINTER (y.value));
|
||||
return (ECMA_GET_NON_NULL_POINTER (x.value) == ECMA_GET_NON_NULL_POINTER (y.value));
|
||||
} /* ecma_op_strict_equality_compare */
|
||||
|
||||
/**
|
||||
@@ -351,8 +351,8 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
// b.
|
||||
ECMA_TRY_CATCH(ny, ecma_op_to_number (py.u.value), ret_value);
|
||||
|
||||
ecma_number_t* num_x_p = (ecma_number_t*)ECMA_GET_POINTER(nx.u.value.value);
|
||||
ecma_number_t* num_y_p = (ecma_number_t*)ECMA_GET_POINTER(ny.u.value.value);
|
||||
ecma_number_t* num_x_p = (ecma_number_t*)ECMA_GET_NON_NULL_POINTER(nx.u.value.value);
|
||||
ecma_number_t* num_y_p = (ecma_number_t*)ECMA_GET_NON_NULL_POINTER(ny.u.value.value);
|
||||
|
||||
if (ecma_number_is_nan (*num_x_p)
|
||||
|| ecma_number_is_nan (*num_y_p))
|
||||
@@ -418,8 +418,8 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
{ // 4.
|
||||
JERRY_ASSERT (is_px_string && is_py_string);
|
||||
|
||||
ecma_string_t *str_x_p = ECMA_GET_POINTER (px.u.value.value);
|
||||
ecma_string_t *str_y_p = ECMA_GET_POINTER (py.u.value.value);
|
||||
ecma_string_t *str_x_p = ECMA_GET_NON_NULL_POINTER (px.u.value.value);
|
||||
ecma_string_t *str_y_p = ECMA_GET_NON_NULL_POINTER (py.u.value.value);
|
||||
|
||||
bool is_px_less = ecma_compare_ecma_strings_relational (str_x_p, str_y_p);
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ ecma_op_same_value (ecma_value_t x, /**< ecma-value */
|
||||
|
||||
if (is_x_number)
|
||||
{
|
||||
ecma_number_t *x_num_p = (ecma_number_t*)ECMA_GET_POINTER(x.value);
|
||||
ecma_number_t *y_num_p = (ecma_number_t*)ECMA_GET_POINTER(y.value);
|
||||
ecma_number_t *x_num_p = (ecma_number_t*)ECMA_GET_NON_NULL_POINTER(x.value);
|
||||
ecma_number_t *y_num_p = (ecma_number_t*)ECMA_GET_NON_NULL_POINTER(y.value);
|
||||
|
||||
if (ecma_number_is_nan (*x_num_p)
|
||||
&& ecma_number_is_nan (*y_num_p))
|
||||
@@ -150,8 +150,8 @@ ecma_op_same_value (ecma_value_t x, /**< ecma-value */
|
||||
|
||||
if (is_x_string)
|
||||
{
|
||||
ecma_string_t* x_str_p = ECMA_GET_POINTER(x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_POINTER(y.value);
|
||||
ecma_string_t* x_str_p = ECMA_GET_NON_NULL_POINTER(x.value);
|
||||
ecma_string_t* y_str_p = ECMA_GET_NON_NULL_POINTER(y.value);
|
||||
|
||||
return ecma_compare_ecma_strings (x_str_p, y_str_p);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ ecma_op_same_value (ecma_value_t x, /**< ecma-value */
|
||||
|
||||
JERRY_ASSERT(is_x_object);
|
||||
|
||||
return (ECMA_GET_POINTER(x.value) == ECMA_GET_POINTER(y.value));
|
||||
return (ECMA_GET_NON_NULL_POINTER(x.value) == ECMA_GET_NON_NULL_POINTER(y.value));
|
||||
} /* ecma_op_same_value */
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ ecma_op_to_primitive (ecma_value_t value, /**< ecma-value */
|
||||
|
||||
case ECMA_TYPE_OBJECT:
|
||||
{
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER (value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (value.value);
|
||||
|
||||
return ecma_op_object_default_value (obj_p, preferred_type);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */
|
||||
{
|
||||
case ECMA_TYPE_NUMBER:
|
||||
{
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER(value.value);
|
||||
ecma_number_t *num_p = ECMA_GET_NON_NULL_POINTER(value.value);
|
||||
|
||||
if (ecma_number_is_nan (*num_p)
|
||||
|| ecma_number_is_zero (*num_p))
|
||||
@@ -250,7 +250,7 @@ ecma_op_to_boolean (ecma_value_t value) /**< ecma-value */
|
||||
}
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
ecma_string_t *str_p = ECMA_GET_POINTER(value.value);
|
||||
ecma_string_t *str_p = ECMA_GET_NON_NULL_POINTER(value.value);
|
||||
|
||||
return ecma_make_simple_completion_value ((ecma_string_get_length (str_p) == 0) ? ECMA_SIMPLE_VALUE_FALSE
|
||||
: ECMA_SIMPLE_VALUE_TRUE);
|
||||
@@ -323,7 +323,7 @@ ecma_op_to_number (ecma_value_t value) /**< ecma-value */
|
||||
}
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
ecma_string_t *str_p = ECMA_GET_POINTER (value.value);
|
||||
ecma_string_t *str_p = ECMA_GET_NON_NULL_POINTER (value.value);
|
||||
|
||||
ecma_number_t *num_p = ecma_alloc_number ();
|
||||
*num_p = ecma_string_to_number (str_p);
|
||||
@@ -418,7 +418,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma-value */
|
||||
|
||||
case ECMA_TYPE_NUMBER:
|
||||
{
|
||||
ecma_number_t *num_p = ECMA_GET_POINTER (value.value);
|
||||
ecma_number_t *num_p = ECMA_GET_NON_NULL_POINTER (value.value);
|
||||
res_p = ecma_new_ecma_string_from_number (*num_p);
|
||||
|
||||
break;
|
||||
@@ -426,7 +426,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma-value */
|
||||
|
||||
case ECMA_TYPE_STRING:
|
||||
{
|
||||
res_p = ECMA_GET_POINTER (value.value);
|
||||
res_p = ECMA_GET_NON_NULL_POINTER (value.value);
|
||||
res_p = ecma_copy_or_ref_ecma_string (res_p);
|
||||
|
||||
break;
|
||||
@@ -649,7 +649,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER (obj_value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (obj_value.value);
|
||||
|
||||
// 2.
|
||||
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
|
||||
@@ -806,7 +806,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (get_prop_value.u.value.value_type == ECMA_TYPE_OBJECT);
|
||||
|
||||
ecma_object_t *get_p = ECMA_GET_POINTER (get_prop_value.u.value.value);
|
||||
ecma_object_t *get_p = ECMA_GET_NON_NULL_POINTER (get_prop_value.u.value.value);
|
||||
ecma_ref_object (get_p);
|
||||
|
||||
prop_desc.get_p = get_p;
|
||||
@@ -850,7 +850,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
{
|
||||
JERRY_ASSERT (set_prop_value.u.value.value_type == ECMA_TYPE_OBJECT);
|
||||
|
||||
ecma_object_t *set_p = ECMA_GET_POINTER (set_prop_value.u.value.value);
|
||||
ecma_object_t *set_p = ECMA_GET_NON_NULL_POINTER (set_prop_value.u.value.value);
|
||||
ecma_ref_object (set_p);
|
||||
|
||||
prop_desc.set_p = set_p;
|
||||
|
||||
@@ -94,7 +94,7 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma-value */
|
||||
return false;
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER(value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(value.value);
|
||||
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(!ecma_is_lexical_environment (obj_p));
|
||||
@@ -118,7 +118,7 @@ ecma_is_constructor (ecma_value_t value) /**< ecma-value */
|
||||
return false;
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER(value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(value.value);
|
||||
|
||||
JERRY_ASSERT(obj_p != NULL);
|
||||
JERRY_ASSERT(!ecma_is_lexical_environment (obj_p));
|
||||
@@ -339,7 +339,7 @@ ecma_function_call_setup_args_variables (ecma_object_t *func_obj_p, /**< Functio
|
||||
|
||||
ecma_value_t formal_parameter_name_value = *formal_params_iterator.current_value_p;
|
||||
JERRY_ASSERT (formal_parameter_name_value.value_type == ECMA_TYPE_STRING);
|
||||
ecma_string_t *formal_parameter_name_string_p = ECMA_GET_POINTER (formal_parameter_name_value.value);
|
||||
ecma_string_t *formal_parameter_name_string_p = ECMA_GET_NON_NULL_POINTER (formal_parameter_name_value.value);
|
||||
|
||||
bool arg_already_declared = ecma_op_has_binding (env_p, formal_parameter_name_string_p);
|
||||
if (!arg_already_declared)
|
||||
@@ -395,7 +395,7 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
|
||||
return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
|
||||
ecma_object_t* v_obj_p = ECMA_GET_POINTER (value.value);
|
||||
ecma_object_t* v_obj_p = ECMA_GET_NON_NULL_POINTER (value.value);
|
||||
JERRY_ASSERT (v_obj_p != NULL);
|
||||
|
||||
ecma_string_t *prototype_magic_string_p = ecma_get_magic_string (ECMA_MAGIC_STRING_PROTOTYPE);
|
||||
@@ -412,7 +412,7 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_object_t *prototype_obj_p = ECMA_GET_POINTER (prototype_obj_value.u.value.value);
|
||||
ecma_object_t *prototype_obj_p = ECMA_GET_NON_NULL_POINTER (prototype_obj_value.u.value.value);
|
||||
JERRY_ASSERT (prototype_obj_p != NULL);
|
||||
|
||||
do
|
||||
@@ -487,7 +487,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_property_t *code_prop_p = ecma_get_internal_property (func_obj_p, ECMA_INTERNAL_PROPERTY_CODE);
|
||||
|
||||
ecma_object_t *scope_p = ECMA_GET_POINTER(scope_prop_p->u.internal_property.value);
|
||||
ecma_object_t *scope_p = ECMA_GET_NON_NULL_POINTER(scope_prop_p->u.internal_property.value);
|
||||
uint32_t code_prop_value = code_prop_p->u.internal_property.value;
|
||||
|
||||
bool is_strict;
|
||||
@@ -599,7 +599,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ecma_object_t *prototype_p;
|
||||
if (func_obj_prototype_prop_value.u.value.value_type == ECMA_TYPE_OBJECT)
|
||||
{
|
||||
prototype_p = ECMA_GET_POINTER (func_obj_prototype_prop_value.u.value.value);
|
||||
prototype_p = ECMA_GET_NON_NULL_POINTER (func_obj_prototype_prop_value.u.value.value);
|
||||
ecma_ref_object (prototype_p);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -56,13 +56,13 @@ ecma_op_get_value_lex_env_base (ecma_reference_t ref) /**< ECMA-reference */
|
||||
}
|
||||
|
||||
// 5.
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER(base.value);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_NON_NULL_POINTER(base.value);
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
// 5.a
|
||||
return ecma_op_get_binding_value (lex_env_p,
|
||||
ECMA_GET_POINTER (ref.referenced_name_cp),
|
||||
ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp),
|
||||
ref.is_strict);
|
||||
} /* ecma_op_get_value_lex_env_base */
|
||||
|
||||
@@ -83,7 +83,7 @@ ecma_op_get_value_object_base (ecma_reference_t ref) /**< ECMA-reference */
|
||||
|| base.value_type == ECMA_TYPE_NUMBER
|
||||
|| base.value_type == ECMA_TYPE_STRING);
|
||||
const bool has_object_base = (base.value_type == ECMA_TYPE_OBJECT
|
||||
&& !(ecma_is_lexical_environment ((ecma_object_t*)ECMA_GET_POINTER(base.value))));
|
||||
&& !(ecma_is_lexical_environment (ECMA_GET_NON_NULL_POINTER(base.value))));
|
||||
const bool is_property_reference = has_primitive_base || has_object_base;
|
||||
|
||||
JERRY_ASSERT (!is_unresolvable_reference);
|
||||
@@ -98,7 +98,7 @@ ecma_op_get_value_object_base (ecma_reference_t ref) /**< ECMA-reference */
|
||||
JERRY_ASSERT(obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
return ecma_op_object_get (obj_p, ECMA_GET_POINTER (ref.referenced_name_cp));
|
||||
return ecma_op_object_get (obj_p, ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,11 +107,11 @@ ecma_op_get_value_object_base (ecma_reference_t ref) /**< ECMA-reference */
|
||||
|
||||
ECMA_TRY_CATCH (obj_base, ecma_op_to_object (base), ret_value);
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER (obj_base.u.value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (obj_base.u.value.value);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
ret_value = ecma_op_object_get (obj_p, ECMA_GET_POINTER (ref.referenced_name_cp));
|
||||
ret_value = ecma_op_object_get (obj_p, ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp));
|
||||
|
||||
ECMA_FINALIZE (obj_base);
|
||||
|
||||
@@ -148,7 +148,7 @@ ecma_op_put_value_lex_env_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
ecma_object_t *global_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL);
|
||||
|
||||
ecma_completion_value_t completion = ecma_op_object_put (global_object_p,
|
||||
ECMA_GET_POINTER (ref.referenced_name_cp),
|
||||
ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp),
|
||||
value,
|
||||
false);
|
||||
|
||||
@@ -162,13 +162,13 @@ ecma_op_put_value_lex_env_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
}
|
||||
|
||||
// 5.
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER(base.value);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_NON_NULL_POINTER(base.value);
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
// 5.a
|
||||
return ecma_op_set_mutable_binding (lex_env_p,
|
||||
ECMA_GET_POINTER (ref.referenced_name_cp),
|
||||
ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp),
|
||||
value,
|
||||
ref.is_strict);
|
||||
} /* ecma_op_put_value_lex_env_base */
|
||||
@@ -210,7 +210,7 @@ ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
|| base.value_type == ECMA_TYPE_NUMBER
|
||||
|| base.value_type == ECMA_TYPE_STRING);
|
||||
const bool has_object_base = (base.value_type == ECMA_TYPE_OBJECT
|
||||
&& !(ecma_is_lexical_environment ((ecma_object_t*)ECMA_GET_POINTER(base.value))));
|
||||
&& !(ecma_is_lexical_environment (ECMA_GET_NON_NULL_POINTER(base.value))));
|
||||
const bool is_property_reference = has_primitive_base || has_object_base;
|
||||
|
||||
JERRY_ASSERT (!is_unresolvable_reference);
|
||||
@@ -221,7 +221,7 @@ ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
{
|
||||
// 4.b case 1
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER(base.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER(base.value);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
@@ -229,7 +229,7 @@ ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
|
||||
ECMA_TRY_CATCH (put_completion,
|
||||
ecma_op_object_put (obj_p,
|
||||
ECMA_GET_POINTER (ref.referenced_name_cp),
|
||||
ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp),
|
||||
value,
|
||||
ref.is_strict),
|
||||
ret_value);
|
||||
@@ -248,11 +248,11 @@ ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
// sub_1.
|
||||
ECMA_TRY_CATCH (obj_base, ecma_op_to_object (base), ret_value);
|
||||
|
||||
ecma_object_t *obj_p = ECMA_GET_POINTER (obj_base.u.value.value);
|
||||
ecma_object_t *obj_p = ECMA_GET_NON_NULL_POINTER (obj_base.u.value.value);
|
||||
JERRY_ASSERT (obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (obj_p));
|
||||
|
||||
ecma_string_t *referenced_name_p = ECMA_GET_POINTER (ref.referenced_name_cp);
|
||||
ecma_string_t *referenced_name_p = ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp);
|
||||
|
||||
// sub_2.
|
||||
if (!ecma_op_object_can_put (obj_p, referenced_name_p))
|
||||
@@ -280,7 +280,7 @@ ecma_op_put_value_object_base (ecma_reference_t ref, /**< ECMA-reference */
|
||||
// sub_6.
|
||||
JERRY_ASSERT (prop_p != NULL && prop_p->type == ECMA_PROPERTY_NAMEDACCESSOR);
|
||||
|
||||
ecma_object_t *setter_p = ECMA_GET_POINTER(prop_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter_p = ECMA_GET_NON_NULL_POINTER(prop_p->u.named_accessor_property.set_p);
|
||||
JERRY_ASSERT (setter_p != NULL);
|
||||
|
||||
ECMA_TRY_CATCH (call_completion,
|
||||
|
||||
@@ -47,7 +47,7 @@ ecma_get_lex_env_binding_object (ecma_object_t* obj_lex_env_p) /**< object lexic
|
||||
JERRY_ASSERT(binding_obj_prop_p != NULL
|
||||
&& binding_obj_prop_p->u.internal_property.type == ECMA_INTERNAL_PROPERTY_BINDING_OBJECT);
|
||||
|
||||
return ECMA_GET_POINTER(binding_obj_prop_p->u.internal_property.value);
|
||||
return ECMA_GET_NON_NULL_POINTER (binding_obj_prop_p->u.internal_property.value);
|
||||
} /* ecma_get_lex_env_binding_object */
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
|
||||
return conv_to_num_completion;
|
||||
}
|
||||
|
||||
ecma_number_t *prim_value_p = ECMA_GET_POINTER (conv_to_num_completion.u.value.value);
|
||||
ecma_number_t *prim_value_p = ECMA_GET_NON_NULL_POINTER (conv_to_num_completion.u.value.value);
|
||||
|
||||
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_NUMBER_BUILTIN
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
|
||||
|
||||
@@ -141,7 +141,7 @@ ecma_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function */
|
||||
JERRY_ASSERT (param_index < formal_params_number);
|
||||
|
||||
JERRY_ASSERT (formal_params_iter_p->current_value_p->value_type == ECMA_TYPE_STRING);
|
||||
formal_params[param_index] = ECMA_GET_POINTER (formal_params_iter_p->current_value_p->value);
|
||||
formal_params[param_index] = ECMA_GET_NON_NULL_POINTER (formal_params_iter_p->current_value_p->value);
|
||||
}
|
||||
|
||||
for (int32_t indx = formal_params_number - 1;
|
||||
@@ -277,14 +277,14 @@ ecma_arguments_get_mapped_arg_value (ecma_object_t *map_p, /**< [[ParametersMap]
|
||||
equal to mapped argument's name */
|
||||
{
|
||||
ecma_property_t *scope_prop_p = ecma_get_internal_property (map_p, ECMA_INTERNAL_PROPERTY_SCOPE);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_POINTER (scope_prop_p->u.internal_property.value);
|
||||
ecma_object_t *lex_env_p = ECMA_GET_NON_NULL_POINTER (scope_prop_p->u.internal_property.value);
|
||||
JERRY_ASSERT(lex_env_p != NULL
|
||||
&& ecma_is_lexical_environment (lex_env_p));
|
||||
|
||||
ecma_value_t arg_name_prop_value = arg_name_prop_p->u.named_data_property.value;
|
||||
|
||||
JERRY_ASSERT (arg_name_prop_value.value_type == ECMA_TYPE_STRING);
|
||||
ecma_string_t *arg_name_p = ECMA_GET_POINTER (arg_name_prop_value.value);
|
||||
ecma_string_t *arg_name_p = ECMA_GET_NON_NULL_POINTER (arg_name_prop_value.value);
|
||||
|
||||
ecma_completion_value_t completion = ecma_op_get_binding_value (lex_env_p,
|
||||
arg_name_p,
|
||||
@@ -310,7 +310,7 @@ ecma_op_arguments_object_get (ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
// 1.
|
||||
ecma_property_t *map_prop_p = ecma_get_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ecma_object_t *map_p = ECMA_GET_POINTER (map_prop_p->u.internal_property.value);
|
||||
ecma_object_t *map_p = ECMA_GET_NON_NULL_POINTER (map_prop_p->u.internal_property.value);
|
||||
|
||||
// 2.
|
||||
ecma_property_t *mapped_prop_p = ecma_op_object_get_own_property (map_p, property_name_p);
|
||||
@@ -355,7 +355,7 @@ ecma_op_arguments_object_get_own_property (ecma_object_t *obj_p, /**< the object
|
||||
|
||||
// 3.
|
||||
ecma_property_t *map_prop_p = ecma_get_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ecma_object_t *map_p = ECMA_GET_POINTER (map_prop_p->u.internal_property.value);
|
||||
ecma_object_t *map_p = ECMA_GET_NON_NULL_POINTER (map_prop_p->u.internal_property.value);
|
||||
|
||||
// 4.
|
||||
ecma_property_t *mapped_prop_p = ecma_op_object_get_own_property (map_p, property_name_p);
|
||||
@@ -395,7 +395,7 @@ ecma_op_arguments_object_define_own_property (ecma_object_t *obj_p, /**< the obj
|
||||
{
|
||||
// 1.
|
||||
ecma_property_t *map_prop_p = ecma_get_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ecma_object_t *map_p = ECMA_GET_POINTER (map_prop_p->u.internal_property.value);
|
||||
ecma_object_t *map_p = ECMA_GET_NON_NULL_POINTER (map_prop_p->u.internal_property.value);
|
||||
|
||||
// 2.
|
||||
ecma_property_t *mapped_prop_p = ecma_op_object_get_own_property (map_p, property_name_p);
|
||||
@@ -488,7 +488,7 @@ ecma_op_arguments_object_delete (ecma_object_t *obj_p, /**< the object */
|
||||
{
|
||||
// 1.
|
||||
ecma_property_t *map_prop_p = ecma_get_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_PARAMETERS_MAP);
|
||||
ecma_object_t *map_p = ECMA_GET_POINTER (map_prop_p->u.internal_property.value);
|
||||
ecma_object_t *map_p = ECMA_GET_NON_NULL_POINTER (map_prop_p->u.internal_property.value);
|
||||
|
||||
// 2.
|
||||
ecma_property_t *mapped_prop_p = ecma_op_object_get_own_property (map_p, property_name_p);
|
||||
|
||||
@@ -306,7 +306,7 @@ ecma_op_general_object_put (ecma_object_t *obj_p, /**< the object */
|
||||
&& desc_p->type == ECMA_PROPERTY_NAMEDACCESSOR)
|
||||
{
|
||||
// a.
|
||||
ecma_object_t *setter_p = ECMA_GET_POINTER(desc_p->u.named_accessor_property.set_p);
|
||||
ecma_object_t *setter_p = ECMA_GET_NON_NULL_POINTER(desc_p->u.named_accessor_property.set_p);
|
||||
JERRY_ASSERT(setter_p != NULL);
|
||||
|
||||
ecma_completion_value_t ret_value;
|
||||
@@ -606,7 +606,7 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
|
||||
|
||||
if (ecma_op_is_callable (function_value_get_completion.u.value))
|
||||
{
|
||||
ecma_object_t *func_obj_p = ECMA_GET_POINTER (function_value_get_completion.u.value.value);
|
||||
ecma_object_t *func_obj_p = ECMA_GET_NON_NULL_POINTER (function_value_get_completion.u.value.value);
|
||||
|
||||
call_completion = ecma_op_function_call (func_obj_p,
|
||||
ecma_make_object_value (obj_p),
|
||||
|
||||
@@ -95,7 +95,7 @@ void
|
||||
ecma_free_reference (ecma_reference_t ref) /**< reference */
|
||||
{
|
||||
ecma_free_value (ref.base, true);
|
||||
ecma_deref_ecma_string (ECMA_GET_POINTER (ref.referenced_name_cp));
|
||||
ecma_deref_ecma_string (ECMA_GET_NON_NULL_POINTER (ref.referenced_name_cp));
|
||||
} /* ecma_free_reference */
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,7 +68,7 @@ ecma_op_create_string_object (ecma_value_t *arguments_list_p, /**< list of argum
|
||||
JERRY_ASSERT (ecma_is_completion_value_normal (to_str_arg_value));
|
||||
|
||||
JERRY_ASSERT (to_str_arg_value.u.value.value_type == ECMA_TYPE_STRING);
|
||||
prim_prop_str_value_p = ECMA_GET_POINTER (to_str_arg_value.u.value.value);
|
||||
prim_prop_str_value_p = ECMA_GET_NON_NULL_POINTER (to_str_arg_value.u.value.value);
|
||||
|
||||
int32_t string_len = ecma_string_get_length (prim_prop_str_value_p);
|
||||
JERRY_ASSERT (string_len >= 0);
|
||||
@@ -169,7 +169,7 @@ ecma_op_string_object_get_own_property (ecma_object_t *obj_p, /**< the array obj
|
||||
// 4.
|
||||
ecma_property_t* prim_value_prop_p = ecma_get_internal_property (obj_p,
|
||||
ECMA_INTERNAL_PROPERTY_PRIMITIVE_STRING_VALUE);
|
||||
ecma_string_t *prim_value_str_p = ECMA_GET_POINTER (prim_value_prop_p->u.internal_property.value);
|
||||
ecma_string_t *prim_value_str_p = ECMA_GET_NON_NULL_POINTER (prim_value_prop_p->u.internal_property.value);
|
||||
|
||||
// 6.
|
||||
int32_t length = ecma_string_get_length (prim_value_str_p);
|
||||
|
||||
Reference in New Issue
Block a user