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 #include "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 return Spawn(arguments, new IsolateSpawnState(canonical_uri)); | 260 return Spawn(arguments, new IsolateSpawnState(canonical_uri)); |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 DEFINE_NATIVE_ENTRY(Isolate_mainPort, 0) { | 264 DEFINE_NATIVE_ENTRY(Isolate_mainPort, 0) { |
265 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 265 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
266 if (port.IsError()) { | 266 if (port.IsError()) { |
267 Exceptions::PropagateError(Error::Cast(port)); | 267 Exceptions::PropagateError(Error::Cast(port)); |
268 } | 268 } |
| 269 |
| 270 // The control port is being accessed as a regular port from Dart code. This |
| 271 // is most likely due to the _startIsolate code in dart:isolate. Account for |
| 272 // this by increasing the number of open control ports. |
| 273 isolate->message_handler()->increment_control_ports(); |
| 274 |
269 return port.raw(); | 275 return port.raw(); |
270 } | 276 } |
271 | 277 |
272 } // namespace dart | 278 } // namespace dart |
OLD | NEW |