OLD | NEW |
1 var _isolate_helper; | 1 var _isolate_helper; |
2 (function(exports) { | 2 (function(exports) { |
3 'use strict'; | 3 'use strict'; |
4 // Function _serializeMessage: (dynamic) → dynamic | 4 // Function _serializeMessage: (dynamic) → dynamic |
5 function _serializeMessage(message) { | 5 function _serializeMessage(message) { |
6 return new _Serializer().serialize(message); | 6 return new _Serializer().serialize(message); |
7 } | 7 } |
8 // Function _deserializeMessage: (dynamic) → dynamic | 8 // Function _deserializeMessage: (dynamic) → dynamic |
9 function _deserializeMessage(message) { | 9 function _deserializeMessage(message) { |
10 return new _Deserializer().deserialize(message); | 10 return new _Deserializer().deserialize(message); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 464 } |
465 static _serializePrintMessage(object) { | 465 static _serializePrintMessage(object) { |
466 return _serializeMessage(dart.map({command: "print", msg: object})); | 466 return _serializeMessage(dart.map({command: "print", msg: object})); |
467 } | 467 } |
468 maybeCloseWorker() { | 468 maybeCloseWorker() { |
469 if (dart.notNull(this.isWorker) && dart.notNull(this.isolates.isEmpty) &&
this.topEventLoop[_activeJsAsyncCount] == 0) { | 469 if (dart.notNull(this.isWorker) && dart.notNull(this.isolates.isEmpty) &&
this.topEventLoop[_activeJsAsyncCount] == 0) { |
470 this.mainManager.postMessage(_serializeMessage(dart.map({command: 'close
'}))); | 470 this.mainManager.postMessage(_serializeMessage(dart.map({command: 'close
'}))); |
471 } | 471 } |
472 } | 472 } |
473 } | 473 } |
474 let _controlPort = Symbol('_controlPort'); | |
475 let _scheduledControlEvents = Symbol('_scheduledControlEvents'); | 474 let _scheduledControlEvents = Symbol('_scheduledControlEvents'); |
476 let _isExecutingEvent = Symbol('_isExecutingEvent'); | 475 let _isExecutingEvent = Symbol('_isExecutingEvent'); |
477 let _updateGlobalState = Symbol('_updateGlobalState'); | 476 let _updateGlobalState = Symbol('_updateGlobalState'); |
478 let _setGlobals = Symbol('_setGlobals'); | 477 let _setGlobals = Symbol('_setGlobals'); |
479 let _addRegistration = Symbol('_addRegistration'); | 478 let _addRegistration = Symbol('_addRegistration'); |
480 let _close = Symbol('_close'); | 479 let _close = Symbol('_close'); |
481 class _IsolateContext extends core.Object { | 480 class _IsolateContext extends core.Object { |
482 _IsolateContext() { | 481 _IsolateContext() { |
483 this.id = (() => { | 482 this.id = (() => { |
484 let o = exports._globalState, x = o.nextIsolateId; | 483 let o = exports._globalState, x = o.nextIsolateId; |
485 o.nextIsolateId = dart.notNull(x) + 1; | 484 o.nextIsolateId = dart.notNull(x) + 1; |
486 return x; | 485 return x; |
487 })(); | 486 })(); |
488 this.ports = new (core.Map$(core.int, RawReceivePortImpl))(); | 487 this.ports = new (core.Map$(core.int, RawReceivePortImpl))(); |
489 this.weakPorts = new (core.Set$(core.int))(); | 488 this.weakPorts = new (core.Set$(core.int))(); |
490 this.isolateStatics = _foreign_helper.JS_CREATE_ISOLATE(); | 489 this.isolateStatics = _foreign_helper.JS_CREATE_ISOLATE(); |
491 this.controlPort = new RawReceivePortImpl[_controlPort](); | 490 this.controlPort = new RawReceivePortImpl._controlPort(); |
492 this.pauseCapability = new isolate.Capability(); | 491 this.pauseCapability = new isolate.Capability(); |
493 this.terminateCapability = new isolate.Capability(); | 492 this.terminateCapability = new isolate.Capability(); |
494 this.delayedEvents = dart.setType([], core.List$(_IsolateEvent)); | 493 this.delayedEvents = dart.setType([], core.List$(_IsolateEvent)); |
495 this.pauseTokens = new (core.Set$(isolate.Capability))(); | 494 this.pauseTokens = new (core.Set$(isolate.Capability))(); |
496 this.errorPorts = new (core.Set$(isolate.SendPort))(); | 495 this.errorPorts = new (core.Set$(isolate.SendPort))(); |
497 this.initialized = false; | 496 this.initialized = false; |
498 this.isPaused = false; | 497 this.isPaused = false; |
499 this.doneHandlers = null; | 498 this.doneHandlers = null; |
500 this[_scheduledControlEvents] = null; | 499 this[_scheduledControlEvents] = null; |
501 this[_isExecutingEvent] = false; | 500 this[_isExecutingEvent] = false; |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 exports.leaveJsAsync = leaveJsAsync; | 1378 exports.leaveJsAsync = leaveJsAsync; |
1380 exports.isWorker = isWorker; | 1379 exports.isWorker = isWorker; |
1381 exports.startRootIsolate = startRootIsolate; | 1380 exports.startRootIsolate = startRootIsolate; |
1382 exports.IsolateNatives = IsolateNatives; | 1381 exports.IsolateNatives = IsolateNatives; |
1383 exports.RawReceivePortImpl = RawReceivePortImpl; | 1382 exports.RawReceivePortImpl = RawReceivePortImpl; |
1384 exports.ReceivePortImpl = ReceivePortImpl; | 1383 exports.ReceivePortImpl = ReceivePortImpl; |
1385 exports.TimerImpl = TimerImpl; | 1384 exports.TimerImpl = TimerImpl; |
1386 exports.hasTimer = hasTimer; | 1385 exports.hasTimer = hasTimer; |
1387 exports.CapabilityImpl = CapabilityImpl; | 1386 exports.CapabilityImpl = CapabilityImpl; |
1388 })(_isolate_helper || (_isolate_helper = {})); | 1387 })(_isolate_helper || (_isolate_helper = {})); |
OLD | NEW |