| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "dart:collection" show HashMap; | 5 import "dart:collection" show HashMap; |
| 6 import "dart:_internal"; | 6 import "dart:_internal"; |
| 7 | 7 |
| 8 patch class ReceivePort { | 8 patch class ReceivePort { |
| 9 /* patch */ factory ReceivePort() = _ReceivePortImpl; | 9 /* patch */ factory ReceivePort() = _ReceivePortImpl; |
| 10 | 10 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 // TODO(iposva): Cleanup to have only one definition. | 336 // TODO(iposva): Cleanup to have only one definition. |
| 337 // These values need to be kept in sync with the class IsolateMessageHandler | 337 // These values need to be kept in sync with the class IsolateMessageHandler |
| 338 // in vm/isolate.cc. | 338 // in vm/isolate.cc. |
| 339 static const _PAUSE = 1; | 339 static const _PAUSE = 1; |
| 340 static const _RESUME = 2; | 340 static const _RESUME = 2; |
| 341 static const _PING = 3; | 341 static const _PING = 3; |
| 342 static const _KILL = 4; | 342 static const _KILL = 4; |
| 343 | 343 |
| 344 | 344 |
| 345 static SendPort _spawnFunction(SendPort readyPort, Function topLevelFunction, | 345 static void _spawnFunction(SendPort readyPort, Function topLevelFunction, |
| 346 var message, bool paused) | 346 var message, bool paused) |
| 347 native "Isolate_spawnFunction"; | 347 native "Isolate_spawnFunction"; |
| 348 | 348 |
| 349 static SendPort _spawnUri(SendPort readyPort, String uri, | 349 static void _spawnUri(SendPort readyPort, String uri, |
| 350 List<String> args, var message, | 350 List<String> args, var message, |
| 351 bool paused, String packageRoot) | 351 bool paused, String packageRoot) |
| 352 native "Isolate_spawnUri"; | 352 native "Isolate_spawnUri"; |
| 353 | 353 |
| 354 static void _sendOOB(port, msg) native "Isolate_sendOOB"; | 354 static void _sendOOB(port, msg) native "Isolate_sendOOB"; |
| 355 | 355 |
| 356 /* patch */ void _pause(Capability resumeCapability) { | 356 /* patch */ void _pause(Capability resumeCapability) { |
| 357 var msg = new List(4) | 357 var msg = new List(4) |
| 358 ..[0] = 0 // Make room for OOB message type. | 358 ..[0] = 0 // Make room for OOB message type. |
| 359 ..[1] = _PAUSE | 359 ..[1] = _PAUSE |
| 360 ..[2] = pauseCapability | 360 ..[2] = pauseCapability |
| 361 ..[3] = resumeCapability; | 361 ..[3] = resumeCapability; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 static Isolate _getCurrentIsolate() { | 412 static Isolate _getCurrentIsolate() { |
| 413 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); | 413 List portAndCapabilities = _getPortAndCapabilitiesOfCurrentIsolate(); |
| 414 return new Isolate(portAndCapabilities[0], | 414 return new Isolate(portAndCapabilities[0], |
| 415 pauseCapability: portAndCapabilities[1], | 415 pauseCapability: portAndCapabilities[1], |
| 416 terminateCapability: portAndCapabilities[2]); | 416 terminateCapability: portAndCapabilities[2]); |
| 417 } | 417 } |
| 418 | 418 |
| 419 static List _getPortAndCapabilitiesOfCurrentIsolate() | 419 static List _getPortAndCapabilitiesOfCurrentIsolate() |
| 420 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; | 420 native "Isolate_getPortAndCapabilitiesOfCurrentIsolate"; |
| 421 } | 421 } |
| OLD | NEW |