Delete ECMA_OP_TO_NUMBER_TRY_CATCH macro (#4229)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-number-arithmetic.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "opcodes.h"
|
||||
#include "jrt-libc-includes.h"
|
||||
|
||||
@@ -61,7 +60,12 @@ do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation
|
||||
if (JERRY_LIKELY (!ecma_is_value_bigint (left_value)))
|
||||
{
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (right_number, right_value, ret_value);
|
||||
|
||||
ecma_number_t right_number;
|
||||
if (ECMA_IS_VALUE_ERROR (ecma_op_to_number (right_value, &right_number)))
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
|
||||
ecma_number_t result = ECMA_NUMBER_ZERO;
|
||||
|
||||
@@ -97,8 +101,6 @@ do_number_arithmetic (number_arithmetic_op op, /**< number arithmetic operation
|
||||
}
|
||||
|
||||
ret_value = ecma_make_number_value (result);
|
||||
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (right_number);
|
||||
#if ENABLED (JERRY_BUILTIN_BIGINT)
|
||||
}
|
||||
else
|
||||
@@ -246,13 +248,17 @@ opfunc_addition (ecma_value_t left_value, /**< left value */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
else
|
||||
{
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (num_left, left_value, ret_value);
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (num_right, right_value, ret_value);
|
||||
|
||||
ret_value = ecma_make_number_value (num_left + num_right);
|
||||
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (num_right);
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (num_left);
|
||||
ecma_number_t num_left;
|
||||
ecma_number_t num_right;
|
||||
if (!ECMA_IS_VALUE_ERROR (ecma_op_to_number (left_value, &num_left))
|
||||
&& !ECMA_IS_VALUE_ERROR (ecma_op_to_number (right_value, &num_right)))
|
||||
{
|
||||
ret_value = ecma_make_number_value (num_left + num_right);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_value = ECMA_VALUE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (free_left_value)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "opcodes.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
@@ -62,7 +61,12 @@ do_number_bitwise_logic (number_bitwise_logic_op op, /**< number bitwise logic o
|
||||
if (JERRY_LIKELY (!ecma_is_value_bigint (left_value)))
|
||||
{
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
ECMA_OP_TO_NUMBER_TRY_CATCH (right_number, right_value, ret_value);
|
||||
ecma_number_t right_number;
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (ecma_op_to_number (right_value, &right_number)))
|
||||
{
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
|
||||
ecma_number_t result = ECMA_NUMBER_ZERO;
|
||||
uint32_t right_uint32 = ecma_number_to_uint32 (right_number);
|
||||
@@ -109,7 +113,6 @@ do_number_bitwise_logic (number_bitwise_logic_op op, /**< number bitwise logic o
|
||||
|
||||
ret_value = ecma_make_number_value (result);
|
||||
|
||||
ECMA_OP_TO_NUMBER_FINALIZE (num_right);
|
||||
#if ENABLED (JERRY_BUILTIN_BIGINT)
|
||||
}
|
||||
else
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "ecma-function-object.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "opcodes.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-promise-object.h"
|
||||
#include "ecma-proxy-object.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jcontext.h"
|
||||
#include "opcodes.h"
|
||||
#include "vm-defines.h"
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "ecma-objects-general.h"
|
||||
#include "ecma-promise-object.h"
|
||||
#include "ecma-regexp-object.h"
|
||||
#include "ecma-try-catch-macro.h"
|
||||
#include "jcontext.h"
|
||||
#include "opcodes.h"
|
||||
#include "vm.h"
|
||||
|
||||
Reference in New Issue
Block a user