Lines Matching full:string
30 auto string = vm->GetFactory()->AllocNonMovableStringObject(EcmaString::SIZE); in CreateEmptyString() local
31 string->SetLength(0, true); in CreateEmptyString()
32 string->SetRawHashcode(0); in CreateEmptyString()
33 return string; in CreateEmptyString()
41 EcmaString *string = nullptr; in AllocStringObjectWithSpaceType() local
44 string = vm->GetFactory()->AllocStringObject(size); in AllocStringObjectWithSpaceType()
47 string = vm->GetFactory()->AllocOldSpaceStringObject(size); in AllocStringObjectWithSpaceType()
50 string = vm->GetFactory()->AllocNonMovableStringObject(size); in AllocStringObjectWithSpaceType()
55 string->SetLength(length, compressed); in AllocStringObjectWithSpaceType()
56 string->SetRawHashcode(0); in AllocStringObjectWithSpaceType()
57 return string; in AllocStringObjectWithSpaceType()
67 EcmaString *string = nullptr; in CreateFromUtf8() local
69 string = AllocStringObjectWithSpaceType(vm, utf8Len, true, type); in CreateFromUtf8()
70 ASSERT(string != nullptr); in CreateFromUtf8()
72 if (memcpy_s(string->GetDataUtf8Writable(), utf8Len, utf8Data, utf8Len) != EOK) { in CreateFromUtf8()
78 string = AllocStringObjectWithSpaceType(vm, utf16Len, false, type); in CreateFromUtf8()
79 ASSERT(string != nullptr); in CreateFromUtf8()
82 …base::utf_helper::ConvertRegionUtf8ToUtf16(utf8Data, string->GetDataUtf16Writable(), utf8Len, utf1… in CreateFromUtf8()
86 ASSERT_PRINT(canBeCompress == CanBeCompressed(string), "Bad input canBeCompress!"); in CreateFromUtf8()
87 return string; in CreateFromUtf8()
96 auto string = AllocStringObjectWithSpaceType(vm, utf16Len, canBeCompress, type); in CreateFromUtf16() local
97 ASSERT(string != nullptr); in CreateFromUtf16()
100 CopyUtf16AsUtf8(utf16Data, string->GetDataUtf8Writable(), utf16Len); in CreateFromUtf16()
103 if (memcpy_s(string->GetDataUtf16Writable(), len, utf16Data, len) != EOK) { in CreateFromUtf16()
109 ASSERT_PRINT(canBeCompress == CanBeCompressed(string), "Bad input canBeCompress!"); in CreateFromUtf16()
110 return string; in CreateFromUtf16()
134 auto string = reinterpret_cast<EcmaString *>(vm->GetFactory()->AllocStringObject(size)); in AllocStringObject() local
135 string->SetLength(length, compressed); in AllocStringObject()
136 string->SetRawHashcode(0); in AllocStringObject()
137 return string; in AllocStringObject()
147 auto string = AllocStringObject(vm, length, true); in FastSubUtf8String() local
149 Span<uint8_t> dst(string->GetDataUtf8Writable(), length); in FastSubUtf8String()
153 ASSERT_PRINT(CanBeCompressed(string), "canBeCompresse does not match the real value!"); in FastSubUtf8String()
154 return string; in FastSubUtf8String()
165 auto string = AllocStringObject(vm, length, canBeCompressed); in FastSubUtf16String() local
168 CopyUtf16AsUtf8(src->GetDataUtf16() + start, string->GetDataUtf8Writable(), length); in FastSubUtf16String()
172 Span<uint16_t> dst(string->GetDataUtf16Writable(), length); in FastSubUtf16String()
176 …ASSERT_PRINT(canBeCompressed == CanBeCompressed(string), "canBeCompresse does not match the real v… in FastSubUtf16String()
177 return string; in FastSubUtf16String()