Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Macros
il_serializer.cc File Reference
#include "vm/compiler/backend/il_serializer.h"
#include "vm/class_id.h"
#include "vm/closure_functions_cache.h"
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
#include "vm/compiler/backend/range_analysis.h"
#include "vm/compiler/frontend/flow_graph_builder.h"
#include "vm/object_store.h"
#include "vm/parser.h"

Go to the source code of this file.

Namespaces

namespace  dart
 

Macros

#define Z   zone_
 
#define INSTRUCTION_REFS_SERIALIZABLE_AS_BLOCK_ENTRY(V)
 
#define SERIALIZABLE_AS_BLOCK_ENTRY(name, type)
 
#define MATCH(member, name)
 
#define MATCH(member, name)
 
#define UNIMPLEMENTED_FUNCTION_KIND(kind)
 
#define READ_INSTRUCTION(type, attrs)
 
#define INSTRUCTIONS_SERIALIZABLE_AS_INSTRUCTION(V)
 
#define SERIALIZABLE_AS_INSTRUCTION(name, type)
 
#define HANDLES_SERIALIZABLE_AS_OBJECT(V)
 
#define SERIALIZE_HANDLE_AS_OBJECT(handle, null_handle)
 

Macro Definition Documentation

◆ HANDLES_SERIALIZABLE_AS_OBJECT

#define HANDLES_SERIALIZABLE_AS_OBJECT (   V)
Value:
V(AbstractType, Object::null_abstract_type()) \
V(Array, Object::null_array()) \
V(Field, Field::Handle(d->zone())) \
V(FunctionType, Object::null_function_type()) \
V(Instance, Object::null_instance()) \
V(String, Object::null_string()) \
V(TypeArguments, Object::null_type_arguments()) \
V(TypeParameters, TypeParameters::Handle(d->zone()))
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition main.cc:19
#define V(name)
Definition raw_object.h:124

Definition at line 2094 of file il_serializer.cc.

