30 const char* protocol_type,
33 bool same_type = (strcmp(protocol_type, vm_type) == 0);
42 if (!ref || IsInstance() ||
IsNull()) {
48 if (
ptr()->IsHeapObject()) {
96 jsobj.AddProperty(
"type",
"null");
100 jsobj.AddFixedServiceId(
"classes/%" Pd "",
id());
105 if (!script.IsNull()) {
112 if (num_type_params > 0) {
113 JSONArray jsarr(&jsobj,
"typeParameters");
115 for (intptr_t
i = 0;
i < num_type_params; ++
i) {
117 jsarr.AddValue(type_param);
126 jsobj.AddProperty(
"error", err);
129 jsobj.AddProperty(
"const",
is_const());
130 jsobj.AddProperty(
"isSealed",
is_sealed());
134 jsobj.AddProperty(
"isFinal",
is_final());
137 jsobj.AddProperty(
"_patch",
false);
141 if (!superClass.IsNull()) {
142 jsobj.AddProperty(
"super", superClass);
145 if (!superType.IsNull()) {
146 jsobj.AddProperty(
"superType", superType);
151 mix ^= interface_array.At(interface_array.Length() - 1);
152 jsobj.AddProperty(
"mixin", mix);
155 JSONArray interfaces_array(&jsobj,
"interfaces");
157 if (!interface_array.IsNull()) {
158 for (intptr_t
i = 0;
i < interface_array.Length(); ++
i) {
159 interface_type ^= interface_array.At(
i);
160 interfaces_array.AddValue(interface_type);
165 JSONArray fields_array(&jsobj,
"fields");
168 if (!field_array.IsNull()) {
169 for (intptr_t
i = 0;
i < field_array.Length(); ++
i) {
170 field ^= field_array.At(
i);
171 fields_array.AddValue(field);
176 JSONArray functions_array(&jsobj,
"functions");
179 if (!function_array.IsNull()) {
180 for (intptr_t
i = 0;
i < function_array.Length();
i++) {
187 JSONArray subclasses_array(&jsobj,
"subclasses");
188 const GrowableObjectArray& subclasses =
190 if (!subclasses.IsNull()) {
192 for (intptr_t
i = 0;
i < subclasses.Length(); ++
i) {
195 subclass ^= subclasses.At(
i);
196 subclasses_array.AddValue(subclass);
208 jsobj.AddServiceId(*
this);
219 const JSONArray& jsarr_fields)
const {}
227 Zone* zone = thread->zone();
228 auto object_store = thread->isolate_group()->object_store();
230 zone, object_store->canonical_type_arguments());
233 typeargs_table.Release();
236 jsobj.AddServiceId(*
this);
244 JSONArray jsarr(&jsobj,
"types");
246 for (intptr_t
i = 0;
i <
Length();
i++) {
248 jsarr.AddValue(type_arg);
252 JSONArray jsarr(&jsobj,
"_instantiations");
253 Array& prior_instantiations =
Array::Handle(zone, instantiations());
256 for (
const auto& tuple :
table) {
259 JSONObject instantiation(&jsarr);
261 instantiation.AddProperty(
"instantiatorTypeArguments", type_args,
true);
263 instantiation.AddProperty(
"functionTypeArguments", type_args,
true);
265 instantiation.AddProperty(
"instantiated", type_args,
true);
271 const JSONArray& jsarr_fields)
const {}
278 const JSONArray& jsarr_fields)
const {}
284 const char* selector =
nullptr;
290 selector =
"closures";
293 selector =
"implicit_closures";
296 selector =
"dispatchers";
304 private_key.ToCString(), encoded_field_name);
312 ASSERT(selector !=
nullptr);
317 private_key.ToCString(), selector,
id);
331 private_key.ToCString(), encoded_name);
358 jsobj.AddProperty(
"owner", parent);
359 }
else if (!cls.
IsNull()) {
362 jsobj.AddProperty(
"owner", library);
364 jsobj.AddProperty(
"owner", cls);
369 jsobj.AddProperty(
"_kind", kind_string);
370 jsobj.AddProperty(
"static", is_static());
371 jsobj.AddProperty(
"const", is_const());
373 jsobj.AddProperty(
"abstract", is_abstract());
374 jsobj.AddProperty(
"_intrinsic", is_intrinsic());
375 jsobj.AddProperty(
"_native", is_native());
376 jsobj.AddProperty(
"isGetter",
kind() == UntaggedFunction::kGetterFunction);
377 jsobj.AddProperty(
"isSetter",
kind() == UntaggedFunction::kSetterFunction);
380 if (!script.IsNull()) {
381#if defined(DART_PRECOMPILED_RUNTIME)
394 jsobj.AddProperty(
"signature", sig);
397 if (!
code.IsNull()) {
398 jsobj.AddProperty(
"code",
code);
402 jsobj.AddProperty(
"_icDataArray", ics);
405 jsobj.AddProperty(
"_inlinable", is_inlinable());
408 if (!
code.IsNull()) {
409 jsobj.AddProperty(
"_unoptimizedCode",
code);
411 jsobj.AddProperty(
"_usageCounter", usage_counter());
412 jsobj.AddProperty(
"_optimizedCallSiteCount", optimized_call_site_count());
413 jsobj.AddProperty(
"_deoptimizations",
414 static_cast<intptr_t
>(deoptimization_counter()));
415 if ((
kind() == UntaggedFunction::kImplicitGetter) ||
416 (
kind() == UntaggedFunction::kImplicitSetter) ||
417 (
kind() == UntaggedFunction::kImplicitStaticGetter) ||
418 (
kind() == UntaggedFunction::kFieldInitializer)) {
420 if (!field.IsNull()) {
421 jsobj.AddProperty(
"_field", field);
427 const JSONArray& jsarr_fields)
const {}
434 const JSONArray& jsarr_fields)
const {}
442 if (cls.IsTopLevel()) {
445 jsobj.AddFixedServiceId(
"libraries/%s/fields/%s", private_key.ToCString(),
448 jsobj.AddFixedServiceId(
"classes/%" Pd "/fields/%s", cls.id(),
455 if (cls.IsTopLevel()) {
457 jsobj.AddProperty(
"owner", library);
459 jsobj.AddProperty(
"owner", cls);
463 jsobj.AddProperty(
"declaredType", declared_type);
464 jsobj.AddProperty(
"static",
is_static());
465 jsobj.AddProperty(
"final",
is_final());
466 jsobj.AddProperty(
"const",
is_const());
478 jsobj.AddProperty(
"staticValue", valueObj);
481 jsobj.AddProperty(
"_guardNullable",
is_nullable());
483 jsobj.AddProperty(
"_guardClass",
"unknown");
485 jsobj.AddProperty(
"_guardClass",
"dynamic");
490 jsobj.AddProperty(
"_guardClass", cls);
493 jsobj.AddProperty(
"_guardLength",
"unknown");
495 jsobj.AddProperty(
"_guardLength",
"variable");
513 jsobj.AddServiceId(*
this);
516 jsobj.AddFixedServiceId(
"libraries/%s/scripts/%s/%" Px64 "",
519 jsobj.AddPropertyStr(
"uri", uri);
520 jsobj.AddProperty(
"_kind",
"kernel");
526 jsobj.AddProperty(
"library", lib);
530 jsobj.AddProperty(
"columnOffset",
col_offset());
532 jsobj.AddPropertyStr(
"source",
source);
536 const GrowableObjectArray& lineNumberArray =
538 if (!lineNumberArray.IsNull() && (lineNumberArray.Length() > 0)) {
539 JSONArray tokenPosTable(&jsobj,
"tokenPosTable");
545 ASSERT(lineNumberArray.Length() > 0);
551 JSONArray lineInfo(&tokenPosTable);
555 if (
value.IsNull()) {
558 const Smi& smi = Smi::Cast(
value);
559 lineInfo.AddValue(smi.Value());
566 const JSONArray& jsarr_fields)
const {}
574 for (intptr_t
i = 0;
i < arr.
Length(); ++
i) {
582 for (intptr_t
i = 0;
i < arr.
Length(); ++
i) {
593 jsobj.AddFixedServiceId(
"libraries/%s",
id.
ToCString());
598 jsobj.AddPropertyStr(
"uri", library_url);
604 JSONArray jsarr(&jsobj,
"classes");
605 ClassDictionaryIterator class_iter(*
this);
607 while (class_iter.HasNext()) {
608 klass = class_iter.GetNextClass();
609 jsarr.AddValue(klass);
613 JSONArray jsarr(&jsobj,
"dependencies");
620 for (intptr_t
i = 0;
i <
imports.Length();
i++) {
622 if (ns.IsNull())
continue;
624 JSONObject jsdep(&jsarr);
625 jsdep.AddProperty(
"isDeferred",
false);
626 jsdep.AddProperty(
"isExport",
false);
627 jsdep.AddProperty(
"isImport",
true);
629 jsdep.AddProperty(
"target",
target);
635 for (intptr_t
i = 0;
i <
exports.Length();
i++) {
637 if (ns.IsNull())
continue;
639 JSONObject jsdep(&jsarr);
640 jsdep.AddProperty(
"isDeferred",
false);
641 jsdep.AddProperty(
"isExport",
true);
642 jsdep.AddProperty(
"isImport",
false);
644 jsdep.AddProperty(
"target",
target);
653 while (entries.HasNext()) {
654 entry = entries.GetNext();
655 if (entry.IsLibraryPrefix()) {
659 for (intptr_t
i = 0;
i <
imports.Length();
i++) {
661 if (ns.IsNull())
continue;
663 JSONObject jsdep(&jsarr);
664 jsdep.AddProperty(
"isDeferred",
prefix.is_deferred_load());
665 jsdep.AddProperty(
"isExport",
false);
666 jsdep.AddProperty(
"isImport",
true);
667 prefix_name =
prefix.name();
668 ASSERT(!prefix_name.IsNull());
669 jsdep.AddProperty(
"prefix", prefix_name.ToCString());
671 jsdep.AddProperty(
"target",
target);
679 JSONArray jsarr(&jsobj,
"variables");
682 while (entries.HasNext()) {
683 entry = entries.GetNext();
684 if (entry.IsField()) {
685 jsarr.AddValue(entry);
690 JSONArray jsarr(&jsobj,
"functions");
693 while (entries.HasNext()) {
694 entry = entries.GetNext();
695 if (entry.IsFunction()) {
696 const Function& func = Function::Cast(entry);
697 if (func.kind() == UntaggedFunction::kRegularFunction ||
698 func.kind() == UntaggedFunction::kGetterFunction ||
699 func.kind() == UntaggedFunction::kSetterFunction) {
700 jsarr.AddValue(func);
706 JSONArray jsarr(&jsobj,
"scripts");
709 for (intptr_t
i = 0;
i <
scripts.Length();
i++) {
717 const JSONArray& jsarr_fields)
const {}
724 const JSONArray& jsarr_fields)
const {}
731 const JSONArray& jsarr_fields)
const {}
738 const JSONArray& jsarr_fields)
const {}
745 const JSONArray& jsarr_fields)
const {}
752 const JSONArray& jsarr_fields)
const {}
759 const JSONArray& jsarr_fields)
const {}
765 jsobj.AddServiceId(*
this);
768 jsobj.AddProperty(
"target", obj);
772 const JSONArray& jsarr_fields)
const {}
777 jsobj.AddServiceId(*
this);
778 jsobj.AddProperty(
"length",
Length());
786 jsobj.AddProperty(
"offset",
offset);
789 jsobj.AddProperty(
"count",
count);
794 JSONArray jsarr(&jsobj,
"elements");
796 for (intptr_t index =
offset; index < limit; index++) {
798 jsarr.AddValue(element);
804 const JSONArray& jsarr_fields)
const {}
809 jsobj.AddServiceId(*
this);
810 jsobj.AddProperty(
"length",
Length());
816 JSONArray jsarr(&jsobj,
"_entries");
819 for (intptr_t
i = 0;
i <
Length();
i++) {
820 JSONObject jsentry(
stream);
823 case ObjectPool::EntryType::kTaggedObject:
825 jsentry.AddProperty(
"kind",
"Object");
826 jsentry.AddProperty(
"value", obj);
828 case ObjectPool::EntryType::kImmediate:
830 jsentry.AddProperty(
"kind",
"Immediate");
831 jsentry.AddPropertyF(
"value",
"0x%" Px, imm);
833 case ObjectPool::EntryType::kNativeFunction:
835 jsentry.AddProperty(
"kind",
"NativeFunction");
836 jsentry.AddPropertyF(
"value",
"0x%" Px, imm);
846 const JSONArray& jsarr_fields)
const {}
857 Iterator iter(*
this, UntaggedPcDescriptors::kAnyKind);
875 const JSONArray& jsarr_fields)
const {}
882 const JSONArray& jsarr_fields)
const {}
889 const JSONArray& jsarr_fields)
const {}
896 jsobj.AddServiceId(*
this);
900 JSONArray members(&jsobj,
"members");
902 for (intptr_t
i = 0;
i <
Length();
i++) {
903 UntaggedLocalVarDescriptors::VarInfo
info;
906 JSONObject var(&members);
907 var.AddProperty(
"name", var_name.ToCString());
908 var.AddProperty(
"index",
static_cast<intptr_t
>(
info.index()));
909 var.AddProperty(
"declarationTokenPos",
info.declaration_pos);
910 var.AddProperty(
"scopeStartTokenPos",
info.begin_pos);
911 var.AddProperty(
"scopeEndTokenPos",
info.end_pos);
912 var.AddProperty(
"scopeId",
static_cast<intptr_t
>(
info.scope_id));
918 const JSONArray& jsarr_fields)
const {}
925 const JSONArray& jsarr_fields)
const {}
930 jsobj.AddServiceId(*
this);
935 jsobj.AddProperty(
"_lowerLimit", lower_limit());
936 jsobj.AddProperty(
"_upperLimit", upper_limit());
940 const JSONArray& jsarr_fields)
const {}
945 jsobj.AddServiceId(*
this);
950 jsobj.AddProperty(
"_argumentsDescriptor",
955 const JSONArray& jsarr_fields)
const {}
960 jsobj.AddServiceId(*
this);
968 const JSONArray& jsarr_fields)
const {}
975 const JSONArray& jsarr_fields)
const {
982 jsobj.AddServiceId(*
this);
988 jsobj.AddProperty(
"_argumentsDescriptor",
1005 JSONArray cache_entries(&jsobj,
"cacheEntries");
1012 cls = class_table->At(
cid);
1024 JSONObject jsobj(
stream);
1032 const bool is_stub =
1035 jsobj.AddProperty(
"kind",
"Stub");
1037 jsobj.AddProperty(
"kind",
"Dart");
1041 if (obj.IsFunction()) {
1042 const Function& func = Function::Cast(obj);
1043 jsobj.AddProperty(
"_intrinsic", func.is_intrinsic());
1044 jsobj.AddProperty(
"_native", func.is_native());
1046 jsobj.AddProperty(
"_intrinsic",
false);
1047 jsobj.AddProperty(
"_native",
false);
1049 if (obj.IsFunction()) {
1050 jsobj.AddProperty(
"function", obj);
1053 JSONObject func(&jsobj,
"function");
1054 func.AddProperty(
"type",
"@Function");
1055 func.AddProperty(
"_kind",
"Stub");
1057 func.AddProperty(
"name",
vm_name);
1065 jsobj.AddProperty(
"_alive",
is_alive());
1069 JSONArray jsarr(&jsobj,
"_disassembly");
1072 DisassembleToJSONStream formatter(jsarr);
1077 if (!descriptors.IsNull()) {
1078 JSONObject
desc(&jsobj,
"_descriptors");
1079 descriptors.PrintToJSONObject(&
desc,
false);
1082 PrintJSONInlineIntervals(&jsobj);
1088 JSONObject jsobj(
stream);
1092 jsobj.AddServiceId(*
this);
1101 if (!parent_context.IsNull()) {
1102 jsobj.AddProperty(
"parent", parent_context);
1105 JSONArray jsarr(&jsobj,
"variables");
1107 for (intptr_t index = 0; index <
num_variables(); index++) {
1109 JSONObject jselement(&jsarr);
1110 jselement.AddProperty(
"value", var);
1115 const JSONArray& jsarr_fields)
const {}
1122 const JSONArray& jsarr_fields)
const {}
1126 if (
ptr() == Object::sentinel().
ptr()) {
1127 JSONObject jsobj(
stream);
1128 jsobj.AddProperty(
"type",
"Sentinel");
1129 jsobj.AddProperty(
"kind",
"NotInitialized");
1130 jsobj.AddProperty(
"valueAsString",
"<not initialized>");
1132 }
else if (
ptr() == Object::transition_sentinel().
ptr()) {
1133 JSONObject jsobj(
stream);
1134 jsobj.AddProperty(
"type",
"Sentinel");
1135 jsobj.AddProperty(
"kind",
"BeingInitialized");
1136 jsobj.AddProperty(
"valueAsString",
"<being initialized>");
1138 }
else if (
ptr() == Object::optimized_out().
ptr()) {
1139 JSONObject jsobj(
stream);
1140 jsobj.AddProperty(
"type",
"Sentinel");
1141 jsobj.AddProperty(
"kind",
"OptimizedOut");
1142 jsobj.AddProperty(
"valueAsString",
"<optimized out>");
1150 const JSONArray& jsarr_fields)
const {}
1153 JSONObject jsobj(
stream);
1155 jsobj.AddServiceId(*
this);
1161 jsobj.AddProperty(
"_mask",
mask());
1162 jsobj.AddProperty(
"_argumentsDescriptor",
1167 const JSONArray& jsarr_fields)
const {}
1170 JSONObject jsobj(
stream);
1172 jsobj.AddServiceId(*
this);
1180 const JSONArray& jsarr_fields)
const {}
1183 JSONObject jsobj(
stream);
1185 jsobj.AddServiceId(*
this);
1191 jsobj.AddProperty(
"_id",
static_cast<intptr_t
>(
id()));
1192 jsobj.AddProperty(
"_loaded",
loaded());
1197 const JSONArray& jsarr_fields)
const {}
1208 JSONObject jsobj(
stream);
1210 jsobj.AddProperty(
"kind",
"InternalError");
1211 jsobj.AddServiceId(*
this);
1216 const JSONArray& jsarr_fields)
const {}
1219 JSONObject jsobj(
stream);
1221 jsobj.AddProperty(
"kind",
"LanguageError");
1222 jsobj.AddServiceId(*
this);
1227 const JSONArray& jsarr_fields)
const {}
1230 JSONObject jsobj(
stream);
1232 jsobj.AddProperty(
"kind",
"UnhandledException");
1233 jsobj.AddServiceId(*
this);
1240 jsobj.AddProperty(
"exception",
instance);
1242 jsobj.AddProperty(
"stacktrace",
instance);
1246 const JSONArray& jsarr_fields)
const {}
1249 JSONObject jsobj(
stream);
1251 jsobj.AddProperty(
"kind",
"TerminationError");
1252 jsobj.AddServiceId(*
this);
1258 const JSONArray& jsarr_fields)
const {}
1262 bool include_id)
const {
1266 uint32_t hash_code = HeapSnapshotWriter::GetHeapSnapshotIdentityHash(
1294 for (intptr_t
i = classes.
length() - 1;
i >= 0;
i--) {
1295 field_array = classes[
i]->fields();
1296 if (!field_array.
IsNull()) {
1297 for (intptr_t j = 0; j < field_array.
Length(); j++) {
1298 field ^= field_array.
At(j);
1312 JSONArray jsarr(jsobj,
"_nativeFields");
1325 jsobj.AddProperty(
"kind",
"PlainInstance");
1340 intptr_t num_fields = 0;
1341 for (intptr_t
i = classes.
length() - 1;
i >= 0; --
i) {
1342 field_array ^= classes[
i]->fields();
1343 if (!field_array.
IsNull()) {
1344 for (intptr_t j = 0; j < field_array.
Length(); ++j) {
1345 field ^= field_array.
At(j);
1352 jsobj.AddProperty(
"length", num_fields);
1356 const JSONArray& jsarr_fields)
const {}
1363 const JSONArray& jsarr_fields)
const {
1368 JSONObject jsobj(
stream);
1370 jsobj.AddProperty(
"kind",
"Type");
1372 if (type_cls.DeclarationType() ==
ptr()) {
1373 intptr_t
cid = type_cls.id();
1374 jsobj.AddFixedServiceId(
"classes/%" Pd "/types/%d",
cid, 0);
1376 jsobj.AddServiceId(*
this);
1378 jsobj.AddProperty(
"typeClass", type_cls);
1386 if (!typeArgs.IsNull()) {
1387 jsobj.AddProperty(
"typeArguments", typeArgs);
1394 JSONObject jsobj(
stream);
1396 jsobj.AddProperty(
"kind",
"FunctionType");
1398 jsobj.AddProperty(
"returnType",
type);
1401 if (type_params_count > 0) {
1402 JSONArray arr(&jsobj,
"typeParameters");
1404 for (intptr_t
i = 0;
i < type_params_count; ++
i) {
1406 arr.AddValue(type_param);
1411 JSONArray jsarr(&jsobj,
"parameters");
1416 for (intptr_t
i = 0;
i < param_count; ++
i) {
1417 JSONObject param(&jsarr);
1419 param.AddProperty(
"parameterType",
type);
1420 bool fixed =
i < fixed_param_count;
1421 param.AddProperty(
"fixed", fixed);
1422 if (!fixed && has_named) {
1424 param.AddProperty(
"name",
name.ToCString());
1432 const JSONArray& jsarr_fields)
const {}
1435 JSONObject jsobj(
stream);
1437 jsobj.AddProperty(
"kind",
"RecordType");
1443 JSONArray jsarr(&jsobj,
"fields");
1446 const intptr_t num_fields =
NumFields();
1448 const intptr_t num_positional_fields = num_fields - field_names.Length();
1449 for (intptr_t index = 0; index < num_fields; ++index) {
1450 JSONObject jsfield(&jsarr);
1451 if (index < num_positional_fields) {
1452 jsfield.AddProperty(
"name", index + 1);
1454 name ^= field_names.At(index - num_positional_fields);
1455 jsfield.AddProperty(
"name",
name.ToCString());
1458 jsfield.AddProperty(
"value",
type);
1464 const JSONArray& jsarr_fields)
const {}
1467 JSONObject jsobj(
stream);
1469 jsobj.AddProperty(
"kind",
"TypeParameter");
1474 jsobj.AddProperty(
"parameterizedClass", Object::null_class());
1478 jsobj.AddProperty(
"parameterIndex",
index());
1480 jsobj.AddProperty(
"bound", upper_bound);
1484 const JSONArray& jsarr_fields)
const {}
1491 const JSONArray& jsarr_fields)
const {
1496 JSONObject jsobj(
stream);
1498 jsobj.AddProperty(
"kind",
"Int");
1499 jsobj.AddProperty(
"valueAsString",
ToCString());
1503 const JSONArray& jsarr_fields)
const {}
1506 JSONObject jsobj(
stream);
1508 jsobj.AddProperty(
"kind",
"Int");
1509 jsobj.AddFixedServiceId(
"objects/int-%" Pd "",
Value());
1510 jsobj.AddPropertyF(
"valueAsString",
"%" Pd "",
Value());
1522 JSONObject jsobj(
stream);
1524 jsobj.AddProperty(
"kind",
"Double");
1525 jsobj.AddProperty(
"valueAsString",
ToCString());
1529 const JSONArray& jsarr_fields)
const {}
1532 JSONObject jsobj(
stream);
1534 jsobj.AddProperty(
"kind",
"String");
1535 jsobj.AddProperty(
"length",
Length());
1538 const intptr_t kFixedCount = 128;
1539 if (jsobj.AddPropertyStr(
"valueAsString", *
this, 0, kFixedCount)) {
1540 jsobj.AddProperty(
"count", kFixedCount);
1541 jsobj.AddProperty(
"valueAsStringIsTruncated",
true);
1550 jsobj.AddProperty(
"offset",
offset);
1553 jsobj.AddProperty(
"count",
count);
1555 jsobj.AddPropertyStr(
"valueAsString", *
this,
offset,
count);
1559 const JSONArray& jsarr_fields)
const {}
1563 JSONObject jsobj(
stream);
1565 jsobj.AddProperty(
"kind",
"Bool");
1566 jsobj.AddFixedServiceId(
"objects/bool-%s", str);
1567 jsobj.AddPropertyF(
"valueAsString",
"%s", str);
1573 JSONObject jsobj(
stream);
1575 jsobj.AddProperty(
"kind",
"List");
1576 jsobj.AddProperty(
"length",
Length());
1584 jsobj.AddProperty(
"offset",
offset);
1587 jsobj.AddProperty(
"count",
count);
1592 JSONArray jsarr(&jsobj,
"elements");
1594 for (intptr_t index =
offset; index < limit; index++) {
1595 element =
At(index);
1596 jsarr.AddValue(element);
1605 JSONObject jsobj(
stream);
1607 jsobj.AddProperty(
"kind",
"List");
1608 jsobj.AddProperty(
"length",
Length());
1616 jsobj.AddProperty(
"offset",
offset);
1619 jsobj.AddProperty(
"count",
count);
1624 JSONArray jsarr(&jsobj,
"elements");
1626 for (intptr_t index =
offset; index < limit; index++) {
1627 element =
At(index);
1628 jsarr.AddValue(element);
1634 const JSONArray& jsarr_fields)
const {}
1637 JSONObject jsobj(
stream);
1639 jsobj.AddProperty(
"kind",
"Map");
1640 jsobj.AddProperty(
"length",
Length());
1648 jsobj.AddProperty(
"offset",
offset);
1651 jsobj.AddProperty(
"count",
count);
1656 JSONArray jsarr(&jsobj,
"associations");
1658 Map::Iterator iterator(*
this);
1660 while (iterator.MoveNext() &&
i < limit) {
1662 JSONObject jsassoc(&jsarr);
1663 object = iterator.CurrentKey();
1664 jsassoc.AddProperty(
"key",
object);
1665 object = iterator.CurrentValue();
1666 jsassoc.AddProperty(
"value",
object);
1676 JSONObject jsobj(
stream);
1678 jsobj.AddProperty(
"kind",
"Set");
1679 jsobj.AddProperty(
"length",
Length());
1687 jsobj.AddProperty(
"offset",
offset);
1690 jsobj.AddProperty(
"count",
count);
1695 JSONArray jsarr(&jsobj,
"elements");
1697 Set::Iterator iterator(*
this);
1699 while (iterator.MoveNext() &&
i < limit) {
1701 object = iterator.CurrentKey();
1702 jsarr.AddValue(
object);
1712 JSONObject jsobj(
stream);
1714 jsobj.AddProperty(
"kind",
"Float32x4");
1715 jsobj.AddProperty(
"valueAsString",
ToCString());
1719 const JSONArray& jsarr_fields)
const {}
1722 JSONObject jsobj(
stream);
1724 jsobj.AddProperty(
"kind",
"Int32x4");
1725 jsobj.AddProperty(
"valueAsString",
ToCString());
1729 const JSONArray& jsarr_fields)
const {}
1732 JSONObject jsobj(
stream);
1734 jsobj.AddProperty(
"kind",
"Float64x2");
1735 jsobj.AddProperty(
"valueAsString",
ToCString());
1739 const JSONArray& jsarr_fields)
const {}
1746 const JSONArray& jsarr_fields)
const {
1751 JSONObject jsobj(
stream);
1754 const char* kind = cls.UserVisibleNameCString();
1755 jsobj.AddProperty(
"kind", kind);
1756 jsobj.AddProperty(
"length",
Length());
1764 jsobj.AddProperty(
"offset",
offset);
1767 jsobj.AddProperty(
"count",
count);
1770 jsobj.AddProperty(
"bytes",
"");
1772 NoSafepointScope no_safepoint;
1773 jsobj.AddPropertyBase64(
"bytes",
1774 reinterpret_cast<const uint8_t*
>(
1781 const JSONArray& jsarr_fields)
const {}
1788 const JSONArray& jsarr_fields)
const {}
1791 JSONObject jsobj(
stream);
1794 const char* kind = cls.UserVisibleNameCString();
1795 jsobj.AddProperty(
"kind", kind);
1796 jsobj.AddProperty(
"length",
Length());
1804 jsobj.AddProperty(
"offset",
offset);
1807 jsobj.AddProperty(
"count",
count);
1810 jsobj.AddProperty(
"bytes",
"");
1812 NoSafepointScope no_safepoint;
1813 jsobj.AddPropertyBase64(
"bytes",
1814 reinterpret_cast<const uint8_t*
>(
1821 const JSONArray& jsarr_fields)
const {}
1828 const JSONArray& jsarr_fields)
const {}
1835 const JSONArray& jsarr_fields)
const {}
1842 const JSONArray& jsarr_fields)
const {}
1847 const StackTrace& allocation_location_ =
1850 obj.AddProperty(
"kind",
"ReceivePort");
1851 obj.AddProperty64(
"portId",
Id());
1852 obj.AddProperty(
"debugName", debug_name_.ToCString());
1853 obj.AddProperty(
"allocationLocation", allocation_location_);
1857 const JSONArray& jsarr_fields)
const {}
1864 const JSONArray& jsarr_fields)
const {}
1871 const JSONArray& jsarr_fields)
const {}
1878 const JSONArray& jsarr_fields)
const {}
1881 JSONObject jsobj(
stream);
1883 jsobj.AddProperty(
"kind",
"Closure");
1885 jsobj.AddProperty(
"closureFunction", func);
1886 if (!func.IsImplicitClosureFunction()) {
1889 jsobj.AddProperty(
"closureContext", Object::null_object());
1891 if (func.IsImplicitInstanceClosureFunction()) {
1892 jsobj.AddProperty(
"closureReceiver",
1895 jsobj.AddProperty(
"closureReceiver", Object::null_object());
1903 if (bpt !=
nullptr) {
1904 jsobj.AddProperty(
"_activationBreakpoint", bpt);
1909 const JSONArray& jsarr_fields)
const {}
1912 JSONObject jsobj(
stream);
1914 jsobj.AddProperty(
"kind",
"Record");
1922 JSONArray jsarr(&jsobj,
"fields");
1926 const intptr_t num_positional_fields =
num_fields - field_names.Length();
1927 for (intptr_t index = 0; index <
num_fields; ++index) {
1928 JSONObject jsfield(&jsarr);
1929 if (index < num_positional_fields) {
1930 jsfield.AddProperty(
"name", index + 1);
1932 name ^= field_names.At(index - num_positional_fields);
1933 jsfield.AddProperty(
"name",
name.ToCString());
1936 jsfield.AddProperty(
"value",
value);
1942 const JSONArray& jsarr_fields)
const {}
1945 JSONObject jsobj(
stream);
1947 jsobj.AddProperty(
"kind",
"StackTrace");
1948 jsobj.AddProperty(
"valueAsString",
ToCString());
1952 const JSONArray& jsarr_fields)
const {}
1955 JSONObject jsobj(
stream);
1957 jsobj.AddProperty(
"kind",
"RegExp");
1965 jsobj.AddProperty(
"isCaseSensitive", !
flags().IgnoreCase());
1966 jsobj.AddProperty(
"isMultiLine",
flags().IsMultiLine());
1968 if (!FLAG_interpret_irregexp) {
1970 func =
function(kOneByteStringCid,
false);
1971 jsobj.AddProperty(
"_oneByteFunction", func);
1972 func =
function(kTwoByteStringCid,
false);
1973 jsobj.AddProperty(
"_twoByteFunction", func);
1974 func =
function(kOneByteStringCid,
true);
1975 jsobj.AddProperty(
"_oneByteFunctionSticky", func);
1976 func =
function(kTwoByteStringCid,
true);
1977 jsobj.AddProperty(
"_twoByteFunctionSticky", func);
1981 jsobj.AddProperty(
"_oneByteBytecode", bc);
1983 jsobj.AddProperty(
"_twoByteBytecode", bc);
1985 jsobj.AddProperty(
"_oneByteBytecodeSticky", bc);
1987 jsobj.AddProperty(
"_twoByteBytecodeSticky", bc);
1992 const JSONArray& jsarr_fields)
const {}
1995 JSONObject jsobj(
stream);
1997 jsobj.AddProperty(
"kind",
"WeakProperty");
2003 jsobj.AddProperty(
"propertyKey", key_handle);
2005 jsobj.AddProperty(
"propertyValue", value_handle);
2009 const JSONArray& jsarr_fields)
const {}
2012 JSONObject jsobj(
stream);
2014 jsobj.AddProperty(
"kind",
"WeakReference");
2020 jsobj.AddProperty(
"target", target_handle);
2024 const JSONArray& jsarr_fields)
const {}
2031 const JSONArray& jsarr_fields)
const {
2036 JSONObject jsobj(
stream);
2038 jsobj.AddProperty(
"kind",
"Finalizer");
2045 jsobj.AddProperty(
"callback",
object);
2047 jsobj.AddProperty(
"allEntries",
object);
2049 jsobj.AddProperty(
"_entriesCollected",
object);
2053 const JSONArray& jsarr_fields)
const {}
2056 JSONObject jsobj(
stream);
2058 jsobj.AddProperty(
"kind",
"NativeFinalizer");
2065 jsobj.AddProperty(
"callbackAddress",
object);
2067 jsobj.AddProperty(
"allEntries",
object);
2069 jsobj.AddProperty(
"_entriesCollected",
object);
2073 const JSONArray& jsarr_fields)
const {}
2076 JSONObject jsobj(
stream);
2078 jsobj.AddProperty(
"kind",
"FinalizerEntry");
2085 jsobj.AddProperty(
"value",
object);
2087 jsobj.AddProperty(
"detach",
object);
2089 jsobj.AddProperty(
"token",
object);
2091 jsobj.AddProperty(
"_finalizer",
object);
2093 jsobj.AddProperty(
"_next",
object);
2097 const JSONArray& jsarr_fields)
const {}
2100 JSONObject jsobj(
stream);
2102 jsobj.AddProperty(
"kind",
"MirrorReference");
2109 jsobj.AddProperty(
"mirrorReferent", referent_handle);
2113 const JSONArray& jsarr_fields)
const {}
2116 JSONObject jsobj(
stream);
2118 jsobj.AddProperty(
"kind",
"UserTag");
2121 jsobj.AddProperty(
"label", tag_label.ToCString());
2125 const JSONArray& jsarr_fields)
const {}
2132 const JSONArray& jsarr_fields)
const {}
2139 const JSONArray& jsarr_fields)
const {}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
StringPtr UserVisibleName() const
virtual const char * ToErrorCString() const
ObjectPtr At(intptr_t index) const
StringPtr target_name() const
ArrayPtr arguments_descriptor() const
bool is_base_class() const
intptr_t FindImplicitClosureFunctionIndex(const Function &needle) const
intptr_t NumTypeParameters() const
LibraryPtr library() const
bool TraceAllocation(IsolateGroup *isolate_group) const
StringPtr ScrubbedName() const
bool is_mixin_class() const
TypePtr super_type() const
ArrayPtr interfaces() const
TokenPosition token_pos() const
ErrorPtr EnsureIsFinalized(Thread *thread) const
GrowableObjectArrayPtr direct_subclasses_unsafe() const
TokenPosition end_token_pos() const
ClassPtr SuperClass(ClassTable *class_table=nullptr) const
bool is_implemented() const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
bool is_transformed_mixin_application() const
friend class AbstractType
bool is_interface_class() const
intptr_t FindInvocationDispatcherFunctionIndex(const Function &needle) const
bool is_finalized() const
ArrayPtr current_functions() const
static intptr_t FindClosureIndex(const Function &needle)
ContextPtr GetContext() const
InstancePtr GetImplicitClosureReceiver() const
FunctionPtr function() const
PcDescriptorsPtr pc_descriptors() const
bool is_optimized() const
ObjectPoolPtr object_pool() const
const char * QualifiedName(const NameFormattingParams ¶ms) const
void Disassemble(DisassemblyFormatter *formatter=nullptr) const
const char * Name() const
bool IsTypeTestStubCode() const
bool IsAllocationStubCode() const
ObjectPoolPtr GetObjectPool() const
uword PayloadStart() const
int64_t compile_timestamp() const
ObjectPtr At(intptr_t context_index) const
intptr_t num_variables() const
ContextPtr parent() const
Breakpoint * BreakpointAtActivation(const Instance &closure)
const char * UserVisibleNameCString() const
static StringPtr NameFromInit(const String &init_name)
ObjectPtr StaticValue() const
intptr_t guarded_cid() const
intptr_t guarded_list_length() const
AbstractTypePtr type() const
TokenPosition end_token_pos() const
TokenPosition token_pos() const
FinalizerEntryPtr entries_collected() const
SetPtr all_entries() const
FinalizerBasePtr finalizer() const
FinalizerEntryPtr next() const
ObjectPtr callback() const
AbstractTypePtr ParameterTypeAt(intptr_t index) const
TypeParameterPtr TypeParameterAt(intptr_t index, Nullability nullability=Nullability::kNonNullable) const
StringPtr ParameterNameAt(intptr_t index) const
AbstractTypePtr result_type() const
bool IsRequiredAt(intptr_t index) const
bool HasOptionalNamedParameters() const
intptr_t NumParameters() const
intptr_t num_fixed_parameters() const
intptr_t NumTypeParameters() const
bool IsRecognized() const
CodePtr CurrentCode() const
bool IsImplicitClosureFunction() const
bool IsNoSuchMethodDispatcher() const
bool IsImplicitGetterOrSetter() const
bool IsFieldInitializer() const
static const char * KindToCString(UntaggedFunction::Kind kind)
FunctionPtr parent_function() const
TokenPosition token_pos() const
void AddFunctionServiceId(const JSONObject &obj) const
bool IsInvokeFieldDispatcher() const
ArrayPtr ic_data_array() const
FieldPtr accessor_field() const
bool IsNonImplicitClosureFunction() const
CodePtr unoptimized_code() const
bool is_optimizable() const
const char * UserVisibleNameCString() const
UntaggedFunction::Kind kind() const
TokenPosition end_token_pos() const
ObjectPtr At(intptr_t index) const
static ArrayPtr ToArray(const Table &table, bool include_payload)
bool is_static_call() const
intptr_t GetReceiverClassIdAt(intptr_t index) const
intptr_t GetCountAt(intptr_t index) const
FunctionPtr GetTargetAt(intptr_t index) const
intptr_t NumberOfChecks() const
void PrintToJSONArray(const JSONArray &jsarray, TokenPosition token_pos) const
FunctionPtr Owner() const
intptr_t GetNativeField(int index) const
uint16_t NumNativeFields() const
ObjectPtr GetField(const Field &field) const
virtual void PrintSharedInstanceJSON(JSONObject *jsobj, bool ref, bool include_id=true) const
static IsolateGroup * Current()
ClassTable * class_table() const
static Isolate * Current()
Debugger * debugger() const
IsolateGroup * group() const
void AddValue(bool b) const
void AddProperty64(const char *name, int64_t i) const
void AddProperty(const char *name, bool b) const
void AddServiceId(const Object &o) const
void AddFixedServiceId(const char *format,...) const PRINTF_ATTRIBUTE(2
void AddPropertyF(const char *name, const char *format,...) const PRINTF_ATTRIBUTE(3
virtual const char * ToErrorCString() const
friend class DictionaryIterator
ArrayPtr LoadedScripts() const
bool IsDebuggable() const
StringPtr private_key() const
LoadingUnitPtr parent() const
bool load_outstanding() const
ArrayPtr base_objects() const
static const char * KindToCString(UntaggedLocalVarDescriptors::VarInfoKind kind)
StringPtr GetName(intptr_t var_index) const
void GetInfo(intptr_t var_index, UntaggedLocalVarDescriptors::VarInfo *info) const
ObjectPtr referent() const
classid_t expected_cid() const
ArrayPtr hide_names() const
ArrayPtr show_names() const
PointerPtr callback() const
EntryType TypeAt(intptr_t index) const
ObjectPtr ObjectAt(intptr_t index) const
uword RawValueAt(intptr_t index) const
static intptr_t OffsetFromIndex(intptr_t index)
void AddCommonObjectProperties(JSONObject *jsobj, const char *protocol_type, bool ref) const
void PrintJSON(JSONStream *stream, bool ref=true) const
virtual const char * JSONType() const
virtual const char * ToCString() const
virtual void PrintImplementationFieldsImpl(const JSONArray &jsarr_fields) const
virtual void PrintJSONImpl(JSONStream *stream, bool ref) const
void PrintImplementationFields(JSONStream *stream) const
TokenPosition TokenPos() const
intptr_t TryIndex() const
UntaggedPcDescriptors::Kind Kind() const
void PrintToJSONObject(JSONObject *jsobj, bool ref) const
StringPtr debug_name() const
StackTracePtr allocation_location() const
AbstractTypePtr FieldTypeAt(intptr_t index) const
ArrayPtr GetFieldNames(Thread *thread) const
intptr_t NumFields() const
ArrayPtr GetFieldNames(Thread *thread) const
intptr_t num_fields() const
ObjectPtr FieldAt(intptr_t field_index) const
TypedDataPtr bytecode(bool is_one_byte, bool sticky) const
StringPtr pattern() const
RegExpFlags flags() const
FunctionPtr function(intptr_t cid, bool sticky) const
static FunctionPtr ResolveFunction(Zone *zone, const Class &receiver_class, const String &function_name)
GrowableObjectArrayPtr GenerateLineNumberArray() const
intptr_t col_offset() const
int64_t load_timestamp() const
LibraryPtr FindLibrary() const
intptr_t line_offset() const
static SmiPtr New(intptr_t value)
static const char * ScrubName(const String &name, bool is_extension=false)
static const char * EncodeIRI(const String &str)
static Thread * Current()
int32_t Serialize() const
@ kInstantiatorTypeArgsIndex
@ kInstantiatedTypeArgsIndex
bool IsInstantiated(Genericity genericity=kAny, intptr_t num_free_fun_type_params=kAllFree) const
StringPtr UserVisibleName() const
friend class AbstractType
AbstractTypePtr TypeAt(intptr_t index) const
AbstractTypePtr bound() const
friend class TypeArguments
virtual ClassPtr type_class() const
virtual TypeArgumentsPtr arguments() const
intptr_t ElementSizeInBytes() const
void * DataAddr(intptr_t byte_offset) const
virtual const char * ToErrorCString() const
InstancePtr exception() const
InstancePtr stacktrace() const
bool is_user_initiated() const
virtual const char * ToErrorCString() const
ObjectPtr At(intptr_t index) const
Dart_NativeFunction function
ArrayOfTuplesView< TypeArguments::Cache::Entry, std::tuple< Object, TypeArguments, TypeArguments >, TypeArguments::Cache::kHeaderSize > InstantiationsCacheTable
UnorderedHashSet< CanonicalTypeArgumentsTraits > CanonicalTypeArgumentsSet
static void AddNameProperties(JSONObject *jsobj, const char *name, const char *vm_name)
static void PrintShowHideNamesToJSON(JSONObject *jsobj, const Namespace &ns)
raw_obj untag() -> num_entries()) VARIABLE_COMPRESSED_VISITOR(Array, Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(TypedData, TypedData::ElementSizeInBytes(raw_obj->GetClassId()) *Smi::Value(raw_obj->untag() ->length())) VARIABLE_COMPRESSED_VISITOR(Record, RecordShape(raw_obj->untag() ->shape()).num_fields()) VARIABLE_NULL_VISITOR(CompressedStackMaps, CompressedStackMaps::PayloadSizeOf(raw_obj)) VARIABLE_NULL_VISITOR(OneByteString, Smi::Value(raw_obj->untag() ->length())) VARIABLE_NULL_VISITOR(TwoByteString, Smi::Value(raw_obj->untag() ->length())) intptr_t UntaggedField::VisitFieldPointers(FieldPtr raw_obj, ObjectPointerVisitor *visitor)
static float Length(float x, float y)