5#ifndef RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_
6#define RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
19class SpeculativeInliningPolicy;
40 bool should_clone_fields)
152 bool TypeCheckAsClassEquality(
const AbstractType&
type, intptr_t* type_cid);
165 int argument_number);
173 BoolPtr InstanceOfAsBool(
const ICData& ic_data,
187 static bool SpecializeTestCidsForNumericTypes(
191 static bool TryReplaceInstanceCallWithInline(
197 static bool TryReplaceStaticCallWithInline(
204 intptr_t receiver_cid,
220#define PUBLIC_TYPED_DATA_CLASS_LIST(V) \
221 V(Int8List, int_type_, kTypedDataInt8ArrayCid) \
222 V(Uint8List, int_type_, kTypedDataUint8ArrayCid) \
223 V(Uint8ClampedList, int_type_, kTypedDataUint8ClampedArrayCid) \
224 V(Int16List, int_type_, kTypedDataInt16ArrayCid) \
225 V(Uint16List, int_type_, kTypedDataUint16ArrayCid) \
226 V(Int32List, int_type_, kTypedDataInt32ArrayCid) \
227 V(Uint32List, int_type_, kTypedDataUint32ArrayCid) \
228 V(Int64List, int_type_, kTypedDataInt64ArrayCid) \
229 V(Uint64List, int_type_, kTypedDataUint64ArrayCid) \
230 V(Float32List, double_type_, kTypedDataFloat32ArrayCid) \
231 V(Float64List, double_type_, kTypedDataFloat64ArrayCid) \
232 V(Float32x4List, float32x4_type_, kTypedDataFloat32x4ArrayCid) \
233 V(Int32x4List, int32x4_type_, kTypedDataInt32x4ArrayCid) \
234 V(Float64x2List, float64x2_type_, kTypedDataFloat64x2ArrayCid)
273 zone_(thread_->zone()),
274 flow_graph_(flow_graph),
284 void EnsureIsInitialized();
305 Zone* zone()
const {
return zone_; }
310 bool initialized_ =
false;
312 struct TypedDataVariant {
319#define DEFINE_INDEX(iface, type, cid) k##iface##Index,
322 kNumTypedDataVariants
325 std::array<TypedDataVariant, kNumTypedDataVariants> typed_data_variants_;
327 AbstractType& int_type_;
328 AbstractType& double_type_;
329 AbstractType& float32x4_type_;
330 AbstractType& int32x4_type_;
331 AbstractType& float64x2_type_;
static float next(float f)
#define DEFINE_INDEX(iface, type, cid)
#define PUBLIC_TYPED_DATA_CLASS_LIST(V)
virtual void VisitStaticCall(StaticCallInstr *instr)
IsolateGroup * isolate_group() const
void AddReceiverCheck(InstanceCallInstr *call)
void set_flow_graph(FlowGraph *flow_graph)
bool TryReplaceWithEqualityOp(InstanceCallInstr *call, Token::Kind op_kind)
FlowGraph * flow_graph() const
void AddCheckNull(Value *to_check, const String &function_name, intptr_t deopt_id, Environment *deopt_environment, Instruction *insert_before)
void AddCheckClass(Definition *to_check, const Cids &cids, intptr_t deopt_id, Environment *deopt_environment, Instruction *insert_before)
void ReplaceCall(Definition *call, Definition *replacement)
virtual ~CallSpecializer()
bool TryInlineInstanceSetter(InstanceCallInstr *call)
CallSpecializer(FlowGraph *flow_graph, SpeculativeInliningPolicy *speculative_policy, bool should_clone_fields)
void InsertBefore(Instruction *next, Instruction *instr, Environment *env, FlowGraph::UseKind use_kind)
const bool should_clone_fields_
void ReplaceCallWithResult(Definition *call, Instruction *replacement, Definition *result)
virtual void VisitLoadCodeUnits(LoadCodeUnitsInstr *instr)
virtual bool TryCreateICData(InstanceCallInstr *call)
void InlineImplicitInstanceGetter(Definition *call, const Field &field)
bool TryInlineInstanceGetter(InstanceCallInstr *call)
bool TryReplaceWithRelationalOp(InstanceCallInstr *call, Token::Kind op_kind)
virtual bool TryOptimizeStaticCallUsingStaticTypes(StaticCallInstr *call)=0
bool TryReplaceWithUnaryOp(InstanceCallInstr *call, Token::Kind op_kind)
SpeculativeInliningPolicy * speculative_policy_
const Function & function() const
virtual void ReplaceInstanceCallsWithDispatchTableCalls()
void ReplaceWithInstanceOf(InstanceCallInstr *instr)
bool TryReplaceWithBinaryOp(InstanceCallInstr *call, Token::Kind op_kind)
bool TryInlineInstanceMethod(InstanceCallInstr *call)
virtual bool TryReplaceInstanceOfWithRangeCheck(InstanceCallInstr *call, const AbstractType &type)
void InsertSpeculativeBefore(Instruction *next, Instruction *instr, Environment *env, FlowGraph::UseKind use_kind)
void set_block_order(const GrowableArray< BlockEntryInstr * > &block_order)
FlowGraphVisitor(const GrowableArray< BlockEntryInstr * > &block_order)
const GrowableArray< BlockEntryInstr * > & reverse_postorder() const
IsolateGroup * isolate_group() const
const Function & function() const
void InsertBefore(Instruction *next, Instruction *instr, Environment *env, UseKind use_kind)
void InsertSpeculativeBefore(Instruction *next, Instruction *instr, Environment *env, UseKind use_kind)
static Thread * Current()
virtual void VisitStaticCall(StaticCallInstr *instr)
virtual void VisitInstanceCall(InstanceCallInstr *instr)
static void Optimize(FlowGraph *flow_graph)
const char *const function_name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network policy
def array_type(data_type)
bool emit_exactness_guard