Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Side by Side Diff: lib/runtime/dart/_isolate_helper.js

Issue 1100633006: Generate static calls for Object fields and methods (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 if (self.console && self.console.error) { 595 if (self.console && self.console.error) {
596 self.console.error(error, stackTrace); 596 self.console.error(error, stackTrace);
597 } else { 597 } else {
598 core.print(error); 598 core.print(error);
599 if (stackTrace != null) 599 if (stackTrace != null)
600 core.print(stackTrace); 600 core.print(stackTrace);
601 } 601 }
602 return; 602 return;
603 } 603 }
604 let message = new core.List(2); 604 let message = new core.List(2);
605 message[core.$set](0, error.toString()); 605 message[core.$set](0, dart.toString(error));
606 message[core.$set](1, stackTrace == null ? null : stackTrace.toString()); 606 message[core.$set](1, stackTrace == null ? null : dart.toString(stackTrace ));
607 for (let port of this.errorPorts) 607 for (let port of this.errorPorts)
608 port.send(message); 608 port.send(message);
609 } 609 }
610 eval(code) { 610 eval(code) {
611 let old = exports._globalState.currentContext; 611 let old = exports._globalState.currentContext;
612 exports._globalState.currentContext = this; 612 exports._globalState.currentContext = this;
613 this[_setGlobals](); 613 this[_setGlobals]();
614 let result = null; 614 let result = null;
615 this[_isExecutingEvent] = true; 615 this[_isExecutingEvent] = true;
616 try { 616 try {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 throw new core.UnsupportedError("only top-level functions can be spawned ."); 1002 throw new core.UnsupportedError("only top-level functions can be spawned .");
1003 } 1003 }
1004 let isLight = false; 1004 let isLight = false;
1005 let isSpawnUri = false; 1005 let isSpawnUri = false;
1006 return IsolateNatives.spawn(name, null, null, message, isLight, isSpawnUri , startPaused); 1006 return IsolateNatives.spawn(name, null, null, message, isLight, isSpawnUri , startPaused);
1007 } 1007 }
1008 static spawnUri(uri, args, message, startPaused) { 1008 static spawnUri(uri, args, message, startPaused) {
1009 IsolateNatives.enableSpawnWorker = true; 1009 IsolateNatives.enableSpawnWorker = true;
1010 let isLight = false; 1010 let isLight = false;
1011 let isSpawnUri = true; 1011 let isSpawnUri = true;
1012 return IsolateNatives.spawn(null, uri.toString(), args, message, isLight, isSpawnUri, startPaused); 1012 return IsolateNatives.spawn(null, dart.toString(uri), args, message, isLig ht, isSpawnUri, startPaused);
1013 } 1013 }
1014 static spawn(functionName, uri, args, message, isLight, isSpawnUri, startPau sed) { 1014 static spawn(functionName, uri, args, message, isLight, isSpawnUri, startPau sed) {
1015 if (uri != null && dart.notNull(uri.endsWith(".dart"))) { 1015 if (uri != null && dart.notNull(uri.endsWith(".dart"))) {
1016 uri = dart.notNull(uri) + ".js"; 1016 uri = dart.notNull(uri) + ".js";
1017 } 1017 }
1018 let port = new isolate.ReceivePort(); 1018 let port = new isolate.ReceivePort();
1019 let completer = new (async.Completer$(core.List))(); 1019 let completer = new (async.Completer$(core.List))();
1020 port.first.then(msg => { 1020 port.first.then(msg => {
1021 if (dart.equals(dart.dindex(msg, 0), _SPAWNED_SIGNAL)) { 1021 if (dart.equals(dart.dindex(msg, 0), _SPAWNED_SIGNAL)) {
1022 completer.complete(msg); 1022 completer.complete(msg);
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 exports.leaveJsAsync = leaveJsAsync; 1393 exports.leaveJsAsync = leaveJsAsync;
1394 exports.isWorker = isWorker; 1394 exports.isWorker = isWorker;
1395 exports.startRootIsolate = startRootIsolate; 1395 exports.startRootIsolate = startRootIsolate;
1396 exports.IsolateNatives = IsolateNatives; 1396 exports.IsolateNatives = IsolateNatives;
1397 exports.RawReceivePortImpl = RawReceivePortImpl; 1397 exports.RawReceivePortImpl = RawReceivePortImpl;
1398 exports.ReceivePortImpl = ReceivePortImpl; 1398 exports.ReceivePortImpl = ReceivePortImpl;
1399 exports.TimerImpl = TimerImpl; 1399 exports.TimerImpl = TimerImpl;
1400 exports.hasTimer = hasTimer; 1400 exports.hasTimer = hasTimer;
1401 exports.CapabilityImpl = CapabilityImpl; 1401 exports.CapabilityImpl = CapabilityImpl;
1402 })(_isolate_helper || (_isolate_helper = {})); 1402 })(_isolate_helper || (_isolate_helper = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698