Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::CompressedStackMapsBuilder Class Reference

#include <code_descriptors.h>

Inheritance diagram for dart::CompressedStackMapsBuilder:
dart::ZoneAllocated

Public Member Functions

 CompressedStackMapsBuilder (Zone *zone)
 
void AddEntry (intptr_t pc_offset, BitmapBuilder *bitmap, intptr_t spill_slot_bit_count)
 
CompressedStackMapsPtr Finalize () const
 
- 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)
 

Detailed Description

Definition at line 50 of file code_descriptors.h.

Constructor & Destructor Documentation

◆ CompressedStackMapsBuilder()

dart::CompressedStackMapsBuilder::CompressedStackMapsBuilder ( Zone zone)
inlineexplicit

Definition at line 52 of file code_descriptors.h.

53 : encoded_bytes_(zone, kInitialStreamSize) {}

Member Function Documentation

◆ AddEntry()

void dart::CompressedStackMapsBuilder::AddEntry ( intptr_t  pc_offset,
BitmapBuilder bitmap,
intptr_t  spill_slot_bit_count 
)

Definition at line 100 of file code_descriptors.cc.

102 {
103 ASSERT(bitmap != nullptr);
104 ASSERT(pc_offset > last_pc_offset_);
105 ASSERT(spill_slot_bit_count >= 0 && spill_slot_bit_count <= bitmap->Length());
106 const uword pc_delta = pc_offset - last_pc_offset_;
107 const uword non_spill_slot_bit_count =
108 bitmap->Length() - spill_slot_bit_count;
109 encoded_bytes_.WriteLEB128(pc_delta);
110 encoded_bytes_.WriteLEB128(spill_slot_bit_count);
111 encoded_bytes_.WriteLEB128(non_spill_slot_bit_count);
112 bitmap->AppendAsBytesTo(&encoded_bytes_);
113 last_pc_offset_ = pc_offset;
114}
C::only_if_unsigned< T, void > WriteLEB128(T value)
Definition: datastream.h:489
#define ASSERT(E)
Definition: bitmap.py:1
uintptr_t uword
Definition: globals.h:501

◆ Finalize()

CompressedStackMapsPtr dart::CompressedStackMapsBuilder::Finalize ( ) const

Definition at line 116 of file code_descriptors.cc.

116 {
117 if (encoded_bytes_.bytes_written() == 0) {
118 return Object::empty_compressed_stackmaps().ptr();
119 }
120 return CompressedStackMaps::NewInlined(encoded_bytes_.buffer(),
121 encoded_bytes_.bytes_written());
122}
DART_FORCE_INLINE intptr_t bytes_written() const
Definition: datastream.h:338
static CompressedStackMapsPtr NewInlined(const void *payload, intptr_t size)
Definition: object.h:6316
uint8_t * buffer() const
Definition: datastream.h:615

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