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:
@@ -534,7 +534,7 @@ jerry_parse_and_save_snapshot_with_args (const jerry_char_t *source_p, /**< scri
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (parse_status))
|
||||
{
|
||||
ecma_free_value (parse_status);
|
||||
ecma_free_value (JERRY_CONTEXT (error_value));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -728,6 +728,11 @@ jerry_snapshot_result_at (const uint32_t *snapshot_p, /**< snapshot */
|
||||
ecma_bytecode_deref (bytecode_p);
|
||||
}
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (ret_val))
|
||||
{
|
||||
return ecma_create_error_reference (JERRY_CONTEXT (error_value));
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
} /* jerry_snapshot_result_at */
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
@@ -1312,14 +1317,14 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
|
||||
is_strict,
|
||||
&bytecode_data_p);
|
||||
|
||||
const bool error = ECMA_IS_VALUE_ERROR (parse_status);
|
||||
ecma_free_value (parse_status);
|
||||
|
||||
if (error)
|
||||
if (ECMA_IS_VALUE_ERROR (parse_status))
|
||||
{
|
||||
ecma_free_value (JERRY_CONTEXT (error_value));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ecma_free_value (parse_status);
|
||||
|
||||
ecma_bytecode_deref (bytecode_data_p);
|
||||
|
||||
ecma_lit_storage_item_t *string_list_p = JERRY_CONTEXT (string_list_first_p);
|
||||
|
||||
+320
-189
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user