Version 2.15.0-8.0.dev

Merge commit '1c06d14fce67991819c8fd698ac8986d1480930f' into 'dev'
diff --git a/DEPS b/DEPS
index 1cd7b47..c42dd21 100644
--- a/DEPS
+++ b/DEPS
@@ -44,7 +44,7 @@
   # co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
   # hashes. It requires access to the dart-build-access group, which EngProd
   # has.
-  "co19_rev": "aff1a334d7875e465c2f43e1b38774512fbb4ba4",
+  "co19_rev": "3bbf92369652b6ba0b347516dabd1ed2193eb5c6",
   "co19_2_rev": "d6e96f6d922b17fcf2e021e0f2b28835c861eb17",
 
   # The internal benchmarks to use. See go/dart-benchmarks-internal
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 48cb890..43f124f 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -372,8 +372,8 @@
   Dart_IsolateFlags* isolate_flags() { return &isolate_flags_; }
 
   ObjectPtr ResolveFunction();
-  InstancePtr BuildArgs(Thread* thread);
-  InstancePtr BuildMessage(Thread* thread);
+  ObjectPtr BuildArgs(Thread* thread);
+  ObjectPtr BuildMessage(Thread* thread);
 
   IsolateGroup* isolate_group() const { return isolate_group_; }
 
@@ -569,25 +569,22 @@
   return func.ptr();
 }
 
