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

#include <il_serializer.h>

Public Member Functions

const AbstractTypeRead (FlowGraphDeserializer *d)
 
AliasIdentity Read (FlowGraphDeserializer *d)
 
bool Read (FlowGraphDeserializer *d)
 
const compiler::ffi::CallbackMarshallerRead (FlowGraphDeserializer *d)
 
const compiler::ffi::CallMarshallerRead (FlowGraphDeserializer *d)
 
const CallTargetsRead (FlowGraphDeserializer *d)
 
const char * Read (FlowGraphDeserializer *d)
 
CidRangeValue Read (FlowGraphDeserializer *d)
 
const CidsRead (FlowGraphDeserializer *d)
 
const ClassRead (FlowGraphDeserializer *d)
 
const CodeRead (FlowGraphDeserializer *d)
 
CompileTypeRead (FlowGraphDeserializer *d)
 
double Read (FlowGraphDeserializer *d)
 
EnvironmentRead (FlowGraphDeserializer *d)
 
const FunctionRead (FlowGraphDeserializer *d)
 
const ICDataRead (FlowGraphDeserializer *d)
 
InstructionRead (FlowGraphDeserializer *d)
 
int8_t Read (FlowGraphDeserializer *d)
 
int16_t Read (FlowGraphDeserializer *d)
 
int32_t Read (FlowGraphDeserializer *d)
 
int64_t Read (FlowGraphDeserializer *d)
 
const LocalVariableRead (FlowGraphDeserializer *d)
 
LocationSummaryRead (FlowGraphDeserializer *d)
 
MoveOperandsRead (FlowGraphDeserializer *d)
 
const ObjectRead (FlowGraphDeserializer *d)
 
RangeRead (FlowGraphDeserializer *d)
 
RecordShape Read (FlowGraphDeserializer *d)
 
Representation Read (FlowGraphDeserializer *d)
 
const SlotRead (FlowGraphDeserializer *d)
 
const SlotRead (FlowGraphDeserializer *d)
 
const compiler::TableSelectorRead (FlowGraphDeserializer *d)
 
TokenPosition Read (FlowGraphDeserializer *d)
 
uint8_t Read (FlowGraphDeserializer *d)
 
uint16_t Read (FlowGraphDeserializer *d)
 
uint32_t Read (FlowGraphDeserializer *d)
 
uint64_t Read (FlowGraphDeserializer *d)
 
ValueRead (FlowGraphDeserializer *d)
 
const MoveScheduleRead (FlowGraphDeserializer *d)
 

Detailed Description

template<typename T, class = void>
struct dart::FlowGraphDeserializer::ReadTrait< T, class >

Definition at line 377 of file il_serializer.h.

Member Function Documentation

◆ Read() [1/38]

const AbstractType * dart::FlowGraphDeserializer::ReadTrait< constAbstractType * >::Read ( FlowGraphDeserializer d)

Definition at line 65 of file il_serializer.cc.

66 {
67 if (!d->Read<bool>()) {
68 return nullptr;
69 }
70 return &(d->Read<const AbstractType&>());
71}
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ Read() [2/38]

Definition at line 81 of file il_serializer.cc.

82 {
83 return AliasIdentity(d);
84}

◆ Read() [3/38]

Definition at line 217 of file il_serializer.cc.

217 {
218 return (d->stream()->Read<uint8_t>() != 0);
219}

◆ Read() [4/38]

const compiler::ffi::CallbackMarshaller & dart::FlowGraphDeserializer::ReadTrait< constcompiler::ffi::CallbackMarshaller & >::Read ( FlowGraphDeserializer d)

Definition at line 251 of file il_serializer.cc.

251 {
252 const Function& dart_signature = d->Read<const Function&>();
253 const char* error = nullptr;
255 d->zone(), dart_signature, &error);
256}
static CallbackMarshaller * FromFunction(Zone *zone, const Function &function, const char **error)
Definition: marshaller.cc:879
const uint8_t uint32_t uint32_t GError ** error

◆ Read() [5/38]

