Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2954463002: Refactoring to prepare for kernel based jump targets (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | pkg/compiler/lib/src/js_backend/backend_usage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698