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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/task.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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_backend/codegen/task.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index 92cd2c0bc5006202395ff05aa43b5732bdeaa168..0e12e63214d426e21afa405dde03acd1b732293b 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -20,6 +20,8 @@ import '../../constants/constant_system.dart';
import '../../cps_ir/cps_ir_nodes.dart' as cps;
import '../../cps_ir/cps_ir_integrity.dart';
import '../../cps_ir/cps_ir_builder_task.dart';
+import '../../diagnostics/diagnostic_listener.dart' show
+ DiagnosticReporter;
import '../../diagnostics/invariant.dart' show
DEBUG_MODE;
import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
@@ -76,16 +78,18 @@ class CpsFunctionCompiler implements FunctionCompiler {
JavaScriptBackend get backend => compiler.backend;
+ DiagnosticReporter get reporter => compiler.reporter;
+
/// Generates JavaScript code for `work.element`.
js.Fun compile(CodegenWorkItem work) {
AstElement element = work.element;
- return compiler.withCurrentElement(element, () {
+ return reporter.withCurrentElement(element, () {
typeSystem = new TypeMaskSystem(compiler);
try {
// TODO(karlklose): remove this fallback when we do not need it for
// testing anymore.
if (false) {
- compiler.log('Using SSA compiler for platform element $element');
+ reporter.log('Using SSA compiler for platform element $element');
return fallbackCompiler.compile(work);
}
@@ -100,7 +104,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
} on CodegenBailout catch (e) {
String message = "Unable to compile $element with the new compiler.\n"
" Reason: ${e.message}";
- compiler.internalError(element, message);
+ reporter.internalError(element, message);
}
});
}
@@ -203,7 +207,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) {
tree_builder.Builder builder = new tree_builder.Builder(
- compiler.internalError);
+ reporter.internalError);
tree_ir.FunctionDefinition treeNode =
treeBuilderTask.measure(() => builder.buildFunction(cpsNode));
assert(treeNode != null);
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | pkg/compiler/lib/src/js_backend/constant_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698