Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
dart::StackMapEntry Class Reference
Inheritance diagram for dart::StackMapEntry:
dart::ZoneAllocated

Public Member Functions

 StackMapEntry (Zone *zone, const CompressedStackMaps::Iterator< CompressedStackMaps > &it)
 
uword Hash ()
 
bool Equals (const StackMapEntry &other) const
 
intptr_t EncodeTo (NonStreamingWriteStream *stream)
 
intptr_t UsageCount () const
 
void IncrementUsageCount ()
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Static Public Attributes

static constexpr intptr_t kHashBits = Object::kHashBits
 

Detailed Description

Definition at line 451 of file program_visitor.cc.

Constructor & Destructor Documentation

◆ StackMapEntry()

dart::StackMapEntry::StackMapEntry ( Zone zone,
const CompressedStackMaps::Iterator< CompressedStackMaps > &  it 
)
inline

Definition at line 453 of file program_visitor.cc.

455 : maps_(CompressedStackMaps::Handle(zone, it.maps_.ptr())),
456 bits_container_(
457 CompressedStackMaps::Handle(zone, it.bits_container_.ptr())),
458 // If the map uses the global table, this accessor call ensures the
459 // entry is fully loaded before we retrieve [it.current_bits_offset_].
460 spill_slot_bit_count_(it.SpillSlotBitCount()),
461 non_spill_slot_bit_count_(it.Length() - it.SpillSlotBitCount()),
462 bits_offset_(it.current_bits_offset_) {
463 ASSERT(!maps_.IsNull() && !maps_.IsGlobalTable());
464 ASSERT(!bits_container_.IsNull());
465 ASSERT(!maps_.UsesGlobalTable() || bits_container_.IsGlobalTable());
466 ASSERT(it.current_spill_slot_bit_count_ >= 0);
467 }
bool IsGlobalTable() const
Definition: object.h:6310
bool UsesGlobalTable() const
Definition: object.h:6304
bool IsNull() const
Definition: object.h:363
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)

Member Function Documentation

◆ EncodeTo()

intptr_t dart::StackMapEntry::EncodeTo ( NonStreamingWriteStream stream)
inline

Definition at line 502 of file program_visitor.cc.

502 {
503 auto const current_offset = stream->Position();
504 stream->WriteLEB128(spill_slot_bit_count_);
505 stream->WriteLEB128(non_spill_slot_bit_count_);
506 {
507 NoSafepointScope scope;
508 stream->WriteBytes(PayloadData(), PayloadLength());
509 }
510 return current_offset;
511 }

◆ Equals()

bool dart::StackMapEntry::Equals ( const StackMapEntry other) const
inline

Definition at line 488 of file program_visitor.cc.

488 {
489 if (spill_slot_bit_count_ != other.spill_slot_bit_count_ ||
490 non_spill_slot_bit_count_ != other.non_spill_slot_bit_count_) {
491 return false;
492 }
493 // Since we ensure that bits in the payload that are not part of the
494 // actual stackmap data are cleared, we can just compare payloads by byte
495 // instead of calling IsObject for each bit.
496 NoSafepointScope scope;
497 return memcmp(PayloadData(), other.PayloadData(), PayloadLength()) == 0;
498 }

◆ Hash()

uword dart::StackMapEntry::Hash ( )
inline

Definition at line 471 of file program_visitor.cc.

471 {
472 if (hash_ != 0) return hash_;
473 uint32_t hash = 0;
474 hash = CombineHashes(hash, spill_slot_bit_count_);
475 hash = CombineHashes(hash, non_spill_slot_bit_count_);
476 {
477 NoSafepointScope scope;
478 auto const start = PayloadData();
479 auto const end = start + PayloadLength();
480 for (auto cursor = start; cursor < end; cursor++) {
481 hash = CombineHashes(hash, *cursor);
482 }
483 }
484 hash_ = FinalizeHash(hash, kHashBits);
485 return hash_;
486 }
static uint32_t hash(const SkShaderBase::GradientInfo &v)
static constexpr intptr_t kHashBits
glong glong end
uint32_t CombineHashes(uint32_t hash, uint32_t other_hash)
Definition: hash.h:12
uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits=kBitsPerInt32)
Definition: hash.h:20

◆ IncrementUsageCount()

void dart::StackMapEntry::IncrementUsageCount ( )
inline

Definition at line 514 of file program_visitor.cc.

514{ uses_ += 1; }

◆ UsageCount()

intptr_t dart::StackMapEntry::UsageCount ( ) const
inline

Definition at line 513 of file program_visitor.cc.

513{ return uses_; }

Member Data Documentation

◆ kHashBits

constexpr intptr_t dart::StackMapEntry::kHashBits = Object::kHashBits
staticconstexpr

Definition at line 469 of file program_visitor.cc.


The documentation for this class was generated from the following file: