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

#include <il_serializer.h>

Inheritance diagram for dart::FlowGraphDeserializer:
dart::ValueObject

Classes

struct  ReadRefTrait
 
struct  ReadTrait
 
struct  ReadTrait< const GrowableArray< T > & >
 
struct  ReadTrait< const ZoneGrowableArray< T > & >
 
struct  ReadTrait< GrowableArray< T > >
 
struct  ReadTrait< T, std::enable_if_t< std::is_same_v< intptr_t, T > &&!std::is_same_v< intptr_t, int32_t > &&!std::is_same_v< intptr_t, int64_t > > >
 
struct  ReadTrait< T, std::enable_if_t< std::is_same_v< uintptr_t, T > &&!std::is_same_v< uintptr_t, uint32_t > &&!std::is_same_v< uintptr_t, uint64_t > > >
 
struct  ReadTrait< ZoneGrowableArray< T > * >
 

Public Member Functions

 FlowGraphDeserializer (const ParsedFunction &parsed_function, ReadStream *stream)
 
const ParsedFunctionparsed_function () const
 
Zonezone () const
 
ReadStreamstream () const
 
Threadthread () const
 
IsolateGroupisolate_group () const
 
GraphEntryInstrgraph_entry () const
 
void set_graph_entry (GraphEntryInstr *entry)
 
BlockEntryInstrcurrent_block () const
 
void set_current_block (BlockEntryInstr *block)
 
BlockEntryInstrblock (intptr_t block_id) const
 
void set_block (intptr_t block_id, BlockEntryInstr *block)
 
Definitiondefinition (intptr_t ssa_temp_index) const
 
void set_definition (intptr_t ssa_temp_index, Definition *def)
 
FlowGraphReadFlowGraph ()
 
template<typename T >
T Read ()
 
template<typename T >
T ReadRef ()
 
template<typename T >
GrowableArray< TReadGrowableArrayOfRefs ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 326 of file il_serializer.h.

Constructor & Destructor Documentation

◆ FlowGraphDeserializer()

dart::FlowGraphDeserializer::FlowGraphDeserializer ( const ParsedFunction parsed_function,
ReadStream stream 
)

Definition at line 39 of file il_serializer.cc.

42 : parsed_function_(parsed_function),
43 stream_(stream),
44 zone_(Thread::Current()->zone()),
45 thread_(Thread::Current()),
46 isolate_group_(IsolateGroup::Current()) {}
const ParsedFunction & parsed_function() const
ReadStream * stream() const
static IsolateGroup * Current()
Definition: isolate.h:539
static Thread * Current()
Definition: thread.h:362

Member Function Documentation

◆ block()

BlockEntryInstr * dart::FlowGraphDeserializer::block ( intptr_t  block_id) const
inline

Definition at line 344 of file il_serializer.h.

344 {
345 BlockEntryInstr* b = blocks_[block_id];
346 ASSERT(b != nullptr);
347 return b;
348 }
#define ASSERT(E)
static bool b

◆ current_block()

BlockEntryInstr * dart::FlowGraphDeserializer::current_block ( ) const
inline

Definition at line 341 of file il_serializer.h.

341{ return current_block_; }

◆ definition()

Definition * dart::FlowGraphDeserializer::definition ( intptr_t  ssa_temp_index) const
inline

Definition at line 354 of file il_serializer.h.

354 {
355 Definition* def = definitions_[ssa_temp_index];
356 ASSERT(def != nullptr);
357 return def;
358 }

◆ graph_entry()

GraphEntryInstr * dart::FlowGraphDeserializer::graph_entry ( ) const
inline

Definition at line 338 of file il_serializer.h.

338{ return graph_entry_; }

◆ isolate_group()

IsolateGroup * dart::FlowGraphDeserializer::isolate_group ( ) const
inline

Definition at line 336 of file il_serializer.h.

336{ return isolate_group_; }

◆ parsed_function()

const ParsedFunction & dart::FlowGraphDeserializer::parsed_function ( ) const
inline

Definition at line 331 of file il_serializer.h.

331{ return parsed_function_; }

◆ Read()

template<typename T >
T dart::FlowGraphDeserializer::Read ( )
inline

Definition at line 459 of file il_serializer.h.

459 {
460 return ReadTrait<T>::Read(this);
461 }
const AbstractType * Read(FlowGraphDeserializer *d)

◆ ReadFlowGraph()

FlowGraph * dart::FlowGraphDeserializer::ReadFlowGraph ( )

Definition at line 714 of file il_serializer.cc.

