| 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 class ConstantEmitter { | 7 class ConstantEmitter { |
| 8 ConstantReferenceEmitter _referenceEmitter; | 8 ConstantReferenceEmitter _referenceEmitter; |
| 9 ConstantLiteralEmitter _literalEmitter; | 9 ConstantLiteralEmitter _literalEmitter; |
| 10 | 10 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 334 |
| 335 JavaScriptBackend get backend => compiler.backend; | 335 JavaScriptBackend get backend => compiler.backend; |
| 336 | 336 |
| 337 jsAst.PropertyAccess getHelperProperty(Element helper) { | 337 jsAst.PropertyAccess getHelperProperty(Element helper) { |
| 338 return backend.emitter.staticFunctionAccess(helper); | 338 return backend.emitter.staticFunctionAccess(helper); |
| 339 } | 339 } |
| 340 | 340 |
| 341 @override | 341 @override |
| 342 jsAst.Expression visitType(TypeConstantValue constant, [_]) { | 342 jsAst.Expression visitType(TypeConstantValue constant, [_]) { |
| 343 DartType type = constant.representedType; | 343 DartType type = constant.representedType; |
| 344 String name = namer.runtimeTypeName(type.element); | 344 String name = namer.getRuntimeTypeName(type.element); |
| 345 jsAst.Expression typeName = new jsAst.LiteralString("'$name'"); | 345 jsAst.Expression typeName = new jsAst.LiteralString("'$name'"); |
| 346 return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()), | 346 return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()), |
| 347 [typeName]); | 347 [typeName]); |
| 348 } | 348 } |
| 349 | 349 |
| 350 @override | 350 @override |
| 351 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { | 351 jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) { |
| 352 ClassElement interceptorClass = constant.dispatchedType.element; | 352 ClassElement interceptorClass = constant.dispatchedType.element; |
| 353 return backend.emitter.interceptorPrototypeAccess(interceptorClass); | 353 return backend.emitter.interceptorPrototypeAccess(interceptorClass); |
| 354 } | 354 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 [value, argumentList]); | 398 [value, argumentList]); |
| 399 } | 399 } |
| 400 return value; | 400 return value; |
| 401 } | 401 } |
| 402 | 402 |
| 403 @override | 403 @override |
| 404 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 404 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
| 405 return constantEmitter.reference(constant.referenced); | 405 return constantEmitter.reference(constant.referenced); |
| 406 } | 406 } |
| 407 } | 407 } |
| OLD | NEW |