| 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 native.NativeResolutionEnqueuer get nativeResolutionEnqueuerForTesting => | 904 native.NativeResolutionEnqueuer get nativeResolutionEnqueuerForTesting => |
| 905 _nativeResolutionEnqueuer; | 905 _nativeResolutionEnqueuer; |
| 906 | 906 |
| 907 native.NativeEnqueuer get nativeCodegenEnqueuer => _nativeCodegenEnqueuer; | 907 native.NativeEnqueuer get nativeCodegenEnqueuer => _nativeCodegenEnqueuer; |
| 908 | 908 |
| 909 /** | 909 /** |
| 910 * Unit test hook that returns code of an element as a String. | 910 * Unit test hook that returns code of an element as a String. |
| 911 * | 911 * |
| 912 * Invariant: [element] must be a declaration element. | 912 * Invariant: [element] must be a declaration element. |
| 913 */ | 913 */ |
| 914 String getGeneratedCode(Element element) { | 914 String getGeneratedCode(MemberEntity element) { |
| 915 assert(element.isDeclaration, failedAt(element)); | 915 assert(!(element is MemberElement && !element.isDeclaration), |
| 916 failedAt(element)); |
| 916 return jsAst.prettyPrint(generatedCode[element], compiler.options); | 917 return jsAst.prettyPrint(generatedCode[element], compiler.options); |
| 917 } | 918 } |
| 918 | 919 |
| 919 /// Generates the output and returns the total size of the generated code. | 920 /// Generates the output and returns the total size of the generated code. |
| 920 int assembleProgram(ClosedWorld closedWorld) { | 921 int assembleProgram(ClosedWorld closedWorld) { |
| 921 int programSize = emitter.assembleProgram(namer, closedWorld); | 922 int programSize = emitter.assembleProgram(namer, closedWorld); |
| 922 noSuchMethodRegistry.emitDiagnostic(reporter); | 923 noSuchMethodRegistry.emitDiagnostic(reporter); |
| 923 int totalMethodCount = generatedCode.length; | 924 int totalMethodCount = generatedCode.length; |
| 924 // TODO(redemption): Support `preMirrorsMethodCount` for entities. | 925 // TODO(redemption): Support `preMirrorsMethodCount` for entities. |
| 925 if (mirrorsCodegenAnalysis.preMirrorsMethodCount != null && | 926 if (mirrorsCodegenAnalysis.preMirrorsMethodCount != null && |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 | 1356 |
| 1356 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1357 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
| 1357 return !selector.isGetter; | 1358 return !selector.isGetter; |
| 1358 } | 1359 } |
| 1359 | 1360 |
| 1360 /// Returns `true` if [member] is called from a subclass via `super`. | 1361 /// Returns `true` if [member] is called from a subclass via `super`. |
| 1361 bool isAliasedSuperMember(MemberEntity member) { | 1362 bool isAliasedSuperMember(MemberEntity member) { |
| 1362 return _aliasedSuperMembers.contains(member); | 1363 return _aliasedSuperMembers.contains(member); |
| 1363 } | 1364 } |
| 1364 } | 1365 } |
| OLD | NEW |