Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); | 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); |
| 8 | 8 |
| 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); | 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); |
| 10 | 10 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 JavaScriptBackend get backend => compiler.backend; | 248 JavaScriptBackend get backend => compiler.backend; |
| 249 | 249 |
| 250 jsAst.PropertyAccess getHelperProperty(Element helper) { | 250 jsAst.PropertyAccess getHelperProperty(Element helper) { |
| 251 return backend.emitter.staticFunctionAccess(helper); | 251 return backend.emitter.staticFunctionAccess(helper); |
| 252 } | 252 } |
| 253 | 253 |
| 254 @override | 254 @override |
| 255 jsAst.Expression visitType(TypeConstantValue constant, [_]) { | 255 jsAst.Expression visitType(TypeConstantValue constant, [_]) { |
| 256 DartType type = constant.representedType; | 256 DartType type = constant.representedType; |
| 257 jsAst.Name typeName = namer.runtimeTypeName(type.element); | 257 jsAst.Name typeName = namer.runtimeTypeName(type.element); |
| 258 return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()), | 258 return new jsAst.Call(getHelperProperty(backend.helpers.createRuntimeType), |
| 259 [js.quoteName(typeName)]); | 259 [js.quoteName(typeName)]); |
| 260 } | 260 } |
| 261 | 261 |
| 262 @override | 262 @override |
| 263 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { | 263 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { |
| 264 ClassElement interceptorClass = constant.dispatchedType.element; | 264 ClassElement interceptorClass = constant.dispatchedType.element; |
| 265 return backend.emitter.interceptorPrototypeAccess(interceptorClass); | 265 return backend.emitter.interceptorPrototypeAccess(interceptorClass); |
| 266 } | 266 } |
| 267 | 267 |
| 268 @override | 268 @override |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 if (type is InterfaceType && | 308 if (type is InterfaceType && |
| 309 !type.treatAsRaw && | 309 !type.treatAsRaw && |
| 310 backend.classNeedsRti(type.element)) { | 310 backend.classNeedsRti(type.element)) { |
| 311 InterfaceType interface = type; | 311 InterfaceType interface = type; |
| 312 RuntimeTypes rti = backend.rti; | 312 RuntimeTypes rti = backend.rti; |
| 313 Iterable<jsAst.Expression> arguments = interface.typeArguments | 313 Iterable<jsAst.Expression> arguments = interface.typeArguments |
| 314 .map((DartType type) => | 314 .map((DartType type) => |
| 315 rti.getTypeRepresentationWithPlaceholders(type, (_){})); | 315 rti.getTypeRepresentationWithPlaceholders(type, (_){})); |
| 316 jsAst.Expression argumentList = | 316 jsAst.Expression argumentList = |
| 317 new jsAst.ArrayInitializer(arguments.toList()); | 317 new jsAst.ArrayInitializer(arguments.toList()); |
| 318 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), | 318 return new jsAst.Call(getHelperProperty(backend.helpers.setRuntimeTypeInfo ), |
|
sigurdm
2015/10/09 10:55:37
long line
Johnni Winther
2015/10/09 11:35:56
Done.
| |
| 319 [value, argumentList]); | 319 [value, argumentList]); |
| 320 } | 320 } |
| 321 return value; | 321 return value; |
| 322 } | 322 } |
| 323 | 323 |
| 324 @override | 324 @override |
| 325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
| 326 return constantReferenceGenerator(constant.referenced); | 326 return constantReferenceGenerator(constant.referenced); |
| 327 } | 327 } |
| 328 } | 328 } |
| OLD | NEW |