Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
dart::IsolateGroupSource Class Reference

#include <isolate.h>

Public Member Functions

 IsolateGroupSource (const char *script_uri, const char *name, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size, Dart_IsolateFlags flags)
 
 ~IsolateGroupSource ()
 
void add_loaded_blob (Zone *zone_, const ExternalTypedData &external_typed_data)
 

Public Attributes

char * script_uri
 
char * name
 
const uint8_t * snapshot_data
 
const uint8_t * snapshot_instructions
 
const uint8_t * kernel_buffer
 
const intptr_t kernel_buffer_size
 
Dart_IsolateFlags flags
 
const uint8_t * script_kernel_buffer
 
intptr_t script_kernel_size
 
ArrayPtr loaded_blobs_
 
intptr_t num_blob_loads_
 

Detailed Description

Definition at line 161 of file isolate.h.

Constructor & Destructor Documentation

◆ IsolateGroupSource()

dart::IsolateGroupSource::IsolateGroupSource ( const char *  script_uri,
const char *  name,
const uint8_t *  snapshot_data,
const uint8_t *  snapshot_instructions,
const uint8_t *  kernel_buffer,
intptr_t  kernel_buffer_size,
Dart_IsolateFlags  flags 
)
inline

Definition at line 163 of file isolate.h.

170 : script_uri(script_uri == nullptr ? nullptr : Utils::StrDup(script_uri)),
176 flags(flags),
177 script_kernel_buffer(nullptr),
179 loaded_blobs_(nullptr),
180 num_blob_loads_(0) {}
intptr_t num_blob_loads_
Definition: isolate.h:205
const uint8_t * script_kernel_buffer
Definition: isolate.h:200
Dart_IsolateFlags flags
Definition: isolate.h:197
const uint8_t * kernel_buffer
Definition: isolate.h:195
intptr_t script_kernel_size
Definition: isolate.h:201
const intptr_t kernel_buffer_size
Definition: isolate.h:196
const uint8_t * snapshot_instructions
Definition: isolate.h:194
const uint8_t * snapshot_data
Definition: isolate.h:193
static char * StrDup(const char *s)

◆ ~IsolateGroupSource()

dart::IsolateGroupSource::~IsolateGroupSource ( )
inline

Definition at line 181 of file isolate.h.

181 {
182 free(script_uri);
183 free(name);
184 }

Member Function Documentation

◆ add_loaded_blob()

void dart::IsolateGroupSource::add_loaded_blob ( Zone zone_,
const ExternalTypedData external_typed_data 
)

Definition at line 133 of file isolate.cc.

135 {
136 Array& loaded_blobs = Array::Handle();
137 bool saved_external_typed_data = false;
138 if (loaded_blobs_ != nullptr) {
139 loaded_blobs = loaded_blobs_;
140
141 // Walk the array, and (if stuff was removed) compact and reuse the space.
142 // Note that the space has to be compacted as the ordering is important.
143 WeakProperty& weak_property = WeakProperty::Handle();
144 WeakProperty& weak_property_tmp = WeakProperty::Handle();
145 ExternalTypedData& existing_entry = ExternalTypedData::Handle(zone);
146 intptr_t next_entry_index = 0;
147 for (intptr_t i = 0; i < loaded_blobs.Length(); i++) {
148 weak_property ^= loaded_blobs.At(i);
149 if (weak_property.key() != ExternalTypedData::null()) {
150 if (i != next_entry_index) {
151 existing_entry = ExternalTypedData::RawCast(weak_property.key());
152 weak_property_tmp ^= loaded_blobs.At(next_entry_index);
153 weak_property_tmp.set_key(existing_entry);
154 }
155 next_entry_index++;
156 }
157 }
158 if (next_entry_index < loaded_blobs.Length()) {
159 // There's now space to re-use.
160 weak_property ^= loaded_blobs.At(next_entry_index);
161 weak_property.set_key(external_typed_data);
162 next_entry_index++;
163 saved_external_typed_data = true;
164 }
165 if (next_entry_index < loaded_blobs.Length()) {
166 ExternalTypedData& nullExternalTypedData =
168 while (next_entry_index < loaded_blobs.Length()) {
169 // Null out any extra spaces.
170 weak_property ^= loaded_blobs.At(next_entry_index);
171 weak_property.set_key(nullExternalTypedData);
172 next_entry_index++;
173 }
174 }
175 }
176 if (!saved_external_typed_data) {
177 const WeakProperty& weak_property =
179 weak_property.set_key(external_typed_data);
180
181 intptr_t length = loaded_blobs.IsNull() ? 0 : loaded_blobs.Length();
182 Array& new_array =
183 Array::Handle(Array::Grow(loaded_blobs, length + 1, Heap::kOld));
184 new_array.SetAt(length, weak_property);
185 loaded_blobs_ = new_array.ptr();
186 }
188}
static ArrayPtr Grow(const Array &source, intptr_t new_length, Heap::Space space=Heap::kNew)
Definition: object.cc:24853
@ kOld
Definition: heap.h:39
static ObjectPtr null()
Definition: object.h:433
static Object & Handle()
Definition: object.h:407
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static WeakPropertyPtr New(Heap::Space space=Heap::kNew)
Definition: object.cc:26756
size_t length

Member Data Documentation

◆ flags

Dart_IsolateFlags dart::IsolateGroupSource::flags

Definition at line 197 of file isolate.h.

◆ kernel_buffer

const uint8_t* dart::IsolateGroupSource::kernel_buffer

Definition at line 195 of file isolate.h.

◆ kernel_buffer_size

const intptr_t dart::IsolateGroupSource::kernel_buffer_size

Definition at line 196 of file isolate.h.

◆ loaded_blobs_

ArrayPtr dart::IsolateGroupSource::loaded_blobs_

Definition at line 204 of file isolate.h.

◆ name

char* dart::IsolateGroupSource::name

Definition at line 192 of file isolate.h.

◆ num_blob_loads_

intptr_t dart::IsolateGroupSource::num_blob_loads_

Definition at line 205 of file isolate.h.

◆ script_kernel_buffer

const uint8_t* dart::IsolateGroupSource::script_kernel_buffer

Definition at line 200 of file isolate.h.

◆ script_kernel_size

intptr_t dart::IsolateGroupSource::script_kernel_size

Definition at line 201 of file isolate.h.

◆ script_uri

char* dart::IsolateGroupSource::script_uri

Definition at line 191 of file isolate.h.

◆ snapshot_data

const uint8_t* dart::IsolateGroupSource::snapshot_data

Definition at line 193 of file isolate.h.

◆ snapshot_instructions

const uint8_t* dart::IsolateGroupSource::snapshot_instructions

Definition at line 194 of file isolate.h.


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