Remove 'ecma_completion_value_t'

Remove ecma_completion_value_t, and add an extra bit to
ecma_value_t to represent errors. From the long list of
completion types only normal and error remained.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-02-16 04:06:18 -08:00
committed by László Langó
parent c25d8617a5
commit b2426a7a94
96 changed files with 2691 additions and 3272 deletions
@@ -30,17 +30,15 @@
* statement with same argument as corresponding ECMA_TRY_CATCH's first argument.
*/
#define ECMA_TRY_CATCH(var, op, return_value) \
JERRY_ASSERT (return_value == ecma_make_empty_completion_value ()); \
ecma_completion_value_t var ## _completion = op; \
if (unlikely (ecma_is_completion_value_throw (var ## _completion))) \
JERRY_ASSERT (return_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY)); \
ecma_value_t var ## _completion = op; \
if (unlikely (ecma_is_value_error (var ## _completion))) \
{ \
return_value = var ## _completion; \
} \
else \
{ \
JERRY_ASSERT (ecma_is_completion_value_normal (var ## _completion)); \
\
ecma_value_t var __attr_unused___ = ecma_get_completion_value_value (var ## _completion)
ecma_value_t var __attr_unused___ = var ## _completion;
/**
* The macro marks end of code block that is defined by corresponding
@@ -50,7 +48,8 @@
* Each ECMA_TRY_CATCH should be followed by ECMA_FINALIZE with same argument
* as corresponding ECMA_TRY_CATCH's first argument.
*/
#define ECMA_FINALIZE(var) ecma_free_completion_value (var ## _completion); \
#define ECMA_FINALIZE(var) \
ecma_free_value (var ## _completion); \
}
/**
@@ -65,7 +64,7 @@
* statement with same argument as corresponding ECMA_OP_TO_NUMBER_TRY_CATCH's first argument.
*/
#define ECMA_OP_TO_NUMBER_TRY_CATCH(num_var, value, return_value) \
JERRY_ASSERT (ecma_is_completion_value_empty (return_value)); \
JERRY_ASSERT (return_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY)); \
ecma_number_t num_var = ecma_number_make_nan (); \
if (ecma_is_value_number (value)) \
{ \
@@ -82,7 +81,7 @@
ECMA_FINALIZE (to_number_value); \
} \
\
if (ecma_is_completion_value_empty (return_value)) \
if (ecma_is_value_empty (return_value)) \
{
/**