Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::CodeDeserializationCluster Class Reference
Inheritance diagram for dart::CodeDeserializationCluster:
dart::DeserializationCluster dart::ZoneAllocated

Public Member Functions

 CodeDeserializationCluster ()
 
 ~CodeDeserializationCluster ()
 
void ReadAlloc (Deserializer *d) override
 
void ReadAllocOneCode (Deserializer *d)
 
void ReadFill (Deserializer *d) override
 
void ReadFill (Deserializer *d, intptr_t start_index, intptr_t stop_index, bool deferred)
 
void PostLoad (Deserializer *d, const Array &refs) override
 
- Public Member Functions inherited from dart::DeserializationCluster
 DeserializationCluster (const char *name, bool is_canonical=false, bool is_immutable=false)
 
virtual ~DeserializationCluster ()
 
virtual void ReadAlloc (Deserializer *deserializer)=0
 
virtual void ReadFill (Deserializer *deserializer)=0
 
virtual void PostLoad (Deserializer *deserializer, const Array &refs)
 
const char * name () const
 
bool is_canonical () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 
- Protected Attributes inherited from dart::DeserializationCluster
const char *const name_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t start_index_
 
intptr_t stop_index_
 

Detailed Description

Definition at line 3008 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ CodeDeserializationCluster()

dart::CodeDeserializationCluster::CodeDeserializationCluster ( )
inline

Definition at line 3010 of file app_snapshot.cc.

3010: DeserializationCluster("Code") {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)

◆ ~CodeDeserializationCluster()

dart::CodeDeserializationCluster::~CodeDeserializationCluster ( )
inline

Definition at line 3011 of file app_snapshot.cc.

3011{}

Member Function Documentation

◆ PostLoad()

void dart::CodeDeserializationCluster::PostLoad ( Deserializer d,
const Array refs 
)
inlineoverridevirtual

Reimplemented from dart::DeserializationCluster.

Definition at line 3107 of file app_snapshot.cc.

3107 {
3108 d->EndInstructions();
3109
3110#if !defined(PRODUCT)
3111 if (!CodeObservers::AreActive() && !FLAG_support_disassembler) return;
3112#endif
3113 Code& code = Code::Handle(d->zone());
3114#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
3115 Object& owner = Object::Handle(d->zone());
3116#endif
3117 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
3118 code ^= refs.At(id);
3119#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(PRODUCT)
3121 Code::NotifyCodeObservers(code, code.is_optimized());
3122 }
3123#endif
3124#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
3125 owner = code.owner();
3126 if (owner.IsFunction()) {
3127 if ((FLAG_disassemble ||
3128 (code.is_optimized() && FLAG_disassemble_optimized)) &&
3129 compiler::PrintFilter::ShouldPrint(Function::Cast(owner))) {
3130 Disassembler::DisassembleCode(Function::Cast(owner), code,
3131 code.is_optimized());
3132 }
3133 } else if (FLAG_disassemble_stubs) {
3135 }
3136#endif // !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
3137 }
3138 }
static bool AreActive()
static void NotifyCodeObservers(const Code &code, bool optimized)
Definition: object.cc:18141
static void DisassembleStub(const char *name, const Code &code)
static void DisassembleCode(const Function &function, const Code &code, bool optimized)
static Object & Handle()
Definition: object.h:407
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ ReadAlloc()

void dart::CodeDeserializationCluster::ReadAlloc ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 3013 of file app_snapshot.cc.

3013 {
3014 start_index_ = d->next_index();
3015 d->set_code_start_index(start_index_);
3016 const intptr_t count = d->ReadUnsigned();
3017 for (intptr_t i = 0; i < count; i++) {
3019 }
3020 stop_index_ = d->next_index();
3021 d->set_code_stop_index(stop_index_);
3022 deferred_start_index_ = d->next_index();
3023 const intptr_t deferred_count = d->ReadUnsigned();
3024 for (intptr_t i = 0; i < deferred_count; i++) {
3026 }
3027 deferred_stop_index_ = d->next_index();
3028 }
int count
Definition: FontMgrTest.cpp:50
void ReadAllocOneCode(Deserializer *d)

◆ ReadAllocOneCode()

