6712 {
6713 Deserializer::Local
d(d_);
6714
6716 StringPtr str =
static_cast<StringPtr
>(
d.Ref(
id));
6717 const intptr_t encoded =
d.ReadUnsigned();
6721
6722
6723
6724 *
reinterpret_cast<word*
>(
reinterpret_cast<uint8_t*
>(str->untag()) +
6726 *
reinterpret_cast<word*
>(
reinterpret_cast<uint8_t*
>(str->untag()) +
6729#if DART_COMPRESSED_POINTERS
6730
6731 const intptr_t length_offset =
6732 reinterpret_cast<intptr_t>(&str->untag()->length_);
6733 const intptr_t data_offset =
6734 cid == kOneByteStringCid
6735 ? reinterpret_cast<intptr_t>(
6736 static_cast<OneByteStringPtr
>(str)->
untag()->data())
6737 : reinterpret_cast<intptr_t>(
6738 static_cast<TwoByteStringPtr>(str)->untag()->data());
6739 const intptr_t length_with_gap = data_offset - length_offset;
6742 memset(reinterpret_cast<void*>(length_offset), 0, length_with_gap);
6743#endif
6745
6746 StringHasher hasher;
6747 if (
cid == kOneByteStringCid) {
6748 for (intptr_t j = 0; j <
length; j++) {
6749 uint8_t code_unit =
d.Read<uint8_t>();
6750 static_cast<OneByteStringPtr
>(str)->
untag()->data()[j] = code_unit;
6751 hasher.Add(code_unit);
6752 }
6753
6754 } else {
6755 for (intptr_t j = 0; j <
length; j++) {
6756 uint16_t code_unit =
d.Read<uint8_t>();
6757 code_unit = code_unit | (
d.Read<uint8_t>() << 8);
6758 static_cast<TwoByteStringPtr
>(str)->
untag()->data()[j] = code_unit;
6759 hasher.Add(code_unit);
6760 }
6761 }
6763 }
6764 }
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static SmiPtr New(intptr_t value)
static uint32_t SetCachedHash(StringPtr obj, uint32_t hash)
static constexpr intptr_t kCompressedWordSize
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)
constexpr intptr_t kWordSize