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

Side by Side Diff: test/codegen/expect/dart/_isolate_helper.js

Issue 1023543002: Enable inference in the core libs (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « test/codegen/expect/dart/_interceptors.js ('k') | test/codegen/expect/dart/_js_helper.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return new List.from(['capability', x[_id]]); 141 return new List.from(['capability', x[_id]]);
142 } 142 }
143 serializeClosure(x) { 143 serializeClosure(x) {
144 let name = IsolateNatives._getJSFunctionName(x); 144 let name = IsolateNatives._getJSFunctionName(x);
145 if (name === null) { 145 if (name === null) {
146 this.unsupported(x, "Closures can't be transmitted:"); 146 this.unsupported(x, "Closures can't be transmitted:");
147 } 147 }
148 return new List.from(['function', name]); 148 return new List.from(['function', name]);
149 } 149 }
150 serializeDartObject(x) { 150 serializeDartObject(x) {
151 let classExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_js_em bedded_names.CLASS_ID_EXTRACTOR, core.String)); 151 let classExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n ames.CLASS_ID_EXTRACTOR);
152 let fieldsExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_js_e mbedded_names.CLASS_FIELDS_EXTRACTOR, core.String)); 152 let fieldsExtractor = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_ names.CLASS_FIELDS_EXTRACTOR);
153 let classId = classExtractor(x); 153 let classId = classExtractor(x);
154 let fields = dart.as(fieldsExtractor(x), core.List); 154 let fields = dart.as(fieldsExtractor(x), core.List);
155 return new List.from(['dart', classId, this.serializeArrayInPlace(dart.as( fields, _interceptors.JSArray))]); 155 return new List.from(['dart', classId, this.serializeArrayInPlace(dart.as( fields, _interceptors.JSArray))]);
156 } 156 }
157 } 157 }
158 let _adjustSendPorts = Symbol('_adjustSendPorts'); 158 let _adjustSendPorts = Symbol('_adjustSendPorts');
159 class _Deserializer extends core.Object { 159 class _Deserializer extends core.Object {
160 _Deserializer(opt$) { 160 _Deserializer(opt$) {
161 let adjustSendPorts = opt$.adjustSendPorts === void 0 ? true : opt$.adjust SendPorts; 161 let adjustSendPorts = opt$.adjustSendPorts === void 0 ? true : opt$.adjust SendPorts;
162 this.deserializedObjects = new core.List(); 162 this.deserializedObjects = new core.List();
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 dart.assert(dart.equals(dart.dindex(x, 0), 'function')); 304 dart.assert(dart.equals(dart.dindex(x, 0), 'function'));
305 let name = dart.as(dart.dindex(x, 1), core.String); 305 let name = dart.as(dart.dindex(x, 1), core.String);
306 let result = dart.as(IsolateNatives._getJSFunctionFromName(name), core.Fun ction); 306 let result = dart.as(IsolateNatives._getJSFunctionFromName(name), core.Fun ction);
307 this.deserializedObjects.add(result); 307 this.deserializedObjects.add(result);
308 return result; 308 return result;
309 } 309 }
310 deserializeDartObject(x) { 310 deserializeDartObject(x) {
311 dart.assert(dart.equals(dart.dindex(x, 0), 'dart')); 311 dart.assert(dart.equals(dart.dindex(x, 0), 'dart'));
312 let classId = dart.as(dart.dindex(x, 1), core.String); 312 let classId = dart.as(dart.dindex(x, 1), core.String);
313 let fields = dart.as(dart.dindex(x, 2), core.List); 313 let fields = dart.as(dart.dindex(x, 2), core.List);
314 let instanceFromClassId = _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_ js_embedded_names.INSTANCE_FROM_CLASS_ID, core.String)); 314 let instanceFromClassId = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embed ded_names.INSTANCE_FROM_CLASS_ID);
315 let initializeObject = _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_js_ embedded_names.INITIALIZE_EMPTY_INSTANCE, core.String)); 315 let initializeObject = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded _names.INITIALIZE_EMPTY_INSTANCE);
316 let emptyInstance = instanceFromClassId(classId); 316 let emptyInstance = instanceFromClassId(classId);
317 this.deserializedObjects.add(emptyInstance); 317 this.deserializedObjects.add(emptyInstance);
318 this.deserializeArrayInPlace(dart.as(fields, _interceptors.JSArray)); 318 this.deserializeArrayInPlace(dart.as(fields, _interceptors.JSArray));
319 return initializeObject(classId, emptyInstance, fields); 319 return initializeObject(classId, emptyInstance, fields);
320 } 320 }
321 } 321 }
322 // Function _callInIsolate: (_IsolateContext, Function) → dynamic 322 // Function _callInIsolate: (_IsolateContext, Function) → dynamic
323 function _callInIsolate(isolate, function) { 323 function _callInIsolate(isolate, function) {
324 let result = isolate.eval(function); 324 let result = isolate.eval(function);
325 exports._globalState.topEventLoop.run(); 325 exports._globalState.topEventLoop.run();
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 let _consoleLog = Symbol('_consoleLog'); 783 let _consoleLog = Symbol('_consoleLog');
784 let _getJSFunctionFromName = Symbol('_getJSFunctionFromName'); 784 let _getJSFunctionFromName = Symbol('_getJSFunctionFromName');
785 let _getJSFunctionName = Symbol('_getJSFunctionName'); 785 let _getJSFunctionName = Symbol('_getJSFunctionName');
786 let _allocate = Symbol('_allocate'); 786 let _allocate = Symbol('_allocate');
787 let _startWorker = Symbol('_startWorker'); 787 let _startWorker = Symbol('_startWorker');
788 let _startNonWorker = Symbol('_startNonWorker'); 788 let _startNonWorker = Symbol('_startNonWorker');
789 let _startIsolate = Symbol('_startIsolate'); 789 let _startIsolate = Symbol('_startIsolate');
790 let _spawnWorker = Symbol('_spawnWorker'); 790 let _spawnWorker = Symbol('_spawnWorker');
791 class IsolateNatives extends core.Object { 791 class IsolateNatives extends core.Object {
792 static computeThisScript() { 792 static computeThisScript() {
793 let currentScript = _foreign_helper.JS_EMBEDDED_GLOBAL('', dart.as(_js_emb edded_names.CURRENT_SCRIPT, core.String)); 793 let currentScript = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na mes.CURRENT_SCRIPT);
794 if (currentScript !== null) { 794 if (currentScript !== null) {
795 return String(currentScript.src); 795 return String(currentScript.src);
796 } 796 }
797 if (_js_helper.Primitives.isD8) 797 if (_js_helper.Primitives.isD8)
798 return computeThisScriptD8(); 798 return computeThisScriptD8();
799 if (_js_helper.Primitives.isJsshell) 799 if (_js_helper.Primitives.isJsshell)
800 return computeThisScriptJsshell(); 800 return computeThisScriptJsshell();
801 if (exports._globalState.isWorker) 801 if (exports._globalState.isWorker)
802 return computeThisScriptFromTrace(); 802 return computeThisScriptFromTrace();
803 return null; 803 return null;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 throw new core.Exception(trace); 906 throw new core.Exception(trace);
907 } 907 }
908 908
909 } 909 }
910 } 910 }
911 static [_consoleLog](msg) { 911 static [_consoleLog](msg) {
912 _js_helper.requiresPreamble(); 912 _js_helper.requiresPreamble();
913 self.console.log(msg); 913 self.console.log(msg);
914 } 914 }
915 static [_getJSFunctionFromName](functionName) { 915 static [_getJSFunctionFromName](functionName) {
916 let globalFunctionsContainer = _foreign_helper.JS_EMBEDDED_GLOBAL("", dart .as(_js_embedded_names.GLOBAL_FUNCTIONS, core.String)); 916 let globalFunctionsContainer = _foreign_helper.JS_EMBEDDED_GLOBAL("", _js_ embedded_names.GLOBAL_FUNCTIONS);
917 return globalFunctionsContainer[functionName](); 917 return globalFunctionsContainer[functionName]();
918 } 918 }
919 static [_getJSFunctionName](f) { 919 static [_getJSFunctionName](f) {
920 return dart.as(dart.is(f, _js_helper.Closure) ? f.$name : null, core.Strin g); 920 return dart.as(dart.is(f, _js_helper.Closure) ? f.$name : null, core.Strin g);
921 } 921 }
922 static [_allocate](ctor) { 922 static [_allocate](ctor) {
923 return new ctor(); 923 return new ctor();
924 } 924 }
925 static spawnFunction(topLevelFunction, message, startPaused) { 925 static spawnFunction(topLevelFunction, message, startPaused) {
926 IsolateNatives.enableSpawnWorker = true; 926 IsolateNatives.enableSpawnWorker = true;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 exports.globalWindow = globalWindow; 1304 exports.globalWindow = globalWindow;
1305 exports.globalWorker = globalWorker; 1305 exports.globalWorker = globalWorker;
1306 exports.globalPostMessageDefined = globalPostMessageDefined; 1306 exports.globalPostMessageDefined = globalPostMessageDefined;
1307 exports.IsolateNatives = IsolateNatives; 1307 exports.IsolateNatives = IsolateNatives;
1308 exports.RawReceivePortImpl = RawReceivePortImpl; 1308 exports.RawReceivePortImpl = RawReceivePortImpl;
1309 exports.ReceivePortImpl = ReceivePortImpl; 1309 exports.ReceivePortImpl = ReceivePortImpl;
1310 exports.TimerImpl = TimerImpl; 1310 exports.TimerImpl = TimerImpl;
1311 exports.hasTimer = hasTimer; 1311 exports.hasTimer = hasTimer;
1312 exports.CapabilityImpl = CapabilityImpl; 1312 exports.CapabilityImpl = CapabilityImpl;
1313 })(_isolate_helper || (_isolate_helper = {})); 1313 })(_isolate_helper || (_isolate_helper = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/dart/_interceptors.js ('k') | test/codegen/expect/dart/_js_helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698