| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.js_emitter.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
| 8 /// function. | 8 /// function. |
| 9 /// | 9 /// |
| 10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 if (method is StaticDartMethod) { | 1161 if (method is StaticDartMethod) { |
| 1162 if (method.needsTearOff) { | 1162 if (method.needsTearOff) { |
| 1163 Holder holder = method.holder; | 1163 Holder holder = method.holder; |
| 1164 inits.add( | 1164 inits.add( |
| 1165 emitInstallTearOff(new js.VariableUse(holder.name), method)); | 1165 emitInstallTearOff(new js.VariableUse(holder.name), method)); |
| 1166 } | 1166 } |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| 1169 for (Class cls in library.classes) { | 1169 for (Class cls in library.classes) { |
| 1170 if (cls.isSoftDeferred != softDeferred) continue; | 1170 if (cls.isSoftDeferred != softDeferred) continue; |
| 1171 var methods = cls.methods.where((m) => m.needsTearOff).toList(); | 1171 var methods = cls.methods.where((dynamic m) => m.needsTearOff).toList(); |
| 1172 js.Expression container = js.js("#.prototype", classReference(cls)); | 1172 js.Expression container = js.js("#.prototype", classReference(cls)); |
| 1173 js.Expression reference = container; | 1173 js.Expression reference = container; |
| 1174 if (methods.length > 1) { | 1174 if (methods.length > 1) { |
| 1175 if (temp == null) { | 1175 if (temp == null) { |
| 1176 inits.add(js.js.statement('var _;')); | 1176 inits.add(js.js.statement('var _;')); |
| 1177 temp = js.js('_'); | 1177 temp = js.js('_'); |
| 1178 } | 1178 } |
| 1179 // First call uses assignment to temp to cache the container. | 1179 // First call uses assignment to temp to cache the container. |
| 1180 reference = js.js('# = #', [temp, container]); | 1180 reference = js.js('# = #', [temp, container]); |
| 1181 } | 1181 } |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1553 } |
| 1554 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1554 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1555 js.objectLiteral(interceptorsByTag))); | 1555 js.objectLiteral(interceptorsByTag))); |
| 1556 statements.add( | 1556 statements.add( |
| 1557 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1557 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
| 1558 statements.addAll(subclassAssignments); | 1558 statements.addAll(subclassAssignments); |
| 1559 | 1559 |
| 1560 return wrapPhase('nativeSupport', statements); | 1560 return wrapPhase('nativeSupport', statements); |
| 1561 } | 1561 } |
| 1562 } | 1562 } |
| OLD | NEW |