Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
call_specializer.h File Reference
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"

Go to the source code of this file.

Classes

class  dart::CallSpecializer
 
struct  dart::CallSpecializer::ExactnessInfo
 
class  dart::TypedDataSpecializer
 

Namespaces

namespace  dart
 

Macros

#define PUBLIC_TYPED_DATA_CLASS_LIST(V)
 
#define ALLOCATE_HANDLE(iface, member_name, type, cid)    member_name(AbstractType::Handle(zone_)),
 
#define DEF_HANDLE(iface, member_name, type, cid)   AbstractType& member_name;
 

Macro Definition Documentation

◆ ALLOCATE_HANDLE

#define ALLOCATE_HANDLE (   iface,
  member_name,
  type,
  cid 
)     member_name(AbstractType::Handle(zone_)),

◆ DEF_HANDLE

#define DEF_HANDLE (   iface,
  member_name,
  type,
  cid 
)    AbstractType& member_name;

Definition at line 309 of file call_specializer.h.

◆ PUBLIC_TYPED_DATA_CLASS_LIST

#define PUBLIC_TYPED_DATA_CLASS_LIST (   V)
Value:
V(Int8List, int8_list_type_, int_type_, kTypedDataInt8ArrayCid) \
V(Uint8List, uint8_list_type_, int_type_, kTypedDataUint8ArrayCid) \
V(Uint8ClampedList, uint8_clamped_type_, int_type_, \
kTypedDataUint8ClampedArrayCid) \
V(Int16List, int16_list_type_, int_type_, kTypedDataInt16ArrayCid) \
V(Uint16List, uint16_list_type_, int_type_, kTypedDataUint16ArrayCid) \
V(Int32List, int32_list_type_, int_type_, kTypedDataInt32ArrayCid) \
V(Uint32List, uint32_list_type_, int_type_, kTypedDataUint32ArrayCid) \
V(Int64List, int64_list_type_, int_type_, kTypedDataInt64ArrayCid) \
V(Uint64List, uint64_list_type_, int_type_, kTypedDataUint64ArrayCid) \
V(Float32List, float32_list_type_, double_type_, kTypedDataFloat32ArrayCid) \
V(Float64List, float64_list_type_, double_type_, kTypedDataFloat64ArrayCid)
#define V(name)
Definition raw_object.h:124

Definition at line 218 of file call_specializer.h.

256 : public FlowGraphVisitor {
257 public:
258 static void Optimize(FlowGraph* flow_graph);
259
260 virtual void VisitInstanceCall(InstanceCallInstr* instr);
261 virtual void VisitStaticCall(StaticCallInstr* instr);
262
263 private:
264 // clang-format off
265 explicit TypedDataSpecializer(FlowGraph* flow_graph)
266 : FlowGraphVisitor(flow_graph->reverse_postorder()),
267 thread_(Thread::Current()),
268 zone_(thread_->zone()),
269 flow_graph_(flow_graph),
270#define ALLOCATE_HANDLE(iface, member_name, type, cid) \
271 member_name(AbstractType::Handle(zone_)),
273#undef INIT_HANDLE
274 int_type_(AbstractType::Handle()),
275 double_type_(AbstractType::Handle()),
276 implementor_(Class::Handle()) {
277 }
278 // clang-format on
279
280 void EnsureIsInitialized();
281 void TryInlineCall(TemplateDartCall<0>* call);
282 void ReplaceWithLengthGetter(TemplateDartCall<0>* call);
283 void ReplaceWithIndexGet(TemplateDartCall<0>* call, classid_t cid);
284 void ReplaceWithIndexSet(TemplateDartCall<0>* call, classid_t cid);
285 void AppendNullCheck(TemplateDartCall<0>* call, Definition** array);
286 void AppendMutableCheck(TemplateDartCall<0>* call, Definition** array);
287 void AppendBoundsCheck(TemplateDartCall<0>* call,
288 Definition* array,
289 Definition** index);
290 Definition* AppendLoadLength(TemplateDartCall<0>* call, Definition* array);
291 Definition* AppendLoadIndexed(TemplateDartCall<0>* call,
292 Definition* array,
293 Definition* index,
294 classid_t cid);
295 void AppendStoreIndexed(TemplateDartCall<0>* call,
296 Definition* array,
297 Definition* index,
298 Definition* value,
299 classid_t cid);
300
301 Zone* zone() const { return zone_; }
302
303 Thread* thread_;
304 Zone* zone_;
305 FlowGraph* flow_graph_;
306 bool initialized_ = false;
307
308#define DEF_HANDLE(iface, member_name, type, cid) AbstractType& member_name;
310#undef DEF_HANDLE
311
312 AbstractType& int_type_;
313 AbstractType& double_type_;
314 Class& implementor_;
315};
316
317} // namespace dart
318
319#endif // RUNTIME_VM_COMPILER_CALL_SPECIALIZER_H_
#define INIT_HANDLE(iface, member_name, type, cid)
#define DEF_HANDLE(iface, member_name, type, cid)
#define PUBLIC_TYPED_DATA_CLASS_LIST(V)
#define ALLOCATE_HANDLE(iface, member_name, type, cid)
const intptr_t cid