2106 { \
2107 s->Write<const Object&>(x); \
2108 } \
2109 template <> \
2110 const handle& FlowGraphDeserializer::ReadTrait<const handle&>::Read( \
2111 FlowGraphDeserializer* d) { \
2112 const Object& result = d->Read<const Object&>(); \
2113 if (result.IsNull()) { \
2114 return null_handle; \
2115 } \
2116 return handle::Cast(result); \
2117 }
2118
2120#undef SERIALIZE_HANDLE_AS_OBJECT
2121#undef HANDLES_SERIALIZABLE_AS_OBJECT
2122
2123void OsrEntryInstr::WriteTo(FlowGraphSerializer* s) {
2124 BlockEntryWithInitialDefs::WriteTo(s);
2125}
2126
2127OsrEntryInstr::OsrEntryInstr(FlowGraphDeserializer* d)
2128 : BlockEntryWithInitialDefs(d), graph_entry_(d->graph_entry()) {}
2129
2130void ParallelMoveInstr::WriteExtra(FlowGraphSerializer* s) {
2131 Instruction::WriteExtra(s);
2132 s->Write<GrowableArray<MoveOperands*>>(moves_);
2133 s->Write<const MoveSchedule*>(move_schedule_);
2134}
2135
2136void ParallelMoveInstr::ReadExtra(FlowGraphDeserializer* d) {
2137 Instruction::ReadExtra(d);
2138 moves_ = d->Read<GrowableArray<MoveOperands*>>();
2139 move_schedule_ = d->Read<const MoveSchedule*>();
2140}
2141
2142void ParameterInstr::WriteExtra(FlowGraphSerializer* s) {
2143 TemplateDefinition::WriteExtra(s);
2144 location_.Write(s);
2145}
2146
2147void ParameterInstr::ReadExtra(FlowGraphDeserializer* d) {
2148 TemplateDefinition::ReadExtra(d);
2149 location_ = Location::Read(d);
2150}
2151
2152void PhiInstr::WriteTo(FlowGraphSerializer* s) {
2153 VariadicDefinition::WriteTo(s);
2154 s->Write<Representation>(representation_);
2155 s->Write<bool>(is_alive_);
2156 s->Write<int8_t>(is_receiver_);
2157}
2158
2159PhiInstr::PhiInstr(FlowGraphDeserializer* d)
2160 : VariadicDefinition(d),
2161 block_(d->current_block()->AsJoinEntry()),
2162 representation_(d->Read<Representation>()),
2163 is_alive_(d->Read<bool>()),
2164 is_receiver_(d->Read<int8_t>()) {}
2165
2166void LeafRuntimeCallInstr::WriteTo(FlowGraphSerializer* s) {
2167 VariadicDefinition::WriteTo(s);
2168 s->Write<Representation>(return_representation_);
2169 s->Write<const ZoneGrowableArray<Representation>&>(argument_representations_);
2170}
2171
2172LeafRuntimeCallInstr::LeafRuntimeCallInstr(FlowGraphDeserializer* d)
2173 : VariadicDefinition(d),
2174 return_representation_(d->Read<Representation>()),
2175 argument_representations_(
2176 d->Read<const ZoneGrowableArray<Representation>&>()),
2177 native_calling_convention_(
2178 compiler::ffi::NativeCallingConvention::FromSignature(
2179 d->zone(),
2180 *compiler::ffi::NativeFunctionType::FromRepresentations(
2181 d->zone(),
2182 return_representation_,
2183 argument_representations_))) {}
2184
2185template <>
2186void FlowGraphSerializer::WriteTrait<Range*>::Write(FlowGraphSerializer* s,
2187 Range* x) {
2188 if (x == nullptr) {
2189 s->Write<bool>(false);
2190 } else {
2191 s->Write<bool>(true);
2192 x->Write(s);
2193 }
2194}
2195
2196template <>
2197Range* FlowGraphDeserializer::ReadTrait<Range*>::Read(
2198 FlowGraphDeserializer* d) {
2199 if (!d->Read<bool>()) {
2200 return nullptr;
2201 }
2202 return new (d->zone()) Range(d);
2203}
2204
2205void Range::Write(FlowGraphSerializer* s) const {
2206 min_.Write(s);
2207 max_.Write(s);
2208}
2209
2210Range::Range(FlowGraphDeserializer* d)
2211 : min_(RangeBoundary(d)), max_(RangeBoundary(d)) {}
2212
2213void RangeBoundary::Write(FlowGraphSerializer* s) const {
2214 s->Write<int8_t>(kind_);
2215 s->Write<int64_t>(value_);
2216 s->Write<int64_t>(offset_);
2217}
2218
2219RangeBoundary::RangeBoundary(FlowGraphDeserializer* d)
2220 : kind_(static_cast<Kind>(d->Read<int8_t>())),
2221 value_(d->Read<int64_t>()),
2222 offset_(d->Read<int64_t>()) {}
2223
2224template <>
2225void FlowGraphSerializer::WriteTrait<RecordShape>::Write(FlowGraphSerializer* s,
2226 RecordShape x) {
2227 s->Write<intptr_t>(x.num_fields());
2228 s->Write<const Array&>(
2229 Array::Handle(s->zone(), x.GetFieldNames(s->thread())));
2230}
2231
2232template <>
2233RecordShape FlowGraphDeserializer::ReadTrait<RecordShape>::Read(
2234 FlowGraphDeserializer* d) {
2235 const intptr_t num_fields = d->Read<intptr_t>();
2236 const auto& field_names = d->Read<const Array&>();
2237 return RecordShape::Register(d->thread(), num_fields, field_names);
2238}
2239
2240void RegisterSet::Write(FlowGraphSerializer* s) const {
2241 s->Write<uintptr_t>(cpu_registers_.data());
2242 s->Write<uintptr_t>(untagged_cpu_registers_.data());
2243 s->Write<uintptr_t>(fpu_registers_.data());
2244}
2245
2246RegisterSet::RegisterSet(FlowGraphDeserializer* d)
2247 : cpu_registers_(d->Read<uintptr_t>()),
2248 untagged_cpu_registers_(d->Read<uintptr_t>()),
2249 fpu_registers_(d->Read<uintptr_t>()) {}
2250
2251template <>
2252void FlowGraphSerializer::WriteTrait<Representation>::Write(
2253 FlowGraphSerializer* s,
2254 Representation x) {
2255 s->Write<uint8_t>(x);
2256}
2257
2258template <>
2259Representation FlowGraphDeserializer::ReadTrait<Representation>::Read(
2260 FlowGraphDeserializer* d) {
2261 return static_cast<Representation>(d->Read<uint8_t>());
2262}
2263
2264template <>
2265void FlowGraphSerializer::WriteTrait<const Slot&>::Write(FlowGraphSerializer* s,
2266 const Slot& x) {
2267 x.Write(s);
2268}
2269
2270template <>
2271const Slot& FlowGraphDeserializer::ReadTrait<const Slot&>::Read(
2272 FlowGraphDeserializer* d) {
2273 return Slot::Read(d);
2274}
2275
2276template <>
2277void FlowGraphSerializer::WriteTrait<const Slot*>::Write(FlowGraphSerializer* s,
2278 const Slot* x) {
2279 if (x == nullptr) {
2280 s->Write<bool>(false);
2281 return;
2282 }
2283 s->Write<bool>(true);
2284 x->Write(s);
2285}
2286
2287template <>
2288const Slot* FlowGraphDeserializer::ReadTrait<const Slot*>::Read(
2289 FlowGraphDeserializer* d) {
2290 if (!d->Read<bool>()) {
2291 return nullptr;
2292 }
2293 return &Slot::Read(d);
2294}
2295
2296void Slot::Write(FlowGraphSerializer* s) const {
2297 s->Write<serializable_type_t<Kind>>(
2298 static_cast<serializable_type_t<Kind>>(kind_));
2299
2300 switch (kind_) {
2301 case Kind::kTypeArguments:
2302 s->Write<int8_t>(flags_);
2303 s->Write<intptr_t>(offset_in_bytes_);
2304 break;
2305 case Kind::kTypeArgumentsIndex:
2306 s->Write<intptr_t>(offset_in_bytes_);
2307 break;
2308 case Kind::kArrayElement:
2309 s->Write<intptr_t>(offset_in_bytes_);
2310 break;
2311 case Kind::kRecordField:
2312 s->Write<intptr_t>(offset_in_bytes_);
2313 break;
2314 case Kind::kCapturedVariable:
2315 s->Write<int8_t>(flags_);
2316 s->Write<intptr_t>(offset_in_bytes_);
2317 s->Write<const String&>(*DataAs<const String>());
2318 type_.Write(s);
2319 break;
2320 case Kind::kDartField:
2321 s->Write<const Field&>(field());
2322 break;
2323 default:
2324 break;
2325 }
2326}
2327
2328const Slot& Slot::Read(FlowGraphDeserializer* d) {
2329 const Kind kind = static_cast<Kind>(d->Read<serializable_type_t<Kind>>());
2330 int8_t flags = 0;
2331 intptr_t offset = -1;
2332 const void* data = nullptr;
2333 CompileType type = CompileType::None();
2334 Representation representation = kTagged;
2335
2336 switch (kind) {
2337 case Kind::kTypeArguments:
2338 flags = d->Read<int8_t>();
2339 offset = d->Read<intptr_t>();
2340 data = ":type_arguments";
2341 type = CompileType::FromCid(kTypeArgumentsCid);
2342 break;
2343 case Kind::kTypeArgumentsIndex:
2344 flags =
2345 IsImmutableBit::encode(true) |
2346 IsCompressedBit::encode(TypeArguments::ContainsCompressedPointers());
2347 offset = d->Read<intptr_t>();
2348 data = ":argument";
2349 type = CompileType(CompileType::kCannotBeNull,
2350 CompileType::kCannotBeSentinel, kDynamicCid, nullptr);
2351 break;
2352 case Kind::kArrayElement:
2353 flags = IsCompressedBit::encode(Array::ContainsCompressedPointers());
2354 offset = d->Read<intptr_t>();
2355 data = ":array_element";
2356 type = CompileType::Dynamic();
2357 break;
2358 case Kind::kRecordField:
2359 flags = IsCompressedBit::encode(Record::ContainsCompressedPointers());
2360 offset = d->Read<intptr_t>();
2361 data = ":record_field";
2362 type = CompileType::Dynamic();
2363 break;
2364 case Kind::kCapturedVariable:
2365 flags = d->Read<int8_t>();
2366 offset = d->Read<intptr_t>();
2367 data = &d->Read<const String&>();
2368 type = CompileType(d);
2369 break;
2370 case Kind::kDartField: {
2371 const Field& field = d->Read<const Field&>();
2372 return Slot::Get(field, &d->parsed_function());
2373 }
2374 default:
2375 return Slot::GetNativeSlot(kind);
2376 }
2377
2378 return GetCanonicalSlot(d->thread(), kind, flags, offset, data, type,
2379 representation);
2380}
2381
2382template <>
2383void FlowGraphSerializer::WriteTrait<const compiler::TableSelector*>::Write(
2384 FlowGraphSerializer* s,
2385 const compiler::TableSelector* x) {
2386#if defined(DART_PRECOMPILER)
2387 ASSERT(x != nullptr);
2388 s->Write<int32_t>(x->id);
2389#else
2390 UNREACHABLE();
2391#endif
2392}
2393
2394template <>
2395const compiler::TableSelector*
2396FlowGraphDeserializer::ReadTrait<const compiler::TableSelector*>::Read(
2397 FlowGraphDeserializer* d) {
2398#if defined(DART_PRECOMPILER)
2399 const int32_t id = d->Read<int32_t>();
2400 const compiler::TableSelector* selector =
2401 Precompiler::Instance()->selector_map()->GetSelector(id);
2402 ASSERT(selector != nullptr);
2403 return selector;
2404#else
2405 UNREACHABLE();
2406#endif
2407}
2408
2409template <intptr_t kExtraInputs>
2410void TemplateDartCall<kExtraInputs>::WriteTo(FlowGraphSerializer* s) {
2411 VariadicDefinition::WriteTo(s);
2412 s->Write<intptr_t>(type_args_len_);
2413 s->Write<const Array&>(argument_names_);
2414 s->Write<TokenPosition>(token_pos_);
2415 if (move_arguments_ == nullptr) {
2416 s->Write<intptr_t>(-1);
2417 } else {
2418 s->Write<intptr_t>(move_arguments_->length());
2419 // Write detached MoveArgument instructions.
2420 for (auto move_arg : *move_arguments_) {
2421 if (move_arg->next() == nullptr) {
2422 s->Write<bool>(true);
2423 s->Write<Instruction*>(move_arg);
2424 } else {
2425 s->Write<bool>(false);
2426 }
2427 }
2428 }
2429}
2430
2431template <intptr_t kExtraInputs>
2432TemplateDartCall<kExtraInputs>::TemplateDartCall(FlowGraphDeserializer* d)
2433 : VariadicDefinition(d),
2434 type_args_len_(d->Read<intptr_t>()),
2435 argument_names_(d->Read<const Array&>()),
2436 token_pos_(d->Read<TokenPosition>()) {
2437 const intptr_t num_move_args = d->Read<intptr_t>();
2438 if (num_move_args >= 0) {
2439 move_arguments_ =
2440 new (d->zone()) MoveArgumentsArray(d->zone(), num_move_args);
2441 move_arguments_->EnsureLength(num_move_args, nullptr);
2442 for (intptr_t i = 0; i < num_move_args; i++) {
2443 if (d->Read<bool>()) {
2444 auto move_arg = d->Read<Instruction*>()->AsMoveArgument();
2445 ASSERT(move_arg != nullptr);
2446 (*move_arguments_)[i] = move_arg;
2447 }
2448 }
2449 }
2450}
2451
2452template <intptr_t kExtraInputs>
2453void TemplateDartCall<kExtraInputs>::WriteExtra(FlowGraphSerializer* s) {
2454 VariadicDefinition::WriteExtra(s);
2455 if (move_arguments_ != nullptr) {
2456 // Write extras for detached MoveArgument in reverse order, because
2457 // we are going to read them back in reverse order.
2458 for (intptr_t i = move_arguments_->length() - 1; i >= 0; --i) {
2459 auto move_arg = move_arguments_->At(i);
2460 if (move_arg->next() == nullptr) {
2461 move_arg->WriteExtra(s);
2462 }
2463 }
2464 }
2465}
2466
2467template <intptr_t kExtraInputs>
2468void TemplateDartCall<kExtraInputs>::ReadExtra(FlowGraphDeserializer* d) {
2469 VariadicDefinition::ReadExtra(d);
2470 if (move_arguments_ != nullptr) {
2471 Instruction* cursor = this;
2472 for (intptr_t i = move_arguments_->length() - 1; i >= 0; --i) {
2473 if ((*move_arguments_)[i] != nullptr) {
2474 (*move_arguments_)[i]->ReadExtra(d);
2475 } else {
2476 // Note: IL might be serialized after ParallelMove instructions
2477 // were inserted between MoveArguments.
2478 do {
2479 cursor = cursor->previous();
2480 } while (!cursor->IsMoveArgument());
2481 (*move_arguments_)[i] = cursor->AsMoveArgument();
2482 }
2483 }
2484 if (env() != nullptr) {
2485 RepairArgumentUsesInEnvironment();
2486 }
2487 }
2488}
2489
2490// Explicit template instantiations, needed for the methods above.
2491template class TemplateDartCall<0>;
2492template class TemplateDartCall<1>;
2493
2494void MoveArgumentInstr::WriteExtra(FlowGraphSerializer* s) {
2495 TemplateDefinition::WriteExtra(s);
2496 location_.Write(s);
2497}
2498
2499void MoveArgumentInstr::ReadExtra(FlowGraphDeserializer* d) {
2500 TemplateDefinition::ReadExtra(d);
2501 location_ = Location::Read(d);
2502}
2503
2504template <>
2505void FlowGraphSerializer::WriteTrait<TokenPosition>::Write(
2506 FlowGraphSerializer* s,
2507 TokenPosition x) {
2508 s->Write<int32_t>(x.Serialize());
2509}
2510
2511template <>
2512TokenPosition FlowGraphDeserializer::ReadTrait<TokenPosition>::Read(
2513 FlowGraphDeserializer* d) {
2514 return TokenPosition::Deserialize(d->Read<int32_t>());
2515}
2516
2517template <>
2518void FlowGraphSerializer::WriteTrait<uint8_t>::Write(FlowGraphSerializer* s,
2519 uint8_t x) {
2520 s->stream()->Write<uint8_t>(x);
2521}
2522
2523template <>
2524uint8_t FlowGraphDeserializer::ReadTrait<uint8_t>::Read(
2525 FlowGraphDeserializer* d) {
2526 return d->stream()->Read<uint8_t>();
2527}
2528
2529template <>
2530void FlowGraphSerializer::WriteTrait<uint16_t>::Write(FlowGraphSerializer* s,
2531 uint16_t x) {
2532 s->stream()->Write<uint16_t>(x);
2533}
2534
2535template <>
2536uint16_t FlowGraphDeserializer::ReadTrait<uint16_t>::Read(
2537 FlowGraphDeserializer* d) {
2538 return d->stream()->Read<uint16_t>();
2539}
2540
2541template <>
2542void FlowGraphSerializer::WriteTrait<uint32_t>::Write(FlowGraphSerializer* s,
2543 uint32_t x) {
2544 s->stream()->Write<int32_t>(static_cast<int32_t>(x));
2545}
2546
2547template <>
2548uint32_t FlowGraphDeserializer::ReadTrait<uint32_t>::Read(
2549 FlowGraphDeserializer* d) {
2550 return static_cast<uint32_t>(d->stream()->Read<int32_t>());
2551}
2552
2553template <>
2554void FlowGraphSerializer::WriteTrait<uint64_t>::Write(FlowGraphSerializer* s,
2555 uint64_t x) {
2556 s->stream()->Write<int64_t>(static_cast<int64_t>(x));
2557}
2558
2559template <>
2560uint64_t FlowGraphDeserializer::ReadTrait<uint64_t>::Read(
2561 FlowGraphDeserializer* d) {
2562 return static_cast<uint64_t>(d->stream()->Read<int64_t>());
2563}
2564
2565void UnboxedConstantInstr::WriteTo(FlowGraphSerializer* s) {
2566 ConstantInstr::WriteTo(s);
2567 s->Write<Representation>(representation_);
2568 // constant_address_ is not written - it is restored when reading.
2569}
2570
2571UnboxedConstantInstr::UnboxedConstantInstr(FlowGraphDeserializer* d)
2572 : ConstantInstr(d),
2573 representation_(d->Read<Representation>()),
2574 constant_address_(0) {
2575 if (representation_ == kUnboxedDouble) {
2576 ASSERT(value().IsDouble());
2577 constant_address_ = FindDoubleConstant(Double::Cast(value()).value());
2578 }
2579}
2580
2581template <>
2582void FlowGraphSerializer::WriteTrait<Value*>::Write(FlowGraphSerializer* s,
2583 Value* x) {
2584 ASSERT(s->can_write_refs());
2585 CompileType* reaching_type = x->reaching_type();
2586 Definition* def = x->definition();
2587 // Omit reaching type if it is the same as definition type.
2588 if ((reaching_type != nullptr) && def->HasType() &&
2589 (reaching_type == def->Type())) {
2590 reaching_type = nullptr;
2591 }
2592 s->Write<CompileType*>(reaching_type);
2593 s->WriteRef<Definition*>(def);
2594}
2595
2596template <>
2597Value* FlowGraphDeserializer::ReadTrait<Value*>::Read(
2598 FlowGraphDeserializer* d) {
2599 CompileType* type = d->Read<CompileType*>();
2600 Definition* def = d->ReadRef<Definition*>();
2601 Value* value = new (d->zone()) Value(def);
2602 value->SetReachingType(type);
2603 return value;
2604}
2605
2606void VariadicDefinition::WriteTo(FlowGraphSerializer* s) {
2607 Definition::WriteTo(s);
2608 s->Write<intptr_t>(inputs_.length());
2609}
2610
2611VariadicDefinition::VariadicDefinition(FlowGraphDeserializer* d)
2612 : Definition(d), inputs_(d->zone(), 0) {
2613 const intptr_t num_inputs = d->Read<intptr_t>();
2614 inputs_.EnsureLength(num_inputs, nullptr);
2615}
2616
2617} // namespace dart
SI F min_(F x, F y)
SI F max_(F x, F y)
#define UNREACHABLE()
Definition assert.h:248
#define ASSERT(E)
struct MyStruct s
FlutterSemanticsFlag flags
uint8_t value
GAsyncResult * result
#define HANDLES_SERIALIZABLE_AS_OBJECT(V)
#define SERIALIZE_HANDLE_AS_OBJECT(handle, null_handle)
double x
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)
bool IsDouble(const dart::Object &a)
uword FindDoubleConstant(double value)
Representation
Definition locations.h:66
ZoneGrowableArray< MoveArgumentInstr * > MoveArgumentsArray
Definition il.h:896
Definition __init__.py:1
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
Point offset

