55#if defined(SUPPORT_PERFETTO)
69 "The default name of this vm as reported by the VM service "
73 warn_on_pause_with_no_debugger,
75 "Print a message when an isolate is paused but there is no "
76 "debugger attached.");
80 log_service_response_sizes,
82 "Log sizes of service responses and events to a file in CSV format.");
84void* Service::service_response_size_log_file_ =
nullptr;
87 if (service_response_size_log_file_ ==
nullptr) {
93 (*file_write)(entry, strlen(entry), service_response_size_log_file_);
98 if (FLAG_log_service_response_sizes ==
nullptr) {
104 if ((file_open ==
nullptr) || (file_write ==
nullptr) ||
105 (file_close ==
nullptr)) {
106 OS::PrintErr(
"Error: Could not access file callbacks.");
109 ASSERT(service_response_size_log_file_ ==
nullptr);
110 service_response_size_log_file_ =
111 (*file_open)(FLAG_log_service_response_sizes,
true);
112 if (service_response_size_log_file_ ==
nullptr) {
113 OS::PrintErr(
"Warning: Failed to open service response size log file: %s\n",
114 FLAG_log_service_response_sizes);
120 if (service_response_size_log_file_ ==
nullptr) {
124 (*file_close)(service_response_size_log_file_);
125 service_response_size_log_file_ =
nullptr;
131 param,
js->LookupParam(param));
147 const char*
name()
const {
return name_; }
175 return value.IsNull();
179#define ISOLATE_PARAMETER new IdParameter("isolateId", true)
180#define ISOLATE_GROUP_PARAMETER new IdParameter("isolateGroupId", true)
181#define NO_ISOLATE_PARAMETER new NoSuchParameter("isolateId")
182#define RUNNABLE_ISOLATE_PARAMETER new RunnableIsolateParameter("isolateId")
183#define OBJECT_PARAMETER new IdParameter("objectId", true)
191 return ElementCount(
value) >= 0;
195 const char* kJsonChars =
" \t\r\n[,]";
198 intptr_t element_count = ElementCount(
value);
199 if (element_count < 0) {
202 intptr_t element_pos = 0;
206 char** elements =
new char*[element_count + 1];
207 elements[element_count] =
nullptr;
210 while (element_pos < element_count) {
214 intptr_t
len = strcspn(
value, kJsonChars);
217 elements[element_pos++] =
value;
222 return const_cast<const char**
>(elements);
227 static bool IsEnumChar(
char c) {
228 return (((c >=
'a') && (c <=
'z')) || ((c >=
'A') && (c <=
'Z')) ||
233 intptr_t ElementCount(
const char*
value)
const {
234 const char* kJsonWhitespaceChars =
" \t\r\n";
235 if (
value ==
nullptr) {
238 const char* cp =
value;
239 cp += strspn(cp, kJsonWhitespaceChars);
245 bool element_allowed =
true;
246 intptr_t element_count = 0;
249 cp += strspn(cp, kJsonWhitespaceChars);
252 return closed ? element_count : -1;
258 if (element_allowed) {
261 element_allowed =
true;
265 if (!element_allowed) {
268 bool valid_enum =
false;
269 const char* id_start = cp;
270 while (IsEnumChar(*cp)) {
273 if (cp == id_start) {
277 intptr_t id_len = cp - id_start;
278 if (enums_ !=
nullptr) {
279 for (intptr_t
i = 0; enums_[
i] !=
nullptr;
i++) {
280 intptr_t
len = strlen(enums_[
i]);
281 if (
len == id_len && strncmp(id_start, enums_[
i],
len) == 0) {
284 element_allowed =
false;
297 const char*
const* enums_;
300#if defined(SUPPORT_TIMELINE)
301static const char*
const timeline_streams_enum_names[] = {
303#define DEFINE_NAME(name, ...) #name,
308static const MethodParameter*
const set_vm_timeline_flags_params[] = {
310 new EnumListParameter(
"recordedStreams",
312 timeline_streams_enum_names),
316static bool HasStream(
const char** recorded_streams,
const char*
stream) {
317 while (*recorded_streams !=
nullptr) {
318 if ((strstr(*recorded_streams,
"all") !=
nullptr) ||
319 (strstr(*recorded_streams,
stream) !=
nullptr)) {
328 const EnumListParameter* recorded_streams_param =
329 static_cast<const EnumListParameter*
>(set_vm_timeline_flags_params[1]);
330 const char** streams = recorded_streams_param->Parse(categories_list);
331 if (streams ==
nullptr) {
335#define SET_ENABLE_STREAM(name, ...) \
336 Timeline::SetStream##name##Enabled(HasStream(streams, #name));
337 TIMELINE_STREAM_LIST(SET_ENABLE_STREAM);
338#undef SET_ENABLE_STREAM
414const uint8_t* Service::dart_library_kernel_ =
nullptr;
415intptr_t Service::dart_library_kernel_len_ = 0;
428 bool include_private_members) {
429 if (FLAG_trace_service) {
430 OS::PrintErr(
"vm-service: starting stream '%s'\n", stream_id);
433 for (intptr_t
i = 0;
i < num_streams;
i++) {
434 if (strcmp(stream_id,
streams_[
i]->
id()) == 0) {
440 if (stream_listen_callback_ !=
nullptr) {
443 return (*stream_listen_callback_)(stream_id);
449 if (FLAG_trace_service) {
450 OS::PrintErr(
"vm-service: stopping stream '%s'\n", stream_id);
453 for (intptr_t
i = 0;
i < num_streams;
i++) {
454 if (strcmp(stream_id,
streams_[
i]->
id()) == 0) {
459 if (stream_cancel_callback_ !=
nullptr) {
462 return (*stream_cancel_callback_)(stream_id);
474 if (get_service_assets_callback_ ==
nullptr) {
477 handle = get_service_assets_callback_();
487 if (!
object.IsTypedData()) {
489 String::New(
"An implementation of Dart_GetVMServiceAssetsArchive "
490 "should return a Uint8Array or null."));
495 const TypedData& typed_data = TypedData::Cast(
object);
498 String::New(
"An implementation of Dart_GetVMServiceAssetsArchive "
499 "should return a Uint8Array or null."));
513#if defined(DART_PRECOMPILED_RUNTIME)
526 if (!FLAG_profiler) {
534 if ((
s ==
nullptr) || (*
s ==
'\0')) {
543 char* end_ptr =
nullptr;
544#if defined(ARCH_IS_32_BIT)
545 r = strtol(
s, &end_ptr,
base);
547 r = strtoll(
s, &end_ptr,
base);
558 if ((
s ==
nullptr) || (*
s ==
'\0')) {
567 char* end_ptr =
nullptr;
568#if defined(ARCH_IS_32_BIT)
569 r = strtoul(
s, &end_ptr,
base);
571 r = strtoull(
s, &end_ptr,
base);
582 if ((
s ==
nullptr) || (*
s ==
'\0')) {
591 char* end_ptr =
nullptr;
592 r = strtoll(
s, &end_ptr,
base);
604 if ((
s ==
nullptr) || (*
s ==
'\0')) {
618 if ((
s ==
nullptr) || (*
s ==
'\0')) {
622 if ((timestamp ==
nullptr) || (address ==
nullptr)) {
647 intptr_t* service_id) {
652 const intptr_t kInputLen = strlen(
s);
653 const intptr_t kPrefixLen = strlen(
prefix);
655 if (kInputLen <= kPrefixLen) {
658 if (strncmp(
s,
prefix, kPrefixLen) != 0) {
668 ASSERT(isolate !=
nullptr);
670 ASSERT(class_table !=
nullptr);
676 ASSERT(isolate !=
nullptr);
678 ASSERT(class_table !=
nullptr);
679 return class_table->
At(
cid);
688 return value.IsString();
698 return value.IsArray() ||
value.IsGrowableObjectArray();
708 if (
value ==
nullptr) {
711 return (strcmp(
"true",
value) == 0) || (strcmp(
"false",
value) == 0);
714 static bool Parse(
const char*
value,
bool default_value =
false) {
715 if (
value ==
nullptr) {
716 return default_value;
718 return strcmp(
"true",
value) == 0;
728 if (
value ==
nullptr) {
731 for (
const char* cp =
value; *cp !=
'\0'; cp++) {
732 if (*cp < '0' || *cp >
'9') {
740 if (
value ==
nullptr) {
743 char* end_ptr =
nullptr;
756 if (
value ==
nullptr) {
759 for (
const char* cp =
value; *cp !=
'\0'; cp++) {
760 if ((*cp < '0' || *cp >
'9') && (*cp !=
'-')) {
767 static int64_t
Parse(
const char*
value, int64_t default_value = -1) {
769 return default_value;
771 char* end_ptr =
nullptr;
784 if (
value ==
nullptr) {
787 for (
const char* cp =
value; *cp !=
'\0'; cp++) {
788 if ((*cp < '0' || *cp >
'9') && (*cp !=
'-')) {
795 static uint64_t
Parse(
const char*
value, uint64_t default_value = 0) {
797 return default_value;
799 char* end_ptr =
nullptr;
829 return (
value !=
nullptr) && (isolate !=
nullptr) &&
837 "Isolate must be runnable before this request is made.");
847 if (
value ==
nullptr) {
850 for (intptr_t
i = 0; enums_[
i] !=
nullptr;
i++) {
851 if (strcmp(
value, enums_[
i]) == 0) {
859 const char*
const* enums_;
868 for (
i = 0; enums[
i] !=
nullptr;
i++) {
869 if (strcmp(
value, enums[
i]) == 0) {
897 if (parameters ==
nullptr) {
900 if (
js->NumObjectParameters() > 0) {
902 for (intptr_t
i = 0; parameters[
i] !=
nullptr;
i++) {
904 const char*
name = parameter->
name();
905 const bool required = parameter->
required();
907 const bool has_parameter = !
value.IsNull();
908 if (required && !has_parameter) {
918 for (intptr_t
i = 0; parameters[
i] !=
nullptr;
i++) {
920 const char*
name = parameter->
name();
921 const bool required = parameter->
required();
923 const bool has_parameter = (
value !=
nullptr);
924 if (required && !has_parameter) {
938 const Array& parameter_keys,
939 const Array& parameter_values,
946 js.Setup(zone.
GetZone(), SendPort::Cast(reply_port).Id(),
id, method_name,
947 parameter_keys, parameter_values);
949 error.ToErrorCString());
953ErrorPtr Service::InvokeMethod(
Isolate*
I,
955 bool parameters_are_dart_objects) {
971 reply_port ^= msg.
At(1);
973 method_name ^= msg.
At(3);
974 param_keys ^= msg.
At(4);
975 param_values ^= msg.
At(5);
978 ASSERT(seq.
IsNull() || seq.IsString() || seq.IsNumber());
986 if (!seq.
IsNull() && !reply_port.IsSendPort()) {
987 FATAL(
"SendPort expected.");
993 js.Setup(zone.GetZone(), reply_port_id, seq, method_name, param_keys,
994 param_values, parameters_are_dart_objects);
997 const char* id_zone_param =
js.LookupParam(
"_idZone");
999 if (id_zone_param !=
nullptr) {
1001 if (strcmp(
"default", id_zone_param) == 0) {
1005 }
else if (strcmp(
"default.reuse", id_zone_param) == 0) {
1007 RingServiceIdZone* zone =
1008 reinterpret_cast<RingServiceIdZone*
>(
js.id_zone());
1016 return T->StealStickyError();
1019 const char* c_method_name = method_name.ToCString();
1021 const ServiceMethodDescriptor* method =
FindMethod(c_method_name);
1022 if (method !=
nullptr) {
1025 return T->StealStickyError();
1027 method->entry(
T, &
js);
1030 return T->StealStickyError();
1033 EmbedderServiceHandler* handler = FindIsolateEmbedderHandler(c_method_name);
1034 if (handler ==
nullptr) {
1035 handler = FindRootEmbedderHandler(c_method_name);
1038 if (handler !=
nullptr) {
1039 EmbedderHandleMessage(handler, &
js);
1040 return T->StealStickyError();
1043 const Instance& extension_handler =
1045 if (!extension_handler.IsNull()) {
1046 ScheduleExtensionHandler(extension_handler, method_name, param_keys,
1047 param_values, reply_port, seq);
1050 return T->StealStickyError();
1055 return T->StealStickyError();
1061 return InvokeMethod(isolate, msg_instance);
1066 return InvokeMethod(isolate, msg_instance,
true);
1070 ASSERT(isolate !=
nullptr);
1072 return MaybePause(isolate,
error);
1079void Service::SendEvent(
const char* stream_id,
1082 intptr_t bytes_length) {
1084 Isolate* isolate = thread->isolate();
1085 ASSERT(isolate !=
nullptr);
1087 if (FLAG_trace_service) {
1089 "vm-service: Pushing ServiceEvent(isolate='%s', "
1092 " len=%" Pd ") to stream %s\n",
1093 isolate->name(),
static_cast<int64_t
>(isolate->main_port()),
event_type,
1094 bytes_length, stream_id);
1112 elements[0] = &cstream_id;
1113 elements[1] = &cbytes;
1116 message.value.as_array.length = 2;
1117 message.value.as_array.values = elements;
1119 std::unique_ptr<Message> msg =
1122 if (msg ==
nullptr) {
1136 intptr_t reservation,
1137 const char* metadata,
1138 intptr_t metadata_size,
1140 intptr_t data_size) {
1146 memset(
data,
' ', reservation);
1147 reinterpret_cast<uint32_t*
>(
data)[0] = reservation;
1148 memmove(&(
reinterpret_cast<uint32_t*
>(
data)[1]), metadata, metadata_size);
1153 const char*
name =
event->isolate()->name();
1154 const int64_t main_port =
static_cast<int64_t
>(
event->isolate()->main_port());
1155 switch (
event->kind()) {
1158 ") '%s' has no debugger attached and is paused at start.",
1163 ") '%s' has no debugger attached and is paused at exit.",
1168 "vm-service: isolate (%" Pd64
1169 ") '%s' has no debugger attached and is paused due to exception.",
1174 "vm-service: isolate (%" Pd64
1175 ") '%s' has no debugger attached and is paused due to interrupt.",
1180 ") '%s' has no debugger attached and is paused.",
1185 ") '%s' has no debugger attached and is paused post reload.",
1195 OS::PrintErr(
" Connect to the Dart VM service to debug.\n");
1197 OS::PrintErr(
" Connect to the Dart VM service at %s to debug.\n",
1207 if (
event->stream_info() !=
nullptr && !
event->stream_info()->enabled()) {
1208 if (FLAG_warn_on_pause_with_no_debugger &&
event->IsPause()) {
1215 }
else if (
event->stream_info() !=
nullptr &&
1216 FLAG_warn_on_pause_with_no_debugger &&
event->IsPause()) {
1223 if (
event->stream_info() !=
nullptr) {
1224 js.set_include_private_members(
1225 event->stream_info()->include_private_members());
1227 const char* stream_id =
event->stream_id();
1228 ASSERT(stream_id !=
nullptr);
1234 params.AddProperty(
"streamId", stream_id);
1237 PostEvent(
event->isolate_group(),
event->isolate(), stream_id,
1238 event->KindAsCString(), &
js, enter_safepoint);
1243 const char* stream_id,
1246 bool enter_safepoint) {
1247 if (enter_safepoint) {
1251 PostEventImpl(isolate_group, isolate, stream_id, kind,
event);
1254 PostEventImpl(isolate_group, isolate, stream_id, kind,
event);
1257void Service::PostEventImpl(IsolateGroup* isolate_group,
1259 const char* stream_id,
1261 JSONStream*
event) {
1262 ASSERT(stream_id !=
nullptr);
1266 if (FLAG_trace_service) {
1267 if (isolate !=
nullptr) {
1268 ASSERT(isolate_group !=
nullptr);
1270 "vm-service: Pushing "
1273 "', kind='%s') to stream %s\n",
1274 isolate_group->id(), isolate->name(),
1275 static_cast<int64_t
>(isolate->main_port()), kind, stream_id);
1276 }
else if (isolate_group !=
nullptr) {
1278 "vm-service: Pushing "
1280 "', kind='%s') to stream %s\n",
1281 isolate_group->id(), kind, stream_id);
1284 "vm-service: Pushing ServiceEvent(isolate='<no current isolate>', "
1285 "kind='%s') to stream %s\n",
1306 list_values[0] = &stream_id_cobj;
1310 json_cobj.
value.
as_string =
const_cast<char*
>(
event->ToCString());
1311 list_values[1] = &json_cobj;
1313 AllocOnlyStackZone zone;
1314 std::unique_ptr<Message> msg =
1317 if (msg !=
nullptr) {
1327 user_data_(nullptr),
1335 const char*
name()
const {
return name_; }
1355void Service::EmbedderHandleMessage(EmbedderServiceHandler* handler,
1357 ASSERT(handler !=
nullptr);
1360 const char* response =
nullptr;
1364 success =
callback(
js->method(),
js->param_keys(),
js->param_values(),
1365 js->num_params(), handler->user_data(), &response);
1367 ASSERT(response !=
nullptr);
1371 js->buffer()->AddString(response);
1373 free(
const_cast<char*
>(response));
1380 if (
name ==
nullptr) {
1384 if (handler !=
nullptr) {
1396 handler->
set_next(isolate_service_handler_head_);
1397 isolate_service_handler_head_ = handler;
1402 while (current !=
nullptr) {
1403 if (strcmp(
name, current->
name()) == 0) {
1406 current = current->
next();
1414 if (
name ==
nullptr) {
1418 if (handler !=
nullptr) {
1430 handler->
set_next(root_service_handler_head_);
1431 root_service_handler_head_ = handler;
1437 stream_listen_callback_ = listen_callback;
1438 stream_cancel_callback_ = cancel_callback;
1443 get_service_assets_callback_ = get_service_assets;
1448 embedder_information_callback_ =
callback;
1452 if (embedder_information_callback_ ==
nullptr) {
1461 embedder_information_callback_(&
info);
1463 return info.current_rss;
1467 if (embedder_information_callback_ ==
nullptr) {
1476 embedder_information_callback_(&
info);
1478 return info.max_rss;
1482 intptr_t kernel_length) {
1483 dart_library_kernel_ = kernel_bytes;
1484 dart_library_kernel_len_ = kernel_length;
1489 while (current !=
nullptr) {
1490 if (strcmp(
name, current->
name()) == 0) {
1493 current = current->
next();
1498void Service::ScheduleExtensionHandler(
const Instance& handler,
1499 const String& method_name,
1500 const Array& parameter_keys,
1501 const Array& parameter_values,
1502 const Instance& reply_port,
1503 const Instance&
id) {
1504 ASSERT(!handler.IsNull());
1505 ASSERT(!method_name.IsNull());
1506 ASSERT(!parameter_keys.IsNull());
1507 ASSERT(!parameter_values.IsNull());
1508 ASSERT(!reply_port.IsNull());
1510 ASSERT(isolate !=
nullptr);
1511 isolate->AppendServiceExtensionCall(handler, method_name, parameter_keys,
1512 parameter_values, reply_port,
id);
1538 switch (sentinel_type) {
1541 jsobj.
AddProperty(
"valueAsString",
"<collected>");
1557static const MethodParameter*
const
1565 const char* stream_id =
js->LookupParam(
"streamId");
1566 if (stream_id ==
nullptr) {
1570 bool include_private_members =
1573 for (intptr_t
i = 0;
i < num_streams;
i++) {
1574 if (strcmp(stream_id,
streams_[
i]->
id()) == 0) {
1597 [&visitor](
IsolateGroup* isolate_group) { visitor(isolate_group); },
1647 intptr_t num_libs =
libs.Length();
1656 JSONArray script_array(&jsobj,
"scripts");
1657 for (intptr_t
i = 0;
i < num_libs;
i++) {
1661 for (intptr_t j = 0; j <
scripts.Length(); j++) {
1681 bool has_limit =
js->HasParam(
"limit");
1701 intptr_t num_frames =
1704 for (intptr_t
i = 0;
i < num_frames;
i++) {
1707 frame->PrintToJSONObject(&jsobj);
1712 if (async_awaiter_stack !=
nullptr) {
1713 JSONArray jsarr(&jsobj,
"asyncCausalFrames");
1714 intptr_t num_frames =
1716 : async_awaiter_stack->
Length();
1717 for (intptr_t
i = 0;
i < num_frames;
i++) {
1720 frame->PrintToJSONObject(&jsobj);
1725 const bool truncated =
1727 (limit < stack->
Length() || (async_awaiter_stack !=
nullptr &&
1728 limit < async_awaiter_stack->
Length())));
1739 if (
js->HasParam(
"text")) {
1755 event.AddProperty(
"type",
"Event");
1756 event.AddProperty(
"kind",
"_Echo");
1757 event.AddProperty(
"isolate", isolate);
1758 if (
text !=
nullptr) {
1759 event.AddProperty(
"text",
text);
1766 intptr_t reservation =
js.buffer()->length() +
sizeof(int32_t);
1767 intptr_t data_size = reservation + 3;
1768 uint8_t*
data =
reinterpret_cast<uint8_t*
>(
malloc(data_size));
1769 data[reservation + 0] = 0;
1770 data[reservation + 1] = 128;
1771 data[reservation + 2] = 255;
1773 js.buffer()->buffer(),
js.buffer()->length(),
data,
1791 if (obj.IsArray()) {
1792 const Array& array = Array::Cast(obj);
1794 for (intptr_t
i = 0;
i < array.
Length(); ++
i) {
1795 element = array.
At(
i);
1796 if (!(element.IsInstance() || element.
IsNull())) {
1801 }
else if (obj.IsGrowableObjectArray()) {
1804 for (intptr_t
i = 0;
i < array.
Length(); ++
i) {
1805 element = array.
At(
i);
1806 if (!(element.IsInstance() || element.
IsNull())) {
1812 return !(obj.IsInstance() || obj.
IsNull());
1820 if (strncmp(arg,
"int-", 4) == 0) {
1830 }
else if (strcmp(arg,
"bool-true") == 0) {
1832 }
else if (strcmp(arg,
"bool-false") == 0) {
1834 }
else if (strcmp(arg,
"null") == 0) {
1851 auto zone = thread->
zone();
1853 if (num_parts != 4) {
1854 return Object::sentinel().ptr();
1857 const char* encoded_id =
parts[3];
1861 return Object::sentinel().ptr();
1864 if (strcmp(
parts[2],
"fields") == 0) {
1867 if (field.IsNull()) {
1868 return Object::sentinel().ptr();
1872 if (strcmp(
parts[2],
"field_inits") == 0) {
1875 if (field.IsNull() || (field.is_late() && !field.has_initializer())) {
1876 return Object::sentinel().ptr();
1880 return Object::sentinel().ptr();
1884 if (strcmp(
parts[2],
"functions") == 0) {
1890 return Object::sentinel().ptr();
1894 if (strcmp(
parts[2],
"implicit_closures") == 0) {
1898 return Object::sentinel().ptr();
1902 if (func.IsNull()) {
1903 return Object::sentinel().ptr();
1907 if (strcmp(
parts[2],
"dispatchers") == 0) {
1911 return Object::sentinel().ptr();
1915 if (func.IsNull()) {
1916 return Object::sentinel().ptr();
1920 if (strcmp(
parts[2],
"closures") == 0) {
1924 return Object::sentinel().ptr();
1929 return Object::sentinel().ptr();
1935 return Object::sentinel().ptr();
1942 if (num_parts < 2) {
1943 return Object::sentinel().ptr();
1952 bool lib_found =
false;
1953 for (intptr_t
i = 0;
i <
libs.Length();
i++) {
1957 if (private_key.
Equals(
id)) {
1963 return Object::sentinel().ptr();
1969 if (num_parts == 2) {
1972 if (strcmp(
parts[2],
"fields") == 0) {
1976 if (strcmp(
parts[2],
"field_inits") == 0) {
1980 if (strcmp(
parts[2],
"functions") == 0) {
1984 if (strcmp(
parts[2],
"closures") == 0) {
1988 if (strcmp(
parts[2],
"implicit_closures") == 0) {
1993 if (strcmp(
parts[2],
"scripts") == 0) {
1995 if (num_parts != 5) {
1996 return Object::sentinel().ptr();
2006 return Object::sentinel().ptr();
2014 for (
i = 0;
i < loaded_scripts.
Length();
i++) {
2017 script_url =
script.url();
2018 if (script_url.
Equals(requested_url) &&
2019 (timestamp ==
script.load_timestamp())) {
2026 return Object::sentinel().ptr();
2033 if (num_parts < 2) {
2034 return Object::sentinel().ptr();
2040 return Object::sentinel().ptr();
2043 if (num_parts == 2) {
2046 if (strcmp(
parts[2],
"closures") == 0) {
2049 }
else if (strcmp(
parts[2],
"field_inits") == 0) {
2052 }
else if (strcmp(
parts[2],
"fields") == 0) {
2055 }
else if (strcmp(
parts[2],
"functions") == 0) {
2058 }
else if (strcmp(
parts[2],
"implicit_closures") == 0) {
2061 }
else if (strcmp(
parts[2],
"dispatchers") == 0) {
2064 }
else if (strcmp(
parts[2],
"types") == 0) {
2066 if (num_parts != 4) {
2067 return Object::sentinel().ptr();
2071 return Object::sentinel().ptr();
2074 return Object::sentinel().ptr();
2077 if (!
type.IsNull()) {
2083 return Object::sentinel().ptr();
2090 if (num_parts < 2) {
2091 return Object::sentinel().ptr();
2095 return Object::sentinel().ptr();
2101 const intptr_t table_size =
table.Length() - 1;
2103 return Object::sentinel().ptr();
2105 return table.At(
id);
2109 if (num_parts != 2) {
2110 return Object::sentinel().ptr();
2113 const char*
const kCollectedPrefix =
"collected-";
2114 const intptr_t kCollectedPrefixLen = strlen(kCollectedPrefix);
2115 const char*
const kNativePrefix =
"native-";
2116 const intptr_t kNativePrefixLen = strlen(kNativePrefix);
2117 const char*
const kReusedPrefix =
"reused-";
2118 const intptr_t kReusedPrefixLen = strlen(kReusedPrefix);
2119 const char*
id =
parts[1];
2120 if (strncmp(kCollectedPrefix,
id, kCollectedPrefixLen) == 0) {
2122 return Object::sentinel().ptr();
2127 if (strncmp(kNativePrefix,
id, kNativePrefixLen) == 0) {
2129 return Object::sentinel().ptr();
2134 if (strncmp(kReusedPrefix,
id, kReusedPrefixLen) == 0) {
2136 return Object::sentinel().ptr();
2141 int64_t timestamp = 0;
2142 if (!
GetCodeId(
id, ×tamp, &pc) || (timestamp < 0)) {
2143 return Object::sentinel().ptr();
2146 if (!
code.IsNull()) {
2151 return Object::sentinel().ptr();
2157 if (num_parts != 2) {
2158 return Object::sentinel().ptr();
2160 uword message_id = 0;
2162 return Object::sentinel().ptr();
2168 return Object::sentinel().ptr();
2178 const char* id_original,
2183 const int MAX_PARTS = 8;
2184 char*
parts[MAX_PARTS];
2188 while (
id[
i] !=
'\0') {
2191 parts[num_parts++] = &
id[start_pos];
2192 if (num_parts == MAX_PARTS) {
2200 if (num_parts < MAX_PARTS) {
2201 parts[num_parts++] = &
id[start_pos];
2209 if (strcmp(
parts[0],
"objects") == 0) {
2218 return Object::sentinel().ptr();
2222 }
else if (strcmp(
parts[0],
"libraries") == 0) {
2224 }
else if (strcmp(
parts[0],
"classes") == 0) {
2226 }
else if (strcmp(
parts[0],
"typearguments") == 0) {
2228 }
else if (strcmp(
parts[0],
"code") == 0) {
2230 }
else if (strcmp(
parts[0],
"messages") == 0) {
2235 return Object::sentinel().ptr();
2242 size_t end_pos = strcspn(
id,
"/");
2243 if (end_pos == strlen(
id)) {
2246 const char* rest =
id + end_pos + 1;
2247 if (strncmp(
"breakpoints",
id, end_pos) == 0) {
2248 intptr_t bpt_id = 0;
2252 if (bpt !=
nullptr) {
2256 if (bpt_id < isolate->debugger()->limitBreakpointId()) {
2267 Array* field_names_handle,
2271 const intptr_t field_slot_offset) {
2273 const intptr_t num_positional_fields =
2275 const intptr_t field_index =
2277 if (field_index < num_positional_fields) {
2278 jsresponse.
AddProperty(
"parentField", field_index);
2280 *name_handle ^= field_names_handle->
At(field_index - num_positional_fields);
2289 ObjectGraph graph(thread);
2296 JSONArray elements(&jsobj,
"references");
2305 for (intptr_t
i = 0;
i < limit; ++
i) {
2308 slot_offset ^=
path.At((
i * 2) + 1);
2312 intptr_t element_index =
2315 jselement.
AddProperty(
"parentListIndex", element_index);
2316 jselement.
AddProperty(
"parentField", element_index);
2317 }
else if (
source.IsRecord()) {
2319 jselement, Record::Cast(
source),
2320 slot_offset.
Value());
2322 if (
source.IsInstance()) {
2323 source_class =
source.clazz();
2326 if (index > 0 && index < parent_field_map.
Length()) {
2327 field ^= parent_field_map.
At(index);
2336 if (field_name !=
nullptr) {
2342 }
else if (
source.IsContext()) {
2343 intptr_t element_index =
2346 jselement.
AddProperty(
"parentListIndex", element_index);
2347 jselement.
AddProperty(
"parentField", element_index);
2358 for (intptr_t
i = 0;
i <
path.Length();
i++) {
2359 path.SetAt(
i, Object::null_object());
2369 const char* target_id =
js->LookupParam(
"targetId");
2370 if (target_id ==
nullptr) {
2374 const char* limit_cstr =
js->LookupParam(
"limit");
2375 if (limit_cstr ==
nullptr) {
2391 if (obj.
ptr() == Object::sentinel().ptr()) {
2408 ObjectGraph graph(thread);
2410 auto result = graph.RetainingPath(obj,
path);
2429 for (intptr_t
i = 0;
i < limit; ++
i) {
2431 element =
path.At(
i * 2);
2436 slot_offset ^=
path.At((
i * 2) - 1);
2437 if (element.IsArray() || element.IsGrowableObjectArray()) {
2438 intptr_t element_index =
2441 jselement.
AddProperty(
"parentListIndex", element_index);
2442 jselement.
AddProperty(
"parentField", element_index);
2443 }
else if (element.IsRecord()) {
2445 jselement, Record::Cast(element),
2446 slot_offset.
Value());
2447 }
else if (element.IsMap()) {
2448 map =
static_cast<MapPtr
>(
path.At(
i * 2));
2449 map_data =
map.data();
2450 intptr_t element_index =
2455 if (iterator.
CurrentKey() == map_data.
At(element_index) ||
2462 }
else if (element.IsWeakProperty()) {
2463 wp ^=
static_cast<WeakPropertyPtr
>(element.
ptr());
2467 if (element.IsInstance()) {
2468 element_class = element.
clazz();
2471 if ((index > 0) && (index < element_field_map.
Length())) {
2472 field ^= element_field_map.
At(index);
2482 if (field_name !=
nullptr) {
2484 }
else if (element.IsContext()) {
2485 intptr_t element_index =
2488 jselement.
AddProperty(
"parentListIndex", element_index);
2489 jselement.
AddProperty(
"parentField", element_index);
2500 for (intptr_t
i = 0;
i <
path.Length();
i++) {
2501 path.SetAt(
i, Object::null_object());
2511 const char* target_id =
js->LookupParam(
"targetId");
2512 if (target_id ==
nullptr) {
2516 const char* limit_cstr =
js->LookupParam(
"limit");
2517 if (limit_cstr ==
nullptr) {
2533 if (obj.
ptr() == Object::sentinel().ptr()) {
2553 const char* target_id =
js->LookupParam(
"targetId");
2554 ASSERT(target_id !=
nullptr);
2558 if (obj.
ptr() == Object::sentinel().ptr()) {
2570 if (obj.IsClass()) {
2571 const Class& cls = Class::Cast(obj);
2572 ObjectGraph graph(thread);
2573 intptr_t retained_size = graph.SizeRetainedByClass(cls.
id());
2579 ObjectGraph graph(thread);
2580 intptr_t retained_size = graph.SizeRetainedByInstance(obj);
2592 const char* target_id =
js->LookupParam(
"targetId");
2593 ASSERT(target_id !=
nullptr);
2597 if (obj.
ptr() == Object::sentinel().ptr()) {
2609 if (obj.IsClass()) {
2610 const Class& cls = Class::Cast(obj);
2611 ObjectGraph graph(thread);
2612 intptr_t retained_size = graph.SizeReachableByClass(cls.
id());
2618 ObjectGraph graph(thread);
2619 intptr_t retained_size = graph.SizeReachableByInstance(obj);
2630 const char* receiver_id =
js->LookupParam(
"targetId");
2631 if (receiver_id ==
nullptr) {
2635 const char* selector_cstr =
js->LookupParam(
"selector");
2636 if (selector_cstr ==
nullptr) {
2640 const char* argument_ids =
js->LookupParam(
"argumentIds");
2641 if (argument_ids ==
nullptr) {
2646#if !defined(DART_PRECOMPILED_RUNTIME)
2647 bool disable_breakpoints =
2650 disable_breakpoints);
2657 if (receiver.
ptr() == Object::sentinel().ptr()) {
2671 bool is_instance = (receiver.IsInstance() || receiver.
IsNull()) &&
2674 growable_args.
Add(receiver);
2677 intptr_t n = strlen(argument_ids);
2678 if ((n < 2) || (argument_ids[0] !=
'[') || (argument_ids[n - 1] !=
']')) {
2686 while ((argument_ids[
end + 1] !=
',') && (argument_ids[
end + 1] !=
']')) {
2695 const char* argument_id =
2702 if (!(argument.IsInstance() || argument.
IsNull()) ||
2707 if (argument.
ptr() == Object::sentinel().ptr()) {
2717 growable_args.
Add(argument);
2726 const Array& arg_names = Object::empty_array();
2728 if (receiver.IsLibrary()) {
2729 const Library& lib = Library::Cast(receiver);
2735 if (receiver.IsClass()) {
2736 const Class& cls = Class::Cast(receiver);
2752 "%s: invalid 'targetId' parameter: "
2753 "Cannot invoke against a VM-internal object",
2763 return (c >=
'A' && c <=
'Z') || (c >=
'a' && c <=
'z');
2766 return (c >=
'A' && c <=
'Z') || (c >=
'a' && c <=
'z') || (c ==
'$');
2769 return (c >=
'0' && c <=
'9') ||
IsAlpha(c);
2778 return IsAlphaNum(c) || c ==
'/' || c ==
'-' || c ==
'@' || c ==
'%';
2787 const char* c = scope;
2788 if (*c++ !=
'{')
return false;
2795 if (*c ==
'}')
return true;
2797 const char*
name = c;
2808 if (*c++ !=
':')
return false;
2834 const char* scope =
js->LookupParam(
"scope");
2837 if (scope !=
nullptr) {
2844 for (intptr_t
i = 0;
i < cids.
length();
i++) {
2847 if (obj.
ptr() == Object::sentinel().ptr()) {
2859 "%s: invalid scope 'targetId' parameter: "
2860 "Cannot evaluate against a VM-internal object",
2877 "%s: No compilation service available; cannot evaluate from source.",
2894 if (
type.IsFunctionType()) {
2902 if (
type.IsRecordType()) {
2907 if (
type.IsDynamicType()) {
2913 if (
type.IsTypeParameter()) {
2935 if (!type_arguments.
IsNull()) {
2939 for (intptr_t
i = 0;
i < type_arguments.
Length();
i++) {
2940 src_type = type_arguments.
TypeAt(
i);
2949 for (intptr_t
i = 0;
i < num_type_parameters;
i++) {
2963 if (framePos >= stack->
Length()) {
2982 bool isStatic =
false;
2986 if (
BuildScope(thread,
js, param_names, param_values)) {
2990 if (
js->HasParam(
"frameIndex")) {
2994 if (framePos >= stack->
Length()) {
3000 script_uri =
frame->SourceUrl();
3001 token_pos =
frame->TokenPos();
3002 frame->BuildParameters(param_names, param_values, type_params_names,
3003 type_params_bounds, type_params_defaults);
3005 if (
frame->function().is_static()) {
3011 method_name =
frame->function().UserVisibleName();
3015 method_cls = method_cls.
Mixin();
3018 method_name =
frame->function().UserVisibleName();
3023 if (!
js->HasParam(
"targetId")) {
3025 "Either targetId or frameIndex has to be provided.");
3028 const char* target_id =
js->LookupParam(
"targetId");
3033 if (obj.
ptr() == Object::sentinel().ptr()) {
3037 if (obj.IsLibrary()) {
3038 const Library& lib = Library::Cast(obj);
3039 library_uri = lib.
url();
3041 }
else if (obj.IsClass() || ((obj.IsInstance() || obj.
IsNull()) &&
3044 if (obj.IsClass()) {
3058 "Expressions can be evaluated only with regular Dart instances");
3068 "%s: invalid 'targetId' parameter: "
3069 "Cannot evaluate against a VM-internal object",
3077 JSONArray jsonParamNames(&report,
"param_names");
3080 for (intptr_t
i = 0;
i < param_names.
Length();
i++) {
3081 param_name ^= param_names.
At(
i);
3086 const JSONArray jsonParamTypes(&report,
"param_types");
3092 for (intptr_t
i = 0;
i < param_names.
Length();
i++) {
3093 obj = param_values.
At(
i);
3095 param_types.
Add(obj);
3096 }
else if (obj.IsInstance()) {
3102 for (intptr_t
i = 0;
i < param_types.
Length();
i++) {
3109 JSONArray jsonTypeParamsNames(&report,
"type_params_names");
3111 for (intptr_t
i = 0;
i < type_params_names.
Length();
i++) {
3112 type_param_name ^= type_params_names.
At(
i);
3117 const JSONArray jsonParamTypes(&report,
"type_params_bounds");
3121 for (intptr_t
i = 0;
i < type_params_bounds.
Length();
i++) {
3122 type ^= type_params_bounds.
At(
i);
3126 for (intptr_t
i = 0;
i < type_params_bounds_strings.
Length();
i++) {
3132 const JSONArray jsonParamTypes(&report,
"type_params_defaults");
3136 for (intptr_t
i = 0;
i < type_params_defaults.
Length();
i++) {
3137 type ^= type_params_defaults.
At(
i);
3141 for (intptr_t
i = 0;
i < type_params_defaults_strings.
Length();
i++) {
3147 if (!klass_name.
IsNull()) {
3150 if (!method_name.
IsNull()) {
3154 if (!script_uri.
IsNull()) {
3160#if !defined(DART_PRECOMPILED_RUNTIME)
3166 const char* c = csv_list;
3167 if (*c++ !=
'[')
return false;
3171 while (*c !=
'\0') {
3172 const char*
value = c;
3173 while (*c !=
'\0' && *c !=
']' && *c !=
',' && !
IsWhitespace(*c)) {
3217#if defined(DART_PRECOMPILED_RUNTIME)
3227 "%s: No compilation service available; cannot evaluate from source.",
3232 const char* klass =
js->LookupParam(
"klass");
3245 if (!
ParseCSVList(
js->LookupParam(
"definitionTypes"), param_types)) {
3252 if (!
ParseCSVList(
js->LookupParam(
"typeDefinitions"), type_params)) {
3264 if (!
ParseCSVList(
js->LookupParam(
"typeDefaults"), type_defaults)) {
3274 kernel_buffer, kernel_buffer_len,
js->LookupParam(
"expression"),
3280 js->LookupParam(
"libraryUri"),
js->LookupParam(
"klass"),
3282 js->LookupParam(
"scriptUri"), is_static);
3286 free(compilation_result.
error);
3290 const uint8_t* kernel_bytes = compilation_result.
kernel;
3291 intptr_t kernel_length = compilation_result.
kernel_size;
3292 ASSERT(kernel_bytes !=
nullptr);
3308 intptr_t kernel_length;
3309 uint8_t* kernel_buffer =
DecodeBase64(kernel_buffer_base64, &kernel_length);
3320 bool disable_breakpoints =
3326 if (frame_pos >= stack->
Length()) {
3335 if (
BuildScope(thread,
js, param_names, param_values)) {
3348 if (
js->HasParam(
"frameIndex")) {
3351 if (frame_pos >= stack->
Length()) {
3359 frame->BuildParameters(param_names, param_values, type_params_names,
3360 type_params_bounds, type_params_defaults));
3364 frame->EvaluateCompiledExpression(
3372 if (!
js->HasParam(
"targetId")) {
3374 "Either targetId or frameIndex has to be provided.");
3377 const char* target_id =
js->LookupParam(
"targetId");
3381 if (obj.
ptr() == Object::sentinel().ptr()) {
3391 const auto& type_params_names_fixed =
3393 const auto& param_values_fixed =
3397 if (obj.IsLibrary()) {
3398 const auto& lib = Library::Cast(obj);
3401 lib.EvaluateCompiledExpression(kernel_data, type_params_names_fixed,
3402 param_values_fixed, type_arguments));
3406 if (obj.IsClass()) {
3407 const auto& cls = Class::Cast(obj);
3410 cls.EvaluateCompiledExpression(kernel_data, type_params_names_fixed,
3411 param_values_fixed, type_arguments));
3420 zone,
instance.EvaluateCompiledExpression(
3421 receiver_cls, kernel_data, type_params_names_fixed,
3422 param_values_fixed, type_arguments));
3427 "%s: invalid 'targetId' parameter: "
3428 "Cannot evaluate against a VM-internal object",
3445 "%s: No compilation service available; cannot evaluate from source.",
3450 bool include_subclasses,
3451 bool include_implementors) {
3456 table->SetCollectInstancesFor(
root.id(),
true);
3464 if (include_subclasses || include_implementors) {
3466 if (!subclasses.
IsNull()) {
3467 for (intptr_t j = 0; j < subclasses.
Length(); j++) {
3469 subclass ^= subclasses.
At(j);
3470 if (!
table->CollectInstancesFor(subclass.
id())) {
3471 table->SetCollectInstancesFor(subclass.
id(),
true);
3477 if (include_implementors) {
3479 if (!implementors.
IsNull()) {
3480 for (intptr_t j = 0; j < implementors.
Length(); j++) {
3482 implementor ^= implementors.
At(j);
3483 if (!
table->CollectInstancesFor(implementor.
id())) {
3484 table->SetCollectInstancesFor(implementor.
id(),
true);
3495 for (intptr_t
i = 1;
i <
table->NumCids();
i++) {
3496 table->SetCollectInstancesFor(
i,
false);
3515 if (count_ < limit_) {
3523 intptr_t
count()
const {
return count_; }
3528 const intptr_t limit_;
3542 const char* object_id =
js->LookupParam(
"objectId");
3544 const bool include_subclasses =
3546 const bool include_implementers =
3551 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsClass()) {
3555 const Class& cls = Class::Cast(obj);
3563 ObjectGraph graph(thread);
3565 MarkClasses(cls, include_subclasses, include_implementers);
3566 graph.IterateObjects(&visitor);
3575 for (
int i = 0; (
i < limit) && (
i <
count);
i++) {
3590 const char* object_id =
js->LookupParam(
"objectId");
3591 bool include_subclasses =
3593 bool include_implementers =
3598 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsClass()) {
3602 const Class& cls = Class::Cast(obj);
3613 ObjectGraph graph(thread);
3615 MarkClasses(cls, include_subclasses, include_implementers);
3616 graph.IterateObjects(&visitor);
3621 for (intptr_t
i = 0;
i <
count;
i++) {
3628template <
typename Adder>
3633 ASSERT(thread !=
nullptr);
3634 intptr_t n = strlen(str);
3637 }
else if (n == 2) {
3648 const char c = str[
end];
3649 if (c ==
',' || c ==
']') {
3665 thread, str, [zone, &elements](
const char*
start, intptr_t
length) {
3669 elements.
Add(element);
3673#if !defined(DART_PRECOMPILED_RUNTIME)
3679 thread, str, [zone, elements](
const char*
start, intptr_t
length) {
3700 for (
int i = 0;
i < ports.
Length(); ++
i) {
3703 if (
port.keep_isolate_alive()) {
3710#if !defined(DART_PRECOMPILED_RUNTIME)
3719#if !defined(DART_PRECOMPILED_RUNTIME)
3731#if defined(DART_PRECOMPILED_RUNTIME)
3737 const char** reports = reports_parameter->
Parse(reports_str);
3738 const char** riter = reports;
3739 intptr_t report_set = 0;
3740 while (*riter !=
nullptr) {
3754 if (reports !=
nullptr) {
3771 if (
js->HasParam(
"scriptId")) {
3773 const char* script_id_param =
js->LookupParam(
"scriptId");
3776 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsScript()) {
3782 if (
js->HasParam(
"tokenPos")) {
3785 "%s: the 'tokenPos' parameter requires the 'scriptId' parameter",
3789 if (
js->HasParam(
"endTokenPos")) {
3792 "%s: the 'endTokenPos' parameter requires the 'scriptId' parameter",
3798 const char* library_filters_param =
js->LookupParam(
"libraryFilters");
3800 if (library_filters_param !=
nullptr) {
3802 intptr_t library_filters_length =
3804 if (library_filters_length < 0) {
3810 const char* libraries_already_compiled_param =
3811 js->LookupParam(
"librariesAlreadyCompiled");
3814 if (libraries_already_compiled_param !=
nullptr) {
3816 intptr_t libraries_already_compiled_length =
ParseJSONSet(
3817 thread, libraries_already_compiled_param, libraries_already_compiled);
3818 if (libraries_already_compiled_length < 0) {
3824 SourceReport report(report_set, library_filters, libraries_already_compiled,
3825 compile_mode, report_lines);
3841#if defined(DART_PRECOMPILED_RUNTIME)
3847 "A library tag handler must be installed.");
3856 "This isolate cannot reload sources anymore because there "
3857 "was an unhandled exception error. Restart the isolate.");
3866 "This isolate cannot reload sources right now.");
3869 const bool force_reload =
3873 js->LookupParam(
"packagesUri"));
3891 if (!
error.IsNull()) {
3904 const String& script_uri) {
3909 const char* line_param =
js->LookupParam(
"line");
3911 const char* col_param =
js->LookupParam(
"column");
3913 if (col_param !=
nullptr) {
3925 if (bpt ==
nullptr) {
3927 "%s: Cannot add breakpoint at line '%s'",
js->method(),
3947 const char* script_id_param =
js->LookupParam(
"scriptId");
3950 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsScript()) {
3973 const char* script_uri_param =
js->LookupParam(
"scriptUri");
3989 const char* function_id =
js->LookupParam(
"functionId");
3991 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsFunction()) {
3998 if (bpt ==
nullptr) {
4000 "%s: Cannot add breakpoint at function '%s'",
js->method(),
4018 const char* object_id =
js->LookupParam(
"objectId");
4020 if (obj.
ptr() == Object::sentinel().ptr() || !obj.IsInstance()) {
4027 if (bpt ==
nullptr) {
4029 "%s: Cannot add breakpoint at activation",
js->method());
4045 if (!
js->HasParam(
"breakpointId")) {
4049 const char* bpt_id =
js->LookupParam(
"breakpointId");
4055 if (bpt ==
nullptr) {
4069 auto isolate = thread->
isolate();
4070#define ADD_METRIC(type, variable, name, unit) \
4071 metrics.AddValue(isolate->Get##variable##Metric());
4076#define ADD_METRIC(type, variable, name, unit) \
4077 metrics.AddValue(isolate_group->Get##variable##Metric());
4084 auto isolate = thread->
isolate();
4085#define ADD_METRIC(type, variable, name, unit) \
4086 if (strcmp(id, name) == 0) { \
4087 isolate->Get##variable##Metric()->PrintJSON(js); \
4094#define ADD_METRIC(type, variable, name, unit) \
4095 if (strcmp(id, name) == 0) { \
4096 isolate_group->Get##variable##Metric()->PrintJSON(js); \
4111 if (
js->HasParam(
"type")) {
4112 if (!
js->ParamIs(
"type",
"Native")) {
4129 const char* metric_id =
js->LookupParam(
"metricId");
4130 if (metric_id ==
nullptr) {
4135 static const char*
const kNativeMetricIdPrefix =
"metrics/native/";
4136 static intptr_t kNativeMetricIdPrefixLen = strlen(kNativeMetricIdPrefix);
4137 if (strncmp(metric_id, kNativeMetricIdPrefix, kNativeMetricIdPrefixLen) !=
4142 const char*
id = metric_id + kNativeMetricIdPrefixLen;
4151 const int64_t time_origin_micros =
4153 const int64_t time_extent_micros =
4155 const bool include_code_samples =
4163 include_code_samples);
4165#if defined(SUPPORT_PERFETTO)
4169 ProfilerService::PrintPerfetto(
js, time_origin_micros, time_extent_micros);
4180 ASSERT(isolate !=
nullptr);
4182 TimelineEventRecorder* timeline_recorder = Timeline::recorder();
4183 ASSERT(timeline_recorder !=
nullptr);
4184 const char*
name = timeline_recorder->name();
4185 if (strcmp(
name, CALLBACK_RECORDER_NAME) == 0) {
4187 "A recorder of type \"%s\" is currently in use. As a "
4188 "result, timeline events are handled by the embedder rather "
4190 timeline_recorder->name());
4192 }
else if (strcmp(
name, FUCHSIA_RECORDER_NAME) == 0 ||
4193 strcmp(
name, SYSTRACE_RECORDER_NAME) == 0 ||
4194 strcmp(
name, MACOS_RECORDER_NAME) == 0) {
4197 "A recorder of type \"%s\" is currently in use. As a result, timeline "
4198 "events are handled by the OS rather than the VM. See the VM service "
4199 "documentation for more details on where timeline events can be found "
4200 "for this recorder type.",
4201 timeline_recorder->name());
4203 }
else if (strcmp(
name, FILE_RECORDER_NAME) == 0 ||
4204 strcmp(
name, PERFETTO_FILE_RECORDER_NAME) == 0) {
4206 "A recorder of type \"%s\" is currently in use. As a "
4207 "result, timeline events are written directly to a file and "
4208 "thus cannot be retrieved through the VM Service.",
4209 timeline_recorder->name());
4212 int64_t time_origin_micros =
4214 int64_t time_extent_micros =
4216 TimelineEventFilter filter(time_origin_micros, time_extent_micros);
4218 timeline_recorder->PrintJSON(
js, &filter);
4220#if defined(SUPPORT_PERFETTO)
4224 timeline_recorder->PrintPerfettoTimeline(
js, filter);
4231#if defined(SUPPORT_PERFETTO)
4232static void GetPerfettoCpuSamples(Thread* thread, JSONStream*
js) {
4236static void GetPerfettoVMTimeline(Thread* thread, JSONStream*
js) {
4242#if !defined(SUPPORT_TIMELINE)
4246 ASSERT(isolate !=
nullptr);
4249 char* recorded_streams =
Utils::StrDup(
js->LookupParam(
"recordedStreams"));
4251 free(recorded_streams);
4263#if !defined(SUPPORT_TIMELINE)
4268 ASSERT(isolate !=
nullptr);
4270 Timeline::PrintFlagsToJSON(
js);
4292 ASSERT(isolate !=
nullptr);
4312 "None",
"Into",
"Over",
"Out",
"Rewind",
"OverAsyncSuspension",
nullptr,
4330 const char* step_param =
js->LookupParam(
"step");
4332 if (step_param !=
nullptr) {
4335 intptr_t frame_index = 1;
4336 const char* frame_index_param =
js->LookupParam(
"frameIndex");
4337 if (frame_index_param !=
nullptr) {
4342 "%s: the 'frameIndex' parameter can only be used when rewinding",
4386 const char*
error =
nullptr;
4404 error.set_is_user_initiated(
true);
4430 if (!FLAG_profiler) {
4431 FLAG_profiler =
true;
4468 int64_t time_origin_micros =
4470 int64_t time_extent_micros =
4475 if (
js->HasParam(
"classId")) {
4476 const char* class_id =
js->LookupParam(
"classId");
4485 time_extent_micros);
4495 time_extent_micros);
4512 bool should_reset_accumulator =
false;
4513 bool should_collect =
false;
4514 if (
js->HasParam(
"reset")) {
4515 if (
js->ParamIs(
"reset",
"true")) {
4516 should_reset_accumulator =
true;
4522 if (
js->HasParam(
"gc")) {
4523 if (
js->ParamIs(
"gc",
"true")) {
4524 should_collect =
true;
4531 if (should_reset_accumulator) {
4534 if (should_collect) {
4535 isolate_group->UpdateLastAllocationProfileGCTimestamp();
4538 isolate_group->class_table()->AllocationProfilePrintJSON(
js, internal);
4572 if (
js->HasParam(
"gc")) {
4573 if (
js->ParamIs(
"gc",
"scavenge")) {
4576 }
else if (
js->ParamIs(
"gc",
"mark-sweep")) {
4579 }
else if (
js->ParamIs(
"gc",
"mark-compact")) {
4587 isolate_group->heap()->PrintHeapMapToJSONStream(isolate_group,
js);
4597 VmServiceHeapSnapshotChunkedWriter vmservice_writer(thread);
4598 HeapSnapshotWriter writer(thread, &vmservice_writer);
4605#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
4611static void AddVMMappings(JSONArray* rss_children) {
4612 FILE*
fp = fopen(
"/proc/self/smaps",
"r");
4613 if (
fp ==
nullptr) {
4617 MallocGrowableArray<VMMapping> mappings(10);
4618 char*
line =
nullptr;
4619 size_t line_buffer_size = 0;
4623 while (getline(&
line, &line_buffer_size,
fp) > 0) {
4624 if (sscanf(
line,
"%zx-%zx", &start, &end) == 2) {
4632 const intptr_t kPathFieldIndex = 5;
4634 char* path_start =
line;
4635 intptr_t current_field = 0;
4636 while (*path_start !=
'\0') {
4638 if (*path_start ==
' ') {
4640 while (*path_start ==
' ') {
4644 if (current_field == kPathFieldIndex) {
4651 if (current_field != kPathFieldIndex) {
4655 strncpy(
path, path_start,
sizeof(
path) - 1);
4660 }
else if (sscanf(
line,
"%s%zd", property, &
size) == 2) {
4667 if ((strcmp(property,
"Rss:") == 0) && (
size != 0) &&
4668 (strcmp(
path,
"(deleted)") != 0) && (strcmp(
path,
"[heap]") != 0) &&
4669 (strcmp(
path,
"") != 0) && (strcmp(
path,
"[anon:dart-heap]") != 0) &&
4670 (strcmp(
path,
"[anon:dart-code]") != 0) &&
4671 (strcmp(
path,
"[anon:dart-profiler]") != 0) &&
4672 (strcmp(
path,
"[anon:dart-timeline]") != 0) &&
4673 (strcmp(
path,
"[anon:dart-zone]") != 0)) {
4674 bool updated =
false;
4675 for (intptr_t
i = 0;
i < mappings.length();
i++) {
4676 if (strcmp(mappings[
i].
path,
path) == 0) {
4677 mappings[
i].size +=
size;
4684 strncpy(mapping.path,
path,
sizeof(mapping.path));
4685 mapping.size =
size;
4686 mappings.Add(mapping);
4694 for (intptr_t
i = 0;
i < mappings.length();
i++) {
4695 JSONObject mapping(rss_children);
4696 mapping.AddProperty(
"name", mappings[
i].
path);
4697 mapping.AddProperty(
"description",
4698 "Mapped file / shared library / executable");
4699 mapping.AddProperty64(
"size", mappings[
i].
size *
KB);
4700 JSONArray(&mapping,
"children");
4707 response.
AddProperty(
"type",
"ProcessMemoryUsage");
4711 rss.
AddProperty(
"description",
"Resident set size");
4713 JSONArray rss_children(&rss,
"children");
4715 intptr_t vm_size = 0;
4725 "Samples from the Dart VM's profiler");
4737 "Timeline events from dart:developer and Dart_RecordTimelineEvent");
4738 intptr_t
size = Timeline::recorder()->Size();
4747 zone.
AddProperty(
"description",
"Arena allocation in the Dart VM");
4757 semi.
AddProperty(
"description",
"Cached heap regions");
4767 (isolate_group->
heap()->new_space()->CapacityInWords() +
4780 int64_t free = capacity - used;
4783 group.AddPropertyF(
"name",
"IsolateGroup %s",
4785 group.AddProperty(
"description",
"Dart heap capacity");
4786 vm_size += capacity;
4787 group.AddProperty64(
"size", capacity);
4813#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
4814 AddVMMappings(&rss_children);
4834 event.set_inspectee(&inspectee);
4839 const char* stream_id,
4840 const char* event_kind,
4841 const uint8_t* bytes,
4842 intptr_t bytes_len) {
4844 event.set_embedder_kind(event_kind);
4845 event.set_embedder_stream_id(stream_id);
4846 event.set_bytes(bytes, bytes_len);
4851 int64_t sequence_number,
4868 log_record.
zone = &zone;
4872 event.set_log_record(log_record);
4877 const String& event_kind,
4878 const String& event_data) {
4886 event.set_extension_event(extension_event);
4895template <
typename T>
4911 if (!weak_persistent_handle->
ptr()->IsHeapObject()) {
4920 "peer",
"0x%" Px "",
4921 reinterpret_cast<uintptr_t
>(weak_persistent_handle->
peer()));
4923 "callbackAddress",
"0x%" Px "",
4924 reinterpret_cast<uintptr_t
>(weak_persistent_handle->
callback()));
4927 reinterpret_cast<uword>(weak_persistent_handle->
callback()),
nullptr);
4929 if (
name !=
nullptr) {
4938 T* handle =
reinterpret_cast<T*
>(
addr);
4947 ASSERT(isolate !=
nullptr);
4950 ASSERT(api_state !=
nullptr);
4957 JSONArray persistent_handles(&obj,
"persistentHandles");
4961 thread, &persistent_handles);
4962 handles.
Visit(&visitor);
4967 JSONArray weak_persistent_handles(&obj,
"weakPersistentHandles");
4971 thread, &weak_persistent_handles);
5016 ASSERT(lookup_result !=
nullptr);
5017 if (obj->
ptr() != Object::sentinel().ptr()) {
5018#if !defined(DART_PRECOMPILED_RUNTIME)
5021 if (obj->IsScript()) {
5023 if (!
script.HasSource() &&
script.IsPartOfDartColonLibrary() &&
5026 const intptr_t kernel_buffer_len =
5028 script.LoadSourceFromKernel(kernel_buffer, kernel_buffer_len);
5047 const char*
id =
js->LookupParam(
"objectId");
5048 if (
id ==
nullptr) {
5052 if (
js->HasParam(
"offset")) {
5060 if (
js->HasParam(
"count")) {
5085 if (bpt !=
nullptr) {
5103 const char*
id =
js->LookupParam(
"objectId");
5121 if (bpt !=
nullptr) {
5123 jsobj.
AddProperty(
"type",
"ImplementationFields");
5124 JSONArray jsarr_fields(&jsobj,
"fields");
5162 table->PrintToJSONObject(&jsobj);
5171 bool only_with_instantiations =
false;
5172 if (
js->ParamIs(
"onlyWithInstantiations",
"true")) {
5173 only_with_instantiations =
true;
5178 zone, object_store->canonical_type_arguments());
5179 const intptr_t table_size = typeargs_table.
NumEntries();
5180 const intptr_t table_used = typeargs_table.
NumOccupied();
5181 const Array& typeargs_array =
5187 jsobj.
AddProperty(
"canonicalTypeArgumentsTableSize", table_size);
5188 jsobj.
AddProperty(
"canonicalTypeArgumentsTableUsed", table_used);
5189 JSONArray members(&jsobj,
"typeArguments");
5190 for (intptr_t
i = 0;
i < table_used;
i++) {
5191 typeargs ^= typeargs_array.
At(
i);
5192 if (!typeargs.
IsNull()) {
5213 jsobj.
AddProperty(
"_privateMajor",
static_cast<intptr_t
>(0));
5214 jsobj.
AddProperty(
"_privateMinor",
static_cast<intptr_t
>(0));
5253 if (embedder_information_callback_ !=
nullptr) {
5260 embedder_information_callback_(&
info);
5262 if (
info.name !=
nullptr) {
5265 if (
info.max_rss >= 0) {
5268 if (
info.current_rss >= 0) {
5286#if defined(DART_PRECOMPILED_RUNTIME)
5293 free(features_string);
5294 jsobj.
AddProperty(
"_profilerMode", FLAG_profile_vm ?
"VM" :
"Dart");
5306 JSONArray jsarr(&jsobj,
"systemIsolates");
5311 JSONArray jsarr_isolate_groups(&jsobj,
"isolateGroups");
5314 jsarr_isolate_groups.AddValue(isolate_group);
5319 JSONArray jsarr_isolate_groups(&jsobj,
"systemIsolateGroups");
5326 jsarr_isolate_groups.AddValue(isolate_group);
5343 static const char*
Name() {
return "UriMappingTraits"; }
5347 const String& a_str = String::Cast(
a);
5348 const String& b_str = String::Cast(
b);
5351 return a_str.
Equals(b_str);
5369 intptr_t num_libs =
libs.Length();
5376#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_MACOS)
5377 String& tmp = thread->StringHandle();
5379 for (intptr_t
i = 0;
i < num_libs; ++
i) {
5382 intptr_t num_scripts =
scripts.Length();
5383 for (intptr_t j = 0; j < num_scripts; ++j) {
5386 resolved_uri ^=
script.resolved_url();
5390#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_MACOS)
5401 object_store->set_uri_to_resolved_uri_map(uri_to_resolved_uri.
Release());
5402 object_store->set_resolved_uri_to_uri_map(resolved_uri_to_uri.
Release());
5404 object_store->set_last_libraries_count(
count);
5409 bool lookup_resolved) {
5415 Smi& last_libraries_count =
5416 Smi::Handle(zone, object_store->last_libraries_count());
5417 if ((object_store->uri_to_resolved_uri_map() ==
Array::null()) ||
5418 (object_store->resolved_uri_to_uri_map() ==
Array::null()) ||
5419 (last_libraries_count.
Value() !=
libs.Length())) {
5422 const char* uris_arg =
js->LookupParam(
"uris");
5423 if (uris_arg ==
nullptr) {
5431 if (uris_length < 0) {
5436 UriMapping map(lookup_resolved ? object_store->uri_to_resolved_uri_map()
5437 : object_store->resolved_uri_to_uri_map());
5445 for (intptr_t
i = 0;
i < uris.
Length(); ++
i) {
5447 res ^=
map.GetOrNull(uri);
5448#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_MACOS)
5452 String& lower_case_uri = thread->StringHandle();
5454 res ^=
map.GetOrNull(lower_case_uri);
5506 const char*
mode =
js->LookupParam(
"mode");
5507 if (
mode ==
nullptr) {
5534 bool state_changed =
false;
5535 const char* exception_pause_mode =
js->LookupParam(
"exceptionPauseMode");
5536 if (exception_pause_mode !=
nullptr) {
5546 state_changed =
true;
5549 const char* pause_isolate_on_exit =
js->LookupParam(
"shouldPauseOnExit");
5550 if (pause_isolate_on_exit !=
nullptr) {
5553 state_changed =
true;
5573 const char* bpt_id =
js->LookupParam(
"breakpointId");
5579 if (bpt ==
nullptr) {
5586 event.set_breakpoint(bpt);
5608 const char* flag_name =
js->LookupParam(
"name");
5609 if (flag_name ==
nullptr) {
5613 const char* flag_value =
js->LookupParam(
"value");
5614 if (flag_value ==
nullptr) {
5622 jsobj.
AddProperty(
"message",
"Cannot set flag: flag not found");
5628 const uintptr_t kProfilePeriodIndex = 3;
5629 const uintptr_t kProfilerIndex = 4;
5630 const char* kAllowedFlags[] = {
5631 "pause_isolates_on_start",
5632 "pause_isolates_on_exit",
5633 "pause_isolates_on_unhandled_exceptions",
5638 bool allowed =
false;
5639 bool profile_period =
false;
5640 bool profiler =
false;
5642 if (strcmp(flag_name, kAllowedFlags[
i]) == 0) {
5644 profile_period = (
i == kProfilePeriodIndex);
5645 profiler = (
i == kProfilerIndex);
5653 jsobj.
AddProperty(
"message",
"Cannot set flag: cannot change at runtime");
5657 const char*
error =
nullptr;
5660 if (profile_period) {
5664 }
else if (profiler) {
5670 event.set_flag_name(flag_name);
5671 event.set_flag_new_value(flag_value);
5689 const char* lib_id =
js->LookupParam(
"libraryId");
5693 const bool is_debuggable =
5695 if (obj.IsLibrary()) {
5696 const Library& lib = Library::Cast(obj);
5728 const char* name_param =
js->LookupParam(
"name");
5747 const char* class_id =
js->LookupParam(
"classId");
5773#define DEFINE_ADD_VALUE_F(id) \
5774 internals.AddValueF("classes/%" Pd, static_cast<intptr_t>(id));
5775#define DEFINE_ADD_VALUE_F_CID(clazz) DEFINE_ADD_VALUE_F(k##clazz##Cid)
5786 for (intptr_t
id = kAbstractTypeCid;
id <= kTypeParameterCid; ++
id) {
5801 for (intptr_t
id = kIntegerCid;
id <= kMintCid; ++
id) {
5827#define DEFINE_ADD_MAP_KEY(clazz) \
5828 {JSONArray internals(&map, #clazz); \
5829 DEFINE_ADD_VALUE_F_CID(TypedData##clazz) \
5830 DEFINE_ADD_VALUE_F_CID(TypedData##clazz##View) \
5831 DEFINE_ADD_VALUE_F_CID(ExternalTypedData##clazz) \
5832 DEFINE_ADD_VALUE_F_CID(UnmodifiableTypedData##clazz##View) \
5835#undef DEFINE_ADD_MAP_KEY
5836#define DEFINE_ADD_MAP_KEY(clazz) \
5837 {JSONArray internals(&map, #clazz); \
5838 DEFINE_ADD_VALUE_F_CID(Ffi##clazz) \
5841#undef DEFINE_ADD_MAP_KEY
5842#undef DEFINE_ADD_VALUE_F_CID
5843#undef DEFINE_ADD_VALUE_F
5899#if defined(SUPPORT_PERFETTO)
5900 {
"getPerfettoCpuSamples", GetPerfettoCpuSamples,
5902 {
"getPerfettoVMTimeline", GetPerfettoVMTimeline,
5998 set_vm_timeline_flags_params },
6008 for (intptr_t
i = 0;
i < num_methods;
i++) {
6010 if (strcmp(method_name, method.
name) == 0) {
static int step(int x, SkScalar min, SkScalar max)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
ax::mojom::Event event_type
#define CLASS_LIST_MAPS(V)
#define CLASS_LIST_STRINGS(V)
#define CLASS_LIST_ARRAYS(V)
#define CLASS_LIST_SETS(V)
#define CLASS_LIST_FFI(V)
#define CLASS_LIST_TYPED_DATA(V)
void RunWithLockedWeakPersistentHandles(std::function< void(FinalizablePersistentHandles &)> fun)
void RunWithLockedPersistentHandles(std::function< void(PersistentHandles &)> fun)
static ObjectPtr UnwrapHandle(Dart_Handle object)
static intptr_t element_offset(intptr_t index)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
static constexpr intptr_t kBytesPerElement
ObjectPtr At(intptr_t index) const
static ArrayPtr MakeFixedLength(const GrowableObjectArray &growable_array, bool unique=false)
void SetAt(intptr_t index, const Object &value) const
void Insert(typename KeyValueTrait::Pair kv)
const T & At(intptr_t index) const
BoolParameter(const char *name, bool required)
static bool Parse(const char *value, bool default_value=false)
virtual bool Validate(const char *value) const
static const Bool & False()
static const Bool & True()
void PrintJSON(JSONStream *stream)
ClassPtr At(intptr_t cid) const
bool IsValidIndex(intptr_t cid) const
bool CollectInstancesFor(intptr_t cid)
bool HasValidClassAt(intptr_t cid) const
LibraryPtr library() const
FunctionPtr InvocationDispatcherFunctionFromIndex(intptr_t idx) const
ObjectPtr Invoke(const String &selector, const Array &arguments, const Array &argument_names, bool respect_reflectable=true, bool check_is_entrypoint=false) const
StringPtr ScrubbedName() const
GrowableObjectArrayPtr direct_implementors_unsafe() const
void SetTraceAllocation(bool trace_allocation) const
ArrayPtr OffsetToFieldMap(ClassTable *class_table=nullptr) const
TypePtr DeclarationType() const
GrowableObjectArrayPtr direct_subclasses_unsafe() const
FieldPtr LookupField(const String &name) const
StringPtr UserVisibleName() const
FunctionPtr ImplicitClosureFunctionFromIndex(intptr_t idx) const
intptr_t NumTypeParameters(Thread *thread) const
static FunctionPtr ClosureFunctionFromIndex(intptr_t idx)
static CodePtr FindCode(uword pc, int64_t timestamp)
static intptr_t variable_offset(intptr_t context_index)
static constexpr intptr_t kBytesPerElement
static ObjectPtr LookupOpenPorts()
virtual bool ValidateObject(const Object &value) const
DartListParameter(const char *name, bool required)
DartStringParameter(const char *name, bool required)
virtual bool ValidateObject(const Object &value) const
static Dart_FileWriteCallback file_write_callback()
static Dart_FileOpenCallback file_open_callback()
static int64_t UptimeMillis()
static char * FeaturesString(IsolateGroup *isolate_group, bool is_vm_snapshot, Snapshot::Kind kind)
static Dart_FileCloseCallback file_close_callback()
ActivationFrame * FrameAt(int i) const
Breakpoint * SetBreakpointAtEntry(const Function &target_function, bool single_shot)
bool SetBreakpointState(Breakpoint *bpt, bool enable)
Breakpoint * SetBreakpointAtActivation(const Instance &closure, bool single_shot)
bool SetResumeAction(ResumeAction action, intptr_t frame_index=1, const char **error=nullptr)
void RemoveBreakpoint(intptr_t bp_id)
DebuggerStackTrace * StackTrace()
DebuggerStackTrace * AsyncAwaiterStackTrace()
const ServiceEvent * PauseEvent() const
void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info)
Breakpoint * GetBreakpointById(intptr_t id)
@ kStepOverAsyncSuspension
Breakpoint * SetBreakpointAtLineCol(const String &script_url, intptr_t line_number, intptr_t column_number)
void EnterSingleStepMode()
void set_callback(Dart_ServiceRequestCallback callback)
const char * name() const
EmbedderServiceHandler(const char *name)
Dart_ServiceRequestCallback callback() const
void set_next(EmbedderServiceHandler *next)
~EmbedderServiceHandler()
EmbedderServiceHandler * next() const
void set_user_data(void *user_data)
EnumListParameter(const char *name, bool required, const char *const *enums)
virtual bool Validate(const char *value) const
const char ** Parse(char *value) const
EnumParameter(const char *name, bool required, const char *const *enums)
virtual bool Validate(const char *value) const
virtual const char * ToErrorCString() const
static DART_NORETURN void PropagateError(const Error &error)
static ExternalTypedDataPtr NewFinalizeWithFree(uint8_t *data, intptr_t len)
Dart_HandleFinalizer callback() const
intptr_t external_size() const
void VisitHandles(HandleVisitor *visitor)
static bool SetFlag(const char *name, const char *value, const char **error)
static void PrintJSON(JSONStream *js)
static Flag * Lookup(const char *name)
virtual Direction VisitObject(ObjectGraph::StackIterator *it)
GetInstancesVisitor(ZoneGrowableHandlePtrArray< Object > *storage, intptr_t limit)
void Add(const Object &value, Heap::Space space=Heap::kNew) const
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
bool UpdateOrInsert(const Object &key, const Object &value) const
StorageTraits::ArrayHandle & Release()
intptr_t NumOccupied() const
intptr_t NumEntries() const
static ArrayPtr ToArray(const Table &table, bool include_payload)
void CollectAllGarbage(GCReason reason=GCReason::kFull, bool compact=false)
void CollectGarbage(Thread *thread, GCType type, GCReason reason)
static const char * hardware()
virtual bool Validate(const char *value) const
IdParameter(const char *name, bool required)
static int64_t Parse(const char *value, int64_t default_value=-1)
virtual bool Validate(const char *value) const
Int64Parameter(const char *name, bool required)
static IntegerPtr New(const String &str, Heap::Space space=Heap::kNew)
ObjectStore * object_store() const
static IsolateGroup * Current()
Dart_LibraryTagHandler library_tag_handler() const
ClassTable * class_table() const
bool is_system_isolate_group() const
ApiState * api_state() const
IsolateGroupSource * source() const
bool ReloadSources(JSONStream *js, bool force_reload, const char *root_script_url=nullptr, const char *packages_url=nullptr, bool dont_delete_reload_context=false)
void PrintJSON(JSONStream *stream, bool ref=true)
static void RunWithIsolateGroup(uint64_t id, std::function< void(IsolateGroup *)> action, std::function< void()> not_found)
void UpdateLastAllocationProfileAccumulatorResetTimestamp()
bool is_vm_isolate() const
static void ForEach(std::function< void(IsolateGroup *)> action)
void PrintMemoryUsageJSON(JSONStream *stream)
void PrintToJSONObject(JSONObject *jsobj)
bool IsSystemIsolate(Isolate *isolate) const
void set_should_pause_post_service_request(bool value)
ErrorPtr sticky_error() const
static Isolate * Current()
IsolateObjectStore * isolate_object_store() const
VMTagCounters * vm_tag_counters()
static void VisitIsolates(IsolateVisitor *visitor)
Debugger * debugger() const
void PrintJSON(JSONStream *stream, bool ref=true)
MessageHandler * message_handler() const
void PrintPauseEventJSON(JSONStream *stream)
bool is_vm_isolate() const
void PrintMemoryUsageJSON(JSONStream *stream)
void SendInternalLibMessage(LibMsgId msg_id, uint64_t capability)
ObjectIdRing * EnsureObjectIdRing()
ErrorPtr PausePostRequest()
bool should_pause_post_service_request() const
IsolateGroup * group() const
bool is_service_registered() const
void set_name(const char *name)
uint64_t pause_capability() const
void AddValueNull() const
void AddValue(bool b) const
void AddProperty64(const char *name, int64_t i) const
void AddProperty(const char *name, bool b) const
void AddPropertyBase64(const char *name, const uint8_t *bytes, intptr_t length) const
void AddPropertyTimeMicros(const char *name, int64_t micros) const
void AddPropertyTimeMillis(const char *name, int64_t millis) const
void AddPropertyF(const char *name, const char *format,...) const PRINTF_ATTRIBUTE(3
static Dart_KernelCompilationResult CompileExpressionToKernel(const uint8_t *platform_kernel, intptr_t platform_kernel_size, const char *expression, const Array &definitions, const Array &definition_types, const Array &type_definitions, const Array &type_bounds, const Array &type_defaults, const char *library_url, const char *klass, const char *method, TokenPosition token_pos, char const *script_uri, bool is_static)
ArrayPtr LoadedScripts() const
ObjectPtr Invoke(const String &selector, const Array &arguments, const Array &argument_names, bool respect_reflectable=true, bool check_is_entrypoint=false) const
ClassPtr toplevel_class() const
void set_debuggable(bool value) const
StringPtr private_key() const
ObjectPtr CurrentValue() const
ObjectPtr CurrentKey() const
bool is_paused_on_start() const
void set_should_pause_on_start(bool should_pause_on_start)
void set_should_pause_on_exit(bool should_pause_on_exit)
bool is_paused_on_exit() const
bool should_pause_on_start() const
Message * FindMessageById(intptr_t id)
const char * name() const
virtual bool ValidateObject(const Object &value) const
virtual bool Validate(const char *value) const
virtual void PrintError(const char *name, const char *value, JSONStream *js) const
MethodParameter(const char *name, bool required)
virtual void PrintErrorObject(const char *name, const Object &value, JSONStream *js) const
virtual ~MethodParameter()
static const char * LookupSymbolName(uword pc, uword *start)
static void FreeSymbolName(const char *name)
virtual bool ValidateObject(const Object &value) const
virtual bool Validate(const char *value) const
NoSuchParameter(const char *name)
static const char * Name()
static int64_t GetCurrentTimeMillis()
static int64_t GetCurrentMonotonicMicros()
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static bool StringToInt64(const char *str, int64_t *value)
static intptr_t ProcessId()
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
ObjectPtr GetObjectForId(int32_t id, LookupResult *kind)
int32_t GetIdForObject(ObjectPtr raw_obj, IdPolicy policy=kAllocateId)
intptr_t GetClassId() const
bool IsPseudoObject() const
void PrintToJSONObject(JSONObject *jsobj)
void PrintJSON(JSONStream *stream, bool ref=true) const
intptr_t GetClassId() const
virtual const char * ToCString() const
static ObjectPtr RawCast(ObjectPtr obj)
void PrintImplementationFields(JSONStream *stream) const
const char * FieldNameForOffset(intptr_t cid, intptr_t offset)
intptr_t UsedInWords() const
intptr_t CapacityInWords() const
static intptr_t CachedSize()
void VisitHandle(uword addr) override
PersistentHandleVisitor(Thread *thread, JSONArray *handles)
void Append(FinalizablePersistentHandle *weak_persistent_handle)
void Append(PersistentHandle *persistent_handle)
void Visit(HandleVisitor *visitor)
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
static void PrintPortsForMessageHandler(MessageHandler *handler, JSONStream *stream)
static void PrintAllocationJSON(JSONStream *stream, const Class &cls, int64_t time_origin_micros, int64_t time_extent_micros)
static void ClearSamples()
static void PrintJSON(JSONStream *stream, int64_t time_origin_micros, int64_t time_extent_micros, bool include_code_samples)
static void UpdateRunningState()
static void UpdateSamplePeriod()
ArrayPtr GetFieldNames(Thread *thread) const
static constexpr intptr_t kBytesPerElement
intptr_t num_fields() const
static intptr_t field_offset(intptr_t index)
static FunctionPtr ResolveFunction(Zone *zone, const Class &receiver_class, const String &function_name)
virtual ~RingServiceIdZone()
ObjectIdRing::IdPolicy policy() const
void Init(ObjectIdRing *ring, ObjectIdRing::IdPolicy policy)
virtual char * GetServiceId(const Object &obj)
RunnableIsolateParameter(const char *name)
virtual bool Validate(const char *value) const
virtual void PrintError(const char *name, const char *value, JSONStream *js) const
intptr_t CapacityInWords() const
@ kTimelineStreamSubscriptionsUpdate
@ kDebuggerSettingsUpdate
ServiceIsolateVisitor(JSONArray *jsarr)
void VisitIsolate(Isolate *isolate)
virtual ~ServiceIsolateVisitor()
static const char * server_address()
static StreamInfo isolate_stream
static void SendEmbedderEvent(Isolate *isolate, const char *stream_id, const char *event_kind, const uint8_t *bytes, intptr_t bytes_len)
static void LogResponseSize(const char *method, JSONStream *js)
static ErrorPtr HandleRootMessage(const Array &message)
static StreamInfo timeline_stream
static void CancelStream(const char *stream_id)
static void HandleEvent(ServiceEvent *event, bool enter_safepoint=true)
static bool ListenStream(const char *stream_id, bool include_privates)
static StreamInfo debug_stream
static void SendEchoEvent(Isolate *isolate, const char *text)
static const uint8_t * dart_library_kernel()
static void SetGetServiceAssetsCallback(Dart_GetVMServiceAssetsArchive get_service_assets)
static bool HasDartLibraryKernelForSources()
static void SetDartLibraryKernelForSources(const uint8_t *kernel_bytes, intptr_t kernel_length)
static void SendExtensionEvent(Isolate *isolate, const String &event_kind, const String &event_data)
static void SetEmbedderStreamCallbacks(Dart_ServiceStreamListenCallback listen_callback, Dart_ServiceStreamCancelCallback cancel_callback)
static ErrorPtr HandleIsolateMessage(Isolate *isolate, const Array &message)
static ObjectPtr RequestAssets()
static void RegisterRootEmbedderCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
static void SendInspectEvent(Isolate *isolate, const Object &inspectee)
static StreamInfo vm_stream
static void RegisterIsolateEmbedderCallback(const char *name, Dart_ServiceRequestCallback callback, void *user_data)
static void PostError(const String &method_name, const Array ¶meter_keys, const Array ¶meter_values, const Instance &reply_port, const Instance &id, const Error &error)
static StreamInfo echo_stream
static StreamInfo logging_stream
static ErrorPtr HandleObjectRootMessage(const Array &message)
static int64_t CurrentRSS()
static StreamInfo profiler_stream
static void SendLogEvent(Isolate *isolate, int64_t sequence_number, int64_t timestamp, intptr_t level, const String &name, const String &message, const Instance &zone, const Object &error, const Instance &stack_trace)
static void CheckForPause(Isolate *isolate, JSONStream *stream)
static StreamInfo gc_stream
static void SendEventWithData(const char *stream_id, const char *event_type, intptr_t reservation, const char *metadata, intptr_t metadata_size, uint8_t *data, intptr_t data_size)
static void PrintJSONForEmbedderInformation(JSONObject *jsobj)
static StreamInfo extension_stream
static void SetEmbedderInformationCallback(Dart_EmbedderInformationCallback callback)
static bool EnableTimelineStreams(char *categories_list)
static StreamInfo heapsnapshot_stream
static intptr_t dart_library_kernel_length()
static void PrintJSONForVM(JSONStream *js, bool ref)
static SmiPtr New(intptr_t value)
static bool IsValid(int64_t value)
void PrintJSON(JSONStream *js, const Script &script, TokenPosition start_pos=TokenPosition::kMinSource, TokenPosition end_pos=TokenPosition::kMaxSource)
static const char * kPossibleBreakpointsStr
static const char * kCallSitesStr
static const char * kCoverageStr
static const char * kBranchCoverageStr
static const char * kProfileStr
void set_enabled(bool value)
void set_include_private_members(bool value)
virtual bool Validate(const char *value) const
StringParameter(const char *name, bool required)
static StringPtr ToLowerCase(const String &str, Heap::Space space=Heap::kNew)
bool Equals(const String &str) const
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static StringPtr SubString(const String &str, intptr_t begin_index, Heap::Space space=Heap::kNew)
static StringPtr DecodeIRI(const String &str)
static const char * ToCString(Thread *thread, StringPtr ptr)
static StringPtr FromUTF8(const uint8_t *utf8_array, intptr_t array_len, Heap::Space space=Heap::kNew)
SystemServiceIsolateVisitor(JSONArray *jsarr)
virtual ~SystemServiceIsolateVisitor()
void VisitIsolate(Isolate *isolate)
static Thread * Current()
void set_sticky_error(const Error &value)
Isolate * isolate() const
IsolateGroup * isolate_group() const
ErrorPtr sticky_error() const
static TokenPosition Deserialize(int32_t value)
bool HasInstantiations() const
AbstractTypePtr TypeAt(intptr_t index) const
static TypePtr DynamicType()
intptr_t ElementSizeInBytes() const
UInt64Parameter(const char *name, bool required)
virtual bool Validate(const char *value) const
static uint64_t Parse(const char *value, uint64_t default_value=0)
virtual bool Validate(const char *value) const
static uintptr_t Parse(const char *value)
UIntParameter(const char *name, bool required)
static UnwindErrorPtr New(const String &message, Heap::Space space=Heap::kNew)
static bool ReportStats()
static uword Hash(const Object &key)
static const char * Name()
static ObjectPtr NewKey(const String &str)
static bool IsMatch(const Object &a, const Object &b)
static char * StrDup(const char *s)
static T Minimum(T x, T y)
void PrintToJSONObject(JSONObject *obj)
static const char * String()
char * PrintToString(const char *format,...) PRINTF_ATTRIBUTE(2
char * MakeCopyOfStringN(const char *str, intptr_t len)
char * MakeCopyOfString(const char *str)
#define DEFINE_NAME(Name)
void(* Dart_FileWriteCallback)(const void *data, intptr_t length, void *stream)
@ Dart_KernelCompilationStatus_Ok
void(* Dart_FileCloseCallback)(void *stream)
struct _Dart_Handle * Dart_Handle
void *(* Dart_FileOpenCallback)(const char *name, bool write)
Dart_Handle(* Dart_GetVMServiceAssetsArchive)(void)
@ Dart_CObject_kExternalTypedData
const EmbeddedViewParams * params
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
Dart_NativeFunction function
#define HANDLESCOPE(thread)
#define ISOLATE_METRIC_LIST(V)
#define ISOLATE_GROUP_METRIC_LIST(V)
Visitor(Ts...) -> Visitor< Ts... >
static const MethodParameter *const get_allocation_profile_params[]
static void ActOnIsolateGroup(JSONStream *js, std::function< void(IsolateGroup *)> visitor)
static const MethodParameter *const get_ports_private_params[]
static const MethodParameter *const set_trace_class_allocation_params[]
static void TriggerEchoEvent(Thread *thread, JSONStream *js)
static void GetIsolateMetricList(Thread *thread, JSONStream *js)
static void LookupResolvedPackageUris(Thread *thread, JSONStream *js)
const ServiceMethodDescriptor * FindMethod(const char *method_name)
ObjectPtr ReadMessage(Thread *thread, Message *message)
static const MethodParameter *const get_source_report_params[]
static const char *const names[]
static void AddBreakpointWithScriptUri(Thread *thread, JSONStream *js)
static bool BuildScope(Thread *thread, JSONStream *js, const GrowableObjectArray &names, const GrowableObjectArray &values)
static void GetSourceReport(Thread *thread, JSONStream *js)
static void GetIsolateObjectStore(Thread *thread, JSONStream *js)
static const MethodParameter *const get_object_store_params[]
static constexpr intptr_t kCompressedWordSizeLog2
static void Evaluate(Thread *thread, JSONStream *js)
static const MethodParameter *const clear_vm_timeline_params[]
static const MethodParameter *const get_type_arguments_list_params[]
static void SetBreakpointState(Thread *thread, JSONStream *js)
static const MethodParameter *const get_isolate_metric_params[]
static void HandleNativeMetric(Thread *thread, JSONStream *js, const char *id)
constexpr intptr_t kBitsPerWord
static void GetTypeArgumentsList(Thread *thread, JSONStream *js)
static void RespondWithMalformedObject(Thread *thread, JSONStream *js)
static const MethodParameter *const pause_params[]
static void SetLibraryDebuggable(Thread *thread, JSONStream *js)
static StreamInfo *const streams_[]
static void ReloadSources(Thread *thread, JSONStream *js)
static void HandleNativeMetricsList(Thread *thread, JSONStream *js)
static const MethodParameter *const set_library_debuggable_params[]
static void LookupPackageUris(Thread *thread, JSONStream *js)
static void GetImplementationFields(Thread *thread, JSONStream *js)
static const MethodParameter *const get_implementation_fields_params[]
static const MethodParameter *const get_vm_timeline_params[]
static void GetObjectStore(Thread *thread, JSONStream *js)
static void PrintSentinel(JSONStream *js, SentinelType sentinel_type)
static bool CheckProfilerDisabled(Thread *thread, JSONStream *js)
static void GetClassList(Thread *thread, JSONStream *js)
static const MethodParameter *const add_breakpoint_at_entry_params[]
static void GetIsolateGroupMemoryUsage(Thread *thread, JSONStream *js)
static const MethodParameter *const get_scripts_params[]
static bool GetUnsignedIntegerId(const char *s, uintptr_t *id, int base=10)
static const MethodParameter *const lookup_resolved_package_uris_params[]
DART_EXPORT bool IsNull(Dart_Handle object)
static void SetStreamIncludePrivateMembers(Thread *thread, JSONStream *js)
static const MethodParameter *const add_breakpoint_at_activation_params[]
static const MethodParameter *const build_expression_evaluation_scope_params[]
static const MethodParameter *const compile_expression_params[]
static const MethodParameter *const get_isolate_object_store_params[]
static const MethodParameter *const collect_all_garbage_params[]
void * malloc(size_t size)
static const MethodParameter *const get_stack_params[]
T EnumMapper(const char *value, const char *const *enums, T *values)
static void GetIsolate(Thread *thread, JSONStream *js)
static const MethodParameter *const get_retaining_path_params[]
static const MethodParameter *const get_instances_as_list_params[]
static void GetMemoryUsage(Thread *thread, JSONStream *js)
static void RemoveBreakpoint(Thread *thread, JSONStream *js)
static void ClearCpuSamples(Thread *thread, JSONStream *js)
static ObjectPtr LookupHeapObjectMessage(Thread *thread, char **parts, int num_parts)
DART_EXPORT void Dart_PropagateError(Dart_Handle handle)
static const MethodParameter *const get_flag_list_params[]
static const MethodParameter *const invoke_params[]
static const MethodParameter *const get_tag_profile_params[]
static void PrintInboundReferences(Thread *thread, Object *target, intptr_t limit, JSONStream *js)
static void GetHeapMap(Thread *thread, JSONStream *js)
static void AddBreakpoint(Thread *thread, JSONStream *js)
static const MethodParameter *const enable_profiler_params[]
void(* ServiceMethodEntry)(Thread *thread, JSONStream *js)
ObjectPtr Invoke(const Library &lib, const char *name)
static void GetStack(Thread *thread, JSONStream *js)
static bool GetInteger64Id(const char *s, int64_t *id, int base=10)
static void SetTraceClassAllocation(Thread *thread, JSONStream *js)
static bool ParseCSVList(const char *csv_list, const GrowableObjectArray &values)
static const MethodParameter *const get_isolate_pause_event_params[]
static void GetInboundReferences(Thread *thread, JSONStream *js)
static intptr_t ParseJSONSet(Thread *thread, const char *str, ZoneCStringSet *elements)
static ObjectPtr LookupHeapObjectCode(char **parts, int num_parts)
static void GetIsolatePauseEvent(Thread *thread, JSONStream *js)
static void SetVMName(Thread *thread, JSONStream *js)
static ObjectPtr LookupHeapObjectLibraries(IsolateGroup *isolate_group, char **parts, int num_parts)
static Dart_ExceptionPauseInfo exception_pause_mode_values[]
static intptr_t GetProcessMemoryUsageHelper(JSONStream *js)
static const MethodParameter *const get_inbound_references_params[]
static const MethodParameter *const clear_cpu_samples_params[]
static bool GetCodeId(const char *s, int64_t *timestamp, uword *address)
static const MethodParameter *const evaluate_in_frame_params[]
static const MethodParameter *const get_process_memory_usage_params[]
static void GetVersion(Thread *thread, JSONStream *js)
static const MethodParameter *const get_class_list_params[]
static const MethodParameter *const get_vm_params[]
static intptr_t ParseJSONCollection(Thread *thread, const char *str, const Adder &add)
static void HandleCommonEcho(JSONObject *jsobj, JSONStream *js)
static bool ValidateParameters(const MethodParameter *const *parameters, JSONStream *js)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
static const MethodParameter *const set_flags_params[]
static const Debugger::ResumeAction step_enum_values[]
static const ServiceMethodDescriptor service_methods_[]
static bool GetHeapObjectCommon(Thread *thread, JSONStream *js, const char *id, Object *obj, ObjectIdRing::LookupResult *lookup_result)
static void ReportPauseOnConsole(ServiceEvent *event)
static void CompileExpression(Thread *thread, JSONStream *js)
static const MethodParameter *const reload_sources_params[]
static const MethodParameter *const request_heap_snapshot_params[]
static void PopulateUriMappings(Thread *thread)
static void BuildExpressionEvaluationScope(Thread *thread, JSONStream *js)
static const MethodParameter *const evaluate_params[]
TimelineOrSamplesResponseFormat
static const MethodParameter *const get_persistent_handles_params[]
static void GetTagProfile(Thread *thread, JSONStream *js)
static void Pause(Thread *thread, JSONStream *js)
static const MethodParameter *const get_isolate_group_memory_usage_params[]
static void PrintMissingParamError(JSONStream *js, const char *param)
void GetVMTimelineCommon(TimelineOrSamplesResponseFormat format, Thread *thread, JSONStream *js)
UnorderedHashMap< UriMappingTraits > UriMapping
static const MethodParameter *const get_ports_params[]
static const MethodParameter *const set_exception_pause_mode_params[]
static bool IsAlpha(char c)
static void EvaluateInFrame(Thread *thread, JSONStream *js)
static ObjectPtr LookupHeapObject(Thread *thread, const char *id_original, ObjectIdRing::LookupResult *result)
static void AddParentFieldToResponseBasedOnRecord(Thread *thread, Array *field_names_handle, String *name_handle, const JSONObject &jsresponse, const Record &record, const intptr_t field_slot_offset)
static const MethodParameter *const evaluate_compiled_expression_params[]
static bool ParseScope(const char *scope, GrowableArray< const char * > *names, GrowableArray< const char * > *ids)
static void GetVMTimelineMicros(Thread *thread, JSONStream *js)
static void EvaluateCompiledExpression(Thread *thread, JSONStream *js)
static const MethodParameter *const get_memory_usage_params[]
constexpr intptr_t kInt32Size
static void Finalizer(void *isolate_callback_data, void *buffer)
static const MethodParameter *const get_version_params[]
static const MethodParameter *const set_breakpoint_state_params[]
static ObjectPtr LookupClassMembers(Thread *thread, const Class &klass, char **parts, int num_parts)
static const MethodParameter *const get_heap_map_params[]
constexpr intptr_t kFirstInternalOnlyCid
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
static void GetPortsPrivate(Thread *thread, JSONStream *js)
static void EnableProfiler()
static void GetAllocationProfilePublic(Thread *thread, JSONStream *js)
static void GetDefaultClassesAliases(Thread *thread, JSONStream *js)
static void RespondWithMalformedJson(Thread *thread, JSONStream *js)
static bool IsWhitespace(char c)
static const MethodParameter *const kill_params[]
static void PrintInvalidParamError(JSONStream *js, const char *param)
static void Kill(Thread *thread, JSONStream *js)
static bool IsAlphaOrDollar(char c)
static const MethodParameter *const add_breakpoint_params[]
static void Echo(Thread *thread, JSONStream *js)
ExternalTypedDataPtr DecodeKernelBuffer(const char *kernel_buffer_base64)
static const char *const exception_pause_mode_names[]
static void GetReachableSize(Thread *thread, JSONStream *js)
static const char * ScanUntilDash(const char *s)
static const MethodParameter *const get_allocation_traces_params[]
static void LookupScriptUrisImpl(Thread *thread, JSONStream *js, bool lookup_resolved)
static void GetIsolateMetric(Thread *thread, JSONStream *js)
static const char * GetVMName()
static void AddBreakpointCommon(Thread *thread, JSONStream *js, const String &script_uri)
static void AddBreakpointAtEntry(Thread *thread, JSONStream *js)
static const MethodParameter *const set_stream_include_private_members_params[]
static bool IsValidClassId(Isolate *isolate, intptr_t cid)
static const MethodParameter *const get_vm_timeline_micros_params[]
constexpr intptr_t kWordSize
static void UnmarkClasses()
static void SetIsolatePauseMode(Thread *thread, JSONStream *js)
static void GetCpuSamples(Thread *thread, JSONStream *js)
static const MethodParameter *const get_reachable_size_params[]
static void GetRetainingPath(Thread *thread, JSONStream *js)
static void Resume(Thread *thread, JSONStream *js)
static void SetFlag(Thread *thread, JSONStream *js)
static const MethodParameter *const resume_params[]
std::unique_ptr< Message > WriteApiMessage(Zone *zone, Dart_CObject *obj, Dart_Port dest_port, Message::Priority priority)
static void GetInstancesAsList(Thread *thread, JSONStream *js)
static void GetProcessMemoryUsage(Thread *thread, JSONStream *js)
static void GetVM(Thread *thread, JSONStream *js)
static ClassPtr GetClassForId(Isolate *isolate, intptr_t cid)
static void PrintRetainingPath(Thread *thread, Object *obj, intptr_t limit, JSONStream *js)
static ObjectPtr LookupObjectId(Thread *thread, const char *arg, ObjectIdRing::LookupResult *kind)
static void CollectAllGarbage(Thread *thread, JSONStream *js)
static const MethodParameter *const get_instances_params[]
static void GetRetainedSize(Thread *thread, JSONStream *js)
static const MethodParameter *const get_default_classes_aliases_params[]
static void GetVMTimeline(Thread *thread, JSONStream *js)
static void GetPorts(Thread *thread, JSONStream *js)
static bool IsAlphaNumOrDollar(char c)
static void SetExceptionPauseMode(Thread *thread, JSONStream *js)
static bool IsAlphaNum(char c)
static const MethodParameter *const set_name_params[]
static void MarkClasses(const Class &root, bool include_subclasses, bool include_implementors)
static void CollectStringifiedType(Thread *thread, Zone *zone, const AbstractType &type, const GrowableObjectArray &output)
static bool IsObjectIdChar(char c)
static void GetObject(Thread *thread, JSONStream *js)
static void GetAllocationProfileImpl(Thread *thread, JSONStream *js, bool internal)
static const MethodParameter *const get_isolate_params[]
static void GetPersistentHandles(Thread *thread, JSONStream *js)
static const MethodParameter *const lookup_package_uris_params[]
static const MethodParameter *const get_cpu_samples_params[]
static const MethodParameter *const get_vm_timeline_flags_params[]
static const MethodParameter *const remove_breakpoint_params[]
bool IsInternalOnlyClassId(intptr_t index)
static bool ContainsNonInstance(const Object &obj)
static bool GetPrefixedIntegerId(const char *s, const char *prefix, intptr_t *service_id)
static int8_t data[kExtLength]
static void GetScripts(Thread *thread, JSONStream *js)
static const MethodParameter *const get_retained_size_params[]
static void GetFlagList(Thread *thread, JSONStream *js)
static bool GetIntegerId(const char *s, intptr_t *id, int base=10)
static const MethodParameter *const set_isolate_pause_mode_params[]
static void RequestHeapSnapshot(Thread *thread, JSONStream *js)
static const MethodParameter *const get_isolate_metric_list_params[]
static void GetCpuSamplesCommon(TimelineOrSamplesResponseFormat format, Thread *thread, JSONStream *js)
static void PrintSuccess(JSONStream *js)
static void SetVMTimelineFlags(Thread *thread, JSONStream *js)
static const char *const step_enum_names[]
intptr_t ParseJSONArray(Thread *thread, const char *str, const GrowableObjectArray &elements)
static Breakpoint * LookupBreakpoint(Isolate *isolate, const char *id, ObjectIdRing::LookupResult *result)
static void GetVMTimelineFlags(Thread *thread, JSONStream *js)
static const MethodParameter *const get_object_params[]
static const MethodParameter *const get_isolate_group_params[]
uint8_t * DecodeBase64(const char *str, intptr_t *out_decoded_len)
static void GetAllocationProfile(Thread *thread, JSONStream *js)
static const MethodParameter *const add_breakpoint_with_script_uri_params[]
static void AddBreakpointAtActivation(Thread *thread, JSONStream *js)
@ kInvalidExceptionPauseInfo
@ kPauseOnUnhandledExceptions
static void GetIsolateGroup(Thread *thread, JSONStream *js)
constexpr intptr_t kLastInternalOnlyCid
static void PrintUnrecognizedMethodError(JSONStream *js)
static void GetAllocationTraces(Thread *thread, JSONStream *js)
static void ClearVMTimeline(Thread *thread, JSONStream *js)
static const MethodParameter *const set_vm_name_params[]
static ObjectPtr LookupHeapObjectTypeArguments(Thread *thread, char **parts, int num_parts)
static ObjectPtr LookupHeapObjectClasses(Thread *thread, char **parts, int num_parts)
static const char *const report_enum_names[]
DECLARE_FLAG(bool, show_invisible_frames)
static void SetName(Thread *thread, JSONStream *js)
static bool CheckDebuggerDisabled(Thread *thread, JSONStream *js)
@ kExpressionCompilationError
@ kInvalidTimelineRequest
static void GetInstances(Thread *thread, JSONStream *js)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network policy
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
std::function< void()> closure
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
#define DEFINE_ADD_MAP_KEY(clazz)
#define RUNNABLE_ISOLATE_PARAMETER
#define DEFINE_ADD_VALUE_F(id)
#define DEFINE_ADD_VALUE_F_CID(clazz)
#define ISOLATE_GROUP_PARAMETER
#define NO_ISOLATE_PARAMETER
#define ADD_METRIC(type, variable, name, unit)
#define ISOLATE_PARAMETER
#define ISOLATE_GROUP_SERVICE_ID_FORMAT_STRING
#define SERVICE_PROTOCOL_MAJOR_VERSION
#define ISOLATE_SERVICE_ID_FORMAT_STRING
#define SERVICE_PROTOCOL_MINOR_VERSION
#define ISOLATE_GROUP_SERVICE_ID_PREFIX
Dart_KernelCompilationStatus status
Dart_HandleFinalizer callback
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@91 as_external_typed_data
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values
const String * event_data
const String * event_kind
const Instance * stack_trace
const MethodParameter *const * parameters
const ServiceMethodEntry entry
#define ARRAY_SIZE(array)