[vm] Bump service protocol to 4.14 and hide implementation

Follow up of https://dart-review.googlesource.com/c/sdk/+/346403.

TEST=pkg/vm_service/test/get_object_rpc_test.dart

Change-Id: I7c1d0fb565f8a128334844f7eec44eb4a4679c08
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-win-debug-x64-try,vm-win-release-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346600
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Daco Harkes 2024-01-16 18:25:18 +00:00 committed by Commit Queue
parent 82520abfb1
commit 8758f1f954
8 changed files with 13 additions and 76 deletions

View file

@ -1 +1 @@
version=4.13
version=4.14

View file

@ -26,7 +26,7 @@ export 'snapshot_graph.dart'
HeapSnapshotObjectNoData,
HeapSnapshotObjectNullData;
const String vmServiceVersion = '4.13.0';
const String vmServiceVersion = '4.14.0';
/// @optional
const String optional = 'optional';
@ -5235,16 +5235,6 @@ class Instance extends Obj implements InstanceRef {
@optional
InstanceRef? allEntries;
/// The entries for a (Native)Finalizer instance.
///
/// A linked list of entries through FinalizerEntry.next.
///
/// Provided for instance kinds:
/// - Finalizer
/// - NativeFinalizer
@optional
InstanceRef? collectedEntries;
/// The value being watched for finalization for a FinalizerEntry instance.
///
/// Provided for instance kinds:
@ -5266,21 +5256,6 @@ class Instance extends Obj implements InstanceRef {
@optional
InstanceRef? detach;
/// The finalizer for a FinalizerEntry instance.
///
/// Provided for instance kinds:
/// - FinalizerEntry
@optional
InstanceRef? finalizer;
/// The next item in the collectedEntries linked list for a FinalizerEntry
/// instance.
///
/// Provided for instance kinds:
/// - FinalizerEntry
@optional
InstanceRef? next;
Instance({
this.kind,
this.identityHashCode,
@ -5321,12 +5296,9 @@ class Instance extends Obj implements InstanceRef {
this.callback,
this.callbackAddress,
this.allEntries,
this.collectedEntries,
this.value,
this.token,
this.detach,
this.finalizer,
this.next,
}) : super(
id: id,
classRef: classRef,
@ -5412,19 +5384,12 @@ class Instance extends Obj implements InstanceRef {
as InstanceRef?;
allEntries = createServiceObject(json['allEntries'], const ['InstanceRef'])
as InstanceRef?;
collectedEntries =
createServiceObject(json['collectedEntries'], const ['InstanceRef'])
as InstanceRef?;
value = createServiceObject(json['value'], const ['InstanceRef'])
as InstanceRef?;
token = createServiceObject(json['token'], const ['InstanceRef'])
as InstanceRef?;
detach = createServiceObject(json['detach'], const ['InstanceRef'])
as InstanceRef?;
finalizer = createServiceObject(json['finalizer'], const ['InstanceRef'])
as InstanceRef?;
next = createServiceObject(json['next'], const ['InstanceRef'])
as InstanceRef?;
}
@override
@ -5477,12 +5442,9 @@ class Instance extends Obj implements InstanceRef {
_setIfNotNull(json, 'callback', callback?.toJson());
_setIfNotNull(json, 'callbackAddress', callbackAddress?.toJson());
_setIfNotNull(json, 'allEntries', allEntries?.toJson());
_setIfNotNull(json, 'collectedEntries', collectedEntries?.toJson());
_setIfNotNull(json, 'value', value?.toJson());
_setIfNotNull(json, 'token', token?.toJson());
_setIfNotNull(json, 'detach', detach?.toJson());
_setIfNotNull(json, 'finalizer', finalizer?.toJson());
_setIfNotNull(json, 'next', next?.toJson());
return json;
}

View file

@ -1954,10 +1954,7 @@ var tests = <IsolateTest>[
expect(entry.value!.classRef!.name, '_DummyClass');
expect(entry.token!.classRef!.name, '_DummyClass');
expect(entry.detach!.classRef!.name, '_DummyClass');
expect(entry.finalizer!.kind, equals(InstanceKind.kFinalizer));
expect(entry.next!.kind, equals(InstanceKind.kNull));
}
expect(result.collectedEntries, isNull);
},
// A native finalizer
@ -1989,7 +1986,6 @@ var tests = <IsolateTest>[
final allEntries =
await service.getObject(isolateId, allEntriesRef!.id!) as Instance;
expect(allEntries.elements, isEmpty);
expect(result.collectedEntries, isNull);
},
];

View file

@ -17,7 +17,7 @@ import 'service_extension_registry.dart';
export 'service_extension_registry.dart' show ServiceExtensionRegistry;
const String vmServiceVersion = '4.13.0';
const String vmServiceVersion = '4.14.0';
/// A class representation of the Dart VM Service Protocol.
abstract interface class VmServiceInterface {

View file

@ -12,7 +12,7 @@ var tests = <VMTest>[
final result = await vm.invokeRpcNoUpgrade('getVersion', {});
expect(result['type'], 'Version');
expect(result['major'], 4);
expect(result['minor'], 13);
expect(result['minor'], 14);
expect(result['_privateMajor'], 0);
expect(result['_privateMinor'], 0);
},

View file

@ -2045,7 +2045,7 @@ void Finalizer::PrintJSONImpl(JSONStream* stream, bool ref) const {
object = all_entries();
jsobj.AddProperty("allEntries", object);
object = entries_collected();
jsobj.AddProperty("entriesCollected", object);
jsobj.AddProperty("_entriesCollected", object);
}
void Finalizer::PrintImplementationFieldsImpl(
@ -2065,7 +2065,7 @@ void NativeFinalizer::PrintJSONImpl(JSONStream* stream, bool ref) const {
object = all_entries();
jsobj.AddProperty("allEntries", object);
object = entries_collected();
jsobj.AddProperty("entriesCollected", object);
jsobj.AddProperty("_entriesCollected", object);
}
void NativeFinalizer::PrintImplementationFieldsImpl(
@ -2087,9 +2087,9 @@ void FinalizerEntry::PrintJSONImpl(JSONStream* stream, bool ref) const {
object = token();
jsobj.AddProperty("token", object);
object = finalizer();
jsobj.AddProperty("finalizer", object);
jsobj.AddProperty("_finalizer", object);
object = next();
jsobj.AddProperty("next", object);
jsobj.AddProperty("_next", object);
}
void FinalizerEntry::PrintImplementationFieldsImpl(

View file

@ -18,7 +18,7 @@
namespace dart {
#define SERVICE_PROTOCOL_MAJOR_VERSION 4
#define SERVICE_PROTOCOL_MINOR_VERSION 13
#define SERVICE_PROTOCOL_MINOR_VERSION 14
class Array;
class EmbedderServiceHandler;
@ -199,7 +199,7 @@ class Service : public AllStatic {
return stream_cancel_callback_;
}
static void PrintJSONForEmbedderInformation(JSONObject *jsobj);
static void PrintJSONForEmbedderInformation(JSONObject* jsobj);
static void PrintJSONForVM(JSONStream* js, bool ref);
static void CheckForPause(Isolate* isolate, JSONStream* stream);

View file

@ -1,8 +1,8 @@
# Dart VM Service Protocol 4.13
# Dart VM Service Protocol 4.14
> Please post feedback to the [observatory-discuss group][discuss-list]
This document describes of _version 4.13_ of the Dart VM Service Protocol. This
This document describes of _version 4.14_ of the Dart VM Service Protocol. This
protocol is used to communicate with a running Dart Virtual Machine.
To use the Service Protocol, start the VM with the *--observe* flag.
@ -3306,15 +3306,6 @@ class Instance extends Object {
// NativeFinalizer
@Instance allEntries [optional];
// The entries for a (Native)Finalizer instance.
//
// A linked list of entries through FinalizerEntry.next.
//
// Provided for instance kinds:
// Finalizer
// NativeFinalizer
@Instance collectedEntries [optional];
// The value being watched for finalization for a FinalizerEntry instance.
//
// Provided for instance kinds:
@ -3332,19 +3323,6 @@ class Instance extends Object {
// Provided for instance kinds:
// FinalizerEntry
@Instance detach [optional];
// The finalizer for a FinalizerEntry instance.
//
// Provided for instance kinds:
// FinalizerEntry
@Instance finalizer [optional];
// The next item in the collectedEntries linked list for a FinalizerEntry
// instance.
//
// Provided for instance kinds:
// FinalizerEntry
@Instance next [optional];
}
```
@ -4808,5 +4786,6 @@ version | comments
4.11 | Added `isGetter` and `isSetter` properties to `@Function` and `Function`.
4.12 | Added `@TypeParameters` and changed `TypeParameters` to extend `Object`.
4.13 | Added `librariesAlreadyCompiled` to `getSourceReport`.
4.14 | Added `Finalizer`, `NativeFinalizer`, and `FinalizerEntry`.
[discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observatory-discuss