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

Public Member Functions

 FunctionDeserializationCluster ()
 
 ~FunctionDeserializationCluster ()
 
void ReadAlloc (Deserializer *d) override
 
void ReadFill (Deserializer *d_) override
 
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 1879 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ FunctionDeserializationCluster()

dart::FunctionDeserializationCluster::FunctionDeserializationCluster ( )
inline

Definition at line 1881 of file app_snapshot.cc.

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

◆ ~FunctionDeserializationCluster()

dart::FunctionDeserializationCluster::~FunctionDeserializationCluster ( )
inline

Definition at line 1882 of file app_snapshot.cc.

1882{}

Member Function Documentation

◆ PostLoad()

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

Reimplemented from dart::DeserializationCluster.

Definition at line 1952 of file app_snapshot.cc.

1952 {
1953 if (d->kind() == Snapshot::kFullAOT) {
1954 Function& func = Function::Handle(d->zone());
1955 for (intptr_t i = start_index_, n = stop_index_; i < n; i++) {
1956 func ^= refs.At(i);
1957 auto const code = func.ptr()->untag()->code();
1958 ASSERT(code->IsCode());
1960 uword entry_point = code->untag()->entry_point_;
1961 ASSERT(entry_point != 0);
1962 func.ptr()->untag()->entry_point_ = entry_point;
1963 uword unchecked_entry_point = code->untag()->unchecked_entry_point_;
1964 ASSERT(unchecked_entry_point != 0);
1965 func.ptr()->untag()->unchecked_entry_point_ = unchecked_entry_point;
1966 }
1967 }
1968 } else if (d->kind() == Snapshot::kFullJIT) {
1969 Function& func = Function::Handle(d->zone());
1970 Code& code = Code::Handle(d->zone());
1971 for (intptr_t i = start_index_, n = stop_index_; i < n; i++) {
1972 func ^= refs.At(i);
1973 code = func.CurrentCode();
1974 if (func.HasCode() && !code.IsDisabled()) {
1975 func.SetInstructionsSafe(code); // Set entrypoint.
1976 func.SetWasCompiled(true);
1977 } else {
1978 func.ClearCodeSafe(); // Set code and entrypoint to lazy compile stub
1979 }
1980 }
1981 } else {
1982 Function& func = Function::Handle(d->zone());
1983 for (intptr_t i = start_index_, n = stop_index_; i < n; i++) {
1984 func ^= refs.At(i);
1985 func.ClearCodeSafe(); // Set code and entrypoint to lazy compile stub.
1986 }
1987 }
1988 }
bool IsUnknownDartCode() const
Definition: object.h:7245
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
uintptr_t uword
Definition: globals.h:501

◆ ReadAlloc()

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

Implements dart::DeserializationCluster.

Definition at line 1884 of file app_snapshot.cc.

1884 {
1886 }
void ReadAllocFixedSize(Deserializer *deserializer, intptr_t instance_size)
static intptr_t InstanceSize()
Definition: object.h:3985

◆ ReadFill()

void dart::FunctionDeserializationCluster::ReadFill ( Deserializer d_)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 1888 of file app_snapshot.cc.

1888 {
1889 Deserializer::Local d(d_);
1890
1891 ASSERT(!is_canonical()); // Never canonical.
1892 Snapshot::Kind kind = d_->kind();
1893
1894 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
1895 FunctionPtr func = static_cast<FunctionPtr>(d.Ref(id));
1896 Deserializer::InitializeHeader(func, kFunctionCid,
1898 d.ReadFromTo(func);
1899
1900#if defined(DEBUG)
1901 func->untag()->entry_point_ = 0;
1902 func->untag()->unchecked_entry_point_ = 0;
1903#endif
1904
1905#if defined(DART_PRECOMPILED_RUNTIME)
1906 ASSERT(kind == Snapshot::kFullAOT);
1907 const intptr_t code_index = d.ReadUnsigned();
1908 uword entry_point = 0;
1909 CodePtr code = d_->GetCodeByIndex(code_index, &entry_point);
1910 func->untag()->code_ = code;
1911 if (entry_point != 0) {
1912 func->untag()->entry_point_ = entry_point;
1913 func->untag()->unchecked_entry_point_ = entry_point;
1914 }
1915#else
1916 ASSERT(kind != Snapshot::kFullAOT);
1917 if (kind == Snapshot::kFullJIT) {
1918 func->untag()->unoptimized_code_ = static_cast<CodePtr>(d.ReadRef());
1919 func->untag()->code_ = static_cast<CodePtr>(d.ReadRef());
1920 func->untag()->ic_data_array_ = static_cast<ArrayPtr>(d.ReadRef());
1921 }
1922#endif
1923
1924#if !defined(DART_PRECOMPILED_RUNTIME)
1925 ASSERT(kind != Snapshot::kFullAOT);
1926 func->untag()->positional_parameter_names_ =
1927 static_cast<ArrayPtr>(d.ReadRef());
1928#endif
1929#if !defined(DART_PRECOMPILED_RUNTIME) || \
1930 (defined(DART_PRECOMPILED_RUNTIME) && !defined(PRODUCT))
1931 func->untag()->token_pos_ = d.ReadTokenPosition();
1932#endif
1933#if !defined(DART_PRECOMPILED_RUNTIME)
1934 func->untag()->end_token_pos_ = d.ReadTokenPosition();
1935 func->untag()->kernel_offset_ = d.Read<uint32_t>();
1936 func->untag()->unboxed_parameters_info_.Reset();
1937 func->untag()->packed_fields_ = d.Read<uint32_t>();
1938#endif
1939
1940 func->untag()->kind_tag_ = d.Read<uint32_t>();
1941#if !defined(DART_PRECOMPILED_RUNTIME)
1942 func->untag()->usage_counter_ = 0;
1943 func->untag()->optimized_instruction_count_ = 0;
1944 func->untag()->optimized_call_site_count_ = 0;
1945 func->untag()->deoptimization_counter_ = 0;
1946 func->untag()->state_bits_ = 0;
1947 func->untag()->inlining_depth_ = 0;
1948#endif
1949 }
1950 }
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)

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