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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 | 7 |
8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
9 final Compiler compiler; | 9 final Compiler compiler; |
10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 return globalPropertyAccess(element); | 269 return globalPropertyAccess(element); |
270 } | 270 } |
271 | 271 |
272 @override | 272 @override |
273 jsAst.Template templateForBuiltin(JsBuiltin builtin) { | 273 jsAst.Template templateForBuiltin(JsBuiltin builtin) { |
274 switch (builtin) { | 274 switch (builtin) { |
275 case JsBuiltin.dartObjectConstructor: | 275 case JsBuiltin.dartObjectConstructor: |
276 return jsAst.js.expressionTemplateYielding( | 276 return jsAst.js.expressionTemplateYielding( |
277 typeAccess(compiler.objectClass)); | 277 typeAccess(compiler.objectClass)); |
278 | 278 |
279 case JsBuiltin.classNameFromIsCheckProperty: | 279 case JsBuiltin.isCheckPropertyToJsConstructorName: |
280 int isPrefixLength = namer.operatorIsPrefix.length; | 280 int isPrefixLength = namer.operatorIsPrefix.length; |
281 return jsAst.js.expressionTemplateFor('#.substring($isPrefixLength)'); | 281 return jsAst.js.expressionTemplateFor('#.substring($isPrefixLength)'); |
282 | 282 |
283 case JsBuiltin.isFunctionType: | 283 case JsBuiltin.isFunctionType: |
284 return backend.rti.representationGenerator.templateForIsFunctionType; | 284 return backend.rti.representationGenerator.templateForIsFunctionType; |
285 | 285 |
286 case JsBuiltin.typeName: | 286 case JsBuiltin.rawRtiToJsConstructorName: |
287 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); | 287 return jsAst.js.expressionTemplateFor("#.$typeNameProperty"); |
288 | 288 |
289 case JsBuiltin.rawRuntimeType: | 289 case JsBuiltin.rawRuntimeType: |
290 return jsAst.js.expressionTemplateFor("#.constructor"); | 290 return jsAst.js.expressionTemplateFor("#.constructor"); |
291 | 291 |
292 case JsBuiltin.createFunctionType: | 292 case JsBuiltin.createFunctionTypeRti: |
293 return backend.rti.representationGenerator | 293 return backend.rti.representationGenerator |
294 .templateForCreateFunctionType; | 294 .templateForCreateFunctionType; |
295 | 295 |
296 case JsBuiltin.isSubtype: | 296 case JsBuiltin.isSubtype: |
297 // TODO(floitsch): move this closer to where is-check properties are | 297 // TODO(floitsch): move this closer to where is-check properties are |
298 // built. | 298 // built. |
299 String isPrefix = namer.operatorIsPrefix; | 299 String isPrefix = namer.operatorIsPrefix; |
300 return jsAst.js.expressionTemplateFor( | 300 return jsAst.js.expressionTemplateFor( |
301 "('$isPrefix' + #) in #.prototype"); | 301 "('$isPrefix' + #) in #.prototype"); |
302 | 302 |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 1964 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
1965 if (element.isInstanceMember) { | 1965 if (element.isInstanceMember) { |
1966 cachedClassBuilders.remove(element.enclosingClass); | 1966 cachedClassBuilders.remove(element.enclosingClass); |
1967 | 1967 |
1968 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 1968 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
1969 | 1969 |
1970 } | 1970 } |
1971 } | 1971 } |
1972 } | 1972 } |
1973 } | 1973 } |
OLD | NEW |