-static InstancePtr DeserializeMessage(Thread* thread, Message* message) {
+static ObjectPtr DeserializeMessage(Thread* thread, Message* message) {
   if (message == NULL) {
-    return Instance::null();
+    return Object::null();
   }
-  Zone* zone = thread->zone();
   if (message->IsRaw()) {
-    return Instance::RawCast(message->raw_obj());
+    return Object::RawCast(message->raw_obj());
   } else {
-    const Object& obj = Object::Handle(zone, ReadMessage(thread, message));
-    ASSERT(!obj.IsError());
-    return Instance::RawCast(obj.ptr());
+    return ReadMessage(thread, message);
   }
 }
 
-InstancePtr IsolateSpawnState::BuildArgs(Thread* thread) {
+ObjectPtr IsolateSpawnState::BuildArgs(Thread* thread) {
   return DeserializeMessage(thread, serialized_args_.get());
 }
 
-InstancePtr IsolateSpawnState::BuildMessage(Thread* thread) {
+ObjectPtr IsolateSpawnState::BuildMessage(Thread* thread) {
   return DeserializeMessage(thread, serialized_message_.get());
 }
 
@@ -759,10 +756,25 @@
         Object::Handle(zone, func.ImplicitStaticClosure());
 
     // Step 2) Enqueue delayed invocation of entrypoint callback.
+    const auto& args_obj = Object::Handle(zone, state_->BuildArgs(thread));
+    if (args_obj.IsError()) {
+      ReportError(
+          "Failed to deserialize the passed arguments to the new isolate.");
+      return false;
+    }
+    ASSERT(args_obj.IsNull() || args_obj.IsInstance());
+    const auto& message_obj =
+        Object::Handle(zone, state_->BuildMessage(thread));
+    if (message_obj.IsError()) {
+      ReportError(
+          "Failed to deserialize the passed arguments to the new isolate.");
+      return false;
+    }
+    ASSERT(message_obj.IsNull() || message_obj.IsInstance());
     const Array& args = Array::Handle(zone, Array::New(4));
     args.SetAt(0, entrypoint_closure);
-    args.SetAt(1, Instance::Handle(zone, state_->BuildArgs(thread)));
-    args.SetAt(2, Instance::Handle(zone, state_->BuildMessage(thread)));
+    args.SetAt(1, args_obj);
+    args.SetAt(2, message_obj);
     args.SetAt(3, is_spawn_uri ? Bool::True() : Bool::False());
 
     const auto& lib = Library::Handle(zone, Library::IsolateLibrary());
diff --git a/runtime/tests/vm/dart/regress_46878_test.dart b/runtime/tests/vm/dart/regress_46878_test.dart
new file mode 100644
index 0000000..6ef37bc
--- /dev/null
+++ b/runtime/tests/vm/dart/regress_46878_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=--enable-isolate-groups
+// VMOptions=--no-enable-isolate-groups
+
+import 'dart:isolate';
+
+import 'package:expect/expect.dart';
+
+main() async {
+  // In the main isolate we don't want to throw.
+  Foo.throwOnHashCode = false;
+
+  final onError = ReceivePort()
+    ..listen((error) {
+      print('Child isolate error: $error');
+    });
+  final onExit = ReceivePort();
+  var spawnError;
+  try {
+    await Isolate.spawn(
+        other,
+        // Rehashing of this map on receiver side will throw.
+        {Foo(): 1},
+        onError: onError.sendPort,
+        onExit: onExit.sendPort);
+
+    await onExit.first;
+  } on IsolateSpawnException catch (error) {
+    spawnError = error;
+  } finally {
+    onError.close();
+    onExit.close();
+  }
+  Expect.contains(
+      'Unable to spawn isolate: Failed to deserialize the passed arguments to the new isolate',
+      '$spawnError');
+}
+
+class Foo {
+  static bool throwOnHashCode = true;
+
+  int get hashCode => throwOnHashCode ? (throw 'rehashing error') : 1;
+}
+
+other(message) {}
diff --git a/runtime/tests/vm/dart_2/regress_46878_test.dart b/runtime/tests/vm/dart_2/regress_46878_test.dart
new file mode 100644
index 0000000..6ef37bc
--- /dev/null
+++ b/runtime/tests/vm/dart_2/regress_46878_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2018, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=--enable-isolate-groups
+// VMOptions=--no-enable-isolate-groups
+
+import 'dart:isolate';
+
+import 'package:expect/expect.dart';
+
+main() async {
+  // In the main isolate we don't want to throw.
+  Foo.throwOnHashCode = false;
+
+  final onError = ReceivePort()
+    ..listen((error) {
+      print('Child isolate error: $error');
+    });
+  final onExit = ReceivePort();
+  var spawnError;
+  try {
+    await Isolate.spawn(
+        other,
+        // Rehashing of this map on receiver side will throw.
+        {Foo(): 1},
+        onError: onError.sendPort,
+        onExit: onExit.sendPort);
+
+    await onExit.first;
+  } on IsolateSpawnException catch (error) {
+    spawnError = error;
+  } finally {
+    onError.close();
+    onExit.close();
+  }
+  Expect.contains(
+      'Unable to spawn isolate: Failed to deserialize the passed arguments to the new isolate',
+      '$spawnError');
+}
+
+class Foo {
+  static bool throwOnHashCode = true;
+
+  int get hashCode => throwOnHashCode ? (throw 'rehashing error') : 1;
+}
+
+other(message) {}
diff --git a/tests/co19_2/co19_2-co19.status b/tests/co19_2/co19_2-co19.status
index 3d7b0c2..ff5abb6 100644
--- a/tests/co19_2/co19_2-co19.status
+++ b/tests/co19_2/co19_2-co19.status
@@ -8,3 +8,9 @@
 Language/Generics/typedef_A08_t02: SkipByDesign # https://github.com/dart-lang/sdk/issues/46483
 Language/Generics/typedef_A08_t03: SkipByDesign # https://github.com/dart-lang/sdk/issues/46483
 Language/Generics/typedef_A08_t04: SkipByDesign # https://github.com/dart-lang/sdk/issues/46483
+Language/Libraries_and_Scripts/Scripts/top_level_main_t01: Skip # https://github.com/dart-lang/co19/issues/1137
+Language/Libraries_and_Scripts/Scripts/top_level_main_t06: Skip # https://github.com/dart-lang/co19/issues/1137
+
+[ $compiler == dart2js || $compiler == dartdevk ]
+Language/Libraries_and_Scripts/Scripts/top_level_main_t01: SkipByDesign # Uses dart:io.
+Language/Libraries_and_Scripts/Scripts/top_level_main_t06: SkipByDesign # Uses dart:io.
diff --git a/tools/VERSION b/tools/VERSION
index 3f3cb25..e510752 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 15
 PATCH 0
-PRERELEASE 7
+PRERELEASE 8
 PRERELEASE_PATCH 0
\ No newline at end of file