const compiler::ffi::CallMarshaller & dart::FlowGraphDeserializer::ReadTrait< constcompiler::ffi::CallMarshaller & >::Read ( FlowGraphDeserializer d)

Definition at line 268 of file il_serializer.cc.

269 {
270 const Function& dart_signature = d->Read<const Function&>();
271 const intptr_t dart_signature_params_start_at = d->Read<int8_t>();
272 const FunctionType& c_signature = d->Read<const FunctionType&>();
273 const char* error = nullptr;
275 d->zone(), dart_signature, dart_signature_params_start_at, c_signature,
276 &error);
277}
static CallMarshaller * FromFunction(Zone *zone, const Function &function, intptr_t function_params_start_at, const FunctionType &c_signature, const char **error)
Definition: marshaller.cc:90

◆ Read() [6/38]

const CallTargets & dart::FlowGraphDeserializer::ReadTrait< constCallTargets & >::Read ( FlowGraphDeserializer d)

Definition at line 287 of file il_serializer.cc.

288 {
289 return *(new (d->zone()) CallTargets(d));
290}

◆ Read() [7/38]

const char * dart::FlowGraphDeserializer::ReadTrait< constchar * >::Read ( FlowGraphDeserializer d)

Definition at line 352 of file il_serializer.cc.

353 {
354 const intptr_t len = d->Read<intptr_t>();
355 char* str = d->zone()->Alloc<char>(len + 1);
356 d->stream()->ReadBytes(str, len);
357 str[len] = 0;
358 return str;
359}

◆ Read() [8/38]

Definition at line 386 of file il_serializer.cc.

387 {
388 const intptr_t cid_start = d->Read<intptr_t>();
389 const intptr_t cid_end = d->Read<intptr_t>();
390 return CidRangeValue(cid_start, cid_end);
391}

◆ Read() [9/38]

const Cids & dart::FlowGraphDeserializer::ReadTrait< constCids & >::Read ( FlowGraphDeserializer d)

Definition at line 406 of file il_serializer.cc.

407 {
408 Zone* zone = d->zone();
409 Cids* cids = new (zone) Cids(zone);
410 const intptr_t len = d->Read<intptr_t>();
411 for (intptr_t i = 0; i < len; ++i) {
412 const intptr_t cid_start = d->Read<intptr_t>();
413 const intptr_t cid_end = d->Read<intptr_t>();
414 CidRange* r = new (zone) CidRange(cid_start, cid_end);
415 cids->Add(r);
416 }
417 return *cids;
418}

◆ Read() [10/38]

const Class & dart::FlowGraphDeserializer::ReadTrait< constClass & >::Read ( FlowGraphDeserializer d)

Definition at line 432 of file il_serializer.cc.

433 {
434 const classid_t cid = d->Read<classid_t>();
435 if (cid == kIllegalCid) {
436 return Class::ZoneHandle(d->zone());
437 }
438 return Class::ZoneHandle(d->zone(), d->GetClassById(cid));
439}
static Object & ZoneHandle()
Definition: object.h:419
int32_t classid_t
Definition: globals.h:524
@ kIllegalCid
Definition: class_id.h:214
const intptr_t cid

◆ Read() [11/38]

const Code & dart::FlowGraphDeserializer::ReadTrait< constCode & >::Read ( FlowGraphDeserializer d)

Definition at line 476 of file il_serializer.cc.

477 {
478 const intptr_t stub_id = d->Read<intptr_t>();
479 if (stub_id < StubCode::NumEntries()) {
480 return StubCode::EntryAt(stub_id);
481 }
482 intptr_t index = StubCode::NumEntries();
483 ObjectStore* object_store = d->isolate_group()->object_store();
484#define MATCH(member, name) \
485 if (index == stub_id) { \
486 return Code::ZoneHandle(d->zone(), object_store->member()); \
487 } \
488 ++index;
490#undef MATCH
492}
static const Code & EntryAt(intptr_t index)
Definition: stub_code.h:101
static intptr_t NumEntries()
Definition: stub_code.h:107
#define UNIMPLEMENTED
#define MATCH(member, name)
#define OBJECT_STORE_STUB_CODE_LIST(DO)
Definition: object_store.h:296

