/third_party/jerryscript/jerry-core/ecma/builtin-objects/ |
D | ecma-builtin-helpers-date.c | 54 extern inline ecma_number_t JERRY_ATTR_ALWAYS_INLINE 55 ecma_date_day (ecma_number_t time) /**< time value */ in ecma_date_day() 59 return (ecma_number_t) floor (time / ECMA_DATE_MS_PER_DAY); in ecma_date_day() 70 extern inline ecma_number_t JERRY_ATTR_ALWAYS_INLINE 71 ecma_date_time_within_day (ecma_number_t time) /**< time value */ in ecma_date_time_within_day() 75 ecma_number_t modulo = fmod (time, ECMA_DATE_MS_PER_DAY); in ecma_date_time_within_day() 92 static ecma_number_t 93 ecma_date_day_from_year (ecma_number_t year) /**< year value */ in ecma_date_day_from_year() 97 return (ecma_number_t) (365 * (year - 1970) in ecma_date_day_from_year() 111 static inline ecma_number_t JERRY_ATTR_ALWAYS_INLINE [all …]
|
D | ecma-builtin-helpers.h | 55 ecma_builtin_helper_string_index_normalize (ecma_number_t index, uint32_t length, bool nan_to_zero); 114 #define ECMA_DATE_HOURS_PER_DAY ((ecma_number_t) 24) 117 #define ECMA_DATE_MINUTES_PER_HOUR ((ecma_number_t) 60) 120 #define ECMA_DATE_SECONDS_PER_MINUTE ((ecma_number_t) 60) 123 #define ECMA_DATE_MS_PER_SECOND ((ecma_number_t) 1000) 153 ecma_number_t ecma_date_day (ecma_number_t time); 154 ecma_number_t ecma_date_time_within_day (ecma_number_t time); 155 ecma_number_t ecma_date_year_from_time (ecma_number_t time); 156 ecma_number_t ecma_date_month_from_time (ecma_number_t time); 157 ecma_number_t ecma_date_date_from_time (ecma_number_t time); [all …]
|
D | ecma-builtin-date.c | 54 static ecma_number_t 72 …ecma_number_t parsed_number = ecma_utf8_string_to_number (str_start_p, (lit_utf8_size_t) (*str_p -… in ecma_date_parse_date_chars() 109 static ecma_number_t 202 ecma_number_t prim_value = ecma_number_make_nan (); in ecma_date_construct_helper() 207 ecma_number_t year = ecma_get_number_from_value (year_value); in ecma_date_construct_helper() 208 ecma_number_t month = ecma_get_number_from_value (month_value); in ecma_date_construct_helper() 209 ecma_number_t date = ECMA_NUMBER_ONE; in ecma_date_construct_helper() 210 ecma_number_t hours = ECMA_NUMBER_ZERO; in ecma_date_construct_helper() 211 ecma_number_t minutes = ECMA_NUMBER_ZERO; in ecma_date_construct_helper() 212 ecma_number_t seconds = ECMA_NUMBER_ZERO; in ecma_date_construct_helper() [all …]
|
D | ecma-builtin-math.c | 125 ecma_number_t result_num = ecma_number_make_infinity (is_max); in ecma_builtin_math_object_max_min() 130 ecma_number_t arg_num; in ecma_builtin_math_object_max_min() 207 ecma_number_t result_num = 0; in ecma_builtin_math_object_hypot() 211 ecma_number_t arg_num; in ecma_builtin_math_object_hypot() 266 static ecma_number_t 267 ecma_builtin_math_object_trunc (ecma_number_t arg) in ecma_builtin_math_object_trunc() 276 return (ecma_number_t) 0.0; in ecma_builtin_math_object_trunc() 281 return (ecma_number_t) -0.0; in ecma_builtin_math_object_trunc() 284 return (ecma_number_t) arg - fmod (arg, 1); in ecma_builtin_math_object_trunc() 295 static ecma_number_t [all …]
|
D | ecma-builtin-date-prototype.c | 149 ecma_number_t num_value = ecma_get_number_from_value (tv); in ecma_builtin_date_prototype_to_json() 236 ecma_number_t date_num) /**< date converted to number */ in ecma_builtin_date_prototype_dispatch_get() 347 ecma_number_t date_num, /**< date converted to number */ in ecma_builtin_date_prototype_dispatch_set() 352 ecma_number_t converted_number[4]; in ecma_builtin_date_prototype_dispatch_set() 415 ecma_number_t day_part; in ecma_builtin_date_prototype_dispatch_set() 416 ecma_number_t time_part; in ecma_builtin_date_prototype_dispatch_set() 434 ecma_number_t year = ecma_date_year_from_time (date_num); in ecma_builtin_date_prototype_dispatch_set() 435 ecma_number_t month = ecma_date_month_from_time (date_num); in ecma_builtin_date_prototype_dispatch_set() 436 ecma_number_t day = ecma_date_date_from_time (date_num); in ecma_builtin_date_prototype_dispatch_set() 509 ecma_number_t hour = ecma_date_hour_from_time (date_num); in ecma_builtin_date_prototype_dispatch_set() [all …]
|
D | ecma-builtin-number.c | 115 ecma_number_t num = ecma_get_number_from_value (arg); in ecma_builtin_number_object_is_finite() 141 ecma_number_t num_val = ecma_get_number_from_value (arg); in ecma_builtin_number_object_is_nan() 170 ecma_number_t num = ecma_get_number_from_value (arg); in ecma_builtin_number_object_is_integer() 177 ecma_number_t int_num; in ecma_builtin_number_object_is_integer() 208 ecma_number_t num = ecma_get_number_from_value (arg); in ecma_builtin_number_object_is_safe_integer() 215 ecma_number_t int_num = ecma_number_trunc (num); in ecma_builtin_number_object_is_safe_integer()
|
D | ecma-builtin-number-prototype.c | 248 ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /**< this argument n… in ecma_builtin_number_prototype_object_to_string() 263 ecma_number_t arg_num; in ecma_builtin_number_prototype_object_to_string() 325 ecma_number_t counter = this_arg_number; in ecma_builtin_number_prototype_object_to_string() 385 ecma_number_t fraction = this_arg_number - (ecma_number_t) whole; in ecma_builtin_number_prototype_object_to_string() 446 fraction -= (ecma_number_t) floor (fraction); in ecma_builtin_number_prototype_object_to_string() 585 ecma_builtin_number_prepare_conversion (ecma_number_t *this_num_p, /**< [out] this argument number … in ecma_builtin_number_prepare_conversion() 594 ecma_number_t arg_num; in ecma_builtin_number_prepare_conversion() 651 ecma_builtin_number_prototype_object_to_fixed (ecma_number_t this_num, /**< this argument number */ in ecma_builtin_number_prototype_object_to_fixed() 749 ecma_builtin_number_prototype_object_to_exponential (ecma_number_t this_num, /**< this argument num… in ecma_builtin_number_prototype_object_to_exponential() 849 ecma_builtin_number_prototype_object_to_precision (ecma_number_t this_num, /**< this argument numbe… in ecma_builtin_number_prototype_object_to_precision() [all …]
|
D | ecma-builtin-array-prototype.c | 103 ecma_number_t length) /**< new length */ in ecma_builtin_array_prototype_helper_set_length() 266 … ((ecma_number_t) new_length)); in ecma_builtin_array_prototype_object_concat() 452 …t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, ((ecma_number_t) len)); in ecma_builtin_array_prototype_object_pop() 478 ecma_number_t n = (ecma_number_t) length; in ecma_builtin_array_prototype_object_push() 487 if ((ecma_number_t) (length + arguments_number) > UINT32_MAX) in ecma_builtin_array_prototype_object_push() 813 …t set_length_value = ecma_builtin_array_prototype_helper_set_length (obj_p, ((ecma_number_t) len)); in ecma_builtin_array_prototype_object_shift() 982 …t_length_value = ecma_builtin_array_prototype_helper_set_length (new_array_p, ((ecma_number_t) n)); in ecma_builtin_array_prototype_object_slice() 1027 ecma_number_t result = ECMA_NUMBER_ZERO; in ecma_builtin_array_prototype_object_sort_compare_helper() 1083 ecma_number_t ret_num; in ecma_builtin_array_prototype_object_sort_compare_helper() 1311 ecma_number_t delete_num; in ecma_builtin_array_prototype_object_splice() [all …]
|
/third_party/jerryscript/tests/unit-core/ |
D | test-string-to-number.c | 52 const ecma_number_t nums[] = in main() 54 (ecma_number_t) 1.0, in main() 55 (ecma_number_t) 0.5, in main() 56 (ecma_number_t) 12345.0, in main() 57 (ecma_number_t) 1.0e-45, in main() 58 (ecma_number_t) -2.5e+38, in main() 59 (ecma_number_t) -2.5e+38, in main() 60 (ecma_number_t) NAN, in main() 61 (ecma_number_t) NAN, in main() 62 (ecma_number_t) NAN, in main() [all …]
|
D | test-number-to-string.c | 44 const ecma_number_t nums[] = in main() 46 (ecma_number_t) 1.0, in main() 47 (ecma_number_t) 0.5, in main() 48 (ecma_number_t) 12345.0, in main() 49 (ecma_number_t) 12345.123, in main() 50 (ecma_number_t) 1.0e-45, in main() 51 (ecma_number_t) -2.5e+38, in main() 52 (ecma_number_t) NAN, in main() 53 (ecma_number_t) INFINITY, in main() 54 (ecma_number_t) -INFINITY, in main() [all …]
|
D | test-date-helpers.c | 22 #define MS_PER_DAY ((ecma_number_t) 86400000) 23 #define MS_PER_YEAR ((ecma_number_t) 365 * MS_PER_DAY) 24 #define START_OF_GREGORIAN_CALENDAR ((ecma_number_t) (-1970 * MS_PER_YEAR \ 53 TEST_ASSERT (ecma_date_year_from_time ((MS_PER_DAY) * (ecma_number_t) 365 - 1) == 1970); in main() 54 TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) 365) == 1971); in main() 55 TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) (365 * (2015 - 1970))) in main() 57 TEST_ASSERT (ecma_date_year_from_time (MS_PER_DAY * (ecma_number_t) (365.25 * (2015 - 1970))) in main()
|
/third_party/jerryscript/jerry-core/ecma/base/ |
D | ecma-helpers-number.c | 43 JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint32_t), 51 static ecma_number_t 72 ecma_number_unpack (ecma_number_t num, /**< ecma-number */ in ecma_number_unpack() 106 JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint64_t), 114 static ecma_number_t 135 ecma_number_unpack (ecma_number_t num, /**< ecma-number */ in ecma_number_unpack() 176 ecma_number_get_fraction_field (ecma_number_t num) /**< ecma-number */ in ecma_number_get_fraction_field() 191 ecma_number_get_biased_exponent_field (ecma_number_t num) /**< ecma-number */ in ecma_number_get_biased_exponent_field() 206 ecma_number_get_sign_field (ecma_number_t num) /**< ecma-number */ in ecma_number_get_sign_field() 223 ecma_number_is_nan (ecma_number_t num) /**< ecma-number */ in ecma_number_is_nan() [all …]
|
D | ecma-helpers.h | 246 ecma_value_t ecma_make_float_value (ecma_number_t *ecma_num_p); 247 ecma_value_t ecma_make_number_value (ecma_number_t ecma_number); 259 ecma_number_t JERRY_ATTR_PURE ecma_get_float_from_value (ecma_value_t value); 260 ecma_number_t * ecma_get_pointer_from_float_value (ecma_value_t value); 261 ecma_number_t JERRY_ATTR_PURE ecma_get_number_from_value (ecma_value_t value); 275 ecma_value_t ecma_update_float_number (ecma_value_t float_value, ecma_number_t new_number); 277 void ecma_value_assign_number (ecma_value_t *value_p, ecma_number_t ecma_number); 304 ecma_string_t *ecma_new_ecma_string_from_number (ecma_number_t num); 314 ecma_number_t ecma_string_to_number (const ecma_string_t *str_p); 390 ecma_number_t ecma_number_make_nan (void); [all …]
|
D | ecma-helpers-value.c | 485 ecma_create_float_number (ecma_number_t ecma_number) /**< value of the float number */ in ecma_create_float_number() 487 ecma_number_t *ecma_num_p = ecma_alloc_number (); in ecma_create_float_number() 500 ecma_make_float_value (ecma_number_t *ecma_num_p) /**< pointer to the float number */ in ecma_make_float_value() 522 ecma_is_number_equal_to_positive_zero (ecma_number_t ecma_number) /**< number */ in ecma_is_number_equal_to_positive_zero() 539 ecma_make_number_value (ecma_number_t ecma_number) /**< number to be encoded */ in ecma_make_number_value() 543 if ((ecma_number_t) integer_value == ecma_number in ecma_make_number_value() 566 return ecma_create_float_number ((ecma_number_t) int32_number); in ecma_make_int32_value() 582 return ecma_create_float_number ((ecma_number_t) uint32_number); in ecma_make_uint32_value() 697 inline ecma_number_t JERRY_ATTR_PURE JERRY_ATTR_ALWAYS_INLINE 702 return *(ecma_number_t *) ecma_get_pointer_from_ecma_value (value); in ecma_get_float_from_value() [all …]
|
D | ecma-globals.h | 1136 typedef float ecma_number_t; typedef 1143 ecma_number_t as_ecma_number_t; 1147 #define DOUBLE_TO_ECMA_NUMBER_T(value) (ecma_number_t) (value) 1181 typedef double ecma_number_t; typedef 1188 ecma_number_t as_ecma_number_t; 1227 #define ECMA_NUMBER_ZERO ((ecma_number_t) 0) 1232 #define ECMA_NUMBER_ONE ((ecma_number_t) 1) 1237 #define ECMA_NUMBER_TWO ((ecma_number_t) 2) 1242 #define ECMA_NUMBER_HALF ((ecma_number_t) 0.5f) 1247 #define ECMA_NUMBER_MINUS_ONE ((ecma_number_t) -1) [all …]
|
D | ecma-helpers-conversion.c | 293 static ecma_number_t 299 ecma_number_t num = ECMA_NUMBER_ZERO; in ecma_utf8_string_to_number_by_radix() 319 num = num * radix + (ecma_number_t) digit_value; in ecma_utf8_string_to_number_by_radix() 350 num = num * radix + (ecma_number_t) digit_value; in ecma_utf8_string_to_number_by_radix() 365 ecma_number_t 695 ecma_number_t num = (ecma_number_t) (uint32_t) fraction_uint64; in ecma_utf8_string_to_number() 697 ecma_number_t m = e_sign ? (ecma_number_t) 0.1 : (ecma_number_t) 10.0; in ecma_utf8_string_to_number() 760 ecma_number_to_uint32 (ecma_number_t num) /**< ecma-number */ in ecma_number_to_uint32() 768 const ecma_number_t abs_num = sign ? -num : num; in ecma_number_to_uint32() 773 const ecma_number_t num_2_pow_32 = (float) uint64_2_pow_32; in ecma_number_to_uint32() [all …]
|
D | ecma-literal-storage.c | 101 … ecma_number_t *num_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_number_t, number_list_p->values[i]); in ecma_free_number_list() 205 ecma_find_or_create_literal_number (ecma_number_t number_arg) /**< number to be searched */ in ecma_find_or_create_literal_number() 235 ecma_number_t *number_p = JMEM_CP_GET_NON_NULL_POINTER (ecma_number_t, in ecma_find_or_create_literal_number() 249 ecma_number_t *num_p = ecma_get_pointer_from_float_value (num); in ecma_find_or_create_literal_number() 445 lit_table_size += (uint32_t) sizeof (ecma_number_t); in ecma_save_literals_for_snapshot() 492 ecma_number_t num = ecma_get_float_from_value (lit_buffer_p[i]); in ecma_save_literals_for_snapshot() 493 memcpy (destination_p, &num, sizeof (ecma_number_t)); in ecma_save_literals_for_snapshot() 495 length = JERRY_ALIGNUP (sizeof (ecma_number_t), JERRY_SNAPSHOT_LITERAL_ALIGNMENT); in ecma_save_literals_for_snapshot() 539 ecma_number_t num; in ecma_snapshot_get_literal() 540 memcpy (&num, literal_p, sizeof (ecma_number_t)); in ecma_snapshot_get_literal()
|
D | ecma-alloc.c | 54 ecma_number_t * 57 return (ecma_number_t *) jmem_pools_alloc (sizeof (ecma_number_t)); in ecma_alloc_number() 64 ecma_dealloc_number (ecma_number_t *number_p) /**< number to be freed */ in ecma_dealloc_number() 66 jmem_pools_free ((uint8_t *) number_p, sizeof (ecma_number_t)); in ecma_dealloc_number()
|
D | ecma-alloc.h | 57 ecma_number_t *ecma_alloc_number (void); 62 void ecma_dealloc_number (ecma_number_t *number_p);
|
/third_party/jerryscript/jerry-core/vm/ |
D | opcodes-ecma-bitwise.c | 53 ecma_number_t result = ECMA_NUMBER_ZERO; in do_number_bitwise_logic() 61 result = (ecma_number_t) ((int32_t) (left_uint32 & right_uint32)); in do_number_bitwise_logic() 67 result = (ecma_number_t) ((int32_t) (left_uint32 | right_uint32)); in do_number_bitwise_logic() 73 result = (ecma_number_t) ((int32_t) (left_uint32 ^ right_uint32)); in do_number_bitwise_logic() 78 result = (ecma_number_t) (ecma_number_to_int32 (num_left) << (right_uint32 & 0x1F)); in do_number_bitwise_logic() 83 result = (ecma_number_t) (ecma_number_to_int32 (num_left) >> (right_uint32 & 0x1F)); in do_number_bitwise_logic() 89 result = (ecma_number_t) (left_uint32 >> (right_uint32 & 0x1F)); in do_number_bitwise_logic() 94 result = (ecma_number_t) ((int32_t) ~right_uint32); in do_number_bitwise_logic()
|
/third_party/jerryscript/jerry-core/ecma/operations/ |
D | ecma-typedarray-object.c | 44 static ecma_number_t 48 return (ecma_number_t) num; in ecma_typedarray_get_int8_element() 54 static ecma_number_t 58 return (ecma_number_t) num; in ecma_typedarray_get_uint8_element() 64 static ecma_number_t 69 return (ecma_number_t) num; in ecma_typedarray_get_int16_element() 75 static ecma_number_t 80 return (ecma_number_t) num; in ecma_typedarray_get_uint16_element() 86 static ecma_number_t 91 return (ecma_number_t) num; in ecma_typedarray_get_int32_element() [all …]
|
D | ecma-number-arithmetic.h | 28 ecma_number_t ecma_op_number_remainder (ecma_number_t left_num, ecma_number_t right_num);
|
D | ecma-conversion.c | 98 ecma_number_t x_num = ecma_get_number_from_value (x); in ecma_op_same_value() 99 ecma_number_t y_num = ecma_get_number_from_value (y); in ecma_op_same_value() 148 ecma_number_t x_num = ecma_get_number_from_value (x); in ecma_op_same_value_zero() 149 ecma_number_t y_num = ecma_get_number_from_value (y); in ecma_op_same_value_zero() 237 ecma_number_t num = ecma_get_float_from_value (value); in ecma_op_to_boolean() 337 ecma_number_t *number_p) /**< [out] ecma number */ in ecma_get_number() 439 return ecma_new_ecma_string_from_number ((ecma_number_t) num); in ecma_op_to_string() 448 ecma_number_t num = ecma_get_float_from_value (value); in ecma_op_to_string() 871 ecma_number_t *number_p) /**< [out] ecma number */ in ecma_op_to_integer() 887 ecma_number_t number = *number_p; in ecma_op_to_integer() [all …]
|
D | ecma-number-arithmetic.c | 35 ecma_number_t 36 ecma_op_number_remainder (ecma_number_t left_num, /**< left operand */ in ecma_op_number_remainder() 37 ecma_number_t right_num) /**< right operand */ in ecma_op_number_remainder()
|
/third_party/jerryscript/jerry-core/ecma/builtin-objects/typedarray/ |
D | ecma-builtin-typedarray-prototype.c | 225 ecma_number_t element_num = typedarray_getter_cb (info.buffer_p + byte_pos); in ecma_builtin_typedarray_prototype_exec_routine() 474 ecma_number_t element_num = src_typedarray_getter_cb (src_info.buffer_p + src_byte_pos); in ecma_builtin_typedarray_prototype_map() 487 ecma_number_t mapped_num; in ecma_builtin_typedarray_prototype_map() 565 ecma_number_t acc_num = getter_cb (info.buffer_p + byte_pos); in ecma_builtin_typedarray_prototype_reduce_with_direction() 600 ecma_number_t get_num = getter_cb (info.buffer_p + byte_pos); in ecma_builtin_typedarray_prototype_reduce_with_direction() 732 ecma_number_t get_num = getter_cb (info.buffer_p + byte_pos); in ecma_builtin_typedarray_prototype_filter() 840 ecma_number_t target_offset_num; in ecma_op_typedarray_set_with_typedarray() 846 if (target_offset_num <= -1.0 || target_offset_num >= (ecma_number_t) UINT32_MAX + 0.5) in ecma_op_typedarray_set_with_typedarray() 901 ecma_number_t elem_num = src_typedarray_getter_cb (src_info.buffer_p + src_byte_index); in ecma_op_typedarray_set_with_typedarray() 939 ecma_number_t target_offset_num; in ecma_builtin_typedarray_prototype_set() [all …]
|