void dart::CodeDeserializationCluster::ReadAllocOneCode ( Deserializer d)
inline

Definition at line 3030 of file app_snapshot.cc.

3030 {
3031 const int32_t state_bits = d->Read<int32_t>();
3032 ASSERT(!Code::DiscardedBit::decode(state_bits));
3033 auto code = static_cast<CodePtr>(d->Allocate(Code::InstanceSize(0)));
3034 d->AssignRef(code);
3035 code->untag()->state_bits_ = state_bits;
3036 }
static intptr_t InstanceSize()
Definition: object.h:7163
#define ASSERT(E)
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124

◆ ReadFill() [1/2]

void dart::CodeDeserializationCluster::ReadFill ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 3038 of file app_snapshot.cc.

3038 {
3039 ASSERT(!is_canonical()); // Never canonical.
3041#if defined(DART_PRECOMPILED_RUNTIME)
3042 ReadFill(d, deferred_start_index_, deferred_stop_index_, true);
3043#else
3044 ASSERT(deferred_start_index_ == deferred_stop_index_);
3045#endif
3046 }
void ReadFill(Deserializer *d) override

◆ ReadFill() [2/2]

void dart::CodeDeserializationCluster::ReadFill ( Deserializer d,
intptr_t  start_index,
intptr_t  stop_index,
bool  deferred 
)
inline

Definition at line 3048 of file app_snapshot.cc.

3051 {
3052 for (intptr_t id = start_index, n = stop_index; id < n; id++) {
3053 auto const code = static_cast<CodePtr>(d->Ref(id));
3054
3056
3059
3060 d->ReadInstructions(code, deferred);
3061
3062#if !defined(DART_PRECOMPILED_RUNTIME)
3063 ASSERT(d->kind() == Snapshot::kFullJIT);
3064 code->untag()->object_pool_ = static_cast<ObjectPoolPtr>(d->ReadRef());
3065#else
3066 ASSERT(d->kind() == Snapshot::kFullAOT);
3067 // There is a single global pool.
3068 code->untag()->object_pool_ = ObjectPool::null();
3069#endif
3070 code->untag()->owner_ = d->ReadRef();
3071 code->untag()->exception_handlers_ =
3072 static_cast<ExceptionHandlersPtr>(d->ReadRef());
3073 code->untag()->pc_descriptors_ =
3074 static_cast<PcDescriptorsPtr>(d->ReadRef());
3075 code->untag()->catch_entry_ = d->ReadRef();
3076#if !defined(DART_PRECOMPILED_RUNTIME)
3077 ASSERT(d->kind() == Snapshot::kFullJIT);
3078 code->untag()->compressed_stackmaps_ =
3079 static_cast<CompressedStackMapsPtr>(d->ReadRef());
3080#else
3081 ASSERT(d->kind() == Snapshot::kFullAOT);
3082 code->untag()->compressed_stackmaps_ = CompressedStackMaps::null();
3083#endif
3084 code->untag()->inlined_id_to_function_ =
3085 static_cast<ArrayPtr>(d->ReadRef());
3086 code->untag()->code_source_map_ =
3087 static_cast<CodeSourceMapPtr>(d->ReadRef());
3088
3089#if !defined(DART_PRECOMPILED_RUNTIME)
3090 ASSERT(d->kind() == Snapshot::kFullJIT);
3091 code->untag()->deopt_info_array_ = static_cast<ArrayPtr>(d->ReadRef());
3092 code->untag()->static_calls_target_table_ =
3093 static_cast<ArrayPtr>(d->ReadRef());
3094#endif // !DART_PRECOMPILED_RUNTIME
3095
3096#if !defined(PRODUCT)
3097 code->untag()->return_address_metadata_ = d->ReadRef();
3098 code->untag()->var_descriptors_ = LocalVarDescriptors::null();
3099 code->untag()->comments_ = FLAG_code_comments
3100 ? static_cast<ArrayPtr>(d->ReadRef())
3101 : Array::null();
3102 code->untag()->compile_timestamp_ = 0;
3103#endif
3104 }
3105 }
static bool IsDiscarded(const CodePtr code)
Definition: object.h:6834
bool IsUnknownDartCode() const
Definition: object.h:7245
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static ObjectPtr null()
Definition: object.h:433

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