OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.lazy_emitter.model_emitter; | 5 library dart2js.js_emitter.lazy_emitter.model_emitter; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' | 7 import 'package:js_runtime/shared/embedded_names.dart' |
8 show | 8 show |
9 CREATE_NEW_ISOLATE, | 9 CREATE_NEW_ISOLATE, |
10 DEFERRED_LIBRARY_URIS, | 10 DEFERRED_LIBRARY_URIS, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 elements.add( | 216 elements.add( |
217 emitLazilyInitializedStatics(fragment.staticLazilyInitializedFields)); | 217 emitLazilyInitializedStatics(fragment.staticLazilyInitializedFields)); |
218 elements.add(emitConstants(fragment.constants)); | 218 elements.add(emitConstants(fragment.constants)); |
219 | 219 |
220 js.Expression code = new js.ArrayInitializer(elements); | 220 js.Expression code = new js.ArrayInitializer(elements); |
221 | 221 |
222 Map<String, dynamic> holes = { | 222 Map<String, dynamic> holes = { |
223 'deferredInitializer': emitDeferredInitializerGlobal(program.loadMap), | 223 'deferredInitializer': emitDeferredInitializerGlobal(program.loadMap), |
224 'holders': emitHolders(program.holders), | 224 'holders': emitHolders(program.holders), |
225 'tearOff': buildTearOffCode(compiler.options, backend.emitter.emitter, | 225 'tearOff': buildTearOffCode(compiler.options, backend.emitter.emitter, |
226 backend.namer, compiler.commonElements), | 226 backend.namer, _closedWorld.commonElements), |
227 'parseFunctionDescriptor': | 227 'parseFunctionDescriptor': |
228 js.js.statement(parseFunctionDescriptorBoilerplate, { | 228 js.js.statement(parseFunctionDescriptorBoilerplate, { |
229 'argumentCount': js.string(namer.requiredParameterField), | 229 'argumentCount': js.string(namer.requiredParameterField), |
230 'defaultArgumentValues': js.string(namer.defaultValuesField), | 230 'defaultArgumentValues': js.string(namer.defaultValuesField), |
231 'callName': js.string(namer.callNameField) | 231 'callName': js.string(namer.callNameField) |
232 }), | 232 }), |
233 'cyclicThrow': backend.emitter | 233 'cyclicThrow': backend.emitter |
234 .staticFunctionAccess(_closedWorld.commonElements.cyclicThrowHelper), | 234 .staticFunctionAccess(_closedWorld.commonElements.cyclicThrowHelper), |
235 'outputContainsConstantList': program.outputContainsConstantList, | 235 'outputContainsConstantList': program.outputContainsConstantList, |
236 'embeddedGlobals': emitEmbeddedGlobals(program), | 236 'embeddedGlobals': emitEmbeddedGlobals(program), |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 new js.VariableDeclaration("init", allowRename: false), | 358 new js.VariableDeclaration("init", allowRename: false), |
359 globalsObject) | 359 globalsObject) |
360 ])) | 360 ])) |
361 ]; | 361 ]; |
362 return new js.Block(statements); | 362 return new js.Block(statements); |
363 } | 363 } |
364 | 364 |
365 js.Property emitMangledGlobalNames() { | 365 js.Property emitMangledGlobalNames() { |
366 List<js.Property> names = <js.Property>[]; | 366 List<js.Property> names = <js.Property>[]; |
367 | 367 |
368 CommonElements commonElements = compiler.commonElements; | 368 CommonElements commonElements = _closedWorld.commonElements; |
369 // We want to keep the original names for the most common core classes when | 369 // We want to keep the original names for the most common core classes when |
370 // calling toString on them. | 370 // calling toString on them. |
371 List<ClassElement> nativeClassesNeedingUnmangledName = [ | 371 List<ClassElement> nativeClassesNeedingUnmangledName = [ |
372 commonElements.intClass, | 372 commonElements.intClass, |
373 commonElements.doubleClass, | 373 commonElements.doubleClass, |
374 commonElements.numClass, | 374 commonElements.numClass, |
375 commonElements.stringClass, | 375 commonElements.stringClass, |
376 commonElements.boolClass, | 376 commonElements.boolClass, |
377 commonElements.nullClass, | 377 commonElements.nullClass, |
378 commonElements.listClass | 378 commonElements.listClass |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 #eagerClasses; | 1289 #eagerClasses; |
1290 | 1290 |
1291 var end = Date.now(); | 1291 var end = Date.now(); |
1292 // print('Setup: ' + (end - start) + ' ms.'); | 1292 // print('Setup: ' + (end - start) + ' ms.'); |
1293 | 1293 |
1294 #invokeMain; // Start main. | 1294 #invokeMain; // Start main. |
1295 | 1295 |
1296 })(Date.now(), #code) | 1296 })(Date.now(), #code) |
1297 }"""; | 1297 }"""; |
1298 } | 1298 } |
OLD | NEW |