21 intptr_t snapshot_length,
24 : dest_port_(dest_port),
26 snapshot_length_(snapshot_length),
27 finalizable_data_(finalizable_data),
33 : dest_port_(dest_port), payload_(raw_obj), priority_(priority) {
41 : dest_port_(dest_port),
43 snapshot_length_(kPersistentHandleSnapshotLen),
51 snapshot_length_(kFinalizerSnapshotLen),
58 free(payload_.snapshot_);
60 delete finalizable_data_;
63 isolate_group->api_state()->FreePersistentHandle(
64 payload_.persistent_handle_);
70 return reinterpret_cast<intptr_t
>(
this);
103 ASSERT(msg->next_ ==
nullptr);
104 if (head_ ==
nullptr) {
111 if (!before_events) {
122 while (cur->next_ !=
nullptr) {
125 msg->next_ = cur->next_;
147 if (head_ ==
nullptr) {
153 return std::unique_ptr<Message>(
result);
159 std::unique_ptr<Message> cur(head_);
162 while (cur !=
nullptr) {
163 std::unique_ptr<Message>
next(cur->next_);
164 cur = std::move(
next);
176 next_ =
queue->head_;
181 return next_ !=
nullptr;
187 next_ = next_->next_;
205 ASSERT(current !=
nullptr);
206 if (current->
Id() ==
id) {
224 message.AddProperty(
"type",
"Message");
225 message.AddPropertyF(
"name",
"Isolate Message (%" Px ")", current->
Id());
226 message.AddPropertyF(
"messageObjectId",
"messages/%" Px "", current->
Id());
228 message.AddProperty(
"index", depth++);
229 message.AddPropertyF(
"_destinationPort",
"%" Pd64 "",
230 static_cast<int64_t
>(current->
dest_port()));
231 message.AddProperty(
"_priority",
236 if (msg_handler.IsClosure()) {
238 msg_handler = Closure::Cast(msg_handler).function();
240 if (msg_handler.IsFunction()) {
static float next(float f)
static ObjectPtr LookupHandler(Dart_Port port_id)
static IsolateGroup * Current()
Iterator(const MessageQueue *queue)
void Reset(const MessageQueue *queue)
Message * FindMessageById(intptr_t id)
void Enqueue(std::unique_ptr< Message > msg, bool before_events)
void PrintJSON(JSONStream *stream)
std::unique_ptr< Message > Dequeue()
bool IsPersistentHandle() const
Priority priority() const
ObjectPtr raw_obj() const
Dart_Port dest_port() const
static const Dart_Port kIllegalPort
Message(Dart_Port dest_port, uint8_t *snapshot, intptr_t snapshot_length, MessageFinalizableData *finalizable_data, Priority priority)
static const char * PriorityAsString(Priority priority)
bool IsFinalizerInvocationRequest() const
UntaggedObject * untag() const
bool InVMIsolateHeap() const
Dart_NativeFunction function