5#ifndef RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_
6#define RUNTIME_VM_COMPILER_BACKEND_BLOCK_BUILDER_H_
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
23 bool with_frame =
true)
24 : flow_graph_(flow_graph),
26 flow_graph->inlining_id())),
30 with_frame_(with_frame) {
51 if (instr->ComputeCanDeoptimize() ||
52 instr->ComputeCanDeoptimizeAfterCall() ||
53 instr->CanBecomeDeoptimizationTarget()) {
56 instr->SetEnvironment(dummy_env_);
80 const auto [location, representation] =
83 with_frame_ ? location : location.ToEntrySpRelative());
93 index, location, representation));
105 auto const unbox_rep = rep == kUnboxedFloat
110 if (rep != unbox_rep && unboxed_value->IsUnboxInteger()) {
114 unboxed_value->AsUnboxInteger()->mark_truncating();
120 unboxed_value->AsUnbox()->value()->SetReachingType(
123 if (rep == kUnboxedFloat) {
127 return unboxed_value;
142 branch->SetEnvironment(dummy_env_);
146 *branch->true_successor_address() = true_successor;
147 *branch->false_successor_address() = false_successor;
155 entry_->AsJoinEntry()->InsertPhi(phi);
166 const bool with_frame_;
void set_last_instruction(Instruction *instr)
static CompileType FromUnboxedRepresentation(Representation rep)
static CompilerState & Current()
static constexpr intptr_t kNone
GraphEntryInstr * graph_entry() const
ConstantInstr * GetConstant(const Object &object, Representation representation=kTagged)
static Representation ReturnRepresentationOf(const Function &function)
const std::pair< Location, Representation > & GetDirectParameterInfoAt(intptr_t i)
const Function & function() const
void AllocateSSAIndex(Definition *def)
void AddToInitialDefinitions(BlockEntryWithInitialDefs *entry, Definition *defn)
FunctionEntryInstr * normal_entry() const
void SetEnvironment(Environment *deopt_env)
Instruction * AppendInstruction(Instruction *tail)
static Object & ZoneHandle()
static UnboxInstr * Create(Representation to, Value *value, intptr_t deopt_id, SpeculativeMode speculative_mode=kGuardInputs)
BlockBuilder(FlowGraph *flow_graph, BlockEntryInstr *entry, bool with_frame=true)
DartReturnInstr * AddReturn(Value *value, Representation representation)
Definition * AddUnboxInstr(Representation rep, Value *value, bool is_checked)
Definition * AddUnboxInstr(Representation rep, Definition *boxed, bool is_checked)
void AddPhi(PhiInstr *phi)
DartReturnInstr * AddReturn(Value *value)
T * AddInstruction(T *instr)
Definition * AddParameter(intptr_t index, Representation representation, Location location=Location())
BranchInstr * AddBranch(ComparisonInstr *comp, TargetEntryInstr *true_successor, TargetEntryInstr *false_successor)
TokenPosition TokenPos() const
Definition * AddParameter(intptr_t index)
Definition * AddNullDefinition()
Instruction * last() const
const InstructionSource & Source() const
Definition * AddToInitialDefinitions(Definition *def)
T * AddDefinition(T *def)
const Function & function() const
static constexpr Representation NativeRepresentation(Representation rep)
const TokenPosition token_pos
static constexpr size_t ValueSize(Representation rep)