◆ INSTRUCTION_REFS_SERIALIZABLE_AS_BLOCK_ENTRY

#define INSTRUCTION_REFS_SERIALIZABLE_AS_BLOCK_ENTRY (   V)
Value:
V(CatchBlockEntry, CatchBlockEntryInstr) \
V(FunctionEntry, FunctionEntryInstr) \
V(IndirectEntry, IndirectEntryInstr) \
V(JoinEntry, JoinEntryInstr) \
V(OsrEntry, OsrEntryInstr) \
V(TargetEntry, TargetEntryInstr)

Definition at line 154 of file il_serializer.cc.

◆ INSTRUCTIONS_SERIALIZABLE_AS_INSTRUCTION

#define INSTRUCTIONS_SERIALIZABLE_AS_INSTRUCTION (   V)
Value:
V(Comparison, ComparisonInstr) \
V(Constant, ConstantInstr) \
V(Definition, Definition) \
V(ParallelMove, ParallelMoveInstr) \
V(Phi, PhiInstr)

Definition at line 1123 of file il_serializer.cc.

◆ MATCH [1/2]

#define MATCH (   member,
  name 
)
Value:
if (object_store->member() == x.ptr()) { \
s->Write<intptr_t>(index); \
return; \
} \
++index;

◆ MATCH [2/2]

