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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/scalar_replacement.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dart2js.cps_ir.scalar_replacement; 4 library dart2js.cps_ir.scalar_replacement;
5 5
6 import 'optimizers.dart'; 6 import 'optimizers.dart';
7 7
8 import 'dart:collection' show Queue; 8 import 'dart:collection' show Queue;
9 9
10 import '../closure.dart' show 10 import '../closure.dart' show
(...skipping 25 matching lines...) Expand all
36 * Replaces aggregates with a set of local values. Performs inlining of 36 * Replaces aggregates with a set of local values. Performs inlining of
37 * single-use closures to generate more replacable aggregates. 37 * single-use closures to generate more replacable aggregates.
38 */ 38 */
39 class ScalarReplacer extends Pass { 39 class ScalarReplacer extends Pass {
40 String get passName => 'Scalar replacement'; 40 String get passName => 'Scalar replacement';
41 41
42 final dart2js.InternalErrorFunction _internalError; 42 final dart2js.InternalErrorFunction _internalError;
43 final World _classWorld; 43 final World _classWorld;
44 44
45 ScalarReplacer(dart2js.Compiler compiler) 45 ScalarReplacer(dart2js.Compiler compiler)
46 : _internalError = compiler.internalError, 46 : _internalError = compiler.reporter.internalError,
47 _classWorld = compiler.world; 47 _classWorld = compiler.world;
48 48
49 @override 49 @override
50 void rewrite(FunctionDefinition root) { 50 void rewrite(FunctionDefinition root) {
51 // Set all parent pointers. 51 // Set all parent pointers.
52 new ParentVisitor().visit(root); 52 new ParentVisitor().visit(root);
53 ScalarReplacementVisitor analyzer = 53 ScalarReplacementVisitor analyzer =
54 new ScalarReplacementVisitor(_internalError, _classWorld); 54 new ScalarReplacementVisitor(_internalError, _classWorld);
55 analyzer.analyze(root); 55 analyzer.analyze(root);
56 analyzer.process(); 56 analyzer.process();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 class ScalarReplacementRemovalVisitor extends RecursiveVisitor { 236 class ScalarReplacementRemovalVisitor extends RecursiveVisitor {
237 ScalarReplacementVisitor process; 237 ScalarReplacementVisitor process;
238 238
239 ScalarReplacementRemovalVisitor(this.process); 239 ScalarReplacementRemovalVisitor(this.process);
240 240
241 processReference(Reference reference) { 241 processReference(Reference reference) {
242 process.reconsider(reference.definition); 242 process.reconsider(reference.definition);
243 reference.unlink(); 243 reference.unlink();
244 } 244 }
245 } 245 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698