Skip to content

Commit b828d4a

Browse files
committed
Rename ecma_is_value_error to ECMA_IS_VALUE_ERROR.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent 1eeed7e commit b828d4a

28 files changed

+147
-154
lines changed

jerry-core/ecma/base/ecma-globals.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ typedef int32_t ecma_integer_value_t;
172172
#define ECMA_INTEGER_MULTIPLY_MAX 0x2d41
173173
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32 */
174174

175+
/**
176+
* Checks whether the error flag is set.
177+
*/
178+
#define ECMA_IS_VALUE_ERROR(value) \
179+
(unlikely ((value & ECMA_VALUE_ERROR_FLAG) != 0))
180+
175181
/**
176182
* Internal properties' identifiers.
177183
*/

jerry-core/ecma/base/ecma-helpers-value.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,6 @@ ecma_is_value_object (ecma_value_t value) /**< ecma value */
311311
return (ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT);
312312
} /* ecma_is_value_object */
313313

314-
/**
315-
* Check if the value is an error value.
316-
*
317-
* @return true - if the value contains an error value,
318-
* false - otherwise.
319-
*/
320-
inline bool __attr_pure___ __attr_always_inline___
321-
ecma_is_value_error (ecma_value_t value) /**< ecma value */
322-
{
323-
return (value & ECMA_VALUE_ERROR_FLAG) != 0;
324-
} /* ecma_is_value_error */
325-
326314
/**
327315
* Debug assertion that specified value's type is one of ECMA-defined
328316
* script-visible types, i.e.: undefined, null, boolean, number, string, object.
@@ -501,7 +489,7 @@ ecma_value_t __attr_const___
501489
ecma_make_error_value (ecma_value_t value) /**< original ecma value */
502490
{
503491
/* Error values cannot be converted. */
504-
JERRY_ASSERT (!ecma_is_value_error (value));
492+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (value));
505493

506494
return value | ECMA_VALUE_ERROR_FLAG;
507495
} /* ecma_make_error_value */
@@ -618,11 +606,11 @@ ecma_invert_boolean_value (ecma_value_t value) /**< ecma value */
618606
ecma_value_t __attr_pure___
619607
ecma_get_value_from_error_value (ecma_value_t value) /**< ecma value */
620608
{
621-
JERRY_ASSERT (ecma_is_value_error (value));
609+
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (value));
622610

623611
value = (ecma_value_t) (value & ~ECMA_VALUE_ERROR_FLAG);
624612

625-
JERRY_ASSERT (!ecma_is_value_error (value));
613+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (value));
626614

627615
return value;
628616
} /* ecma_get_value_from_error_value */

jerry-core/ecma/base/ecma-helpers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ extern bool ecma_is_value_float_number (ecma_value_t) __attr_pure___;
129129
extern bool ecma_is_value_number (ecma_value_t) __attr_pure___;
130130
extern bool ecma_is_value_string (ecma_value_t) __attr_pure___;
131131
extern bool ecma_is_value_object (ecma_value_t) __attr_pure___;
132-
extern bool ecma_is_value_error (ecma_value_t) __attr_pure___;
133132

134133
extern void ecma_check_value_type_is_spec_defined (ecma_value_t);
135134

jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ ecma_builtin_array_prototype_object_every (ecma_value_t this_arg, /**< this argu
20052005

20062006
/* We already checked that arg1 is callable, so it will always coerce to an object. */
20072007
ecma_value_t to_object_comp = ecma_op_to_object (arg1);
2008-
JERRY_ASSERT (!ecma_is_value_error (to_object_comp));
2008+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
20092009

20102010
func_object_p = ecma_get_object_from_value (to_object_comp);
20112011

@@ -2103,7 +2103,7 @@ ecma_builtin_array_prototype_object_some (ecma_value_t this_arg, /**< this argum
21032103

21042104
/* We already checked that arg1 is callable, so it will always coerce to an object. */
21052105
ecma_value_t to_object_comp = ecma_op_to_object (arg1);
2106-
JERRY_ASSERT (!ecma_is_value_error (to_object_comp));
2106+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
21072107

21082108
func_object_p = ecma_get_object_from_value (to_object_comp);
21092109

@@ -2200,7 +2200,7 @@ ecma_builtin_array_prototype_object_for_each (ecma_value_t this_arg, /**< this a
22002200

22012201
/* We already checked that arg1 is callable, so it will always coerce to an object. */
22022202
ecma_value_t to_object_comp = ecma_op_to_object (arg1);
2203-
JERRY_ASSERT (!ecma_is_value_error (to_object_comp));
2203+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (to_object_comp));
22042204

22052205
func_object_p = ecma_get_object_from_value (to_object_comp);
22062206

@@ -2295,7 +2295,7 @@ ecma_builtin_array_prototype_object_map (ecma_value_t this_arg, /**< this argume
22952295

22962296
/* 6. */
22972297
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
2298-
JERRY_ASSERT (!ecma_is_value_error (new_array));
2298+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
22992299
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
23002300

23012301
/* 7-8. */
@@ -2402,7 +2402,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t this_arg, /**< this arg
24022402

24032403
/* 6. */
24042404
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
2405-
JERRY_ASSERT (!ecma_is_value_error (new_array));
2405+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
24062406
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
24072407

24082408
/* We already checked that arg1 is callable, so it will always be an object. */

jerry-core/ecma/builtin-objects/ecma-builtin-date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ ecma_builtin_date_dispatch_construct (const ecma_value_t *arguments_list_p, /**<
564564
}
565565
else
566566
{
567-
JERRY_ASSERT (ecma_is_value_error (ret_value));
567+
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (ret_value));
568568
ecma_deref_object (obj_p);
569569
}
570570

jerry-core/ecma/builtin-objects/ecma-builtin-error-prototype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
8787
name_to_str_completion = ecma_op_to_string (name_get_ret_value);
8888
}
8989

90-
if (unlikely (ecma_is_value_error (name_to_str_completion)))
90+
if (unlikely (ECMA_IS_VALUE_ERROR (name_to_str_completion)))
9191
{
9292
ret_value = ecma_copy_value (name_to_str_completion);
9393
}
@@ -112,7 +112,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
112112
msg_to_str_completion = ecma_op_to_string (msg_get_ret_value);
113113
}
114114

115-
if (unlikely (ecma_is_value_error (msg_to_str_completion)))
115+
if (unlikely (ECMA_IS_VALUE_ERROR (msg_to_str_completion)))
116116
{
117117
ret_value = ecma_copy_value (msg_to_str_completion);
118118
}

jerry-core/ecma/builtin-objects/ecma-builtin-function-prototype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ ecma_builtin_function_prototype_object_bind (ecma_value_t this_arg, /**< this ar
289289
if (ecma_object_get_class_name (this_arg_obj_p) == LIT_MAGIC_STRING_FUNCTION_UL)
290290
{
291291
ecma_value_t get_len_value = ecma_op_object_get (this_arg_obj_p, magic_string_length_p);
292-
JERRY_ASSERT (!ecma_is_value_error (get_len_value));
292+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (get_len_value));
293293
JERRY_ASSERT (ecma_is_value_number (get_len_value));
294294

295295
const ecma_length_t bound_arg_count = arg_count > 1 ? arg_count - 1 : 0;

jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ecma_builtin_helper_object_to_string (const ecma_value_t this_arg) /**< this arg
6565
{
6666
ecma_value_t obj_this = ecma_op_to_object (this_arg);
6767

68-
if (ecma_is_value_error (obj_this))
68+
if (ECMA_IS_VALUE_ERROR (obj_this))
6969
{
7070
return obj_this;
7171
}
@@ -200,7 +200,7 @@ ecma_builtin_helper_object_get_properties (ecma_object_t *obj_p, /**< object */
200200
JERRY_ASSERT (obj_p != NULL);
201201

202202
ecma_value_t new_array = ecma_op_create_array_object (NULL, 0, false);
203-
JERRY_ASSERT (!ecma_is_value_error (new_array));
203+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (new_array));
204204
ecma_object_t *new_array_p = ecma_get_object_from_value (new_array);
205205

206206
uint32_t index = 0;

jerry-core/ecma/builtin-objects/ecma-builtin-json.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ ecma_builtin_json_parse_value (ecma_json_token_t *token_p) /**< token argument *
533533
uint32_t length = 0;
534534

535535
ecma_value_t array_construction = ecma_op_create_array_object (NULL, 0, false);
536-
JERRY_ASSERT (!ecma_is_value_error (array_construction));
536+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (array_construction));
537537

538538
ecma_object_t *array_p = ecma_get_object_from_value (array_construction);
539539

@@ -678,7 +678,7 @@ ecma_builtin_json_walk (ecma_object_t *reviver_p, /**< reviver function */
678678
}
679679
else
680680
{
681-
JERRY_ASSERT (ecma_is_value_error (ret_value));
681+
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (ret_value));
682682
}
683683

684684
ECMA_FINALIZE (value_get);
@@ -1323,7 +1323,7 @@ ecma_builtin_json_str (ecma_string_t *key_p, /**< property key*/
13231323
if (ecma_is_value_null (my_val) || ecma_is_value_boolean (my_val))
13241324
{
13251325
ret_value = ecma_op_to_string (my_val);
1326-
JERRY_ASSERT (!ecma_is_value_error (ret_value));
1326+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
13271327
}
13281328
/* 8. */
13291329
else if (ecma_is_value_string (my_val))
@@ -1340,7 +1340,7 @@ ecma_builtin_json_str (ecma_string_t *key_p, /**< property key*/
13401340
if (!ecma_number_is_nan (num_value_p) && !ecma_number_is_infinity (num_value_p))
13411341
{
13421342
ret_value = ecma_op_to_string (my_val);
1343-
JERRY_ASSERT (!ecma_is_value_error (ret_value));
1343+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (ret_value));
13441344
}
13451345
else
13461346
{
@@ -1482,7 +1482,7 @@ ecma_builtin_json_object (ecma_object_t *obj_p, /**< the object*/
14821482

14831483
/* 8.b.i */
14841484
ecma_value_t str_comp_val = ecma_builtin_json_quote (key_p);
1485-
JERRY_ASSERT (!ecma_is_value_error (str_comp_val));
1485+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (str_comp_val));
14861486

14871487
ecma_string_t *member_str_p = ecma_get_string_from_value (str_comp_val);
14881488

jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg
17631763
ecma_string_t *zero_str_p = ecma_new_ecma_string_from_number (ECMA_NUMBER_ZERO);
17641764
ecma_value_t match_comp_value = ecma_op_object_get (match_array_obj_p, zero_str_p);
17651765

1766-
JERRY_ASSERT (!ecma_is_value_error (match_comp_value));
1766+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (match_comp_value));
17671767

17681768
ecma_string_t *match_str_p = ecma_get_string_from_value (match_comp_value);
17691769
ecma_length_t match_str_length = ecma_string_get_length (match_str_p);
@@ -1842,7 +1842,7 @@ ecma_builtin_string_prototype_object_split (ecma_value_t this_arg, /**< this arg
18421842

18431843
ecma_value_t match_comp_value = ecma_op_object_get (match_array_obj_p, idx_str_p);
18441844

1845-
JERRY_ASSERT (!ecma_is_value_error (match_comp_value));
1845+
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (match_comp_value));
18461846

18471847
/* 13.c.iii.7.b */
18481848
ecma_value_t put_comp = ecma_builtin_helper_def_prop (new_array_p,

0 commit comments

Comments
 (0)