#define MATCH (   member,
  name 
)
Value:
if (index == stub_id) { \
return Code::ZoneHandle(d->zone(), object_store->member()); \
} \
++index;

◆ READ_INSTRUCTION

#define READ_INSTRUCTION (   type,
  attrs 
)
Value:
case Instruction::k##type: \
return new (d->zone()) type##Instr(d);

◆ SERIALIZABLE_AS_BLOCK_ENTRY

#define SERIALIZABLE_AS_BLOCK_ENTRY (   name,
  type 
)
Value:
template <> \
void FlowGraphSerializer::WriteRefTrait<type*>::WriteRef( \
FlowGraphSerializer* s, type* x) { \
s->WriteRef<BlockEntryInstr*>(x); \
} \
template <> \
type* FlowGraphDeserializer::ReadRefTrait<type*>::ReadRef( \
FlowGraphDeserializer* d) { \
BlockEntryInstr* instr = d->ReadRef<BlockEntryInstr*>(); \
ASSERT((instr == nullptr) || instr->Is##name()); \
return static_cast<type*>(instr); \
}
const char * name
Definition fuchsia.cc:50

Definition at line 162 of file il_serializer.cc.

165 { \
166 s->WriteRef<BlockEntryInstr*>(x); \
167 } \
168 template <> \
169 type* FlowGraphDeserializer::ReadRefTrait<type*>::ReadRef( \
170 FlowGraphDeserializer* d) { \
171 BlockEntryInstr* instr = d->ReadRef<BlockEntryInstr*>(); \
172 ASSERT((instr == nullptr) || instr->Is##name()); \
173 return static_cast<type*>(instr); \
174 }

◆ SERIALIZABLE_AS_INSTRUCTION

#define SERIALIZABLE_AS_INSTRUCTION (   name,
  type 
)
Value:
template <> \
void FlowGraphSerializer::WriteTrait<type*>::Write(FlowGraphSerializer* s, \
type* x) { \
s->Write<Instruction*>(x); \
} \
template <> \
type* FlowGraphDeserializer::ReadTrait<type*>::Read( \
FlowGraphDeserializer* d) { \
Instruction* instr = d->Read<Instruction*>(); \
ASSERT((instr == nullptr) || instr->Is##name()); \
return static_cast<type*>(instr); \
}

Definition at line 1130 of file il_serializer.cc.

1133 { \
1134 s->Write<Instruction*>(x); \
1135 } \
1136 template <> \
1137 type* FlowGraphDeserializer::ReadTrait<type*>::Read( \
1138 FlowGraphDeserializer* d) { \
1139 Instruction* instr = d->Read<Instruction*>(); \
1140 ASSERT((instr == nullptr) || instr->Is##name()); \
1141 return static_cast<type*>(instr); \
1142 }

◆ SERIALIZE_HANDLE_AS_OBJECT

#define SERIALIZE_HANDLE_AS_OBJECT (   handle,
  null_handle 
)
Value:
template <> \
void FlowGraphSerializer::WriteTrait<const handle&>::Write( \
FlowGraphSerializer* s, const handle& x) { \
s->Write<const Object&>(x); \
} \
template <> \
const handle& FlowGraphDeserializer::ReadTrait<const handle&>::Read( \
FlowGraphDeserializer* d) { \
const Object& result = d->Read<const Object&>(); \
if (result.IsNull()) { \
return null_handle; \
} \
return handle::Cast(result); \
}

Definition at line 2104 of file il_serializer.cc.

2107 { \
2108 s->Write<const Object&>(x); \
2109 } \
2110 template <> \
2111 const handle& FlowGraphDeserializer::ReadTrait<const handle&>::Read( \
2112 FlowGraphDeserializer* d) { \
2113 const Object& result = d->Read<const Object&>(); \
2114 if (result.IsNull()) { \
2115 return null_handle; \
2116 } \
2117 return handle::Cast(result); \
2118 }

◆ UNIMPLEMENTED_FUNCTION_KIND

#define UNIMPLEMENTED_FUNCTION_KIND (   kind)
Value:
case UntaggedFunction::k##kind: \
FATAL("Unimplemented WriteTrait<const Function&>::Write for " #kind);

◆ Z

#define Z   zone_

Definition at line 19 of file il_serializer.cc.