| 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.new_js_emitter.emitter; | 5 library dart2js.new_js_emitter.emitter; |
| 6 | 6 |
| 7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show | 7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show |
| 8 JsBuiltin, | 8 JsBuiltin, |
| 9 METADATA, | 9 METADATA, |
| 10 TYPES; | 10 TYPES; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return _backend.rti.representationGenerator | 164 return _backend.rti.representationGenerator |
| 165 .templateForCreateFunctionType; | 165 .templateForCreateFunctionType; |
| 166 | 166 |
| 167 case JsBuiltin.isSubtype: | 167 case JsBuiltin.isSubtype: |
| 168 // TODO(floitsch): move this closer to where is-check properties are | 168 // TODO(floitsch): move this closer to where is-check properties are |
| 169 // built. | 169 // built. |
| 170 String isPrefix = namer.operatorIsPrefix; | 170 String isPrefix = namer.operatorIsPrefix; |
| 171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); | 171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); |
| 172 | 172 |
| 173 case JsBuiltin.getMetadata: | 173 case JsBuiltin.getMetadata: |
| 174 String metadataAccess = | 174 return _emitter.templateForReadMetadata; |
| 175 _emitter.generateEmbeddedGlobalAccessString(METADATA); | |
| 176 return js.js.expressionTemplateFor("$metadataAccess[#]"); | |
| 177 | 175 |
| 178 case JsBuiltin.getType: | 176 case JsBuiltin.getType: |
| 179 return _emitter.templateForReadType; | 177 return _emitter.templateForReadType; |
| 180 | 178 |
| 181 default: | 179 default: |
| 182 _compiler.internalError(NO_LOCATION_SPANNABLE, | 180 _compiler.internalError(NO_LOCATION_SPANNABLE, |
| 183 "Unhandled Builtin: $builtin"); | 181 "Unhandled Builtin: $builtin"); |
| 184 return null; | 182 return null; |
| 185 } | 183 } |
| 186 } | 184 } |
| 187 | 185 |
| 188 @override | 186 @override |
| 189 void invalidateCaches() { | 187 void invalidateCaches() { |
| 190 } | 188 } |
| 191 } | 189 } |
| OLD | NEW |