Rework error to use a global slot to store the error value.

This change frees up the error bit in ecma_value_t, which allows
to define 4 more value types (e.g. symbols). To keep API
compatibility we introduce a box for values with error flag.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-10-18 03:44:48 -07:00
committed by yichoi
parent 742654a3f1
commit 53cd324179
19 changed files with 582 additions and 288 deletions
+6 -4
View File
@@ -164,6 +164,7 @@ jerry_debugger_send_eval (const lit_utf8_byte_t *eval_string_p, /**< evaluated s
if (ECMA_IS_VALUE_ERROR (result))
{
type = JERRY_DEBUGGER_EVAL_ERROR;
result = JERRY_CONTEXT (error_value);
if (ecma_is_value_object (result))
{
@@ -980,18 +981,19 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
* false - otherwise
*/
bool
jerry_debugger_send_exception_string (ecma_value_t exception_value) /**< error value */
jerry_debugger_send_exception_string (void)
{
ecma_string_t *string_p = NULL;
ecma_value_t exception_value = JERRY_CONTEXT (error_value);
if (ecma_is_value_object (exception_value))
{
ecma_value_t object_value = ecma_get_value_from_error_value (exception_value);
string_p = jerry_debugger_exception_object_to_string (exception_value);
string_p = jerry_debugger_exception_object_to_string (object_value);
if (string_p == NULL)
{
string_p = ecma_get_string_from_value (ecma_builtin_helper_object_to_string (object_value));
string_p = ecma_get_string_from_value (ecma_builtin_helper_object_to_string (exception_value));
}
}
else if (ecma_is_value_string (exception_value))
+1 -1
View File
@@ -352,7 +352,7 @@ bool jerry_debugger_send_string (uint8_t message_type, uint8_t sub_type, const u
bool jerry_debugger_send_function_cp (jerry_debugger_header_type_t type, ecma_compiled_code_t *compiled_code_p);
bool jerry_debugger_send_parse_function (uint32_t line, uint32_t column);
void jerry_debugger_send_memstats (void);
bool jerry_debugger_send_exception_string (ecma_value_t exception_value);
bool jerry_debugger_send_exception_string (void);
#endif /* JERRY_DEBUGGER */