diff --git a/jerry-core/api/jerry-snapshot.c b/jerry-core/api/jerry-snapshot.c index 33760b299f..9a5f642ba0 100644 --- a/jerry-core/api/jerry-snapshot.c +++ b/jerry-core/api/jerry-snapshot.c @@ -123,11 +123,7 @@ snapshot_write_to_buffer_by_offset (uint8_t *buffer_p, /**< buffer */ /** * Maximum snapshot write buffer offset. */ -#if !JERRY_NUMBER_TYPE_FLOAT64 -#define JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET (0x7fffff >> 1) -#else /* JERRY_NUMBER_TYPE_FLOAT64 */ #define JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET (UINT32_MAX >> 1) -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Save snapshot helper. diff --git a/jerry-core/api/jerryscript.c b/jerry-core/api/jerryscript.c index d8174b92c0..e2ea5f2372 100644 --- a/jerry-core/api/jerryscript.c +++ b/jerry-core/api/jerryscript.c @@ -6587,9 +6587,7 @@ static jerry_typedarray_mapping_t jerry_typedarray_mappings[] = { TYPEDARRAY_ENTRY (INT8, INT8, 0), TYPEDARRAY_ENTRY (UINT16, UINT16, 1), TYPEDARRAY_ENTRY (INT16, INT16, 1), TYPEDARRAY_ENTRY (UINT32, UINT32, 2), TYPEDARRAY_ENTRY (INT32, INT32, 2), TYPEDARRAY_ENTRY (FLOAT32, FLOAT32, 2), -#if JERRY_NUMBER_TYPE_FLOAT64 TYPEDARRAY_ENTRY (FLOAT64, FLOAT64, 3), -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT TYPEDARRAY_ENTRY (BIGINT64, BIGINT64, 3), TYPEDARRAY_ENTRY (BIGUINT64, BIGUINT64, 3), #endif /* JERRY_BUILTIN_BIGINT */ diff --git a/jerry-core/config.h b/jerry-core/config.h index 002f49e3ca..b16bb1b635 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -666,13 +666,6 @@ * Cross component requirements check. */ -/** - * The date module can only use the float 64 number types. - */ -#if JERRY_BUILTIN_DATE && !JERRY_NUMBER_TYPE_FLOAT64 -#error "Date does not support float32" -#endif /* JERRY_BUILTIN_DATE && !JERRY_NUMBER_TYPE_FLOAT64 */ - /** * Source name related types into a single guard */ diff --git a/jerry-core/ecma/base/ecma-error-messages.inc.h b/jerry-core/ecma/base/ecma-error-messages.inc.h index 64a18f8937..11fd28ba03 100644 --- a/jerry-core/ecma/base/ecma-error-messages.inc.h +++ b/jerry-core/ecma/base/ecma-error-messages.inc.h @@ -472,10 +472,8 @@ ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT, "Argument 'this' is n ECMA_ERROR_DEF (ECMA_ERR_CANNOT_DECLARE_SAME_PRIVATE_FIELD_TWICE, "Cannot declare same private field twice") #if JERRY_BUILTIN_TYPEDARRAY ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW, "Constructor Float32Array requires 'new'") -#endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT64_ARRAY_REQUIRES_NEW, "Constructor Float64Array requires 'new'") -#endif /* JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 */ +#endif /* JERRY_BUILTIN_TYPEDARRAY */ ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_PROTOTYPE_NOT_A_CONSTRUCTOR, "Function.prototype is not a constructor") #if JERRY_MODULE_SYSTEM ECMA_ERROR_DEF (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE, "Imported binding shadows local variable") diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h index ae5ed10523..526f269be3 100644 --- a/jerry-core/ecma/base/ecma-globals.h +++ b/jerry-core/ecma/base/ecma-globals.h @@ -218,45 +218,23 @@ enum #endif /* JERRY_BUILTIN_GLOBAL_THIS */ }; -#if !JERRY_NUMBER_TYPE_FLOAT64 /** * Maximum integer number for an ecma value */ -#define ECMA_INTEGER_NUMBER_MAX 0x7fffff -/** - * Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT) - */ -#define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7fffff0 -#else /* JERRY_NUMBER_TYPE_FLOAT64 */ -/** - * Maximum integer number for an ecma value - */ -#define ECMA_INTEGER_NUMBER_MAX 0x7ffffff +#define ECMA_INTEGER_NUMBER_MAX 0x7ffffff /** * Maximum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT) */ #define ECMA_INTEGER_NUMBER_MAX_SHIFTED 0x7ffffff0 -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#if !JERRY_NUMBER_TYPE_FLOAT64 -/** - * Minimum integer number for an ecma value - */ -#define ECMA_INTEGER_NUMBER_MIN -0x7fffff -/** - * Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT) - */ -#define ECMA_INTEGER_NUMBER_MIN_SHIFTED -0x7fffff0 -#else /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Minimum integer number for an ecma value */ -#define ECMA_INTEGER_NUMBER_MIN -0x8000000 +#define ECMA_INTEGER_NUMBER_MIN -0x8000000 /** * Minimum integer number for an ecma value (shifted left with ECMA_DIRECT_SHIFT) */ #define ECMA_INTEGER_NUMBER_MIN_SHIFTED (-0x7fffffff - 1) /* -0x80000000 */ -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ #if ECMA_DIRECT_SHIFT != 4 #error "Please update ECMA_INTEGER_NUMBER_MIN/MAX_SHIFTED according to the new value of ECMA_DIRECT_SHIFT." @@ -270,11 +248,7 @@ enum /** * Maximum integer number, which if squared, still fits in ecma_integer_value_t */ -#if !JERRY_NUMBER_TYPE_FLOAT64 -#define ECMA_INTEGER_MULTIPLY_MAX 0xb50 -#else /* JERRY_NUMBER_TYPE_FLOAT64 */ #define ECMA_INTEGER_MULTIPLY_MAX 0x2d41 -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Checks whether the error flag is set. @@ -1333,11 +1307,7 @@ typedef struct /** * Description of an ecma-number */ -#if JERRY_NUMBER_TYPE_FLOAT64 typedef double ecma_number_t; -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -typedef float ecma_number_t; -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Convert double to an ecma-number. diff --git a/jerry-core/ecma/base/ecma-helpers-conversion.c b/jerry-core/ecma/base/ecma-helpers-conversion.c index cae04a1dbd..819282d826 100644 --- a/jerry-core/ecma/base/ecma-helpers-conversion.c +++ b/jerry-core/ecma/base/ecma-helpers-conversion.c @@ -30,8 +30,6 @@ * @{ */ -#if JERRY_NUMBER_TYPE_FLOAT64 - /** * \addtogroup ecmahelpersbigintegers Helpers for operations intermediate 128-bit integers * @{ @@ -253,28 +251,6 @@ ecma_uint64_normalize_shift (uint64_t n) /**< integer to count leading zeros in * @} */ -/** - * Number.MAX_VALUE exponent part when using 64 bit float representation. - */ -#define NUMBER_MAX_DECIMAL_EXPONENT 308 -/** - * Number.MIN_VALUE exponent part when using 64 bit float representation. - */ -#define NUMBER_MIN_DECIMAL_EXPONENT -324 - -#elif !JERRY_NUMBER_TYPE_FLOAT64 - -/** - * Number.MAX_VALUE exponent part when using 32 bit float representation. - */ -#define NUMBER_MAX_DECIMAL_EXPONENT 38 -/** - * Number.MIN_VALUE exponent part when using 32 bit float representation. - */ -#define NUMBER_MIN_DECIMAL_EXPONENT -45 - -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ - /** * Value of epsilon */ @@ -535,7 +511,6 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ return sign ? -ECMA_NUMBER_ZERO : ECMA_NUMBER_ZERO; } -#if JERRY_NUMBER_TYPE_FLOAT64 /* * 128-bit mantissa storage * @@ -628,25 +603,6 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */ JERRY_ASSERT (significand < (1ull << ECMA_NUMBER_FRACTION_WIDTH)); return ecma_number_create (sign, (uint32_t) binary_exponent, significand); -#elif !JERRY_NUMBER_TYPE_FLOAT64 - /* Less precise conversion */ - ecma_number_t num = (ecma_number_t) (uint32_t) fraction_uint64; - - ecma_number_t m = e_sign ? (ecma_number_t) 0.1 : (ecma_number_t) 10.0; - - while (e) - { - if (e % 2) - { - num *= m; - } - - m *= m; - e /= 2; - } - - return num; -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ } /* ecma_utf8_string_to_number */ /** diff --git a/jerry-core/ecma/base/ecma-helpers-number.h b/jerry-core/ecma/base/ecma-helpers-number.h index 85969d15c5..b3a006ce2a 100644 --- a/jerry-core/ecma/base/ecma-helpers-number.h +++ b/jerry-core/ecma/base/ecma-helpers-number.h @@ -23,11 +23,7 @@ /** * Binary representation of an ecma-number */ -#if JERRY_NUMBER_TYPE_FLOAT64 typedef uint64_t ecma_binary_num_t; -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -typedef uint32_t ecma_binary_num_t; -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Makes it possible to read/write the binary representation of an ecma_number_t @@ -50,11 +46,7 @@ ecma_number_t ecma_number_create (bool sign, uint32_t biased_exp, uint64_t fract /** * Maximum number of significant decimal digits that an ecma-number can store */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_MAX_DIGITS (19) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_MAX_DIGITS (9) -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Width of sign field @@ -70,20 +62,12 @@ ecma_number_t ecma_number_create (bool sign, uint32_t biased_exp, uint64_t fract * See also: * IEEE-754 2008, 3.6, Table 3.5 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_BIASED_EXP_WIDTH (11) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_BIASED_EXP_WIDTH (8) -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Exponent bias */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_EXPONENT_BIAS (1023) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_EXPONENT_BIAS (127) -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Width of fraction field @@ -91,38 +75,22 @@ ecma_number_t ecma_number_create (bool sign, uint32_t biased_exp, uint64_t fract * See also: * IEEE-754 2008, 3.6, Table 3.5 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_FRACTION_WIDTH (52) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_FRACTION_WIDTH (23) -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Sign bit in ecma-numbers */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_SIGN_BIT 0x8000000000000000ull -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_SIGN_BIT 0x7f800000u; -#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */ /** * Binary representation of an IEEE-754 QNaN value. */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_BINARY_QNAN 0x7ff8000000000000ull -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_BINARY_QNAN 0x7fc00000u -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Binary representation of an IEEE-754 Infinity value. */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_BINARY_INF 0x7ff0000000000000ull -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_BINARY_INF 0x7f800000u -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Binary representation of an IEEE-754 zero value. @@ -134,73 +102,45 @@ ecma_number_t ecma_number_create (bool sign, uint32_t biased_exp, uint64_t fract * * See also: ECMA_262 v5, 15.7.3.3 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_MIN_VALUE ((ecma_number_t) 5e-324) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_MIN_VALUE (FLT_MIN) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.MAX_VALUE (i.e., the maximum value of ecma-number) * * See also: ECMA_262 v5, 15.7.3.2 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_MAX_VALUE ((ecma_number_t) 1.7976931348623157e+308) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_MAX_VALUE (FLT_MAX) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.EPSILON * * See also: ECMA_262 v6, 20.1.2.1 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_EPSILON ((ecma_number_t) 2.2204460492503130808472633361816e-16) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_EPSILON ((ecma_number_t) 1.1920928955078125e-7) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.MAX_SAFE_INTEGER * * See also: ECMA_262 v6, 20.1.2.6 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_MAX_SAFE_INTEGER ((ecma_number_t) 0x1FFFFFFFFFFFFF) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_MAX_SAFE_INTEGER ((ecma_number_t) 0xFFFFFF) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.MIN_SAFE_INTEGER * * See also: ECMA_262 v6, 20.1.2.8 */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_NUMBER_MIN_SAFE_INTEGER ((ecma_number_t) -0x1FFFFFFFFFFFFF) -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define ECMA_NUMBER_MIN_SAFE_INTEGER ((ecma_number_t) -0xFFFFFF) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.MAX_VALUE exponent part */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define NUMBER_MAX_DECIMAL_EXPONENT 308 -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define NUMBER_MAX_DECIMAL_EXPONENT 38 -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Number.MIN_VALUE exponent part */ -#if JERRY_NUMBER_TYPE_FLOAT64 #define NUMBER_MIN_DECIMAL_EXPONENT -324 -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -#define NUMBER_MIN_DECIMAL_EXPONENT -45 -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ /** * Euler number diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c index 6cb9ba3a65..1342ac52c8 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.c @@ -49,9 +49,7 @@ enum ECMA_DATAVIEW_PROTOTYPE_GET_INT32, ECMA_DATAVIEW_PROTOTYPE_GET_UINT32, ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT32, -#if JERRY_NUMBER_TYPE_FLOAT64 ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT64, -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT ECMA_DATAVIEW_PROTOTYPE_GET_BIGINT64, ECMA_DATAVIEW_PROTOTYPE_GET_BIGUINT64, @@ -64,9 +62,7 @@ enum ECMA_DATAVIEW_PROTOTYPE_SET_INT32, ECMA_DATAVIEW_PROTOTYPE_SET_UINT32, ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT32, -#if JERRY_NUMBER_TYPE_FLOAT64 ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT64, -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT ECMA_DATAVIEW_PROTOTYPE_SET_BIGINT64, ECMA_DATAVIEW_PROTOTYPE_SET_BIGUINT64, @@ -162,9 +158,7 @@ ecma_builtin_dataview_prototype_dispatch_routine (uint8_t builtin_routine_id, /* return ecma_builtin_dataview_prototype_object_getters (this_arg, builtin_routine_id); } case ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT32: -#if JERRY_NUMBER_TYPE_FLOAT64 case ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT64: -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ case ECMA_DATAVIEW_PROTOTYPE_GET_INT16: case ECMA_DATAVIEW_PROTOTYPE_GET_INT32: case ECMA_DATAVIEW_PROTOTYPE_GET_UINT16: @@ -183,9 +177,7 @@ ecma_builtin_dataview_prototype_dispatch_routine (uint8_t builtin_routine_id, /* id); } case ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT32: -#if JERRY_NUMBER_TYPE_FLOAT64 case ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT64: -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ case ECMA_DATAVIEW_PROTOTYPE_SET_INT16: case ECMA_DATAVIEW_PROTOTYPE_SET_INT32: case ECMA_DATAVIEW_PROTOTYPE_SET_UINT16: diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.inc.h index 82ef26b1d3..ab4453b37a 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-dataview-prototype.inc.h @@ -33,9 +33,7 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, LIT_MAGIC_STRING_DATAVIEW_UL, ECM /* Routine properties: * (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */ ROUTINE (LIT_MAGIC_STRING_GET_FLOAT_32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT32, 2, 1) -#if JERRY_NUMBER_TYPE_FLOAT64 ROUTINE (LIT_MAGIC_STRING_GET_FLOAT_64_UL, ECMA_DATAVIEW_PROTOTYPE_GET_FLOAT64, 2, 1) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ ROUTINE (LIT_MAGIC_STRING_GET_INT8_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT8, 1, 1) ROUTINE (LIT_MAGIC_STRING_GET_INT16_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT16, 2, 1) ROUTINE (LIT_MAGIC_STRING_GET_INT32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_INT32, 2, 1) @@ -43,9 +41,7 @@ ROUTINE (LIT_MAGIC_STRING_GET_UINT8_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT8, 2, 1) ROUTINE (LIT_MAGIC_STRING_GET_UINT16_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT16, 2, 1) ROUTINE (LIT_MAGIC_STRING_GET_UINT32_UL, ECMA_DATAVIEW_PROTOTYPE_GET_UINT32, 2, 1) ROUTINE (LIT_MAGIC_STRING_SET_FLOAT_32_UL, ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT32, 2, 2) -#if JERRY_NUMBER_TYPE_FLOAT64 ROUTINE (LIT_MAGIC_STRING_SET_FLOAT_64_UL, ECMA_DATAVIEW_PROTOTYPE_SET_FLOAT64, 2, 2) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ ROUTINE (LIT_MAGIC_STRING_SET_INT8_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT8, 1, 2) ROUTINE (LIT_MAGIC_STRING_SET_INT16_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT16, 2, 2) ROUTINE (LIT_MAGIC_STRING_SET_INT32_UL, ECMA_DATAVIEW_PROTOTYPE_SET_INT32, 2, 2) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h index e0b02698f0..622918c4b2 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-global.inc.h @@ -139,9 +139,7 @@ OBJECT_VALUE (LIT_MAGIC_STRING_UINT32_ARRAY_UL, ECMA_BUILTIN_ID_UINT32ARRAY, ECM OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, ECMA_BUILTIN_ID_FLOAT32ARRAY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#if JERRY_NUMBER_TYPE_FLOAT64 OBJECT_VALUE (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, ECMA_BUILTIN_ID_FLOAT64ARRAY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT OBJECT_VALUE (LIT_MAGIC_STRING_BIGINT64_ARRAY_UL, ECMA_BUILTIN_ID_BIGINT64ARRAY, ECMA_PROPERTY_CONFIGURABLE_WRITABLE) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h index 449aef98bd..4a447520d9 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtins.inc.h @@ -384,13 +384,11 @@ BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FLOAT32ARRAY, true, float32array) -#if JERRY_NUMBER_TYPE_FLOAT64 BUILTIN_ROUTINE (ECMA_BUILTIN_ID_FLOAT64ARRAY, ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION, ECMA_BUILTIN_ID_TYPEDARRAY, true, float64array) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT BUILTIN_ROUTINE (ECMA_BUILTIN_ID_BIGINT64ARRAY, @@ -454,13 +452,11 @@ BUILTIN (ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE, true, float32array_prototype) -#if JERRY_NUMBER_TYPE_FLOAT64 BUILTIN (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE, ECMA_OBJECT_TYPE_BUILT_IN_GENERAL, ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE, true, float64array_prototype) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT BUILTIN (ECMA_BUILTIN_ID_BIGINT64ARRAY_PROTOTYPE, diff --git a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c index 205d23a785..ae8d398224 100644 --- a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c +++ b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.c @@ -16,7 +16,6 @@ #include "ecma-builtins.h" #if JERRY_BUILTIN_TYPEDARRAY -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -41,5 +40,4 @@ * @} */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ diff --git a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h index 815be714a1..84c8dd0f16 100644 --- a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array-prototype.inc.h @@ -18,11 +18,9 @@ */ #if JERRY_BUILTIN_TYPEDARRAY -#if JERRY_NUMBER_TYPE_FLOAT64 #define TYPEDARRAY_BYTES_PER_ELEMENT 8 #define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT64ARRAY #include "ecma-builtin-typedarray-prototype-template.inc.h" -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ diff --git a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c index fe3cebb874..b47824b3bf 100644 --- a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c +++ b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.c @@ -23,7 +23,6 @@ #include "jrt.h" #if JERRY_BUILTIN_TYPEDARRAY -#if JERRY_NUMBER_TYPE_FLOAT64 #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" @@ -75,5 +74,4 @@ ecma_builtin_float64array_dispatch_construct (const ecma_value_t *arguments_list * @} */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ diff --git a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h index ea8bd422b0..e64a1cf08f 100644 --- a/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h +++ b/jerry-core/ecma/builtin-objects/typedarray/ecma-builtin-float64array.inc.h @@ -18,12 +18,10 @@ */ #if JERRY_BUILTIN_TYPEDARRAY -#if JERRY_NUMBER_TYPE_FLOAT64 #define TYPEDARRAY_BYTES_PER_ELEMENT 8 #define TYPEDARRAY_MAGIC_STRING_ID LIT_MAGIC_STRING_FLOAT64_ARRAY_UL #define TYPEDARRAY_BUILTIN_ID ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE #include "ecma-builtin-typedarray-template.inc.h" -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #endif /* JERRY_BUILTIN_TYPEDARRAY */ diff --git a/jerry-core/ecma/operations/ecma-bigint.c b/jerry-core/ecma/operations/ecma-bigint.c index 7a4464e0c9..fe18524c8e 100644 --- a/jerry-core/ecma/operations/ecma-bigint.c +++ b/jerry-core/ecma/operations/ecma-bigint.c @@ -313,18 +313,12 @@ ecma_bigint_number_to_digits (ecma_number_t number, /**< ecma number */ fraction >>= ECMA_NUMBER_FRACTION_WIDTH - biased_exp; digits_p[0] = (ecma_bigint_digit_t) fraction; -#if JERRY_NUMBER_TYPE_FLOAT64 digits_p[1] = (ecma_bigint_digit_t) (fraction >> (8 * sizeof (ecma_bigint_digit_t))); return ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (digits_p[1] == 0 ? 1 : 2) | has_fraction; -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ - return ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (1) | has_fraction; -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ } digits_p[0] = (ecma_bigint_digit_t) fraction; -#if JERRY_NUMBER_TYPE_FLOAT64 digits_p[1] = (ecma_bigint_digit_t) (fraction >> (8 * sizeof (ecma_bigint_digit_t))); -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ biased_exp -= ECMA_NUMBER_FRACTION_WIDTH; @@ -333,27 +327,16 @@ ecma_bigint_number_to_digits (ecma_number_t number, /**< ecma number */ if (shift_left == 0) { -#if JERRY_NUMBER_TYPE_FLOAT64 return biased_exp | ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (2); -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ - return biased_exp | ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (1); -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ } uint32_t shift_right = (1 << ECMA_BIGINT_DIGIT_SHIFT) - shift_left; -#if JERRY_NUMBER_TYPE_FLOAT64 digits_p[2] = digits_p[1] >> shift_right; digits_p[1] = (digits_p[1] << shift_left) | (digits_p[0] >> shift_right); digits_p[0] <<= shift_left; return biased_exp | ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (digits_p[2] == 0 ? 2 : 3); -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ - digits_p[1] = digits_p[0] >> shift_right; - digits_p[0] <<= shift_left; - - return biased_exp | ECMA_BIGINT_NUMBER_TO_DIGITS_SET_DIGITS (digits_p[1] == 0 ? 1 : 2); -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ } /* ecma_bigint_number_to_digits */ /** diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index 9f993a396d..41b56adcd8 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -2671,9 +2671,7 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */ || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE) -#if JERRY_NUMBER_TYPE_FLOAT64 || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE) -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_BIGINT_PROTOTYPE) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_BIGINT64ARRAY_PROTOTYPE) diff --git a/jerry-core/ecma/operations/ecma-typedarray-object.c b/jerry-core/ecma/operations/ecma-typedarray-object.c index 40b42bb6cf..f506ac0470 100644 --- a/jerry-core/ecma/operations/ecma-typedarray-object.c +++ b/jerry-core/ecma/operations/ecma-typedarray-object.c @@ -431,7 +431,6 @@ ecma_typedarray_set_float_element (lit_utf8_byte_t *dst_p, /**< the location in return ECMA_VALUE_TRUE; } /* ecma_typedarray_set_float_element */ -#if JERRY_NUMBER_TYPE_FLOAT64 /** * Write a double value into the given arraybuffer * @@ -454,7 +453,6 @@ ecma_typedarray_set_double_element (lit_utf8_byte_t *dst_p, /**< the location in ECMA_TYPEDARRAY_SET_ELEMENT (dst_p, num, double); return ECMA_VALUE_TRUE; } /* ecma_typedarray_set_double_element */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT /** @@ -501,17 +499,12 @@ ecma_typedarray_set_bigint_element (lit_utf8_byte_t *dst_p, /**< the location in * Builtin id of the last %TypedArray% builtin routine intrinsic object */ #define ECMA_LAST_TYPEDARRAY_BUILTIN_ROUTINE_ID ECMA_BUILTIN_ID_BIGUINT64ARRAY -#elif !JERRY_BUILTIN_BIGINT && JERRY_NUMBER_TYPE_FLOAT64 +#elif !JERRY_BUILTIN_BIGINT /** * Builtin id of the last %TypedArray% builtin routine intrinsic object */ #define ECMA_LAST_TYPEDARRAY_BUILTIN_ROUTINE_ID ECMA_BUILTIN_ID_FLOAT64ARRAY -#else /* !JERRY_NUMBER_TYPE_FLOAT64 */ -/** - * Builtin id of the last %TypedArray% builtin routine intrinsic object - */ -#define ECMA_LAST_TYPEDARRAY_BUILTIN_ROUTINE_ID ECMA_BUILTIN_ID_FLOAT32ARRAY -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ +#endif /* JERRY_BUILTIN_BIGINT */ /** * Builtin id of the first %TypedArray% builtin prototype intrinsic object @@ -530,9 +523,7 @@ static const ecma_typedarray_getter_fn_t ecma_typedarray_getters[] = { ecma_typedarray_get_int32_element, /**< Uint32Array */ ecma_typedarray_get_uint32_element, /**< Uint32Array */ ecma_typedarray_get_float_element, /**< Float32Array */ -#if JERRY_NUMBER_TYPE_FLOAT64 ecma_typedarray_get_double_element, /**< Float64Array */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT ecma_typedarray_get_bigint64_element, /**< BigInt64Array*/ ecma_typedarray_get_biguint64_element, /**< BigUint64Array */ @@ -551,9 +542,7 @@ static const ecma_typedarray_setter_fn_t ecma_typedarray_setters[] = { ecma_typedarray_set_int32_element, /**< Uint32Array */ ecma_typedarray_set_uint32_element, /**< Uint32Array */ ecma_typedarray_set_float_element, /**< Float32Array */ -#if JERRY_NUMBER_TYPE_FLOAT64 ecma_typedarray_set_double_element, /**< Float64Array */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT ecma_typedarray_set_bigint_element, /**< BigInt64Array */ ecma_typedarray_set_bigint_element, /**< BigUInt64Array */ @@ -572,9 +561,7 @@ static const uint8_t ecma_typedarray_element_shift_sizes[] = { 2, /**< Int32Array */ 2, /**< Uint32Array */ 2, /**< Float32Array */ -#if JERRY_NUMBER_TYPE_FLOAT64 3, /**< Float64Array */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT 3, /**< BigInt64Array */ 3, /**< BigUInt64Array */ @@ -593,9 +580,7 @@ static const uint16_t ecma_typedarray_magic_string_list[] = { (uint16_t) LIT_MAGIC_STRING_INT32_ARRAY_UL, /**< Int32Array */ (uint16_t) LIT_MAGIC_STRING_UINT32_ARRAY_UL, /**< Uint32Array */ (uint16_t) LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, /**< Float32Array */ -#if JERRY_NUMBER_TYPE_FLOAT64 (uint16_t) LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, /**< Float64Array */ -#endif /* JERRY_NUMBER_TYPE_FLOAT64 */ #if JERRY_BUILTIN_BIGINT (uint16_t) LIT_MAGIC_STRING_BIGINT64_ARRAY_UL, /**< BigInt64Array */ (uint16_t) LIT_MAGIC_STRING_BIGUINT64_ARRAY_UL, /**< BigUInt64Array */ diff --git a/jerry-core/lit/lit-magic-strings.inc.h b/jerry-core/lit/lit-magic-strings.inc.h index d9b3471fbe..c8da20af29 100644 --- a/jerry-core/lit/lit-magic-strings.inc.h +++ b/jerry-core/lit/lit-magic-strings.inc.h @@ -607,10 +607,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_COPY_WITHIN, "copyWithin") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_ENUMERABLE, "enumerable") #if JERRY_BUILTIN_DATAVIEW LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FLOAT_32_UL, "getFloat32") -#endif /* JERRY_BUILTIN_DATAVIEW */ -#if JERRY_BUILTIN_DATAVIEW && JERRY_NUMBER_TYPE_FLOAT64 LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_FLOAT_64_UL, "getFloat64") -#endif /* JERRY_BUILTIN_DATAVIEW && JERRY_NUMBER_TYPE_FLOAT64 */ +#endif /* JERRY_BUILTIN_DATAVIEW */ #if JERRY_BUILTIN_DATE LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_MINUTES_UL, "getMinutes") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_GET_SECONDS_UL, "getSeconds") @@ -631,10 +629,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_REPLACE_ALL, "replaceAll") #endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING */ #if JERRY_BUILTIN_DATAVIEW LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_FLOAT_32_UL, "setFloat32") -#endif /* JERRY_BUILTIN_DATAVIEW */ -#if JERRY_BUILTIN_DATAVIEW && JERRY_NUMBER_TYPE_FLOAT64 LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_FLOAT_64_UL, "setFloat64") -#endif /* JERRY_BUILTIN_DATAVIEW && JERRY_NUMBER_TYPE_FLOAT64 */ +#endif /* JERRY_BUILTIN_DATAVIEW */ #if JERRY_BUILTIN_DATE LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_MINUTES_UL, "setMinutes") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_SET_SECONDS_UL, "setSeconds") @@ -704,10 +700,8 @@ LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_TO_UPPER_CASE_UL, "toUpperCase") LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_UNSCOPABLES, "unscopables") #if JERRY_BUILTIN_TYPEDARRAY LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT32_ARRAY_UL, "Float32Array") -#endif /* JERRY_BUILTIN_TYPEDARRAY */ -#if JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_FLOAT64_ARRAY_UL, "Float64Array") -#endif /* JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 */ +#endif /* JERRY_BUILTIN_TYPEDARRAY */ #if JERRY_BUILTIN_DATE LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING_INVALID_DATE_UL, "Invalid Date") #endif /* JERRY_BUILTIN_DATE */ @@ -903,8 +897,6 @@ LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (10, LIT_MAGIC_STRING_ALLSETTLED) LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (11, LIT_MAGIC_STRING_SOURCE_NAME_ANON) #if JERRY_BUILTIN_TYPEDARRAY LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT32_ARRAY_UL) -#elif JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 -LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_FLOAT64_ARRAY_UL) #elif JERRY_BUILTIN_DATE LIT_MAGIC_STRING_FIRST_STRING_WITH_SIZE (12, LIT_MAGIC_STRING_INVALID_DATE_UL) #else /* !(JERRY_BUILTIN_DATE) */