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:
@@ -336,7 +336,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */
|
||||
if (ecma_is_value_string (value))
|
||||
{
|
||||
res_p = ecma_get_string_from_value (value);
|
||||
res_p = ecma_copy_or_ref_ecma_string (res_p);
|
||||
res_p = ecma_ref_ecma_string (res_p);
|
||||
}
|
||||
else if (ecma_is_value_integer_number (value))
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ ecma_new_standard_error_with_message (ecma_standard_error_t error_type, /**< nat
|
||||
ECMA_PROPERTY_CONFIGURABLE_WRITABLE);
|
||||
|
||||
ecma_set_named_data_property_value (prop_p,
|
||||
ecma_make_string_value (ecma_copy_or_ref_ecma_string (message_string_p)));
|
||||
ecma_make_string_value (ecma_ref_ecma_string (message_string_p)));
|
||||
ecma_deref_ecma_string (message_magic_string_p);
|
||||
|
||||
return new_error_obj_p;
|
||||
|
||||
@@ -751,7 +751,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
|
||||
JERRY_ASSERT (name_pos > 0
|
||||
&& name_pos <= array_index_named_properties_count + string_named_properties_count);
|
||||
names_p[--name_pos] = ecma_copy_or_ref_ecma_string (name_p);
|
||||
names_p[--name_pos] = ecma_ref_ecma_string (name_p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ ecma_make_reference (ecma_value_t base, /**< base value */
|
||||
ecma_string_t *name_p, /**< referenced name */
|
||||
bool is_strict) /**< strict reference flag */
|
||||
{
|
||||
name_p = ecma_copy_or_ref_ecma_string (name_p);
|
||||
name_p = ecma_ref_ecma_string (name_p);
|
||||
|
||||
ecma_reference_t ref;
|
||||
ref.base = ecma_copy_value (base);
|
||||
|
||||
@@ -142,7 +142,7 @@ ecma_op_string_object_get_own_property (ecma_object_t *obj_p, /**< a String obje
|
||||
{
|
||||
uint32_index = property_name_p->u.uint32_number;
|
||||
|
||||
new_prop_name_p = ecma_copy_or_ref_ecma_string (property_name_p);
|
||||
new_prop_name_p = ecma_ref_ecma_string (property_name_p);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user