| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Sorting by the long name clusters constants with the same constructor | 110 // Sorting by the long name clusters constants with the same constructor |
| 111 // which compresses a tiny bit better. | 111 // which compresses a tiny bit better. |
| 112 int r = namer.constantLongName(a).compareTo(namer.constantLongName(b)); | 112 int r = namer.constantLongName(a).compareTo(namer.constantLongName(b)); |
| 113 if (r != 0) return r; | 113 if (r != 0) return r; |
| 114 | 114 |
| 115 // Resolve collisions in the long name by using a structural order. | 115 // Resolve collisions in the long name by using a structural order. |
| 116 return deepCompareConstants(a, b); | 116 return deepCompareConstants(a, b); |
| 117 } | 117 } |
| 118 | 118 |
| 119 js.Expression generateStaticClosureAccess(MethodElement element) { | 119 js.Expression generateStaticClosureAccess(MethodElement element) { |
| 120 return js.js('#.#()', | 120 return js.js('#.#()', [ |
| 121 [namer.globalObjectFor(element), namer.staticClosureName(element)]); | 121 namer.globalObjectForMember(element), |
| 122 namer.staticClosureName(element) |
| 123 ]); |
| 122 } | 124 } |
| 123 | 125 |
| 124 js.Expression generateConstantReference(ConstantValue value) { | 126 js.Expression generateConstantReference(ConstantValue value) { |
| 125 if (value.isFunction) { | 127 if (value.isFunction) { |
| 126 FunctionConstantValue functionConstant = value; | 128 FunctionConstantValue functionConstant = value; |
| 127 return generateStaticClosureAccess(functionConstant.element); | 129 return generateStaticClosureAccess(functionConstant.element); |
| 128 } | 130 } |
| 129 | 131 |
| 130 // We are only interested in the "isInlined" part, but it does not hurt to | 132 // We are only interested in the "isInlined" part, but it does not hurt to |
| 131 // test for the other predicates. | 133 // test for the other predicates. |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 #eagerClasses; | 1289 #eagerClasses; |
| 1288 | 1290 |
| 1289 var end = Date.now(); | 1291 var end = Date.now(); |
| 1290 // print('Setup: ' + (end - start) + ' ms.'); | 1292 // print('Setup: ' + (end - start) + ' ms.'); |
| 1291 | 1293 |
| 1292 #invokeMain; // Start main. | 1294 #invokeMain; // Start main. |
| 1293 | 1295 |
| 1294 })(Date.now(), #code) | 1296 })(Date.now(), #code) |
| 1295 }"""; | 1297 }"""; |
| 1296 } | 1298 } |
| OLD | NEW |