◆ Read() [12/38]

Definition at line 507 of file il_serializer.cc.

508 {
509 if (!d->Read<bool>()) {
510 return nullptr;
511 }
512 return new (d->zone()) CompileType(d);
513}

◆ Read() [13/38]

Definition at line 592 of file il_serializer.cc.

593 {
594 return bit_cast<double>(d->stream()->Read<int64_t>());
595}

◆ Read() [14/38]

Definition at line 611 of file il_serializer.cc.

612 {
613 if (!d->Read<bool>()) {
614 return nullptr;
615 }
616 return new (d->zone()) Environment(d);
617}

◆ Read() [15/38]

const Function & dart::FlowGraphDeserializer::ReadTrait< constFunction & >::Read ( FlowGraphDeserializer d)

Definition at line 861 of file il_serializer.cc.

862 {
863 const int8_t raw_kind = d->Read<int8_t>();
864 if (raw_kind < 0) {
865 return Object::null_function();
866 }
867 Zone* zone = d->zone();
868 const auto kind = static_cast<UntaggedFunction::Kind>(raw_kind);
869 switch (kind) {
870 case UntaggedFunction::kRegularFunction:
871 case UntaggedFunction::kGetterFunction:
872 case UntaggedFunction::kSetterFunction:
873 case UntaggedFunction::kImplicitGetter:
874 case UntaggedFunction::kImplicitSetter:
875 case UntaggedFunction::kImplicitStaticGetter:
876 case UntaggedFunction::kConstructor: {
877 const classid_t owner_class_id = d->Read<classid_t>();
878 const intptr_t function_index = d->Read<intptr_t>();
879 const auto& owner = Class::Handle(zone, d->GetClassById(owner_class_id));
880 const auto& result =
881 Function::ZoneHandle(zone, owner.FunctionFromIndex(function_index));
882 ASSERT(!result.IsNull());
883 return result;
884 }
885 case UntaggedFunction::kImplicitClosureFunction: {
886 const auto& parent = d->Read<const Function&>();
887 return Function::ZoneHandle(zone, parent.ImplicitClosureFunction());
888 }
889 case UntaggedFunction::kFieldInitializer: {
890 const auto& field = d->Read<const Field&>();
891 return Function::ZoneHandle(zone, field.EnsureInitializerFunction());
892 }
893 case UntaggedFunction::kClosureFunction: {
894 const intptr_t index = d->Read<intptr_t>();
897 }
898 case UntaggedFunction::kMethodExtractor: {
899 const Function& function = d->Read<const Function&>();
900 const String& name = d->Read<const String&>();
901 return Function::ZoneHandle(zone, function.GetMethodExtractor(name));
902 }
903 case UntaggedFunction::kInvokeFieldDispatcher: {
904 const Class& owner = d->Read<const Class&>();
905 const String& target_name = d->Read<const String&>();
906 const Array& args_desc = d->Read<const Array&>();
908 zone,
909 owner.GetInvocationDispatcher(
910 target_name, args_desc, UntaggedFunction::kInvokeFieldDispatcher,
911 /*create_if_absent=*/true));
912 }
913 case UntaggedFunction::kDynamicInvocationForwarder: {
914 const auto& target = d->Read<const Function&>();
915 auto& name = String::Handle(zone, target.name());
918 target.GetDynamicInvocationForwarder(name));
919 }
920 case UntaggedFunction::kFfiTrampoline: {
921 const FfiCallbackKind kind =
922 static_cast<FfiCallbackKind>(d->Read<uint8_t>());
923 const FunctionType& c_signature = d->Read<const FunctionType&>();
924 const Function& callback_target = d->Read<const Function&>();
925 const Instance& exceptional_return = d->Read<const Instance&>();
928 c_signature, callback_target, exceptional_return, kind));
929 }
930 default:
932 return Object::null_function();
933 }
934}
static FunctionPtr ClosureFunctionFromIndex(intptr_t idx)
static StringPtr CreateDynamicInvocationForwarderName(const String &name)
Definition: object.cc:4205
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)
GAsyncResult * result
uint32_t * target
Dart_NativeFunction function
Definition: fuchsia.cc:51
FunctionPtr NativeCallbackFunction(const FunctionType &c_signature, const Function &dart_target, const Instance &exceptional_return, FfiCallbackKind kind)
Definition: callback.cc:36
const char *const name
FfiCallbackKind
Definition: object.h:2984

