Lines Matching defs:string

16 #include "src/objects/string-table-inl.h"
17 #include "src/objects/string.h"
20 #include "src/strings/string-hasher-inl.h"
29 #include "torque-generated/src/objects/string-tq-inl.inc"
33 // Creates no SharedMutexGuard<kShared> for the string access since it was
37 // Creates a SharedMutexGuard<kShared> for the string access if it was called
176 // TODO(v8:12007): Set is_shared to true on internalized string when
193 // TODO(v8:12007): Set is_shared to true on internalized string when
196 // If you crashed here, you probably added a new shared string
197 // type. Explicitly handle all shared string cases above.
322 bool String::IsOneByteRepresentationUnderneath(String string) {
324 uint32_t type = string.map().instance_type();
327 DCHECK(string.IsFlat());
334 string = string.GetUnderlying();
415 SeqSubStringKey(Isolate* isolate, Handle<SeqString> string, int from, int len,
418 string_(string),
424 string->GetChars(no_gc) + from, len, HashSeed(isolate));
436 bool IsMatch(Isolate* isolate, String string) {
437 DCHECK(!SharedStringAccessGuardIfNeeded::IsNeeded(string));
440 return string.IsEqualTo<String::EqualityType::kNoLengthCheck>(
537 String string = *this;
540 int32_t type = string.map(cage_base).instance_type();
544 SeqOneByteString::cast(string).GetChars(no_gc, access_guard) +
549 SeqTwoByteString::cast(string).GetChars(no_gc, access_guard) +
554 ExternalOneByteString::cast(string).GetChars(cage_base) +
559 ExternalTwoByteString::cast(string).GetChars(cage_base) +
565 SlicedString slicedString = SlicedString::cast(string);
567 string = slicedString.parent(cage_base);
575 return IsConsStringEqualToImpl<Char>(ConsString::cast(string),
582 string = ThinString::cast(string).actual(cage_base);
594 ConsString string, int slice_offset, base::Vector<const Char> str,
599 DCHECK_GE(string.length(), str.size());
601 ConsStringIterator iter(ConsString::cast(string), slice_offset);
606 // remaining string.
645 Handle<String> String::Flatten(Isolate* isolate, Handle<String> string,
649 String s = *string;
653 if (V8_LIKELY(shape.IsDirect())) return string;
675 Handle<String> String::Flatten(LocalIsolate* isolate, Handle<String> string,
678 DCHECK(string->IsFlat());
679 return string;
685 String string, int offset, int length,
689 DCHECK_LE(offset + length, string.length());
690 switch (StringShape{string, cage_base}.representation_and_encoding_tag()) {
693 SeqOneByteString::cast(string).GetChars(no_gc, access_guard) + offset,
697 SeqTwoByteString::cast(string).GetChars(no_gc, access_guard) + offset,
701 ExternalOneByteString::cast(string).GetChars(cage_base) + offset,
705 ExternalTwoByteString::cast(string).GetChars(cage_base) + offset,
748 // When ENABLE_SLOW_DCHECKS, check the string contents did not change during
753 // FlatContent during its lifetime (e.g. GC relocated the string). This is
786 Handle<String> String::Share(Isolate* isolate, Handle<String> string) {
790 isolate->factory()->ComputeSharingStrategyForString(string, &new_map)) {
792 return SlowShare(isolate, string);
794 // A relaxed write is sufficient here, because at this point the string
796 DCHECK(string->InSharedHeap());
797 string->set_map_no_write_barrier(*new_map.ToHandleChecked());
798 return string;
800 return string;
878 // Giving direct access to underlying string only makes sense if the
879 // wrapping string is already flattened.
891 ConsString String::VisitFlat(Visitor* visitor, String string,
893 DCHECK(!SharedStringAccessGuardIfNeeded::IsNeeded(string));
894 return VisitFlat(visitor, string, offset,
900 Visitor* visitor, String string, const int offset,
904 const int length = string.length();
906 PtrComprCageBase cage_base = GetPtrComprCageBase(string);
909 StringShape(string, cage_base).representation_and_encoding_tag();
913 SeqOneByteString::cast(string).GetChars(no_gc, access_guard) +
920 SeqTwoByteString::cast(string).GetChars(no_gc, access_guard) +
927 ExternalOneByteString::cast(string).GetChars(cage_base) +
934 ExternalTwoByteString::cast(string).GetChars(cage_base) +
941 SlicedString slicedString = SlicedString::cast(string);
943 string = slicedString.parent(cage_base);
949 return ConsString::cast(string);
953 string = ThinString::cast(string).actual(cage_base);
1000 const uint8_t* string,
1006 memcpy(address, string, string_length);
1209 // uncached string with an uncacheable resource.
1281 // uncached string with an uncacheable resource.
1308 void ConsStringIterator::PushLeft(ConsString string) {
1309 frames_[depth_++ & kDepthMask] = string;
1312 void ConsStringIterator::PushRight(ConsString string) {
1314 frames_[(depth_ - 1) & kDepthMask] = string;
1329 inline explicit StringCharacterStream(String string, int offset = 0);
1334 inline void Reset(String string, int offset = 0);
1360 StringCharacterStream::StringCharacterStream(String string, int offset)
1361 : is_one_byte_(false), access_guard_(string) {
1362 Reset(string, offset);
1365 void StringCharacterStream::Reset(String string, int offset) {
1370 String::VisitFlat(this, string, offset, access_guard_);
1373 string = iter_.Next(&offset);
1374 if (!string.is_null())
1375 String::VisitFlat(this, string, offset, access_guard_);
1382 String string = iter_.Next(&offset);
1384 if (string.is_null()) return false;
1385 String::VisitFlat(this, string, 0, access_guard_);
1429 SubStringRange::SubStringRange(String string,
1432 : string_(string),
1434 length_(length == -1 ? string.length() : length),
1478 bool String::IsInPlaceInternalizable(String string) {
1479 return IsInPlaceInternalizable(string.map().instance_type());