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

Public Member Functions

 ScriptSerializationCluster ()
 
 ~ScriptSerializationCluster ()
 
void Trace (Serializer *s, ObjectPtr object)
 
void WriteAlloc (Serializer *s)
 
void WriteFill (Serializer *s)
 
- Public Member Functions inherited from dart::SerializationCluster
 SerializationCluster (const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)
 
virtual ~SerializationCluster ()
 
virtual void Trace (Serializer *serializer, ObjectPtr object)=0
 
virtual void WriteAlloc (Serializer *serializer)=0
 
virtual void WriteFill (Serializer *serializer)=0
 
void WriteAndMeasureAlloc (Serializer *serializer)
 
void WriteAndMeasureFill (Serializer *serializer)
 
const char * name () const
 
intptr_t cid () const
 
bool is_canonical () const
 
bool is_immutable () const
 
intptr_t size () const
 
intptr_t num_objects () const
 
intptr_t target_memory_size () 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

- Static Public Attributes inherited from dart::SerializationCluster
static constexpr intptr_t kSizeVaries = -1
 
- Protected Attributes inherited from dart::SerializationCluster
const char *const name_
 
const intptr_t cid_
 
const intptr_t target_instance_size_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t size_ = 0
 
intptr_t num_objects_ = 0
 
intptr_t target_memory_size_ = 0
 

Detailed Description

Definition at line 2302 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ ScriptSerializationCluster()

dart::ScriptSerializationCluster::ScriptSerializationCluster ( )
inline

Definition at line 2304 of file app_snapshot.cc.

2305 : SerializationCluster("Script",
2306 kScriptCid,
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~ScriptSerializationCluster()

dart::ScriptSerializationCluster::~ScriptSerializationCluster ( )
inline

Definition at line 2308 of file app_snapshot.cc.

2308{}

Member Function Documentation

◆ Trace()

void dart::ScriptSerializationCluster::Trace ( Serializer s,
ObjectPtr  object 
)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 2310 of file app_snapshot.cc.

2310 {
2311 ScriptPtr script = Script::RawCast(object);
2312 objects_.Add(script);
2313 auto* from = script->untag()->from();
2314 auto* to = script->untag()->to_snapshot(s->kind());
2315 for (auto* p = from; p <= to; p++) {
2316 const intptr_t offset =
2317 reinterpret_cast<uword>(p) - reinterpret_cast<uword>(script->untag());
2318 const ObjectPtr obj = p->Decompress(script->heap_base());
2320 // Line starts are delta encoded.
2321 s->Push(obj, kDeltaEncodedTypedDataCid);
2322 } else {
2323 s->Push(obj);
2324 }
2325 }
2326 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static intptr_t line_starts_offset()
Definition: object.h:4964
struct MyStruct s
uintptr_t uword
Definition: globals.h:501
SeparatedVector2 offset

◆ WriteAlloc()

void dart::ScriptSerializationCluster::WriteAlloc ( Serializer s)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 2328 of file app_snapshot.cc.

2328 {
2329 const intptr_t count = objects_.length();
2330 s->WriteUnsigned(count);
2331 for (intptr_t i = 0; i < count; i++) {
2332 ScriptPtr script = objects_[i];
2333 s->AssignRef(script);
2334 }
2335 }
int count
Definition: FontMgrTest.cpp:50
intptr_t length() const

◆ WriteFill()

void dart::ScriptSerializationCluster::WriteFill ( Serializer s)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 2337 of file app_snapshot.cc.

2337 {
2338 const intptr_t count = objects_.length();
2339 for (intptr_t i = 0; i < count; i++) {
2340 ScriptPtr script = objects_[i];
2341 AutoTraceObjectName(script, script->untag()->url());
2343 if (s->kind() != Snapshot::kFullAOT) {
2344 // Clear out the max position cache in snapshots to ensure no
2345 // differences in the snapshot due to triggering caching vs. not.
2346 int32_t written_flags =
2348 0, script->untag()->flags_and_max_position_);
2350 false, written_flags);
2351 s->Write<int32_t>(written_flags);
2352 }
2353 s->Write<int32_t>(script->untag()->kernel_script_index_);
2354 }
2355 }
#define WriteFromTo(obj,...)
#define AutoTraceObjectName(obj, str)
static constexpr S update(T value, S original)
Definition: bitfield.h:188

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