◆ Read() [16/38]

const ICData * dart::FlowGraphDeserializer::ReadTrait< constICData * >::Read ( FlowGraphDeserializer d)

Definition at line 1011 of file il_serializer.cc.

1012 {
1013 if (!d->Read<bool>()) {
1014 return nullptr;
1015 }
1016 return &ICData::Cast(d->Read<const Object&>());
1017}

◆ Read() [17/38]

Definition at line 1070 of file il_serializer.cc.

1071 {
1072 const uint8_t tag = d->Read<uint8_t>();
1073 switch (tag) {
1074#define READ_INSTRUCTION(type, attrs) \
1075 case Instruction::k##type: \
1076 return new (d->zone()) type##Instr(d);
1078#undef READ_INSTRUCTION
1079 case Instruction::kNumInstructions:
1080 return nullptr;
1081 }
1082 UNREACHABLE();
1083 return nullptr;
1084}
#define UNREACHABLE()
Definition: assert.h:248
#define FOR_EACH_INSTRUCTION(M)
Definition: il.h:405
#define READ_INSTRUCTION(type, attrs)

◆ Read() [18/38]

Definition at line 1155 of file il_serializer.cc.

1156 {
1157 return d->stream()->Read<int8_t>();
1158}

◆ Read() [19/38]

Definition at line 1167 of file il_serializer.cc.

1168 {
1169 return d->stream()->Read<int16_t>();
1170}

◆ Read() [20/38]

Definition at line 1179 of file il_serializer.cc.

1180 {
1181 return d->stream()->Read<int32_t>();
1182}

◆ Read() [21/38]

Definition at line 1191 of file il_serializer.cc.

1192 {
1193 return d->stream()->Read<int64_t>();
1194}

◆ Read() [22/38]

const LocalVariable & dart::FlowGraphDeserializer::ReadTrait< constLocalVariable & >::Read ( FlowGraphDeserializer d)

Definition at line 1223 of file il_serializer.cc.

1224 {
1225 UNIMPLEMENTED();
1226 return *d->parsed_function().receiver_var();
1227}

◆ Read() [23/38]

Definition at line 1273 of file il_serializer.cc.

1274 {
1275 if (!d->Read<bool>()) {
1276 return nullptr;
1277 }
1278 return new (d->zone()) LocationSummary(d);
1279}

◆ Read() [24/38]

Definition at line 1367 of file il_serializer.cc.

1368 {
1369 return new (d->zone()) MoveOperands(d);
1370}

◆ Read() [25/38]

const Object & dart::FlowGraphDeserializer::ReadTrait< constObject & >::Read ( FlowGraphDeserializer d)

Definition at line 1401 of file il_serializer.cc.

1402 {
1403 const intptr_t cid = d->Read<intptr_t>();
1404 if (cid == kIllegalCid) {
1405 const intptr_t object_index = d->Read<intptr_t>();
1406 return *(d->objects_[object_index]);
1407 }
1408 const intptr_t object_index = d->object_counter_;
1409 d->object_counter_++;
1410 const Object& result = d->ReadObjectImpl(cid, object_index);
1411 d->SetObjectAt(object_index, result);
1412 return result;
1413}

◆ Read() [26/38]

Definition at line 2198 of file il_serializer.cc.

2199 {
2200 if (!d->Read<bool>()) {
2201 return nullptr;
2202 }
2203 return new (d->zone()) Range(d);
2204}

