Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::FlowGraphSerializer::WriteRefTrait< T, class > Struct Template Reference

#include <il_serializer.h>

Public Member Functions

void WriteRef (FlowGraphSerializer *s, BlockEntryInstr *x)
 
void WriteRef (FlowGraphSerializer *s, Definition *x)
 

Detailed Description

template<typename T, class = void>
struct dart::FlowGraphSerializer::WriteRefTrait< T, class >

Definition at line 275 of file il_serializer.h.

Member Function Documentation

◆ WriteRef() [1/2]

Definition at line 131 of file il_serializer.cc.

133 {
134 ASSERT(s->can_write_refs());
135 if (x == nullptr) {
136 s->Write<intptr_t>(-1);
137 return;
138 }
139 const intptr_t id = x->block_id();
140 ASSERT(id >= 0);
141 s->Write<intptr_t>(id);
142}
#define ASSERT(E)
struct MyStruct s
double x
const uintptr_t id

◆ WriteRef() [2/2]

Definition at line 560 of file il_serializer.cc.

562 {
563 if (!x->HasSSATemp()) {
564 if (auto* move_arg = x->AsMoveArgument()) {
565 // Environments of the calls can reference MoveArgument instructions
566 // and they don't have SSA temps.
567 // Write a reference to the original definition.
568 // When reading it is restored using RepairArgumentUsesInEnvironment.
569 x = move_arg->value()->definition();
570 } else {
571 UNREACHABLE();
572 }
573 }
574 ASSERT(x->HasSSATemp());
575 ASSERT(s->can_write_refs());
576 s->Write<intptr_t>(x->ssa_temp_index());
577}
#define UNREACHABLE()
Definition: assert.h:248

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