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 library js_backend.backend; | 5 library js_backend.backend; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/backend_api.dart' | 8 import '../common/backend_api.dart' |
9 show ForeignResolver, NativeRegistry, ImpactTransformer; | 9 show ForeignResolver, NativeRegistry, ImpactTransformer; |
10 import '../common/codegen.dart' show CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenWorkItem; |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 String getGeneratedCode(Element element) { | 958 String getGeneratedCode(Element element) { |
959 assert(element.isDeclaration, failedAt(element)); | 959 assert(element.isDeclaration, failedAt(element)); |
960 return jsAst.prettyPrint(generatedCode[element], compiler.options); | 960 return jsAst.prettyPrint(generatedCode[element], compiler.options); |
961 } | 961 } |
962 | 962 |
963 /// Generates the output and returns the total size of the generated code. | 963 /// Generates the output and returns the total size of the generated code. |
964 int assembleProgram(ClosedWorld closedWorld) { | 964 int assembleProgram(ClosedWorld closedWorld) { |
965 int programSize = emitter.assembleProgram(namer, closedWorld); | 965 int programSize = emitter.assembleProgram(namer, closedWorld); |
966 noSuchMethodRegistry.emitDiagnostic(reporter); | 966 noSuchMethodRegistry.emitDiagnostic(reporter); |
967 int totalMethodCount = generatedCode.length; | 967 int totalMethodCount = generatedCode.length; |
968 // TODO(johnniwinther): Support `preMirrorsMethodCount` for entities. | 968 // TODO(redemption): Support `preMirrorsMethodCount` for entities. |
969 if (mirrorsCodegenAnalysis.preMirrorsMethodCount != null && | 969 if (mirrorsCodegenAnalysis.preMirrorsMethodCount != null && |
970 totalMethodCount != mirrorsCodegenAnalysis.preMirrorsMethodCount) { | 970 totalMethodCount != mirrorsCodegenAnalysis.preMirrorsMethodCount) { |
971 int mirrorCount = | 971 int mirrorCount = |
972 totalMethodCount - mirrorsCodegenAnalysis.preMirrorsMethodCount; | 972 totalMethodCount - mirrorsCodegenAnalysis.preMirrorsMethodCount; |
973 double percentage = (mirrorCount / totalMethodCount) * 100; | 973 double percentage = (mirrorCount / totalMethodCount) * 100; |
974 DiagnosticMessage hint = reporter.createMessage( | 974 DiagnosticMessage hint = reporter.createMessage( |
975 closedWorld.elementEnvironment.mainLibrary, | 975 closedWorld.elementEnvironment.mainLibrary, |
976 MessageKind.MIRROR_BLOAT, { | 976 MessageKind.MIRROR_BLOAT, { |
977 'count': mirrorCount, | 977 'count': mirrorCount, |
978 'total': totalMethodCount, | 978 'total': totalMethodCount, |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1397 |
1398 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1398 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
1399 return !selector.isGetter; | 1399 return !selector.isGetter; |
1400 } | 1400 } |
1401 | 1401 |
1402 /// Returns `true` if [member] is called from a subclass via `super`. | 1402 /// Returns `true` if [member] is called from a subclass via `super`. |
1403 bool isAliasedSuperMember(MemberEntity member) { | 1403 bool isAliasedSuperMember(MemberEntity member) { |
1404 return _aliasedSuperMembers.contains(member); | 1404 return _aliasedSuperMembers.contains(member); |
1405 } | 1405 } |
1406 } | 1406 } |
OLD | NEW |