◆ Read() [27/38]

Definition at line 2234 of file il_serializer.cc.

2235 {
2236 const intptr_t num_fields = d->Read<intptr_t>();
2237 const auto& field_names = d->Read<const Array&>();
2238 return RecordShape::Register(d->thread(), num_fields, field_names);
2239}
static RecordShape Register(Thread *thread, intptr_t num_fields, const Array &field_names)
Definition: object.cc:27898

◆ Read() [28/38]

Definition at line 2260 of file il_serializer.cc.

2261 {
2262 return static_cast<Representation>(d->Read<uint8_t>());
2263}
Representation
Definition: locations.h:66

◆ Read() [29/38]

const Slot & dart::FlowGraphDeserializer::ReadTrait< constSlot & >::Read ( FlowGraphDeserializer d)

Definition at line 2272 of file il_serializer.cc.

2273 {
2274 return Slot::Read(d);
2275}
static const Slot & Read(FlowGraphDeserializer *d)

◆ Read() [30/38]

const Slot * dart::FlowGraphDeserializer::ReadTrait< constSlot * >::Read ( FlowGraphDeserializer d)

Definition at line 2289 of file il_serializer.cc.

2290 {
2291 if (!d->Read<bool>()) {
2292 return nullptr;
2293 }
2294 return &Slot::Read(d);
2295}

◆ Read() [31/38]

const compiler::TableSelector * dart::FlowGraphDeserializer::ReadTrait< constcompiler::TableSelector * >::Read ( FlowGraphDeserializer d)

Definition at line 2397 of file il_serializer.cc.

2398 {
2399#if defined(DART_PRECOMPILER)
2400 const int32_t id = d->Read<int32_t>();
2401 const compiler::TableSelector* selector =
2403 ASSERT(selector != nullptr);
2404 return selector;
2405#else
2406 UNREACHABLE();
2407#endif
2408}
static Precompiler * Instance()
Definition: precompiler.h:264
compiler::SelectorMap * selector_map()
Definition: precompiler.h:260
const TableSelector * GetSelector(const Function &interface_target) const

◆ Read() [32/38]

Definition at line 2513 of file il_serializer.cc.

2514 {
2515 return TokenPosition::Deserialize(d->Read<int32_t>());
2516}
static TokenPosition Deserialize(int32_t value)

◆ Read() [33/38]

Definition at line 2525 of file il_serializer.cc.

2526 {
2527 return d->stream()->Read<uint8_t>();
2528}

◆ Read() [34/38]

Definition at line 2537 of file il_serializer.cc.

2538 {
2539 return d->stream()->Read<uint16_t>();
2540}

◆ Read() [35/38]

Definition at line 2549 of file il_serializer.cc.

2550 {
2551 return static_cast<uint32_t>(d->stream()->Read<int32_t>());
2552}

◆ Read() [36/38]

Definition at line 2561 of file il_serializer.cc.

2562 {
2563 return static_cast<uint64_t>(d->stream()->Read<int64_t>());
2564}

◆ Read() [37/38]

Definition at line 2598 of file il_serializer.cc.

2599 {
2600 CompileType* type = d->Read<CompileType*>();
2601 Definition* def = d->ReadRef<Definition*>();
2602 Value* value = new (d->zone()) Value(def);
2603 value->SetReachingType(type);
2604 return value;
2605}
GLenum type
uint8_t value

◆ Read() [38/38]

const MoveSchedule * dart::FlowGraphDeserializer::ReadTrait< constMoveSchedule * >::Read ( FlowGraphDeserializer d)

Definition at line 406 of file parallel_move_resolver.cc.

407 {
408 const intptr_t len = d->Read<intptr_t>();
409 MoveSchedule& schedule = MoveSchedule::Allocate(len);
410 for (intptr_t i = 0; i < len; ++i) {
411 schedule[i].kind =
412 static_cast<ParallelMoveResolver::OpKind>(d->Read<uint8_t>());
413 schedule[i].operands = MoveOperands(d);
414 }
415 return &schedule;
416}

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