Lines Matching refs:length
138 inline EcmaString *EcmaString::CreateLineString(const EcmaVM *vm, size_t length, bool compressed)
140 size_t size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(length);
142 string->SetLength(length, compressed);
148 inline EcmaString *EcmaString::CreateLineStringNoGC(const EcmaVM *vm, size_t length, bool compressed)
150 size_t size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(length);
153 string->SetLength(length, compressed);
159 inline EcmaString *EcmaString::CreateLineStringWithSpaceType(const EcmaVM *vm, size_t length, bool compressed,
163 size_t size = compressed ? LineEcmaString::ComputeSizeUtf8(length) : LineEcmaString::ComputeSizeUtf16(length);
179 string->SetLength(length, compressed);
193 size_t length, bool compressed, MemSpaceType type, uint32_t idOffset)
198 string->SetLength(length, compressed);
228 const JSHandle<EcmaString> &left, const JSHandle<EcmaString> &right, uint32_t length, bool compressed)
230 ECMA_STRING_CHECK_LENGTH_AND_TRHOW(vm, length);
234 string->SetLength(length, compressed);
243 uint32_t length)
245 JSHandle<EcmaString> string(vm->GetJSThread(), CreateLineString(vm, length, true));
248 Span<uint8_t> dst(string->GetDataUtf8Writable(), length);
249 Span<const uint8_t> source(srcFlat.GetDataUtf8() + start, length);
250 EcmaString::MemCopyChars(dst, length, source, length);
258 uint32_t length)
261 bool canBeCompressed = CanBeCompressed(srcFlat.GetDataUtf16() + start, length);
262 JSHandle<EcmaString> string(vm->GetJSThread(), CreateLineString(vm, length, canBeCompressed));
267 CopyChars(string->GetDataUtf8Writable(), srcFlat.GetDataUtf16() + start, length);
269 uint32_t len = length * (sizeof(uint16_t) / sizeof(uint8_t));
271 Span<uint16_t> dst(string->GetDataUtf16Writable(), length);
272 Span<const uint16_t> source(srcFlat.GetDataUtf16() + start, length);
328 int32_t length = static_cast<int32_t>(GetLength());
330 if ((index < 0) || (index >= length)) {
376 uint32_t length = src->GetLength();
377 if (length == 0) {
381 ASSERT(length <= maxLength && length > 0);
382 ASSERT(length <= src->GetLength());
386 CopyChars(buf, src->GetDataUtf8(), length);
388 CopyChars(buf, src->GetDataUtf16(), length);
394 CopyChars(buf, src->GetDataUtf8(), length);
413 length -= firstLength;
427 length -= secondLength;
434 CopyChars(buf, parent->GetDataUtf8() + SlicedString::Cast(src)->GetStartIndex(), length);
436 CopyChars(buf, parent->GetDataUtf16() + SlicedString::Cast(src)->GetStartIndex(), length);
448 void EcmaString::WriteToFlatWithPos(EcmaString *src, Char *buf, uint32_t length, uint32_t pos)
452 if (length == 0) {
456 ASSERT(length + pos <= maxLength && length > 0);
457 ASSERT(length <= src->GetLength());
462 CopyChars(buf, src->GetDataUtf8() + pos, length);
464 CopyChars(buf, src->GetDataUtf16() + pos, length);
470 CopyChars(buf, src->GetDataUtf8() + pos, length);
483 CopyChars(buf, parent->GetDataUtf8() + SlicedString::Cast(src)->GetStartIndex() + pos, length);
485 CopyChars(buf, parent->GetDataUtf16() + SlicedString::Cast(src)->GetStartIndex() + pos, length);
532 uint32_t start, uint32_t destSize, uint32_t length)
534 dst->WriteData(src, start, destSize, length);