@@ -14,7 +14,6 @@ import 'package:compiler_unsupported/src/filenames.dart'
14
14
show appendSlash;
15
15
import 'package:path/path.dart' as p;
16
16
17
- import 'asset/dart/serialize.dart' ;
18
17
import 'exceptions.dart' ;
19
18
import 'io.dart' ;
20
19
import 'log.dart' as log;
@@ -177,19 +176,8 @@ Future runInIsolate(String code, message, {packageRoot, String snapshot})
177
176
await withTempDir ((dir) async {
178
177
var dartPath = p.join (dir, 'runInIsolate.dart' );
179
178
writeTextFile (dartPath, code, dontLogContents: true );
180
- var port = new ReceivePort ();
181
- await Isolate .spawn (_isolateBuffer, {
182
- 'replyTo' : port.sendPort,
183
- // Make the snapshot URI absolute to work around sdk#8440.
184
- 'uri' : p.toUri (p.absolute (dartPath)).toString (),
185
- 'packageRoot' : packageRoot == null ? null : packageRoot.toString (),
186
- 'message' : message
187
- });
188
-
189
- var response = await port.first;
190
- if (response['type' ] == 'error' ) {
191
- throw new CrossIsolateException .deserialize (response['error' ]);
192
- }
179
+ await Isolate .spawnUri (p.toUri (p.absolute (dartPath)), [], message,
180
+ packageRoot: packageRoot);
193
181
194
182
if (snapshot == null ) return ;
195
183
@@ -208,27 +196,6 @@ Future runInIsolate(String code, message, {packageRoot, String snapshot})
208
196
});
209
197
}
210
198
211
- // TODO(nweiz): remove this when issue 12617 is fixed.
212
- /// A function used as a buffer between the host isolate and [spawnUri] .
213
- ///
214
- /// [spawnUri] synchronously loads the file and its imports, which can deadlock
215
- /// the host isolate if there's an HTTP import pointing at a server in the host.
216
- /// Adding an additional isolate in the middle works around this.
217
- void _isolateBuffer (message) {
218
- var replyTo = message['replyTo' ];
219
- var packageRoot = message['packageRoot' ];
220
- if (packageRoot != null ) packageRoot = Uri .parse (packageRoot);
221
- Isolate .spawnUri (Uri .parse (message['uri' ]), [], message['message' ],
222
- packageRoot: packageRoot)
223
- .then ((_) => replyTo.send ({'type' : 'success' }))
224
- .catchError ((e, stack) {
225
- replyTo.send ({
226
- 'type' : 'error' ,
227
- 'error' : CrossIsolateException .serialize (e, stack)
228
- });
229
- });
230
- }
231
-
232
199
/// Snapshots the Dart executable at [executableUrl] to a snapshot at
233
200
/// [snapshotPath] .
234
201
///
0 commit comments