Fix VM service message routing and asset loading.

Change-Id: I8c36663fd2324e731283ea65dd8a0d3b5e13d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134760
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2020-02-06 22:28:04 +00:00 committed by commit-bot@chromium.org
parent a8a4497cc6
commit a85f6ec3a1
6 changed files with 18 additions and 13 deletions

View file

@ -17,12 +17,12 @@ class Function {
(positionalArguments != null ? positionalArguments.length : 0);
int numNamedArguments = namedArguments != null ? namedArguments.length : 0;
int numArguments = numPositionalArguments + numNamedArguments;
List arguments = new List.filled(numArguments, null);
List arguments = new List<dynamic>.filled(numArguments, null);
arguments[0] = function;
if (positionalArguments != null) {
arguments.setRange(1, numPositionalArguments, positionalArguments);
}
List names = new List.filled(numNamedArguments, null);
List names = new List<dynamic>.filled(numNamedArguments, null);
int argumentIndex = numPositionalArguments;
int nameIndex = 0;
if (numNamedArguments > 0) {

View file

@ -226,9 +226,9 @@ abstract class _ObjectMirror extends Mirror implements ObjectMirror {
int numPositionalArguments = positionalArguments.length;
int numNamedArguments = namedArguments.length;
int numArguments = numPositionalArguments + numNamedArguments;
List arguments = new List.filled(numArguments, null);
List arguments = new List<dynamic>.filled(numArguments, null);
arguments.setRange(0, numPositionalArguments, positionalArguments);
List names = new List.filled(numNamedArguments, null);
List names = new List<dynamic>.filled(numNamedArguments, null);
int argumentIndex = numPositionalArguments;
int nameIndex = 0;
if (numNamedArguments > 0) {
@ -316,10 +316,10 @@ class _InstanceMirror extends _ObjectMirror implements InstanceMirror {
int numPositionalArguments = positionalArguments.length + 1; // Receiver.
int numNamedArguments = namedArguments.length;
int numArguments = numPositionalArguments + numNamedArguments;
List arguments = new List.filled(numArguments, null);
List arguments = new List<dynamic>.filled(numArguments, null);
arguments[0] = _reflectee; // Receiver.
arguments.setRange(1, numPositionalArguments, positionalArguments);
List names = new List.filled(numNamedArguments, null);
List names = new List<dynamic>.filled(numNamedArguments, null);
int argumentIndex = numPositionalArguments;
int nameIndex = 0;
if (numNamedArguments > 0) {
@ -651,9 +651,9 @@ class _ClassMirror extends _ObjectMirror implements ClassMirror, _TypeMirror {
int numPositionalArguments = positionalArguments.length;
int numNamedArguments = namedArguments.length;
int numArguments = numPositionalArguments + numNamedArguments;
List arguments = new List.filled(numArguments, null);
List arguments = new List<dynamic>.filled(numArguments, null);
arguments.setRange(0, numPositionalArguments, positionalArguments);
List names = new List.filled(numNamedArguments, null);
List names = new List<dynamic>.filled(numNamedArguments, null);
int argumentIndex = numPositionalArguments;
int nameIndex = 0;
if (numNamedArguments > 0) {

View file

@ -832,7 +832,7 @@ class _RandomAccessFile implements RandomAccessFile {
return new Future.error(e);
}
List request = new List.filled(4, null);
List request = new List<dynamic>.filled(4, null);
request[0] = null;
request[1] = result.buffer;
request[2] = result.start;

View file

@ -1019,7 +1019,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
Future<_FilterStatus> _pushAllFilterStages() {
bool wasInHandshake = _status != connectedStatus;
List args = new List.filled(2 + bufferCount * 2, null);
List args = new List<dynamic>.filled(2 + bufferCount * 2, null);
args[0] = _secureFilter!._pointer();
args[1] = wasInHandshake;
var bufs = _secureFilter!.buffers!;

View file

@ -43,6 +43,7 @@ class Asset {
return null;
}
List assetList = _decodeAssets(tarBytes);
Map<String, Asset> assets = new HashMap<String, Asset>();
for (int i = 0; i < assetList.length; i += 2) {
final a = Asset(assetList[i], assetList[i + 1]);
assets[a.name] = a;

View file

@ -147,9 +147,13 @@ class Message {
// elements in the list are strings, making consumption by C++ simpler.
// This has a side effect that boolean literal values like true become 'true'
// and thus indistinguishable from the string literal 'true'.
List<String> _makeAllString(List list) => <String>[
for (final e in list) e.toString(),
];
List<String> _makeAllString(List list) {
var new_list = List<String>.filled(list.length, "");
for (var i = 0; i < list.length; i++) {
new_list[i] = list[i].toString();
}
return new_list;
}
Future<Response> sendToIsolate(SendPort sendPort) {
final receivePort = RawReceivePort();