714 {
715 const intptr_t current_ssa_temp_index = Read<intptr_t>();
716 const intptr_t max_block_id = Read<intptr_t>();
717 const intptr_t inlining_id = Read<intptr_t>();
718 const Array& coverage_array = Read<const Array&>();
719 const PrologueInfo prologue_info(Read<intptr_t>(), Read<intptr_t>());
720
721 definitions_.EnsureLength(current_ssa_temp_index, nullptr);
722 blocks_.EnsureLength(max_block_id + 1, nullptr);
723
724 // Read/create instructions.
725 ZoneGrowableArray<Instruction*> instructions(16);
726 Instruction* prev = nullptr;
727 while (Instruction* instr = Read<Instruction*>()) {
728 instructions.Add(instr);
729 if (!instr->IsBlockEntry()) {
730 ASSERT(prev != nullptr);
731 prev->LinkTo(instr);
732 }
733 prev = instr;
734 }
735 ASSERT(graph_entry_ != nullptr);
736 const auto& detached_defs = Read<const ZoneGrowableArray<Definition*>&>();
737
738 // Read instructions extra info.
739 // It may contain references to other instructions.
740 for (Instruction* instr : instructions) {
741 instr->ReadExtra(this);
742 }
743 for (auto* instr : detached_defs) {
744 instr->ReadExtra(this);
745 }
746
747 FlowGraph* flow_graph =
748 new (Z) FlowGraph(parsed_function(), graph_entry_, max_block_id,
750 flow_graph->set_current_ssa_temp_index(current_ssa_temp_index);
751 flow_graph->CreateCommonConstants();
752 flow_graph->disallow_licm();
753 flow_graph->set_inlining_id(inlining_id);
754 flow_graph->set_coverage_array(coverage_array);
755
756 {
757 const intptr_t num_blocks = Read<intptr_t>();
758 if (num_blocks != 0) {
759 auto* codegen_block_order = flow_graph->CodegenBlockOrder();
760 ASSERT(codegen_block_order == &flow_graph->optimized_block_order());
761 for (intptr_t i = 0; i < num_blocks; ++i) {
762 codegen_block_order->Add(ReadRef<BlockEntryInstr*>());
763 }
764 }
765 }
766
767 if (Read<bool>()) {
768 GrowableArray<intptr_t> indices = Read<GrowableArray<intptr_t>>();
769 for (intptr_t i : indices) {
770 flow_graph->captured_parameters()->Add(i);
771 }
772 }
773
774 return flow_graph;
775}
static float prev(float f)
#define Z

◆ ReadGrowableArrayOfRefs()

template<typename T >
GrowableArray< T > dart::FlowGraphDeserializer::ReadGrowableArrayOfRefs ( )
inline

Definition at line 490 of file il_serializer.h.

490 {
491 const intptr_t len = Read<intptr_t>();
492 GrowableArray<T> array(len);
493 for (int i = 0; i < len; ++i) {
494 array.Add(ReadRef<T>());
495 }
496 return array;
497 }

◆ ReadRef()

template<typename T >
T dart::FlowGraphDeserializer::ReadRef ( )
inline

Definition at line 485 of file il_serializer.h.

485 {
486 return ReadRefTrait<T>::ReadRef(this);
487 }
BlockEntryInstr * ReadRef(FlowGraphDeserializer *d)

◆ set_block()

void dart::FlowGraphDeserializer::set_block ( intptr_t  block_id,
BlockEntryInstr block 
)
inline

Definition at line 349 of file il_serializer.h.

349 {
350 ASSERT(blocks_[block_id] == nullptr);
351 blocks_[block_id] = block;
352 }
BlockEntryInstr * block(intptr_t block_id) const

◆ set_current_block()

void dart::FlowGraphDeserializer::set_current_block ( BlockEntryInstr block)
inline

Definition at line 342 of file il_serializer.h.

342{ current_block_ = block; }

◆ set_definition()

void dart::FlowGraphDeserializer::set_definition ( intptr_t  ssa_temp_index,
Definition def 
)
inline

Definition at line 359 of file il_serializer.h.

359 {
360 ASSERT(definitions_[ssa_temp_index] == nullptr);
361 definitions_[ssa_temp_index] = def;
362 }

◆ set_graph_entry()

void dart::FlowGraphDeserializer::set_graph_entry ( GraphEntryInstr entry)
inline

Definition at line 339 of file il_serializer.h.

339{ graph_entry_ = entry; }

◆ stream()

ReadStream * dart::FlowGraphDeserializer::stream ( ) const
inline

Definition at line 334 of file il_serializer.h.

334{ return stream_; }

◆ thread()

Thread * dart::FlowGraphDeserializer::thread ( ) const
inline

Definition at line 335 of file il_serializer.h.

335{ return thread_; }

◆ zone()

Zone * dart::FlowGraphDeserializer::zone ( ) const
inline

Definition at line 333 of file il_serializer.h.

333{ return zone_; }

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