[vm/sendandexit] Introduce Isolate.exit([port, message]).

This exits current isolate immediately. If [port] is provided, then [message] is verified and sent out as isolate exits.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47164

Change-Id: I513f4d7ceb5d74820f4aee60f5799b7b5193f2e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214312
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This commit is contained in:
Alexander Aprelev
2021-09-30 20:20:24 +00:00
committed by commit-bot@chromium.org
parent ead8b7f6ac
commit 56403a0d35
22 changed files with 97 additions and 98 deletions
+1 -3
View File
@@ -10,8 +10,6 @@ import 'dart:typed_data';
import 'package:benchmark_harness/benchmark_harness.dart' show BenchmarkBase;
import 'runtime/tests/vm/dart/export_sendAndExit_helper.dart' show sendAndExit;
class JsonDecodingBenchmark {
JsonDecodingBenchmark(this.name,
{required this.sample,
@@ -80,7 +78,7 @@ Future<Map> decodeJson(bool useSendAndExit, Uint8List encodedJson) async {
Future<void> jsonDecodingIsolate(JsonDecodeRequest request) async {
final result = json.decode(utf8.decode(request.encodedJson));
if (request.useSendAndExit) {
sendAndExit(request.sendPort, result);
Isolate.exit(request.sendPort, result);
} else {
request.sendPort.send(result);
}
@@ -1 +0,0 @@
export 'dart:_internal' show sendAndExit;