ecma_concat_ecma_strings (ecma_string_t *string1_p, /**< first ecma-string */
                          ecma_string_t *string2_p) /**< second ecma-string */
{
  JERRY_ASSERT (string1_p != NULL && string2_p != NULL);

  if (JERRY_UNLIKELY (ecma_string_is_empty (string1_p)))
  {
    ecma_ref_ecma_string (string2_p);
    return string2_p;
  }
  else if (JERRY_UNLIKELY (ecma_string_is_empty (string2_p)))
  {
    return string1_p;
  }

  lit_utf8_size_t cesu8_string2_size;
  lit_utf8_size_t cesu8_string2_length;
  lit_utf8_byte_t uint32_to_string_buffer[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
  uint8_t flags = ECMA_STRING_FLAG_IS_ASCII;

  const lit_utf8_byte_t *cesu8_string2_p = ecma_string_get_chars (string2_p,
                                                                  &cesu8_string2_size,
                                                                  &cesu8_string2_length,
                                                                  uint32_to_string_buffer,
                                                                  &flags);

  JERRY_ASSERT (cesu8_string2_p != NULL);

  ecma_string_t *result_p = ecma_append_chars_to_string (string1_p,
                                                         cesu8_string2_p,
                                                         cesu8_string2_size,
                                                         cesu8_string2_length);

  JERRY_ASSERT (!(flags & ECMA_STRING_FLAG_MUST_BE_FREED));

  return result_p;
} /* ecma_concat_ecma_strings */
ecma_concat_ecma_strings (ecma_string_t *string1_p,  
                          ecma_string_t *string2_p)  
{
  JERRY_ASSERT (string1_p != NULL && string2_p != NULL);

  if (JERRY_UNLIKELY (ecma_string_is_empty (string1_p)))
  {
    ecma_ref_ecma_string (string2_p);
    return string2_p;
  }
  else if (JERRY_UNLIKELY (ecma_string_is_empty (string2_p)))
  {
    return string1_p;
  }

  lit_utf8_size_t cesu8_string2_size;
  lit_utf8_size_t cesu8_string2_length;
  lit_utf8_byte_t uint32_to_string_buffer[ECMA_MAX_CHARS_IN_STRINGIFIED_UINT32];
  uint8_t flags = ECMA_STRING_FLAG_IS_ASCII;

  const lit_utf8_byte_t *cesu8_string2_p = ecma_string_get_chars (string2_p,
                                                                  &cesu8_string2_size,
                                                                  &cesu8_string2_length,
                                                                  uint32_to_string_buffer,
                                                                  &flags);

  JERRY_ASSERT (cesu8_string2_p != NULL);

  ecma_string_t *result_p = ecma_append_chars_to_string (string1_p,
                                                         cesu8_string2_p,
                                                         cesu8_string2_size,
                                                         cesu8_string2_length);

  JERRY_ASSERT (!(flags & ECMA_STRING_FLAG_MUST_BE_FREED));

  return result_p;
}  