Remove string copy

Changed 'ecma_copy_or_ref_ecma_string' to 'ecma_ref_ecma_string'. It does
not copy the string if the maximum number of reference counter is reached,
but bails out with an error like the 'ecma_ref_object' function does.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-06-14 13:51:44 +02:00
parent 7a3ed2650d
commit 0daeb2f942
18 changed files with 36 additions and 117 deletions
@@ -992,7 +992,7 @@ ecma_builtin_json_stringify (ecma_value_t this_arg, /**< 'this' argument */
if (num_of_chars < 10)
{
context.gap_str_p = ecma_copy_or_ref_ecma_string (space_str_p);
context.gap_str_p = ecma_ref_ecma_string (space_str_p);
}
else
{
@@ -1061,7 +1061,7 @@ ecma_builtin_json_quote (ecma_string_t *string_p) /**< string that should be quo
{
/* 1. */
ecma_string_t *quote_str_p = ecma_get_magic_string (LIT_MAGIC_STRING_DOUBLE_QUOTE_CHAR);
ecma_string_t *product_str_p = ecma_copy_or_ref_ecma_string (quote_str_p);
ecma_string_t *product_str_p = ecma_ref_ecma_string (quote_str_p);
ecma_string_t *tmp_str_p;
ECMA_STRING_TO_UTF8_STRING (string_p, string_buff, string_buff_size);