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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 return backend.rti.representationGenerator | 299 return backend.rti.representationGenerator |
300 .templateForCreateFunctionType; | 300 .templateForCreateFunctionType; |
301 | 301 |
302 case JsBuiltin.isSubtype: | 302 case JsBuiltin.isSubtype: |
303 // TODO(floitsch): move this closer to where is-check properties are | 303 // TODO(floitsch): move this closer to where is-check properties are |
304 // built. | 304 // built. |
305 String isPrefix = namer.operatorIsPrefix; | 305 String isPrefix = namer.operatorIsPrefix; |
306 return jsAst.js.expressionTemplateFor( | 306 return jsAst.js.expressionTemplateFor( |
307 "('$isPrefix' + #) in #.prototype"); | 307 "('$isPrefix' + #) in #.prototype"); |
308 | 308 |
| 309 case JsBuiltin.getMetadata: |
| 310 String metadataAccess = |
| 311 generateEmbeddedGlobalAccessString(embeddedNames.METADATA); |
| 312 return jsAst.js.expressionTemplateFor("$metadataAccess[#]"); |
| 313 |
| 314 case JsBuiltin.getType: |
| 315 String typesAccess = |
| 316 generateEmbeddedGlobalAccessString(embeddedNames.TYPES); |
| 317 return jsAst.js.expressionTemplateFor("$typesAccess[#]"); |
| 318 |
309 default: | 319 default: |
310 compiler.internalError(NO_LOCATION_SPANNABLE, | 320 compiler.internalError(NO_LOCATION_SPANNABLE, |
311 "Unhandled Builtin: $builtin"); | 321 "Unhandled Builtin: $builtin"); |
312 return null; | 322 return null; |
313 } | 323 } |
314 } | 324 } |
315 | 325 |
316 List<jsAst.Statement> buildTrivialNsmHandlers(){ | 326 List<jsAst.Statement> buildTrivialNsmHandlers(){ |
317 return nsmEmitter.buildTrivialNsmHandlers(); | 327 return nsmEmitter.buildTrivialNsmHandlers(); |
318 } | 328 } |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 1951 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
1942 if (element.isInstanceMember) { | 1952 if (element.isInstanceMember) { |
1943 cachedClassBuilders.remove(element.enclosingClass); | 1953 cachedClassBuilders.remove(element.enclosingClass); |
1944 | 1954 |
1945 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 1955 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
1946 | 1956 |
1947 } | 1957 } |
1948 } | 1958 } |
1949 } | 1959 } |
1950 } | 1960 } |
OLD | NEW |