[ Service ] Update @Code to include its corresponding function

Removes the need to make extra requests when building CPU profiles with
code nodes.

TEST=N/A

Change-Id: Iade2bcbbf36cce83046c7123628a215636786967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264780
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Ben Konyi 2022-10-18 19:52:41 +00:00 committed by Commit Queue
parent c42ab25787
commit 177b9a9278

View file

@ -917,9 +917,6 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddProperty("_intrinsic", false);
jsobj.AddProperty("_native", false);
}
if (ref) {
return;
}
if (obj.IsFunction()) {
jsobj.AddProperty("function", obj);
} else {
@ -931,6 +928,9 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
func.AddProperty("name", vm_name);
AddNameProperties(&func, vm_name, vm_name);
}
if (ref) {
return;
}
jsobj.AddPropertyF("_startAddress", "%" Px "", PayloadStart());
jsobj.AddPropertyF("_endAddress", "%" Px "", PayloadStart() + Size());
jsobj.AddProperty("_alive", is_alive());