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

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

Issue 1146813009: Introduce WorldImpact (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 6 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart_backend; 5 part of dart_backend;
6 6
7 // TODO(ahe): This class is simply wrong. This backend should use 7 // TODO(ahe): This class is simply wrong. This backend should use
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, 8 // elements when it can, not AST nodes. Perhaps a [Map<Element,
9 // TreeElements>] is what is needed. 9 // TreeElements>] is what is needed.
10 class ElementAst { 10 class ElementAst {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 classElement.ensureResolved(compiler); 122 classElement.ensureResolved(compiler);
123 } 123 }
124 // Enqueue the methods that the VM might invoke on user objects because 124 // Enqueue the methods that the VM might invoke on user objects because
125 // we don't trust the resolution to always get these included. 125 // we don't trust the resolution to always get these included.
126 world.registerInvocation(new Selector.call("toString", null, 0)); 126 world.registerInvocation(new Selector.call("toString", null, 0));
127 world.registerInvokedGetter(new Selector.getter("hashCode", null)); 127 world.registerInvokedGetter(new Selector.getter("hashCode", null));
128 world.registerInvocation(new Selector.binaryOperator("==")); 128 world.registerInvocation(new Selector.binaryOperator("=="));
129 world.registerInvocation(new Selector.call("compareTo", null, 1)); 129 world.registerInvocation(new Selector.call("compareTo", null, 1));
130 } 130 }
131 131
132 void codegen(CodegenWorkItem work) { } 132 WorldImpact codegen(CodegenWorkItem work) => const WorldImpact();
133
133 /** 134 /**
134 * Tells whether we should output given element. Corelib classes like 135 * Tells whether we should output given element. Corelib classes like
135 * Object should not be in the resulting code. 136 * Object should not be in the resulting code.
136 */ 137 */
137 @override 138 @override
138 bool shouldOutput(Element element) { 139 bool shouldOutput(Element element) {
139 return (!element.library.isPlatformLibrary && 140 return (!element.library.isPlatformLibrary &&
140 !element.isSynthesized && 141 !element.isSynthesized &&
141 element is! AbstractFieldElement) 142 element is! AbstractFieldElement)
142 || mirrorRenamer.isMirrorHelperLibrary(element.library); 143 || mirrorRenamer.isMirrorHelperLibrary(element.library);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 class _ElementAstCreationContext implements ElementAstCreationContext { 474 class _ElementAstCreationContext implements ElementAstCreationContext {
474 final Compiler compiler; 475 final Compiler compiler;
475 final ConstantSystem constantSystem; 476 final ConstantSystem constantSystem;
476 477
477 _ElementAstCreationContext(this.compiler, this.constantSystem); 478 _ElementAstCreationContext(this.compiler, this.constantSystem);
478 479
479 DartTypes get dartTypes => compiler.types; 480 DartTypes get dartTypes => compiler.types;
480 481
481 InternalErrorFunction get internalError => compiler.internalError; 482 InternalErrorFunction get internalError => compiler.internalError;
482 } 483 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698