| 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 code_generator_dependencies; | 5 library code_generator_dependencies; |
| 6 | 6 |
| 7 import '../js_backend.dart'; | 7 import '../js_backend.dart'; |
| 8 import '../../common/registry.dart' show | 8 import '../../common/registry.dart' show |
| 9 Registry; | 9 Registry; |
| 10 import '../../common/codegen.dart' show | 10 import '../../common/codegen.dart' show |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return _backend.mapLiteralConstructorEmpty; | 105 return _backend.mapLiteralConstructorEmpty; |
| 106 } | 106 } |
| 107 | 107 |
| 108 FunctionElement get identicalFunction => _compiler.identicalFunction; | 108 FunctionElement get identicalFunction => _compiler.identicalFunction; |
| 109 | 109 |
| 110 js.Name invocationName(Selector selector) { | 110 js.Name invocationName(Selector selector) { |
| 111 return _namer.invocationName(selector); | 111 return _namer.invocationName(selector); |
| 112 } | 112 } |
| 113 | 113 |
| 114 FunctionElement get createInvocationMirrorMethod { | 114 FunctionElement get createInvocationMirrorMethod { |
| 115 return _backend.getCreateInvocationMirror(); | 115 return _backend.helpers.createInvocationMirror; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void registerUseInterceptorInCodegen() { | 118 void registerUseInterceptorInCodegen() { |
| 119 _backend.registerUseInterceptor(_enqueuer); | 119 _backend.registerUseInterceptor(_enqueuer); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool isInterceptedSelector(Selector selector) { | 122 bool isInterceptedSelector(Selector selector) { |
| 123 return _backend.isInterceptedSelector(selector); | 123 return _backend.isInterceptedSelector(selector); |
| 124 } | 124 } |
| 125 | 125 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 js.Name getInterceptorName(Set<ClassElement> interceptedClasses) { | 164 js.Name getInterceptorName(Set<ClassElement> interceptedClasses) { |
| 165 return _backend.namer.nameForGetInterceptor(interceptedClasses); | 165 return _backend.namer.nameForGetInterceptor(interceptedClasses); |
| 166 } | 166 } |
| 167 | 167 |
| 168 js.Expression getInterceptorLibrary() { | 168 js.Expression getInterceptorLibrary() { |
| 169 return new js.VariableUse( | 169 return new js.VariableUse( |
| 170 _backend.namer.globalObjectFor(_backend.interceptorsLibrary)); | 170 _backend.namer.globalObjectFor(_backend.interceptorsLibrary)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 FunctionElement getWrapExceptionHelper() { | 173 FunctionElement getWrapExceptionHelper() { |
| 174 return _backend.getWrapExceptionHelper(); | 174 return _backend.helpers.wrapExceptionHelper; |
| 175 } | 175 } |
| 176 | 176 |
| 177 FunctionElement getExceptionUnwrapper() { | 177 FunctionElement getExceptionUnwrapper() { |
| 178 return _backend.getExceptionUnwrapper(); | 178 return _backend.helpers.exceptionUnwrapper; |
| 179 } | 179 } |
| 180 | 180 |
| 181 FunctionElement getTraceFromException() { | 181 FunctionElement getTraceFromException() { |
| 182 return _backend.getTraceFromException(); | 182 return _backend.helpers.traceFromException; |
| 183 } | 183 } |
| 184 | 184 |
| 185 FunctionElement getCreateRuntimeType() { | 185 FunctionElement getCreateRuntimeType() { |
| 186 return _backend.getCreateRuntimeType(); | 186 return _backend.helpers.createRuntimeType; |
| 187 } | 187 } |
| 188 | 188 |
| 189 FunctionElement getRuntimeTypeToString() { | 189 FunctionElement getRuntimeTypeToString() { |
| 190 return _backend.getRuntimeTypeToString(); | 190 return _backend.helpers.runtimeTypeToString; |
| 191 } | 191 } |
| 192 | 192 |
| 193 FunctionElement getRuntimeTypeArgument() { | 193 FunctionElement getRuntimeTypeArgument() { |
| 194 return _backend.getGetRuntimeTypeArgument(); | 194 return _backend.helpers.getRuntimeTypeArgument; |
| 195 } | 195 } |
| 196 | 196 |
| 197 FunctionElement getTypeArgumentByIndex() { | 197 FunctionElement getTypeArgumentByIndex() { |
| 198 return _backend.getGetTypeArgumentByIndex(); | 198 return _backend.helpers.getTypeArgumentByIndex; |
| 199 } | 199 } |
| 200 | 200 |
| 201 FunctionElement getAddRuntimeTypeInformation() { | 201 FunctionElement getAddRuntimeTypeInformation() { |
| 202 return _backend.getSetRuntimeTypeInfo(); | 202 return _backend.helpers.setRuntimeTypeInfo; |
| 203 } | 203 } |
| 204 | 204 |
| 205 /// checkSubtype(value, $isT, typeArgs, $asT) | 205 /// checkSubtype(value, $isT, typeArgs, $asT) |
| 206 FunctionElement getCheckSubtype() { | 206 FunctionElement getCheckSubtype() { |
| 207 return _backend.getCheckSubtype(); | 207 return _backend.helpers.checkSubtype; |
| 208 } | 208 } |
| 209 | 209 |
| 210 /// subtypeCast(value, $isT, typeArgs, $asT) | 210 /// subtypeCast(value, $isT, typeArgs, $asT) |
| 211 FunctionElement getSubtypeCast() { | 211 FunctionElement getSubtypeCast() { |
| 212 return _backend.getSubtypeCast(); | 212 return _backend.helpers.subtypeCast; |
| 213 } | 213 } |
| 214 | 214 |
| 215 /// checkSubtypeOfRuntime(value, runtimeType) | 215 /// checkSubtypeOfRuntime(value, runtimeType) |
| 216 FunctionElement getCheckSubtypeOfRuntimeType() { | 216 FunctionElement getCheckSubtypeOfRuntimeType() { |
| 217 return _backend.getCheckSubtypeOfRuntimeType(); | 217 return _backend.helpers.checkSubtypeOfRuntimeType; |
| 218 } | 218 } |
| 219 | 219 |
| 220 /// subtypeOfRuntimeTypeCast(value, runtimeType) | 220 /// subtypeOfRuntimeTypeCast(value, runtimeType) |
| 221 FunctionElement getSubtypeOfRuntimeTypeCast() { | 221 FunctionElement getSubtypeOfRuntimeTypeCast() { |
| 222 return _backend.getSubtypeOfRuntimeTypeCast(); | 222 return _backend.helpers.subtypeOfRuntimeTypeCast; |
| 223 } | 223 } |
| 224 | 224 |
| 225 js.Expression getRuntimeTypeName(ClassElement cls) { | 225 js.Expression getRuntimeTypeName(ClassElement cls) { |
| 226 return js.quoteName(_namer.runtimeTypeName(cls)); | 226 return js.quoteName(_namer.runtimeTypeName(cls)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 int getTypeVariableIndex(TypeVariableType variable) { | 229 int getTypeVariableIndex(TypeVariableType variable) { |
| 230 return RuntimeTypes.getTypeVariableIndex(variable.element); | 230 return RuntimeTypes.getTypeVariableIndex(variable.element); |
| 231 } | 231 } |
| 232 | 232 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 bool isBoolClass(ClassElement classElement) => | 287 bool isBoolClass(ClassElement classElement) => |
| 288 classElement == _backend.jsBoolClass || | 288 classElement == _backend.jsBoolClass || |
| 289 classElement == _compiler.boolClass; | 289 classElement == _compiler.boolClass; |
| 290 | 290 |
| 291 // TODO(sra): Should this be part of CodegenRegistry? | 291 // TODO(sra): Should this be part of CodegenRegistry? |
| 292 void registerNativeBehavior(NativeBehavior nativeBehavior, node) { | 292 void registerNativeBehavior(NativeBehavior nativeBehavior, node) { |
| 293 if (nativeBehavior == null) return; | 293 if (nativeBehavior == null) return; |
| 294 _enqueuer.nativeEnqueuer.registerNativeBehavior(nativeBehavior, node); | 294 _enqueuer.nativeEnqueuer.registerNativeBehavior(nativeBehavior, node); |
| 295 } | 295 } |
| 296 } | 296 } |
| OLD | NEW |