packed property

PackedCell get packed

Returns a fixed-layout packed cell tuple for fast comparisons.

Layout:

  • word0: content kind/width plus low content bits
  • word1: content high bits
  • word2: canonicalized style identity
  • word3: canonicalized link identity

Implementation

PackedCell get packed {
  final contentLo = _contentValue & _contentPackLoMask;
  final contentHi = _contentValue >>> _contentValueBits;
  return PackedCell(
    word0:
        (_contentKind & _cellContentKindMask) |
        ((_width & _cellWidthMask) << _cellWidthShift) |
        (contentLo << _packedContentShift),
    word1: contentHi,
    word2: _styleId,
    word3: _linkId,
  );
}